Skip to content
Pyreon Zero

SSG, SSR, ISR or SPA. Per route, in one line.

@pyreon/zero lets every route pick how it renders, prints what it chose at build time, and hydrates by adopting the server's DOM, so what your users typed before the JavaScript landed is still there. Compiled server rendering runs 6.5× faster than React 19 at 1,000 rows (one run).

npm create @pyreon/zero@latest

Fast on the server, fast on the hand-off.

  • 5.7–6.6× faster compiled SSR than React 19 at 10 / 100 / 1,000 rowsovernight run, one run · Apple M3 Max · synthetic, author-run
  • 1.64–4.68× renderToString throughput vs Solid across four scenarios, byte-identical output enforcedovernight run, one run · Apple M3 Max · synthetic, author-run
  • 4.02 ms to hydrate a 320-component page, ahead of React 4.15, Preact 4.30, Vue 4.47final pass, one run · real Chromium · Apple M3 Max · synthetic, author-run

Compiled SSR also leads Vue 3 (1.14–1.68×) and Svelte 5 (1.21–1.55×) at every size measured, one run. Synthetic, author-run, Apple M3 Max.

Every result, including where we lose →
code

One export per route.

The app mode is only the default. A page, or a _layout that cascades to everything below it, declares its own mode. Prefer policy in one place? routeRules maps path globs to modes.

src/routes/about.tsx
export const renderMode = 'ssg'
vite.config.ts
zero({
  mode: 'ssr',
  routeRules: {
    '/blog/**': { renderMode: 'isr' },
    '/admin/**': { renderMode: 'spa' },
  },
})
npm run build
[zero] Route modes (app: ssr) — 5 ssr λ · 1 ssg ○
  λ ssr  /
  ○ ssg  /about  (declared)
  λ ssr  /counter
  λ ssr  /dashboard
  λ ssr  /posts
  λ ssr  /posts/:id

Precedence is always the same: the page's own renderMode, the nearest _layout, routeRules, mode: 'auto' inference, then the app mode. Impossible combinations fail the build and name the route.

Render modes per route, resolved through one precedence chain A precedence chain across the top: the page's own renderMode, the nearest _layout, routeRules, mode: 'auto' (experimental), then the app mode. Four routes resolve in turn. / falls through to the app mode and gets SSR. /about declares renderMode = 'ssg' on the page and gets SSG. /blog/** matches a routeRules glob and gets ISR. /admin/** matches routeRules and gets SPA. ZERO · ONE RENDER MODE PER ROUTE precedence first match wins page renderMode nearest _layout routeRules mode: 'auto' EXPERIMENTAL app mode 'ssr' routegets/ mode: 'ssr' λ SSR/about renderMode = 'ssg' ○ SSG/blog/** → renderMode: 'isr' ⟳ ISR/admin/** → renderMode: 'spa' ⚡︎ SPAimpossible combinations fail the build and name the route
in detail

Or let Zero decide.

mode: 'auto' is experimental. It infers a mode per route on a "static unless the code says otherwise" rule, and the build prints the table so you can see every choice.

revalidate export

ISR.

getStaticPaths export

SSG, even next to a loader.

loader, .server.ts, guard or middleware

SSR.

Anything else

SSG.

Inferred-SSG routes prerender in mixed appsnext release

In a build that also has SSR routes, pages inferred as SSG are now prerendered, and one resolver answers "what mode does this page get" everywhere. New on main, shipping in the next release.

Hydration that keeps what you typed.

A slow train, a server-rendered page, three letters typed into the search box. Then the JavaScript lands and a hydrating framework that rebuilds the DOM throws the letters away, along with the cursor.

Pyreon adopts the server's nodes instead of replacing them. Text typed into an uncontrolled input, focus, scroll position inside adopted regions and listeners other scripts attached early all survive the boot. Zero resolves the current route's code before hydrating, so the first client render is the real page, not a loading fallback.

Hydration adopts the server DOM and keeps what you typed Three browser frames. 1, the server-rendered HTML arrives with an empty email input; the JavaScript has not loaded. 2, the user types ada@pyreon before the JavaScript lands. 3, hydration adopts the existing nodes instead of replacing them: the typed text, the focus and the caret are all still there. Below, a dashed ghost frame shows the alternative, a hydration that rebuilds the DOM, where the input comes back empty and focus is lost. HYDRATION THAT ADOPTS THE SERVER DOM example.com/login 1 server HTML arrives the page is usable email JavaScript: not loaded example.com/login 2 you type before the JS slow network, real user email aadadaada@ada@pada@pyada@pyrada@pyreada@pyreoada@pyreon JavaScript: loading… JavaScript: landed JavaScript: landed example.com/login 3 hydration adopts the page same nodes, nothing rebuilt email ada@pyreon ✓ text ✓ focus ✓ caret …adopting… alternative: rebuild the DOM (empty) text, focus and caret: gone Adopted on hydration: text typed into uncontrolled inputs focus and the caret scroll inside adopted regions listeners other scripts attached early
Diagram of the hand-off, not a capture of this page.
in detail

Deploy where you already deploy.

--adapter on npm create @pyreon/zero@latest writes the platform files and wires the adapter into vite.config.ts.

node and bun

A production server plus a Dockerfile.

vercel

vercel.json.

netlify

netlify.toml.

cloudflare

A wrangler.toml with nodejs_compat already set.

static

Just dist/. The scaffolder refuses it with SSR or ISR, because there is no server to run them.

in detail

Content and a blog, built in.

@pyreon/zero-content turns .md and .mdx into real Pyreon JSX at build time, with typed collections, Shiki highlighting, callouts, search and inline live examples. It powers the Pyreon docs and blog.

Typed collections

getCollection, getEntry and getEntries query your content with types.

Scheduled publishingnext release

Declare publishDate: 'date' on a collection and a future-dated entry stays out of listings, search, the sitemap and the feed of a production build until its date; unpublished: 'omit' keeps it out of the bundle too. PYREON_CONTENT_NOW=<date> builds the site as it will look that day. New on main, shipping in the next release.

Feedsnext release

Full-content RSS with content: 'full', the shape dev.to's "Publishing from RSS" imports. New on main, shipping in the next release.

steps

From scaffold to a running server.

  1. Scaffold

    Pick a mode and an adapter, or take the defaults.

    npm create @pyreon/zero@latest my-app -- --mode ssr-stream --adapter node
  2. Build

    Every SSG, SSR, ISR or auto build prints its per-route mode table.

    npm run build
  3. Run

    The Node adapter writes a node:http server.

    PORT=8080 node dist/index.js
questions

Questions before you ship.

Does streaming SSR work?

Yes: ssr: { mode: 'stream' }. The default is buffered string rendering.

What if a prerendered file goes missing?

The Node and Bun servers serve SSG pages from disk first and fall back to rendering the page, never to a 404.

Will a typo in my config fail quietly?

No. Config typos fail with a did-you-mean.

Is mode: 'auto' safe for production?

It is labelled experimental. The build table shows exactly what it chose, and an explicit renderMode export always wins, so you can pin any route.

Your users typed it. Pyreon keeps it.

npm create @pyreon/zero@latest