finds.dev← search

// the find

trueadm/ssr-with-prepack-hackathon

★ 307 · JavaScript · MIT · updated Jun 2018

ReactDOMServer + experimental Prepack (React) compiler

A 2-day hackathon experiment from 2018 that used Prepack to compile React components to optimized SSR output — eliminating the React runtime entirely and emitting plain string concatenation with HTML-escape helpers. The benchmark result (13ms → 0.245ms for the HN benchmark) is the whole point. This is a proof-of-concept, not a library.

The core idea is sound and the benchmark result is genuinely impressive: 53x speedup by statically evaluating the component tree at build time and leaving only the dynamic holes. The approach predates React Server Components and React Compiler by years, and the author (Dominic Gannaway, who later worked on the React compiler) clearly understood what Prepack was capable of. The compiled output in the gist is readable and shows exactly what the technique produces.

Prepack is dead — Facebook abandoned it in 2019 and nothing in this repo works anymore without significant archaeology. The repo is a single benchmark with TODOs throughout; it was never meant to generalize beyond the HN demo. No tests, no API, no way to plug in your own components. If you're looking for the modern equivalent of this idea, React Compiler and React Server Components are where this thinking landed — this repo is historical context, not usable code.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →