3 ms·
I'm curious about this - are you using shadow DOM? If so, I completely understand your frustration. IMHO shadow dom isn't really useful for application authori
by claytongulick 3y ago
I'm curious about this - are you using shadow DOM? If so, I completely understand your frustration.
IMHO shadow dom isn't really useful for application authoring, it's beneficial for library authors and such.
Web Components become a lot easier if you just stick with the light dom.
- spankalee 3y agoShadow DOM is what enables interoperable composition. Without it you don't get <slot>s and without that you can't put children into a component without some very ad-hoc hacks.
- claytongulick 3y agoYeah - I've been writing native web component applications for many years now, and I have never, not a single time, needed slots. I have WC scenes, which are top level components that are able to be accessed by a url/deep linking/router outlet. Scenes are built from html and css that lay out smaller components - sometimes WCs, sometimes vanilla html, depending on what makes sense. Components mostly take care of themselves, load the data they need, and maintain their own state. Unless that doesn't make sense, in which case data is passed to them via properties. I have hundreds of thousands of lines of high performance, quality production code running this way and again - have never needed a slot. Slots are mostly useful for library authors, IMHO.
- brainbag 3y agoThat sounds like an interesting approach haven't heard of before, do you have it documented somewhere?
- claytongulick 3y agoYou may have motivated me to write something about it.