5 ms·
not to mention, web components come with their own complexity around shadow tree and the question of how to style/interact within the component tree from outsid
by wg0 3y ago
not to mention, web components come with their own complexity around shadow tree and the question of how to style/interact within the component tree from outside etc.
- miguelxt 3y agoNot mandatory to use the Shadow DOM. And you can easily add public methods to the component for external interaction.
- megaman821 3y agoYou don't have to use the shadow DOM, you can use the light DOM, but then you lose slots. I think they should really prioritize using slots with the light DOM as it would make it easier to incorporate web components into existing sites.
- coxmi 3y agoI don’t see how light DOM slots could work since it’s just replacing element.innerHTML, but a non-style-encapsulating shadow DOM option would be great. That, and some progress on template instantiation, reactive DOM primitives or DOM partials, so we don’t have to concatenate strings and overwrite el.shadowRoot.innerHTML, or do direct DOM manipulation for any updates. Until that all exists, and there’s a simple API to bring it all together, other frameworks will eat this space completely.