3 ms·
I don't think Web Components are a "framework replacement", they are an addition. Stuff like Bootstrap needs them to enrich their "top down" approach with CSS
by k__ 10y ago
I don't think Web Components are a "framework replacement", they are an addition.
Stuff like Bootstrap needs them to enrich their "top down" approach with CSS and HTML so you don't have to mess around with either their source OR CSS classes and "their" HTML structure everywhere to get the components right. You add their CSS & (Web Component) JS at the top and use their custom components as the "leafs" of your sites. I wrote about it here: https://dev.to/kayis/web-components-for-your-custom-elements https://dev.to/kayis/web-components-for-your-custom-elements
The other frameworks like React, Angular, Cycle or Ember will then become the Data-flow layer of the app.
- meowlicious 10y ago>The other frameworks like React, Angular, Cycle or Ember will then become the Data-flow layer of the app. None of these frameworks like dom being changed from underneath them, you will run into all sort of weirdness.
- elcritch 10y agoShadow DOM encapsulates the web components sufficiently so that VDOM or other frameworks don't see the inner HTML changes.
- k__ 10y agoI think this depends on the complexity of the components you implement as web-components. I mean, in React, the whole app is basically a component. It wouldn't make any sense to replicate this with Web Components. But yes, I read a few times that the React devs don't consider React a "data flow framework", so they decide when to re-render and stuff. Cycle is more in line with this thinking.