Open justinfagnani opened 5 years ago
From my comment here: https://github.com/w3c/webcomponents/issues/776#issuecomment-443018559
These are things that describe the basic HTML, DOM, & CSS structure of an element:
In addition, we'll probably want:
I am a little afraid if we put here all the things that are potentially nice - that it will be just wwaayyy too much.
Let's focus on what are the must-haves for an MVP then go for it and then adjust from there.
I would say must-haves are (all have name, description)
You can see a complete example here https://github.com/webcomponents/custom-elements-json/issues/3#issuecomment-546750767
One thing not listed above is delegatesFocus
feature.
@daKmoR a lot of what I included are necessary to document the material components. We absolutely need to document CSS shadow parts if we include them. There aren't a lot of methods, but those need to be documented as much as properties.
jup fully agree 👍 added methods (+ params)
and cssParts
possible output example
Name | Description |
---|---|
open | Will open a dialog where you can define an initial action Params: - focusAfterClose \ - initialDelay \ |
close | Closes the Dialog |
@daKmoR the superclass is also important for extending built-ins (also interesting for an IDE to allow auto completion for the is
attribute.
A general question regarding inheritance should the element information just contain the attributes/properties/events which are declared in the specific implementation or implementation + super class information merged (preferred). Otherwise there must be a field which defines the module/package where the super class is defined to pull the information from the packages custom-elements.json (which complicates things if you need to resolve custom-elements.json and merge them during runtime)
I should be the merged information 👍 as for many use case it should just be read this one file and you should have everything you need 🤗
For the inheritance I'm not sure how easy that is from the analyze tools size... let's discuss it separately at https://github.com/webcomponents/custom-elements-json/issues/7
This might be a question rather than a requirement/feature request - I'm not sure. In my vanilla component, I'm piggybacking on some common event names that already exist in the DOM for my custom events.
For example, I dispatch a "playing" event, and I call it "playing" so that the tag has the power to use "onplaying" as an attribute.
It's not clear to me if this should be documented as an event, an attribute, or both. Maybe a special category is needed to get across the idea that this is an even that can be used as "onwhatever".
I have another weird one. I'm likely looking to put non-slotted content as non-rendered DOM objects existing outside the Shadow Root that exist purely for reference and for the sake of placing in a tag to feed the component data. Basically exactly what A-Frame is doing. I assume this falls under "permitted content"? Maybe it's too much of an edge case to really consider in the spec, but something I'm likely to do
I would add an information whether a property is readonly or not. When only getter is created then a property is read only.
What do we need to capture in the description file?