The current Web Components compiler produces an invalid Custom Element. When instantiated via document.createElement('icon-a-b'), it will throw an error: "Failed to construct 'CustomElement': The result must not have children". The recommended solution from the CE spec is to append light DOM children in connectedCallback, so I've made that change here. I've also added a shadow option to have the generated CE use an open Shadow Root instead of light DOM children.
Linked Issues
(none)
Additional context
I made this change via GH web, so it doesn't include any of the TypeScript definition changes for the new options.shadow boolean.
Description
The current Web Components compiler produces an invalid Custom Element. When instantiated via
document.createElement('icon-a-b')
, it will throw an error: "Failed to construct 'CustomElement': The result must not have children". The recommended solution from the CE spec is to append light DOM children inconnectedCallback
, so I've made that change here. I've also added ashadow
option to have the generated CE use an open Shadow Root instead of light DOM children.Linked Issues
(none)
Additional context
I made this change via GH web, so it doesn't include any of the TypeScript definition changes for the new
options.shadow
boolean.