next-zonesv0.1.0

Zones for Next.js

Build each part of a product as its own Next.js app, with its own version. Serve them as one: one origin, one Node process, soft navigation between zones, one React. Install a new version of a zone into the running server, and roll it back, with no restart.

Get started Read the docs npx @runsnip/next-zones init my-app blog shop

Not Multi-Zones

Next.js Multi-Zonesnext-zones
Moving between zoneshard navigationsoft <Link> navigation between App Router pages, client state kept
Serversone per zoneone for all zones
A module shared by zonesloaded once per zoneloaded once
Releasing a zoneredeploy its serverinstall it live, roll back the same way

Measured

3.0–3.2 µs

for the switch to a newly installed version (p50), a 29-route zone in an app of 248 routes; atomic, and no wrong answer under load.

291.6 MB

RSS for two real apps and their shell on one Zones, against 500.3 MB for three next start, at the same latency.

16.3.6 → 16.4.0

Next.js versions the whole suite has passed on. Zones checks every internal it relies on before it hooks anything.

How each was measured: spikes/zones/RESULTS.md.

What a zone can use

App Router and Pages Router

Routing, route handlers, metadata, server actions, prerendering and ISR; and Pages Router zones with getStaticProps, getServerSideProps and their own _app.

Live installs

Build an image of one zone, install it while the server runs, roll back with the same command. Open tabs follow with <ZoneUpdates />.

One app, if you prefer

mode: "single" links every zone into one Next app for next start. Both modes work with output: "standalone" and "export".

Develop them together

next-zones dev runs every zone in one next dev, with HMR and soft navigation. next-zones doctor says what to fix.

Images and pulls

Zone images are pulled from a folder, a URL template or your own source: streamed, checked against their build's integrity, pruned.

Metrics

Zones' own and your zones' measurements, as Prometheus text, from metrics: true.

Start

A workspace: a shared package, the shell (the zone at /) and two zones.

npx @runsnip/next-zones init my-app blog shop

Develop every zone at once.

cd my-app && npx next-zones dev .

Build the shell and each zone's image, and serve them.

npx next-zones build && npx next-zones start

Release one zone while it serves.

npx next-zones build blog && npx next-zones install blog 1.1.0

Next.js 16.3.6, 16.3.7, 16.3.8 or 16.4.0, and Node.js 24. Getting started walks through it.

For assistants

llms.txt holds what an assistant most often gets wrong; llms-full.txt every page in one file; each page is also markdown. The package ships them, and a skill for coding assistants (skills/next-zones).