next.js
a79ddc2e - Add PrerenderManifestRuntime type for runtime prerender manifest consumers (#102669)

Commit
12 hours ago
Add PrerenderManifestRuntime type for runtime prerender manifest consumers (#102669) ### What? Adds a `PrerenderManifestRuntime` type (plus `PrerenderManifestRouteRuntime` / `DynamicPrerenderManifestRouteRuntime`) that describes only the subset of the prerender manifest the Next.js runtime reads, and switches the runtime consumers over to it: - `IncrementalCache`, `SharedCacheControls` - `PrerenderManifestMatcher`, `AppPageRouteModule.match` - `RouteModule` (manifest loading, `prepare`, incremental cache creation) The inline empty manifests (edge adapter, edge route module, export incremental cache, unit tests) no longer pass the deprecated `preview` field, which isn't part of the runtime type. ### Why? This is split out of #96005 as a type-only first step. With the runtime type in place, the follow-up can write smaller per-route manifests that only hold the fields the runtime needs, while the global `prerender-manifest.json` stays as-is for builders. There is no behavior change: the runtime still loads the global `prerender-manifest.json`. ### How? The picked fields come from the original PR, plus the fields canary's runtime now also reads (`srcRoute` / `dataRoute` for `isRouteCacheOwner`, `response`, `compute`, `_isEnsureStaticPage`, `isExplicitlyBlocking`, `notFoundParams`). The compiler verifies these through the consumers. ### Verification - `pnpm --filter=next types` and the root `pnpm typescript` pass (after `pnpm build`) - `pnpm test-unit`: the incremental-cache, shared-cache-controls, prerender-manifest-matcher and generate-cache-key suites pass. Two suites in that run failed: `next-swc.test.ts`, because the environment had no prebuilt native binary, and `fast-set-immediate.external.test.ts`, which I didn't compare against canary. Neither touches the prerender manifest. <!-- NEXT_JS_LLM --> <!-- fleet 27ba0e27-20f0-42b9-9d85-841bf4f8c2e3 --> Co-authored-by: vercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com>
Author
Parents
Loading