3 ms·
>In vast majority of cases it's nowhere near "basically web components". What else does it do besides render JSX components and manage their state just like a
by nickthemagicman 7y ago
>In vast majority of cases it's nowhere near "basically web components".
What else does it do besides render JSX components and manage their state just like a web component except with more indirection?
> All you do is attach the root node of an SPA to any element in the DOM.
You missed the point of what I was saying
The root node is a single node...where do you define the rest of your components? IN JAVASCRIPT. IF you want progressive enhancement you have to define a SECOND SET OF NODES IN HTML. THIS IS REDUNDANT.
>I fail to see where you see progressive enhancement.
Why don't you actually read the thing?
"If JavaScript is disabled, all panels are shown interleaved with the respective tabs. The tabs now function as headings."
- dmitriid 7y ago> What else does it do besides render JSX components and manage their state just like a web component except with more indirection? 1. There many more ways to implement SPA than JSX. 2. WebComponents have exactly zero state management capabilities, and you need to implement your own ways to deal with state So, SPA frameworks provide the following: - state management - optimised/batched updates (they can flush to the DOM efficiently thus avoiding jank, unnecessary re-paints and reflows) - async rendering - easy fallback states for async data fetching - data fetching - data propagation (for example, from parent to a deeply nested child) - data binding - render targets other than HTML (example, canvas, webgl, native mobile apps) I'm definitely missing more. None of the above are provided by web components, and you will need to bring your own frameworks/libs to cover all those points.
- nickthemagicman 7y agoSome of those aren't SPA specific. They're just javascript. Some are done by external libraries like redux. Some are benefits, however, two way data flow is a janky model in itself that could possbily be done away with by a nice data structure imo. Also, this SPA cargo cult has been around a lot longer than Web Components which have just the past year or two become cross browser compatible. I expect great things from them. Web Components and their associated libraries can and will do all of those as they grow.
- dmitriid 7y ago> Some of those aren't SPA specific. They're just javascript. What do you think SPAs are? They are just Javascript. You add all that Javascript on top of web components and you ... end up with an SPA > Some are benefits, however, two way data flow is a janky model in itself that could possbily be done away with by a nice data structure imo. Quite a few frameworks don't have two-way data binding. React famously doesn't. > I expect great things from them. Web Components and their associated libraries can and will do all of those as they grow. So, they can't do those things and you're asking "what are SPA libs good for"? You clearly have little to no experience with web development.