Re: [WICG/webcomponents] "open-stylable" Shadow Roots (#909)

I think there's something to be said for this idea:

>Turn off shadow DOM (as is an option in LitElement), but keep <slot> working (which obviously isn't).

Possibly a bit off topic, but StencilJS went [through great lengths](https://medium.com/8451/make-your-stenciljs-web-components-faster-by-using-shadow-dom-d010a9f0cdda) to support both ShadowDOM and non-ShadowDOM, using the same component / syntax.  It sounds like the biggest challenge was how to emulate slots without the help of ShadowDOM.  Performance is an issue with this emulation, apparently.

I think userland has demonstrated that the slot concept is [quite](https://v3.vuejs.org/guide/component-slots.html) [useful](https://svelte.dev/tutorial/slots), even without ShadowDOM. React has something [roughly similar](https://codeburst.io/a-quick-intro-to-reacts-props-children-cb3d2fce4891), perhaps.

I'm guessing the most natural fit for supporting this would be as part of the template instantiation initiative.  I know that initiative is currently awaiting a determination whether there are underlying primitives that would benefit the platform more generally.

Perhaps in parallel to that effort, template instantiation could start, but focus squarely on this (additional?) requirement, which does seem to be quite widely applicable,  but much harder to implement in a performant way than other features of that proposal?  Or maybe there are also some underlying primitives that would make slot emulation easier to implement / faster performing?

If not, I would still suggest looking at supporting slots when/if the discussion does move on to actual declarative template instantiation. 



-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/WICG/webcomponents/issues/909#issuecomment-743095184

Received on Friday, 11 December 2020 09:54:33 UTC