4 ms·
Bait and switch tactics seem really common in the web space. Web components were supposed to make it easier to share components between frameworks. But from wh
by TheAceOfHearts 3y ago
Bait and switch tactics seem really common in the web space.
Web components were supposed to make it easier to share components between frameworks. But from what I can tell, this never fully materialized because the tools provided by web components are insufficient and people end up having to import additional libraries. Despite web components being around, most developers continue on with React and friends.
With ES modules cascading loads I think there was a lot of handwaving done by claiming you would eventually use HTTP2 to push the full asset graph to the client. Did that ever materialize? What tools support that? Generating this asset graph sure sounds like a build step, and since it's possible to have dynamic imports you also have to be prepared to handle those somehow.
Adding async support to CommonJS might've been easier than migrating to ES modules. I know that Webpack had support for that at some point, although it wasn't widely supported in other ecosystems.
A lot of interesting features of the module system are considered out of band and have barely been developed and explored, since it's not part of ECMA Script. Module import maps and the like are starting to get supported by browsers. Generating those probably requires a build step too.
- callahad 3y agoHTTP/2 Server Push is dead, and Chromium dropped support in 106: https://developer.chrome.com/blog/removing-push/ https://developer.chrome.com/blog/removing-push/
- azangru 3y agoThere are early hints instead [0]. Aren't they sort of a replacement for http2 push? [0] - https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/103 https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/103
- aseipp 3y agoThe intended purpose of both Server Push and Early Hints is basically "Lower overall latency by letting the client know early on that there is more data it might need in subsequent requests." But in practice Early Hints are much better because only the client knows definitively if it needs the resource or not i.e. a 103 might say "you might need this file soon" but you already have it in cache. Both approaches would still require the server to have some knowledge about the semantic request/response structure of client applications, though.
- azangru 3y ago> Web components were supposed to make it easier to share components between frameworks. But from what I can tell, this never fully materialized because the tools provided by web components are insufficient and people end up having to import additional libraries. Web components do make it possible to share components between projects. See, e.g. Nordhealth, whose design system are build as web components with Lit, but whose big framework is Nuxt. > Despite web components being around, most developers continue on with React and friends. Most developers are taught React when they start; and do not learn the web platform properly.
- TheAceOfHearts 3y agoI remember a big selling point for web components was that it wouldn't matter which framework you were using because they would just give you a common interface. But this isn't that useful if you still have to import some giant framework as a dependency, maybe the main exception to this is something like Svelte. The claim certainly feels like it has been downsized over time. If I'm already using the same framework between projects I can share components without web components. It just feels like a bait and switch when platform developers continue claiming things which never fully materialize. Maybe part of the blame goes to me as the reader for making assumptions. I've read through the HTML spec and try to keep up with web platform updates. That doesn't change the fact that React and friends _is_ the de facto web platform for tons of developers.
- azangru 3y ago> But this isn't that useful if you still have to import some giant framework as a dependency I agree. And I don't believe that you have to import a giant framework either. Web components today, especially with a bit of extra convenience that comes, for example, from Lit, are now where React was around 2015, before all the big frameworks came about, and before React changed its api from the one based on component's life cycle to the one based on data dependencies.
- travellingprog 3y agoOne major thing that has held back Web Components, IMO, is that the standard never provided a JSX equivalent: a convenient declarative, condensed way to express your component's structure along with event handlers. So if you choose to build web components, unless you want to have a terrible developer experience, you're still going to reach for a library anyways, like Lit (the successor to Polymer). Only unlike using popular libraries like React/Vue/Angular, the ecosystem, community and resources at your disposal will be much smaller.