Support more prefetch configuration options#92859
Conversation
| @@ -208,7 +217,7 @@ export function parseAppSegmentConfig( | |||
| } | |||
| case 'unstable_prefetch': { | |||
| return { | |||
| message: `Invalid unstable_prefetch value ${JSON.stringify(ctx.data)} on "${route}", must be "static" or "runtime".`, | |||
| message: `Invalid unstable_prefetch value ${JSON.stringify(ctx.data)} on "${route}", must be "auto", "disabled", "force-static", or "force-runtime".`, | |||
ffc9b22 to
75ff082
Compare
|
Thanks for the detailed proposal. The new prefetch modes make sense overall, especially the distinction between |
75ff082 to
6941cbb
Compare
Failing test suitesCommit: d510e7f | About building and testing Next.js
Expand output● instant-nav-panel › should show loading skeleton during SPA navigation after clicking Start |
6941cbb to
f899ae0
Compare
Stats from current PR✅ No significant changes detected📊 All Metrics📖 Metrics GlossaryDev Server Metrics:
Build Metrics:
Change Thresholds:
⚡ Dev Server
📦 Dev Server (Webpack) (Legacy)📦 Dev Server (Webpack)
⚡ Production Builds
📦 Production Builds (Webpack) (Legacy)📦 Production Builds (Webpack)
📦 Bundle SizesBundle Sizes⚡ TurbopackClient Main Bundles
Server Middleware
Build DetailsBuild Manifests
📦 WebpackClient Main Bundles
Polyfills
Pages
Server Edge SSR
Middleware
Build DetailsBuild Manifests
Build Cache
🔄 Shared (bundler-independent)Runtimes
📝 Changed Files (8 files)Files with changes:
View diffsapp-page-exp..ntime.dev.jsfailed to diffapp-page-exp..time.prod.jsDiff too large to display app-page-tur..ntime.dev.jsfailed to diffapp-page-tur..time.prod.jsDiff too large to display app-page-tur..ntime.dev.jsfailed to diffapp-page-tur..time.prod.jsDiff too large to display app-page.runtime.dev.jsfailed to diffapp-page.runtime.prod.jsDiff too large to display 📎 Tarball URL |
"auto" mode is the default. It does not need to be explicitly exported "force-" modes suggest overriding framework heuristics "force-disabled" disables prefetching for this segment "force-static" forces any prefetching of this segment to be static "force-runtime" forces any prefetching of this segment to do runtime prefetching It's worth noting that when runtime prefetching we fetch the necessary segment and all child segments in a single request. This means that a deeper segment might specify disabled or static and still get conditionally rendered as a runtime prefetch. This was already the behavior of runtime prefetching and not changing in this PR just something to call out since it may be confusing to folks trying to understand how the implementation of prefetching actually works
f899ae0 to
d510e7f
Compare

"auto" mode is the default. It does not need to be explicitly exported "force-" modes suggest overriding framework heuristics "force-disabled" disables prefetching for this segment "force-static" forces any prefetching of this segment to be static "force-runtime" forces any prefetching of this segment to do runtime prefetching
It's worth noting that when runtime prefetching we fetch the necessary segment and all child segments in a single request. This means that a deeper segment might specify disabled or static and still get conditionally rendered as a runtime prefetch. This was already the behavior of runtime prefetching and not changing in this PR just something to call out since it may be confusing to folks trying to understand how the implementation of prefetching actually work