▲ | azangru 7 days ago | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
> the current advise for web components is to avoid Shadow DOM (almost like the plague) Could you provide the source for this advice? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
▲ | troupo 6 days ago | parent | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
It may have actually started with Web Components Community Group report itself: https://w3c.github.io/webcomponents-cg/2022.html --- start quote --- It's worth noting that many of these pain points are directly related to Shadow DOM's encapsulation. While there are many benefits to some types of widely shared components to strong encapsulation, the friction of strong encapsulation has prevented most developers from adopting Shadow DOM, to the point of there being alternate proposals for style scoping that don't use Shadow DOM. We urge browser vendors to recognize these barriers and work to make Shadow DOM more usable by more developers. --- end quote --- And probably continued in HTML Web Components https://blog.jim-nielsen.com/2023/html-web-components/ A more technical and measured take on Shadow DOM is here: https://nolanlawson.com/2023/12/30/shadow-dom-and-the-proble... | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
▲ | jfagnani 7 days ago | parent | prev [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
It's wrong - both that it's general "current advice", and the advice itself when it does pop up. Yes, there are some people who say to build web components without shadow DOM, but I'm convinced they're only building leaf nodes so they don't need composition with slots. As soon as they try to build any kind of container element they hit big problems. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|