The Illusion of the Instant: A Critique of the 'Zero JavaScript' Movement
There’s a powerful, seductive idea gaining traction in our circles: that the ultimate achievement in front-end performance is a page that ships zero JavaScript. It’s presented as the purest form of the web, a return to a semantic HTML Eden unburdened by the bloat of frameworks. The metric, the Core Web Vital of Largest Contentful Paint (LCP), seems to sing its praises. A static page, served from the edge, paints near-instantly. The graph is green. The goal is achieved. We are performance wizards.
But this is a mirage. In our fervent pursuit of a perfect Lighthouse score, we risk conflating a single metric with the actual user experience. The ‘Zero JS’ movement, in its most dogmatic form, champions a web that is fast to arrive but often inert and unresponsive upon landing. It optimizes for the initial render at the expense of everything that might happen next. It’s like building a beautiful, instantly-appearing storefront with a door that doesn’t open.
The Silent Cost of Purity
This dogma ignores a fundamental truth: the web is interactive. Users don’t just look; they click, they scroll, they type, they navigate. By stripping away all JavaScript in the name of speed, we are often stripping away the very functionality that makes our pages useful. A form with no validation, a menu that doesn’t dropdown, a ‘load more’ button that does nothing—these are not performant experiences; they are broken ones.
The critique here isn’t of simplicity itself. A beautifully crafted, semantic HTML document is a marvel. The critique is of the absolutist stance that any JavaScript is a failure. This mindset leads to a bizarre arms race of complexity: developers contort their backends to pre-render every possible state, turning dynamic applications into millions of static files, all to avoid the ‘sin’ of executing a few kilobytes of script on the client. The infrastructure becomes more complex to keep the front-end artificially simple.
True front-end craft isn’t about the blind elimination of a tool; it’s about its intelligent application. It’s the discernment to know when a simple CSS toggle is enough, when a few lines of vanilla JS can provide crucial feedback, or when a larger framework is the right tool for a complex application. Performance is not just about how fast the paint happens; it’s about how fast the *right* thing happens in response to a user. A button that responds to a click within 50ms with a tiny, purpose-built script provides a better, faster-feeling experience than a button that does nothing at all, even if the latter page has a perfect LCP.
Let’s move beyond the dogma of ‘zero’. Let’s instead champion ‘right’. The right amount of JavaScript, for the right interaction, loaded with the right priority. Let’s build pages that are not just fast to look at, but a joy to use. Because a page that loads instantly but then does nothing is not a performance win. It’s just a very quickly delivered disappointment.
Notes & further reading
A few pages I came back to while writing this:
- The Sculptor's First Un-anchored Base: On the Silent Topple of a Perfectly Optimized Page Without a `loading=eager`
- The Mason's First Un-mortared Stone: On the Silent Settling of a Perfectly Optimized Layout Without a `aspect-ratio` Box
- The Blacksmith's First Un-quenched Blade: On the Brittle Edge of a Perfectly Optimized Page With Too Much Lazy-Loading