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.
Not Multi-Zones
| Next.js Multi-Zones | next-zones | |
|---|---|---|
| Moving between zones | hard navigation | soft <Link> navigation between App Router pages, client state kept |
| Servers | one per zone | one for all zones |
| A module shared by zones | loaded once per zone | loaded once |
| Releasing a zone | redeploy its server | install it live, roll back the same way |
Measured
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.
RSS for two real apps and their shell on one Zones, against 500.3 MB for three next start, at the same latency.
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 shopDevelop 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 startRelease one zone while it serves.
npx next-zones build blog && npx next-zones install blog 1.1.0Next.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).