DEV Community

Discussion on: Understanding Transitional JavaScript Apps

Collapse
 
ryansolid profile image
Ryan Carniato

Yeah in terms of progressive enhancement they have a decent story in theory. I mean you can accomplish most things with built-ins so adding on top of that makes sense. Except Apple basically veto that and is not supporting extending built-in elements in Safari ever. It was still added to the spec for future discussion but they haven't budged on this issue once in 5 years. So you can can't extend Form or Anchor but need to make your own at which point that unfortunately falls apart.

The next thing to consider is that there is no universal way to server render web components. Recently there is the addition of the Declarative Shadow Root which is cool since now it can be server rendered, but without a DOM on the server there is no unit, no component, it has to come down to whatever templating system you have. I actually was in a meeting with the guys from Lit and they were quite unapologetically like it should be expected you need to use a library to do web components. Lit knows how to server render their webcomponents. In a way its just a different framework.

So I don't really see Lit as framework agnostic. Sure in theory anyone can consume them (client side atleast) but for size reasons you don't want to have 20 components authored with 20 different libraries. In a sense framework agnostic is a fallacy unless you use hand spun ones, and well to do that efficiently requires a certain level of expertise. Not saying people won't do this and those in theory form a strong foundation but then we are stuck with how to server render them.

Lightening the load on the backends isn't really the concern here. The problem is every byte of JavaScript in the browser carries weight. Devices/networks vary and are out of our control. The technologies I'm talking about are all about mitigating the cost of JavaScript in the browser. Advances in edge computing/serverless have us covered on the backend, what we really need is less JavaScript in the browser. That isn't something we can scale to mitigate. We've already went heavy client, that doesn't work for everything, now we are looking how to scale back.

Collapse
 
hobbydev profile image
Cy Walker

Wow - thanks for the reply, best reply I've ever received & has really helped me understand the driving forces at play. Thanks.