The video of Ryan Townsend’s speak from Efficiency Now(), The Insufferable Weight of Huge JavaScript is nicely value a watch. Extreme JS, seemingly turbo-charged by JS frameworks, has lengthy been an issue on the net, with bundle sizes displaying no signal of lowering.
As Ryan factors out, all that JS isn’t within the service of customers. Reasonably, architectural selections are made primarily for developer expertise. It looks like few firms query whether or not they want a JS framework like React. Corporations rent for React-and-Typescript, so builders be taught these abilities, and in flip they need to work with these frameworks as a result of it’s what they know, so that they push for these.
One slide particularly stayed with me:
Trickle-down consumer expertise
Yep, that’s it. We persuade ourselves that by prioritising the developer expertise that we need, we’ll have the ability to present a greater expertise for customers. The issue is, it’s simply not understanding that method. Our stacks are fragile, breakable. The slightest breeze they usually come crashing down. Trickle-down consumer expertise works just about simply in addition to trickle-down economics. What customers need are quick, accessible, useable web sites. We’re simply not giving them that.
We’re additionally making issues fairly difficult for ourselves, tying ourselves (and future builders) into an ecosystem of dependency spaghetti, and bending over backwards to re-implement issues in JS that the browser provides us free of charge.
You’ll be able to depend on net requirements
It’s refreshing to see a renewed curiosity in net elements in latest weeks — one thing I confess I nonetheless haven’t obtained round to studying correctly. Reasonably than frameworks which come and go, and require common love and a spotlight with a view to proceed working, net requirements are designed to be future-proof. And with new options like nesting and cascade layers, it’s turning into simpler to write down CSS at scale with out requiring a construct step.
I wouldn’t say there’s no place for JS frameworks, however they may undoubtedly be used lots much less.
HTML first…or is it?
Relatedly, this HTML First manifesto(?) has been doing the rounds. On preliminary look, I agree! HTML-first is what net requirements folks have been advocating for years, proper?! And there’s some good concepts in there: Choose “Vanilla” approaches over frameworks! Keep away from construct steps!
The place I’m not so certain I agree is on the concept all the things ought to go within the HTML. And a number of the recommendation feels downright contradictory: the creator advocates for libraries like Tailwind and Alpine.js, which do require a construct step, a minimum of if you wish to ship them in an environment friendly method, and I’m unsure that utilizing HTML attributes in the way in which advocated within the instance is extra comprehensible. (Facet be aware: Alpine.js bugs me as a result of you find yourself littering your HTML with invalid attributes.) I’m not die-hard “separation-of-concerns-at-all-costs”, however I thinks there are advantages to separating CSS and JS from HTML on the entire. I’m not satisfied that (because the creator claims) “it will likely be simpler for different builders to seek out and perceive behaviour, navigate it, and make modifications to it”.
The creator proclaims that you need to have the ability to right-click to view supply and have the ability to perceive the underlying code. Numerous folks would agree, however once more, I really feel that’s a bit of contradictory whenever you’re peppering an internet web page with inline types and JS. However to be trustworthy, I don’t actually care about having the ability to view supply. I do know that’s one thing of an unpopular opinion, however I’ve by no means discovered it significantly useful. We’ve got significantly better developer instruments than 10 years in the past, it’s by no means been simpler to debug within the browser. So long as the HTML shipped to the consumer is legitimate and accessible, I’m not bothered what appears like beneath. So I perceive the place persons are coming from after they lament the great outdated “view supply” days, however I really feel prefer to construct a workflow round that dangers as soon as once more prioritising builders over customers.
I don’t need to dismiss all the things within the article although. I really like the concept of simplifying how we construct for the online, and weaning ourselves of our extreme JavaScript behavior. It’ll be fascinating to see if a few of these concepts catch on.

