So lots of hot takes going around about web components. I love em, but I understand the frustrations. Here's my take on the single thing that makes Web Components distinct, for better or worse. jschof.dev/posts/2024/1...
Post
Web components can easily be aware of parents and children. You can fire events to communicate upwards, and you can use events to register children for downward data flow, like the Context community protocol github.com/webcomponent...
In my other posts I gush over the lit context. It's the only reasonable way to share live javascript in a somewhat ergonomic way. Technically though... a provider shouldn't know what should be put in its slots, and there are many that say reaching into your assigned slots is a bad pattern
0 reposts0 likes
I don't think firing events really counts as knowing what's in slots, but also I don't think it's bad to know what's in slots. All this stuff is very flexible, you can use it in lots of different ways. There may be some HTML-related best practices, but I don't want people to feel overly constrained.