next.js
d8f3a5b3 - [Experiment] Generate the entry for pages on the native RSC runtime

Commit
1 hour ago
[Experiment] Generate the entry for pages on the native RSC runtime Scaffolding for an experiment: the native RSC runtime, a highly experimental runtime for rendering React Server Components on the server. None of it is usable yet. A page with `experimental_nativeRscRuntime = true` now gets its own Turbopack entry instead of a build error. The template imports nothing from App Router: only the renderer's precompiled bundles (the SSR one through the `next-ssr` transition, so it resolves React for Fizz), the root layout, and the page. It has no request handler yet: serving the page is a later step, which adds the bridge. The first phase supports only one shape of route, a page directly inside the root layout, so the wiring can land before any features do. Everything else is left out on purpose, and a route that uses it is a build error, never a fallback to App Router: `next dev`, `runtime = 'edge'`, a root layout inside a route group, segments between the root layout and the page, parallel routes, `error`/`loading`/`template`/`not-found` and the other special files, a `"use client"` root layout or page, metadata files including `favicon`, and `metadata`/`viewport` exports and their `generate…` functions (now recorded by segment config parsing). Each error points at the file that causes it, and one build reports them all. The checks are coarse by design; later steps lift them one at a time as the runtime supports each feature, so the e2e suite checks them together in one build rather than one build each. `next build` doesn't prerender these pages, also on purpose for the first phase. The build reads the export from the page's static info, with layout inheritance, the way it reads `runtime`, and tells the static worker the page is dynamic without loading it, as it does for Go route handlers.
Author
Committer
Parents
Loading