DEV Community

Discussion on: Maybe Web Components are not the Future?

Collapse
 
sergiodxa profile image
Sergio Daniel Xalambrí

I never understood why there is a war between WC and JS libraries like React, I always thought WC were more intended to low-level parts of an app (like tabs) to basically supply as HTML tags what HTML doesn’t, then use use something like React to build the app can keep track of state. Somehow everyone expected to be able to build a whole app with WC 🤷‍♂️

Collapse
 
ryansolid profile image
Ryan Carniato

I think we tend to look for solutions to escape vendor lock-in. We don't like the prospect of rewriting our own code at someone else's behest. What I saw with Web Components was a full solution between it, tagged template literals, and Object.observe. I was already on the reactive programming bandwagon back in 2013 and I thought that at some point I'd just write custom element classes with tagged template literals that constructed DOM elements and bound each expression. The web would be the ultimately be my platform and I could drop all libraries. Others would do this too and we could all share our web components in a single unified web. What changed though was big advancement in technology like compilation/bundling where I could write my applications in even better ways and abstractions. Even that wasn't enough until I realized that practically speaking those approaches could be even more performant or provide better UI than the way I'd be writing using Web Components. It's not that I couldn't do it all vanilla better at the cost of DX. I wouldn't be able to get things both ways. Obviously the dialogue has changed a bit the last couple years. But this did come from natural place at one point.