Currently SuperHTML has lax validation for web components: if a - is found in an element name, then it's considered to be good and all extra validation is skipped (e.g. attribute validation).
https://github.com/webcomponents/custom-elements-manifest
The custom elements manifest is a json file that describes properties of a web component, including:
- custom attributes allowed (if any)
- inheritance (in case the element extends, say, a div vs p (flow vs phrasing))
This would allow us to validate both nesting and attributes for web components.
Solving this issue requires solving the following:
This second task is probably best left to me, while the first one can be considered contributor friendly.
Currently SuperHTML has lax validation for web components: if a
-is found in an element name, then it's considered to be good and all extra validation is skipped (e.g. attribute validation).https://github.com/webcomponents/custom-elements-manifest
The custom elements manifest is a json file that describes properties of a web component, including:
This would allow us to validate both nesting and attributes for web components.
Solving this issue requires solving the following:
src/html/Ast.zig(and related files) to have a new dedicated Kind for web components distinct from.___. In the implementation of this newElementboth attribute validation and content validation must be customized to dispatch to the right manifest file rule set based on the concrete element name (as theKindis going to be the same for all web components).This second task is probably best left to me, while the first one can be considered contributor friendly.