5 ms·
This is OK. It compares some of the features of Web Components and React components as they stand today. Having recently used Web Components in a side project,
by wakamoleguy 9y ago
This is OK. It compares some of the features of Web Components and React components as they stand today. Having recently used Web Components in a side project, I will say that I wish it touched more on how to give Web Components reactivity. The author touches on data binding, but doesn't really go too deeply into what will be one of the most customized (ergo hard to maintain) pieces of the VanillaJS code.
Polyfills also add an interesting twist. You can use them to enable Web Components in Firefox, but they mimic shadowdom behavior imperfectly. You need to be very careful of how you use CSS in that case.
Lastly, there seemed to be some gotchas in ES6 module loading a few months back. Perhaps those have been fixed. At the time, I found it hard to debug modules that failed to load.
In any case, I'm always happy to see Web Components and more powerful/useful features being added to JavaScript in the browser. Frameworks like React serve useful purposes, and it's great that we have a platform that allows us to move quickly and bring new patterns to life without waiting for browsers. In the long term, though, I will always be an advocate for standards and making vanilla implementations feasible.
- Andrex 9y agoBelieve me, I want to touch more on Web Component reactivity, but I don't have the depth of knowledge yet to really expound on it in a blog post. Happy for others to fill the gap in the meantime though. :) I definitely agree with pretty much all your points. I think it's a pretty exciting time for web dev right now.
- wakamoleguy 9y agoYeah, I wish I could call myself an expert there, too, but I've still some exploration to do before I'm really happy with how I have it set up, let alone recommending it to others. Awesome that you're here responding, though. Great post, overall! (Sorry if my points were mostly critical...I glossed over the parts I liked.)
- Andrex 9y agoHaha, I always expect far worse when sending a blog post like this out there. It's the nature of the medium and I try to take it in stride. Your comment was good-natured, so no worries.