Next.js Change
Next.js added a new unstable_prefetch route segment config option, decoupled from unstable_instant.
Commit: vercel/next.js@ac6d993
PR: #92754
What Changed
A new route segment config export unstable_prefetch was added to App Router pages/layouts:
export const unstable_prefetch = 'runtime' // or 'static'
Key details:
- Type:
'static' | 'runtime' — 'static' is a no-op (default), 'runtime' enables runtime prefetching
- Requires
cacheComponents: true in next.config.js — throws a build error otherwise
- Server Components only — throws a build error if used in a
"use client" module
- Decoupled from
unstable_instant — previously, runtime prefetching was configured via unstable_instant: { prefetch: 'runtime' }. Now unstable_prefetch controls prefetching independently, and unstable_instant is purely for instant validation
- The
create-component-tree.tsx now reads unstable_prefetch instead of unstable_instant.prefetch to determine hasRuntimePrefetch
Impact on vinext
vinext's route segment config parsing (routing/app-router.ts, get-page-static-info equivalent) should recognize unstable_prefetch as a valid export to avoid spurious warnings. The actual runtime prefetching behavior is not something vinext needs to implement immediately (it's experimental and tied to cacheComponents), but the config should be parsed and acknowledged.
Files Changed (non-test)
packages/next/src/build/segment-config/app/app-segment-config.ts — added PrefetchSchema, Prefetch type, and unstable_prefetch to the schema
packages/next/src/build/analysis/get-page-static-info.ts — added validation (requires cacheComponents, disallows "use client")
packages/next/src/server/app-render/create-component-tree.tsx — reads unstable_prefetch instead of unstable_instant.prefetch
crates/next-core/src/segment_config.rs — Turbopack-side parsing of the new config
Next.js Change
Next.js added a new
unstable_prefetchroute segment config option, decoupled fromunstable_instant.Commit: vercel/next.js@ac6d993
PR: #92754
What Changed
A new route segment config export
unstable_prefetchwas added to App Router pages/layouts:Key details:
'static' | 'runtime'—'static'is a no-op (default),'runtime'enables runtime prefetchingcacheComponents: trueinnext.config.js— throws a build error otherwise"use client"moduleunstable_instant— previously, runtime prefetching was configured viaunstable_instant: { prefetch: 'runtime' }. Nowunstable_prefetchcontrols prefetching independently, andunstable_instantis purely for instant validationcreate-component-tree.tsxnow readsunstable_prefetchinstead ofunstable_instant.prefetchto determinehasRuntimePrefetchImpact on vinext
vinext's route segment config parsing (
routing/app-router.ts,get-page-static-infoequivalent) should recognizeunstable_prefetchas a valid export to avoid spurious warnings. The actual runtime prefetching behavior is not something vinext needs to implement immediately (it's experimental and tied tocacheComponents), but the config should be parsed and acknowledged.Files Changed (non-test)
packages/next/src/build/segment-config/app/app-segment-config.ts— addedPrefetchSchema,Prefetchtype, andunstable_prefetchto the schemapackages/next/src/build/analysis/get-page-static-info.ts— added validation (requirescacheComponents, disallows"use client")packages/next/src/server/app-render/create-component-tree.tsx— readsunstable_prefetchinstead ofunstable_instant.prefetchcrates/next-core/src/segment_config.rs— Turbopack-side parsing of the new config