| ▲ | dfabulich 10 hours ago | ||||||||||||||||
https://2025.stateofhtml.com/en-US/features/web_components/ Sort by negative sentiment; Shadow DOM is at the top of the list, the most hated feature in Web Components. You can read the comments, too, and they're almost all negative, and 100% correct. "Accessibility nightmare" "always hard to comprehend, and it doesn't get easier with time" "most components don't need it" "The big issue is you need some better way to some better way to incorporate styling from outside the shadow dom" > It's the only DOM primitive that allows for interoperable composition. There is no DOM primitive that allows for interoperable composition with fine-grained reactivity. Your framework offers fine-grained reactivity (Virtual DOM for React/Preact, signals for Angular, runes for Svelte, etc.) and any component that contains another component has to coordinate with it. As a result, you can only mix-and-match container components between frameworks with different reactivity workflows by giving up on fine-grained reactivity, blowing away the internals when you cross boundaries between frameworks. (And Shadow DOM makes it harder, not easier, to coordinate workflows between frameworks.) Shadow DOM sucks at the only thing it's supposed to be for. Please, listen to the wisdom of the crowd here. | |||||||||||||||||
| ▲ | spankalee 7 hours ago | parent | next [-] | ||||||||||||||||
> There is no DOM primitive that allows for interoperable composition with fine-grained reactivity. Your framework offers fine-grained reactivity (Virtual DOM for React/Preact, signals for Angular, runes for Svelte, etc.) and any component that contains another component has to coordinate with it. This just isn't true - composition and reactivity are completely orthogonal concerns. Any reactivity system can manage DOM outside of the component, including nodes that are projected into slots. The component's internal DOM is managed by the component using whatever reactivity system it desires. There are major applications built this way. They make have a React outer shell using vdom and Lit custom elements using lit-html for their shadow contents. On top of those basics you can also have cross-shadow interoperable fine-grained reactivity with primitives like signals. You can pass signals around, down the tree, across subtrees, and have different reactivity systems use those signals to update the DOM. | |||||||||||||||||
| |||||||||||||||||
| ▲ | 9dev 8 hours ago | parent | prev [-] | ||||||||||||||||
I feel like it’s a niche feature that got way too much attention. In a past job, we maintained a widget customers could embed onto their page. How much trouble we had with parent styles creeping into our widget and ruining the layout! This would have been so much easier with shadow DOM effectively isolating it from the customer site; that is the only valid use case for it, I feel. Yet, for actual web components, I entirely agree with you. | |||||||||||||||||