Flare
Subscribe
Technology

The Compiler That Ships Nothing

What happens when a framework compiles itself away entirely — and leaves nothing but your own code

Kai Andersen · December 12, 2024 · 8 min read

Two winters ago, I rewrote a data dashboard from a virtual-DOM framework to a compiler-first approach. The original shipped 42 kilobytes of runtime none of my users ever asked for — diffing logic, lifecycle managers, event delegation layers. The rewrite shipped none of it. Just vanilla JavaScript, shaped to update exactly the DOM nodes I described in my templates. The page load dropped from 1.8 seconds to under 400 milliseconds on a throttled 3G connection.

Reactivity Without the Baggage

The core insight is disarmingly simple: if you know at build time which variables affect which DOM nodes, you can generate targeted update functions. No virtual DOM. No reconciliation step. Just $: reactive declarations that compile into surgical assignments. A list component with ten bindings becomes ten update calls, not a re-render of the entire subtree. I watched the profiler flatten in ways I had never seen before.

“Every byte of framework code you ship is a byte your users pay to download, parse, and execute. The best framework is the one that isn’t there at all.”