Remove experimental.appShells flag#95415
Conversation
App Shells was mostly a temporary kill switch in case we needed to quickly turn off the prefetch/render behavior that shipped alongside Cache Components. It's stable now, so remove the flag and inline every reference as if it were `true`, deleting the dead "off" branches. The one behavior that was incidentally gated on App Shells — the client's two-phase (Shell then Speculative) prefetch flow — should only apply when Partial Prefetching is on. Re-gate it on the route's SubtreeHasPartialPrefetching / SubtreeHasRuntimePrefetch hints, matching the server's anySegmentHasPartialPrefetchingEnabled, so client and server agree on which routes are "partial prefetching". Everything gated on partialPrefetching / PrefetchingMode.Partial is a separate system (despite the shared "shell" naming) and is untouched. Test configs drop their appShells overrides; the errors.json entry is left in place.
Failing test suitesCommit: 7cee0d1 | About building and testing Next.js
Expand output● segment cache - vary params › renders cached loading state instantly with runtime prefetching ● segment cache - vary params › does not reuse prefetched segment when page accesses searchParams ● segment cache - vary params › does not reuse prefetched empty-query segment for prefetches with searchParams ● segment cache - vary params › shares cached segment across all params when none accessed statically (runtime prefetch) ● segment cache - vary params › does not share cached segment when all params accessed statically (runtime prefetch) ● segment cache - vary params › tracks metadata param access separately from body (runtime prefetch) ● segment cache - vary params › tracks vary params per-segment with layout/page split (runtime prefetch)
Expand output● runtime prefetching › in a page › includes dynamic params, but not dynamic content ● runtime prefetching › in a page › includes root params, but not dynamic content ● runtime prefetching › in a page › includes search params, but not dynamic content ● runtime prefetching › in a page › includes headers, but not dynamic content ● runtime prefetching › in a page › includes cookies, but not dynamic content ● runtime prefetching › in a page › can completely prefetch a page that uses cookies and no uncached IO ● runtime prefetching › in a private cache › includes dynamic params, but not dynamic content ● runtime prefetching › in a private cache › includes root params, but not dynamic content ● runtime prefetching › in a private cache › includes search params, but not dynamic content ● runtime prefetching › in a private cache › includes headers, but not dynamic content ● runtime prefetching › in a private cache › includes cookies, but not dynamic content ● runtime prefetching › in a private cache › can completely prefetch a page that uses cookies and no uncached IO ● runtime prefetching › passed to a public cache › includes dynamic params, but not dynamic content ● runtime prefetching › passed to a public cache › includes root params, but not dynamic content ● runtime prefetching › passed to a public cache › includes search params, but not dynamic content ● runtime prefetching › passed to a public cache › includes headers, but not dynamic content ● runtime prefetching › passed to a public cache › includes cookies, but not dynamic content ● runtime prefetching › passed to a public cache › can completely prefetch a page that uses cookies and no uncached IO ● runtime prefetching › should not cache runtime prefetch responses in the browser cache or server-side › different cookies should return different prefetch results - in a page ● runtime prefetching › should not cache runtime prefetch responses in the browser cache or server-side › different cookies should return different ... truncated ...
Expand output● App Shell prefetching › reuses the app shell across different param values so navigation to an unprefetched route is instant ● App Shell prefetching › skips the per-link Speculative prefetch for a non-eager (allow-runtime) route ● App Shell prefetching › extracts the App Shell from a fully-static prerender response ● App Shell prefetching › root params › includes root params in a runtime App Shell ● App Shell prefetching › root params › includes root params in a static App Shell ● App Shell prefetching › root params › includes root params in a runtime App Shell when accessed via params object ● App Shell prefetching › root params › includes root params in an App Shell when accessed via params object ● App Shell prefetching › root params › uses separate runtime App Shells for links with different root params ● App Shell prefetching › root params › uses separate static App Shells for links with different root params
... truncated to fit in one GitHub comment ... |
Stats cancelledCommit: 7cee0d1 |
What
Removes the
experimental.appShellsfeature flag entirely.App Shells was mostly a temporary kill switch, in case we needed to quickly turn off the new prefetch/render behavior that shipped alongside Cache Components. The behavior is stable now, so this removes the flag and inlines every reference as if it were
true, deleting the dead "off" branches.The one behavior that moves instead of being deleted
appShellswas also incidentally gating the client's two-phase prefetch flow (aShellphase betweenRouteTreeandSpeculative). That behavior should only apply when Partial Prefetching is on, not whenever App Shells was enabled. This PR re-gates it on Partial Prefetching:Shellphase (and skips the speculative concrete prefetch by default) only for routes whose route tree carriesSubtreeHasPartialPrefetchingorSubtreeHasRuntimePrefetch— i.e. routes that opted into Partial Prefetching globally (partialPrefetchingconfig) or per segment (instant,prefetch: 'partial' | 'unstable_eager' | 'allow-runtime').anySegmentHasPartialPrefetchingEnabled, so the client and server agree on which routes are "partial prefetching".Everything gated on
partialPrefetching/PrefetchingMode.Partial/shouldRenderWithAppShellwas already a separate system (despite the shared "shell" naming) and is untouched.Kill-switch inlining (behavior = flag always on)
appShellsschema/type/serialization, the validation block, and the auto-enable-with-cacheComponentsdefault (config.ts,config-schema.ts,config-shared.ts).__NEXT_APP_SHELLSdefine and theexperimental.appShellsrender-opt threading (define-env.ts,base-server.ts,app-render/types.ts,templates/app-page.ts,templates/edge-ssr-app.ts,export/index.ts).route-module.ts: segment-cache prefetches (isPrefetchRSCRequest) always count as prefetches.response-cache/index.ts: a prefetch miss always runs its own generator instead of joining the batcher.request/params.ts: static non-root params are always deferred out of the shell.app-render.tsx: dropped the deadruntime-onlyRuntimePrerenderModevariant (only ever produced by the flag-off arms);shellByteLengthDeferred,collectedChunksByStage, and the/_shellsegment are now always created/emitted.Tests
Removed the
appShells: true/falseoverrides from 11 test configs. Thefalseones relied on legacy single-phase behavior for observability — which they retain automatically, since those apps don't enable Partial Prefetching. CI will surface any that need follow-up migration.Note
errors.jsonentry1279is left in place (append-only convention); the error is simply no longer thrown.