Demo

Northstar Supply

A small industrial-tools store written as an ordinary React 18 app (function components, four contexts, hooks, lists, useId, forms), server-rendered three ways. The app is known ahead of time and the request data is not. The two specialized renderers produce the same bytes as renderToString, in a fraction of the time.

React renderToString ReactDOMServer.renderToString on the bundled app (dist/app.js). The reference output. Open the store → Prepack Prepack-specialized dist/render-prepack.js: the revived Prepack partially evaluates React's server renderer together with the app for a data schema. No React at runtime; data outside the schema falls back to React. Open the store → Hybrid Hybrid (traced templates) dist/render-hybrid.js: templates learned by tracing the real app under React, with runtime guards; a failed guard renders that request with React. Open the store →

Open the store Compare render times

Using the demo

How the specialized renderers are made

Both are built from the same bundle (dist/app.js) and checked byte-for-byte against renderToString on 600 live-store requests and a 500-input random benchmark corpus. Source: jlongster/northstar-supply.