Add export fallbacks for cache components routes#92555
Add export fallbacks for cache components routes#92555feedthejim wants to merge 1 commit intocanaryfrom
Conversation
Failing test suitesCommit: 3be5080 | About building and testing Next.js
Expand output● app dir - with output export - cacheComponents fallback with known params › emits both prerendered known params and fallback artifacts ● app dir - with output export - cacheComponents fallback with known params › serves both prerendered and fallback params ● app dir - with output export - cacheComponents fallback with known params › serves both prerendered and fallback params ● Test suite failed to run
Expand output● app dir - with output export - cacheComponents fallback dynamic params › writes fallback artifacts instead of per-param prerenders ● app dir - with output export - cacheComponents fallback dynamic params › renders an unenumerated slug on hard load and client navigation ● app dir - with output export - cacheComponents fallback dynamic params › renders an unenumerated slug on hard load and client navigation ● app dir - with output export - cacheComponents fallback dynamic params › renders the app not-found page when no fallback route matches ● app dir - with output export - cacheComponents fallback dynamic params › renders the app not-found page when no fallback route matches ● Test suite failed to run
Expand output● segment cache - root params segment prefetch › does not encode root param placeholders in segment-prefetch responses
Expand output● use-cache-with-server-function-props › should be able to use inline server actions as props ● use-cache-with-server-function-props › should be able to use nested cache functions as props
Expand output● ppr-use-server-inserted-html › should mark the route as ppr rendered ● ppr-use-server-inserted-html › should not log insertion in build ● ppr-use-server-inserted-html › should insert the html insertion into html body
Expand output● use-cache › should cache results ● use-cache › should cache results custom handler ● use-cache › should cache complex args ● use-cache › should dedupe with react cache inside "use cache" ● use-cache › should return the same object reference for multiple invocations ● use-cache › should dedupe cached data in the RSC payload ● use-cache › should cache results in route handlers ● use-cache › should revalidate before redirecting in a route handler ● use-cache › should cache results for cached functions imported from client components ● use-cache › should cache results for cached functions passed to client components ● use-cache › should update after revalidateTag correctly ● use-cache › should revalidate caches after redirect ● use-cache › should revalidate caches nested in unstable_cache ● use-cache › should revalidate caches during on-demand revalidation ● use-cache › should not use stale caches in server actions that have revalidated ● use-cache › should prerender fully cacheable pages as static HTML ● use-cache › should match the expected revalidate and expire configs on the prerender manifest ● use-cache › should match the expected stale config in the page header ● use-cache › should send an SWR cache-control header based on the revalidate and expire values ● use-cache › should omit dynamic caches from prerendered shells ● use-cache › should not have hydration errors when resuming a partial shell with dynamic caches ● use-cache › should propagate unstable_cache tags correctly ● use-cache › can reference server actions in "use cache" functions ● use-cache › should be able to revalidate a page using revalidateTag ● use-cache › should use revalidate config in fetch ● use-cache › should cache fetch without no-store ● use-cache › should override fetch with no-store in use cache properly ● use-cache › should store a fetch response without no-store in the incremental cache handler during build ● use-cache › should not store a fetch response with no-store in the incremental cache handler during build ● use-cache › should NOT update immediately after revalidateTag with profile (stale-while-revalidate) ● use-cache › should override fetch with cookies/auth in use cache properly ● use-cache › works with useActionState if previousState parameter is not used in "use cache" function ● use-cache › works with useActionState if previousState parameter is not used in "use cache" function (separate export) ● use-cache › works with "use cache" in method props ● use-cache › works with "use cache" in static class methods ● use-cache › renders the not-found page when ● use-cache › should not read nor write cached data when draft mode is enabled › js enabled, with cookies ● use-cache › should not read nor write cached data when draft mode is enabled › js disabled, with cookies ● use-cache › should not read nor write cached data when draft mode is enabled › js enabled, without cookies ● use-cache › should not read nor write cached data when draft mode is enabled › js disabled, without cookies ● use-cache › should exclude inner caches and omitted caches from the resume data cache (RDC) ● use-cache › usage in node_modules › should cache results when using a directive without a handler ● use-cache › usage in node_modules › should cache results when using a directive with a handler ● use-cache › shares caches between the page/layout and generateMetadata ● use-cache › can resume a cached generateMetadata function ● use-cache › can resume a cached generateMetadata function that does not read params ● use-cache › can serialize parent metadata as generateMetadata argument ● use-cache › makes a cached generateMetadata function that implicitly depends on params dynamic during prerendering ● use-cache › makes a cached generateMetadata function that reads params dynamic during prerendering ● use-cache › can resume a cached generateViewport function ● use-cache › can resume a cached generateViewport function that does not read params ● use-cache › makes a cached generateViewport function that reads params dynamic during prerendering ● use-cache › caches a higher-order component in a "use cache" module ● use-cache › ignores unused arguments in a "use cache" function ● use-cache › should allow nested short-lived caches after connection()
Expand output● segment cache - root params segment prefetch › does not encode root param placeholders in segment-prefetch responses
Expand output● use-cache-search-params › should fail the build with errors ● use-cache-search-params › should resume a cached page that does not access search params without hydration errors
Expand output● use-cache-with-server-function-props › should be able to use inline server actions as props ● use-cache-with-server-function-props › should be able to use nested cache functions as props
Expand output● instant-validation-build › basic dynamic hole detection › valid - suspense around runtime › should succeed build when cookies are inside Suspense ● instant-validation-build › server errors › valid - ignores server errors that do not surface in SSR ● instant-validation-build › searchParams › search params are correctly read from samples ● instant-validation-build › searchParams › useSearchParams() receives search params from samples ● instant-validation-build › searchParams › valid - awaited search params passed to a cache ● instant-validation-build › searchParams › valid - awaited search params passed to a client component ● instant-validation-build › headers › headers are correctly read from samples ● instant-validation-build › headers › valid - header value passed to a cache ● instant-validation-build › headers › valid - header value passed to a client component ● instant-validation-build › cookies › cookies are correctly read from samples ● instant-validation-build › cookies › valid - cookies passed to a cache ● instant-validation-build › params › valid - params are correctly read from samples ● instant-validation-build › params › useParams() receives params from samples ● instant-validation-build › params › valid - awaited params passed to a cache ● instant-validation-build › params › valid - awaited params passed to a client component ● instant-validation-build › pathname › valid - usePathname() on a route without params ● instant-validation-build › pathname › valid - usePathname() on a route with params (all provided in samples) ● instant-validation-build › pathname › valid - usePathname() on a route inside a route group does not include the group segment ● instant-validation-build › pathname › valid - usePathname() on a catch-all route ● instant-validation-build › pathname › valid - usePathname() on an optional catch-all route ● instant-validation-build › root params › valid - static - root params are correctly read from samples ● instant-validation-build › root params › valid - runtime - root params are correctly read from samples ● instant-validation-build › root params › error - reading a root param not present in samples ● instant-validation-build › root params › error - reading a root param not present in samples and catching the error ● instant-validation-build › samples precedence › page samples override layout samples ● instant-validation-build › samples precedence › page inherits samples from layout when it has none ● instant-validation-build › generateStaticParams › valid - page with generateStaticParams and samples only runs validation once ● instant-validation-build › caches › valid - static prefetch - awaiting a cache in the static stage does not require a suspense boundary ● instant-validation-build › caches › valid - runtime prefetch - awaiting a cache in the runtime stage does not require a suspense boundary ● instant-validation-build › caches › valid - runtime prefetch - awaiting a mix of caches in the static and runtime stages does not require a suspense boundary ● instant-validation-build › caches › valid - runtime prefetch - awaiting a private cache in the runtime stage does not require a suspense boundary
Expand output● app dir - with output export - cacheComponents fallback with known params › emits both prerendered known params and fallback artifacts ● app dir - with output export - cacheComponents fallback with known params › serves both prerendered and fallback params ● app dir - with output export - cacheComponents fallback with known params › serves both prerendered and fallback params ● Test suite failed to run
Expand output● app dir - with output export - cacheComponents fallback with known params › emits both prerendered known params and fallback artifacts ● app dir - with output export - cacheComponents fallback with known params › serves both prerendered and fallback params ● app dir - with output export - cacheComponents fallback with known params › serves both prerendered and fallback params ● Test suite failed to run
Expand output● Node Extensions › Random › Cache Components › should not error when accessing middlware that use Math.random() ● Node Extensions › Random › Cache Components › should not error when accessing pages that use Math.random() in App Router ● Node Extensions › Random › Cache Components › should not error when accessing routes that use Math.random() in App Router ● Node Extensions › Random › Cache Components › should not error when accessing pages that use Math.random() in Pages Router ● Node Extensions › Random › Cache Components › should not error when accessing routes that use Math.random() in Pages Router
Expand output● app-dir - server source maps › logged errors have a sourcemapped stack with a codeframe ● app-dir - server source maps › logged errors have a sourcemapped ● app-dir - server source maps › logged errors collapse deeply nested causes at depth 2 ● app-dir - server source maps › logged errors include ● app-dir - server source maps › logged errors in client components during ssr have a sourcemapped stack with a codeframe ● app-dir - server source maps › stack frames are ignore-listed in ssr ● app-dir - server source maps › stack frames are ignore-listed in rsc ● app-dir - server source maps › thrown SSR errors ● app-dir - server source maps › logged errors preserve their name ● app-dir - server source maps › handles invalid sourcemaps gracefully ● app-dir - server source maps › sourcemaps errors during module evaluation ● app-dir - server source maps › ignore-lists anonymous rsc stack frame sandwiches ● app-dir - server source maps › ignore-lists anonymous ssr stack frame sandwiches
Expand output● instant validation › build › valid - static prefetch - suspense around runtime and dynamic ● instant validation › build › valid - runtime prefetch - suspense only around dynamic ● instant validation › build › valid - runtime prefetch - does not require Suspense around params ● instant validation › build › valid - runtime prefetch - does not require Suspense around search params ● instant validation › build › valid - target segment not visible in all navigations ● instant validation › build › valid - runtime prefetch - sync IO in a static parent layout is allowed ● instant validation › build › valid - runtime prefetch - sync IO in generateMetadata on a static page is allowed ● instant validation › build › valid - runtime prefetch - sync IO in layout generateMetadata when page is NOT prefetchable ● instant validation › build › valid - no suspense needed around dynamic in page if loading.js is present ● instant validation › build › blocking › valid - blocking layout with unstable_instant = false is allowed to block ● instant validation › build › blocking › valid - blocking page inside a static layout is allowed if the layout has suspense ● instant validation › build › blocking › valid - blocking page inside a runtime layout is allowed if the layout has suspense ● instant validation › build › client components › valid - parent suspends on client data but does not block children ● instant validation › build › client components › valid - parent uses sync IO in a client component ● instant validation › build › client components › valid - parent uses dynamic usePathname() in a client component ● instant validation › build › client components › valid - parent uses useSearchParams() in a client component ● instant validation › build › client errors › valid - client error from sibling of children slot with suspense ● instant validation › build › head › valid - runtime prefetch - dynamic generateMetadata does not block navigation ● instant validation › build › head › valid - static prefetch - runtime generateMetadata does not block navigation ● instant validation › build › head › valid - runtime prefetch - runtime generateViewport does not block navigation ● instant validation › build › head › valid - blocking layout - dynamic viewport is allowed to block ● instant validation › build › disabling validation › in a layout ● instant validation › build › disabling validation › in a page ● instant validation › build › disabling validation › in a page with a parent that has a config ● instant validation › build › disabling validation › disabling build validation
Expand output● ppr-use-server-inserted-html › should mark the route as ppr rendered ● ppr-use-server-inserted-html › should not log insertion in build ● ppr-use-server-inserted-html › should insert the html insertion into html body
Expand output● unstable_io with cache components › should make content after unstable_io() dynamic during prerender ● unstable_io with cache components › should resolve immediately inside a "use cache" scope ● unstable_io with cache components › should work in pages router with getServerSideProps (CC) ● unstable_io with cache components › should work in pages router with getStaticProps (CC) ● unstable_io with cache components › should work in pages router with React.use() (CC)
Expand output● cache-components › should not prerender GET route handlers that use dynamic APIs ● cache-components › should prerender GET route handlers that have entirely cached io (fetches) ● cache-components › should not prerender GET route handlers that have some uncached io (fetches) ● cache-components › should prerender GET route handlers that have entirely cached io (unstable_cache) ● cache-components › should prerender GET route handlers that have entirely cached io ("use cache") ● cache-components › should not prerender GET route handlers that have some uncached io (unstable_cache) ● cache-components › should prerender GET route handlers that complete synchronously or in a microtask ● cache-components › should not prerender GET route handlers that complete in a new Task ● cache-components › should prerender GET route handlers when accessing params
Expand output● deterministic build - changing deployment id › build output API - cacheComponents builder › should produce identical build outputs even when changing deployment id ● deterministic build - changing deployment id › build output API - cacheComponents adapter › should produce identical build outputs even when changing deployment id
Expand output● instant-validation-build › basic dynamic hole detection › valid - suspense around runtime › should succeed build when cookies are inside Suspense ● instant-validation-build › server errors › valid - ignores server errors that do not surface in SSR ● instant-validation-build › searchParams › search params are correctly read from samples ● instant-validation-build › searchParams › useSearchParams() receives search params from samples ● instant-validation-build › searchParams › valid - awaited search params passed to a cache ● instant-validation-build › searchParams › valid - awaited search params passed to a client component ● instant-validation-build › headers › headers are correctly read from samples ● instant-validation-build › headers › valid - header value passed to a cache ● instant-validation-build › headers › valid - header value passed to a client component ● instant-validation-build › cookies › cookies are correctly read from samples ● instant-validation-build › cookies › valid - cookies passed to a cache ● instant-validation-build › params › valid - params are correctly read from samples ● instant-validation-build › params › useParams() receives params from samples ● instant-validation-build › params › valid - awaited params passed to a cache ● instant-validation-build › params › valid - awaited params passed to a client component ● instant-validation-build › pathname › valid - usePathname() on a route without params ● instant-validation-build › pathname › valid - usePathname() on a route with params (all provided in samples) ● instant-validation-build › pathname › valid - usePathname() on a route inside a route group does not include the group segment ● instant-validation-build › pathname › valid - usePathname() on a catch-all route ● instant-validation-build › pathname › valid - usePathname() on an optional catch-all route ● instant-validation-build › root params › valid - static - root params are correctly read from samples ● instant-validation-build › root params › valid - runtime - root params are correctly read from samples ● instant-validation-build › root params › error - reading a root param not present in samples ● instant-validation-build › root params › error - reading a root param not present in samples and catching the error ● instant-validation-build › samples precedence › page samples override layout samples ● instant-validation-build › samples precedence › page inherits samples from layout when it has none ● instant-validation-build › generateStaticParams › valid - page with generateStaticParams and samples only runs validation once ● instant-validation-build › caches › valid - static prefetch - awaiting a cache in the static stage does not require a suspense boundary ● instant-validation-build › caches › valid - runtime prefetch - awaiting a cache in the runtime stage does not require a suspense boundary ● instant-validation-build › caches › valid - runtime prefetch - awaiting a mix of caches in the static and runtime stages does not require a suspense boundary ● instant-validation-build › caches › valid - runtime prefetch - awaiting a private cache in the runtime stage does not require a suspense boundary
Expand output● empty-shell-route-cache › should emit both routes as partially static build artifacts ● empty-shell-route-cache › after next start › should not rewrite /with-suspense build artifacts on the first request ● empty-shell-route-cache › after next start › should not rewrite /without-suspense build artifacts on the first request
Expand output● instant validation › build › valid - static prefetch - suspense around runtime and dynamic ● instant validation › build › valid - runtime prefetch - suspense only around dynamic ● instant validation › build › valid - runtime prefetch - does not require Suspense around params ● instant validation › build › valid - runtime prefetch - does not require Suspense around search params ● instant validation › build › valid - target segment not visible in all navigations ● instant validation › build › valid - runtime prefetch - sync IO in a static parent layout is allowed ● instant validation › build › valid - runtime prefetch - sync IO in generateMetadata on a static page is allowed ● instant validation › build › valid - runtime prefetch - sync IO in layout generateMetadata when page is NOT prefetchable ● instant validation › build › valid - no suspense needed around dynamic in page if loading.js is present ● instant validation › build › blocking › valid - blocking layout with unstable_instant = false is allowed to block ● instant validation › build › blocking › valid - blocking page inside a static layout is allowed if the layout has suspense ● instant validation › build › blocking › valid - blocking page inside a runtime layout is allowed if the layout has suspense ● instant validation › build › client components › valid - parent suspends on client data but does not block children ● instant validation › build › client components › valid - parent uses sync IO in a client component ● instant validation › build › client components › valid - parent uses dynamic usePathname() in a client component ● instant validation › build › client components › valid - parent uses useSearchParams() in a client component ● instant validation › build › client errors › valid - client error from sibling of children slot with suspense ● instant validation › build › head › valid - runtime prefetch - dynamic generateMetadata does not block navigation ● instant validation › build › head › valid - static prefetch - runtime generateMetadata does not block navigation ● instant validation › build › head › valid - runtime prefetch - runtime generateViewport does not block navigation ● instant validation › build › head › valid - blocking layout - dynamic viewport is allowed to block ● instant validation › build › disabling validation › in a layout ● instant validation › build › disabling validation › in a page ● instant validation › build › disabling validation › in a page with a parent that has a config ● instant validation › build › disabling validation › disabling build validation |
Stats from current PR🔴 1 regression
📊 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 (9 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.jsfailed to diffapp-page-tur..ntime.dev.jsfailed to diffapp-page-tur..time.prod.jsfailed to diffapp-page.runtime.dev.jsfailed to diffapp-page.runtime.prod.jsDiff too large to display server.runtime.prod.jsDiff too large to display 📎 Tarball URL |
Summary
This adds dynamic param fallback support for App Router
output: 'export'routes whencacheComponentsis enabled.__fallbackartifacts plus a global/_fallback.htmlentry for static hostsoptimisticRoutingandvaryParams)Testing
pnpm --filter=next buildpnpm testonly packages/next/src/lib/output-export-dynamic-fallback.test.ts packages/next/src/client/output-export-fallback.test.ts packages/next/src/client/flight-data-helpers.test.tsNotes
The new export browser e2e coverage is included in this PR, but I could not fully execute it locally because this checkout has a mismatched native
@next/swcsetup and fails in the fixture build withbindings.lockfileTryAcquireSync is not a function.