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...
2 reposts5 likes
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...
2 reposts5 likes
So Westbrook on mastadon pointed out that there are some proposals out there: For templating: github.com/WICG/webcomp... For Inverting control and having render props: github.com/webcomponent...
If you're interested in render props using pure platform, check out the slottable request proposal. You don't need a framework and you can have the consumer dictate templates using provided elements from the component. Here's a simple example of a list: lit.dev/playground/#...
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...
Nice post! And thanks to @justinfagnani.com for the corrections. In particular, I agree with the use cases. At a certain scale and for certain use cases, they have tremendous value, despite any limitations they may have. The value they provide is worth the effort to support them in frameworks.