vercel/next.js
Systems
Internal building blocks of the framework. Each "system" cuts across multiple files and layers — the App Router rendering pipeline, the build orchestrator, the dev server, the route server. They are organized here because they don't map cleanly to a single workspace package: most live inside packages/next/src/, but each has a distinct responsibility worth documenting on its own.
What's covered
| System | Lives in |
|---|---|
| App Router | packages/next/src/server/app-render/, packages/next/src/client/components/ |
| Pages Router | packages/next/src/server/render.tsx, packages/next/src/pages |
| Server runtime | packages/next/src/server/{base-server,next-server,lib/router-server}.ts |
| Build pipeline | packages/next/src/build/ |
| Dev server | packages/next/src/server/dev/ |
| Image optimization | packages/next/src/server/image-optimizer.ts, packages/next/src/client/image-component.tsx |
| Server actions | packages/next/src/server/app-render/action-handler.ts |
| Middleware and edge | packages/next/src/server/web/ |
| Caching | packages/next/src/server/lib/incremental-cache/, packages/next/src/server/use-cache/ |
How they fit together
graph TD
Build[Build pipeline] --> Manifests[Manifests<br/>.next/*]
DevServer[Dev server] --> RouterServer
Start[Production start] --> RouterServer
RouterServer[Server runtime<br/>router-server, base-server, next-server] --> Match{Match}
Match -- app/ --> AppRouter[App Router<br/>app-render.tsx]
Match -- pages/ --> PagesRouter[Pages Router<br/>render.tsx]
Match -- middleware --> Edge[Middleware/edge]
Match -- /_next/image --> Image[Image optimization]
AppRouter --> ServerActions[Server actions<br/>action-handler.ts]
AppRouter --> Cache[Caching<br/>incremental-cache, use-cache]
PagesRouter --> Cache
Edge --> EdgeRuntime[Edge runtime<br/>@edge-runtime/vm]
Manifests -.read by.-> RouterServer
Manifests -.read by.-> AppRouter
Manifests -.read by.-> PagesRouterThe Build pipeline produces the manifests in .next/ that the runtime systems read at request time. The Server runtime is the entry point for both dev and production, dispatching to one of the two routers (or to middleware / image optimization).
For the runtime classes themselves — BaseServer, NextServer, NextDevServer — see server runtime.
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.