5 ms·
Webcomponents will outlive React 13? Sure. Will they outlive React entirely or its cousins like Solid and Svelte? Perhaps not. Webcomponents and React look lik
by nojvek 3y ago
Webcomponents will outlive React 13? Sure. Will they outlive React entirely or its cousins like Solid and Svelte? Perhaps not.
Webcomponents and React look like they solve the same problem but they do not.
Webcomponent api is pretty shallow. You get connected/disconnnected/attributeChanged call back but gotta write your own property setter and getters, slots, template, shadow dom and that’s mostly it. Shadow dom becomes a pain to work with if something needs to pierce it. No built-in webcomponent api for efficiently applying state changes to dom. All attributes have to be strings and other types need to be parsed.
Mixpanel went all in on webcomponents. They made their own framework on top of webcomponents. https://github.com/mixpanel/panel https://github.com/mixpanel/panel
Worked on panel lib and webcomponent UI for many years. Webcomponents are not a silver bullet.
The issue with webcomponents is there are a ton of libraries that fill in the missing gaps. There’s not a lot you can do with pure vanilla webcomponent api. Google has their own thing, Microsoft had multiple internal libs across orgs, Reddit does their own thing.
The most standard thing for frontend with wide adoption right now is React.
vanilla webcomponents are good for simple widgets in a vanilla html/css page. To build complex single page applications, would not recommend it. You’d be building you’re own bespoke framework to fill in the gaps.