Skip to content

(12/19) Fallback to exported RSC for cache misses#93570

Draft
feedthejim wants to merge 1 commit intofeedthejim/export-dynamic-fallback-client-cachefrom
feedthejim/export-dynamic-fallback-client-cache-miss
Draft

(12/19) Fallback to exported RSC for cache misses#93570
feedthejim wants to merge 1 commit intofeedthejim/export-dynamic-fallback-client-cachefrom
feedthejim/export-dynamic-fallback-client-cache-miss

Conversation

@feedthejim
Copy link
Copy Markdown
Contributor

@feedthejim feedthejim commented May 7, 2026

Stack position

Part 12 of 19 in the output export dynamic fallback stack.

Previous PR: #93562 (11/19)
Next PR: #93571 (13/19)

Context

The stack is split so build-time output can land behind experimental.outputExportDynamicFallbacks before the client router behavior is enabled. The target behavior is for output: 'export' apps with parameterized App Router routes to emit fallback HTML/RSC artifacts that a later client can resolve for hard loads and soft navigations.

This PR scope: Segment-cache recovery when no route cache entry exists.

A soft navigation can miss the route cache for an unknown param. This PR lets the segment cache fetch the full fallback RSC payload, validate it, and seed reusable cache entries.

What changed

  • Adds output-export fallback recovery for route cache misses.
  • Writes fallback-derived route and segment data into the cache using the fallback base path.
  • Keeps the recovery branch feature-gated so normal export behavior is unchanged when disabled.

Deliberately not included

  • Does not add route-shape mismatch fallback-to-not-found yet.
  • Does not add manifest conflict resolution.
  • Does not change the generic prefetch fetch helper.

Verification

After restacking and autosquashing, I verified the full stack with:

  • pnpm --filter=next build
  • pnpm testonly packages/next/src/lib/output-export-dynamic-fallback.test.ts packages/next/src/lib/output-export-fallback-routes.test.ts packages/next/src/export/helpers/output-export-fallback.test.ts packages/next/src/server/request/fallback-params.test.ts
  • pnpm testonly packages/next/src/client/output-export-fallback.test.ts packages/next/src/client/components/router-reducer/fetch-server-response.test.ts packages/next/src/client/components/router-reducer/create-initial-router-state.test.ts packages/next/src/client/components/segment-cache/cache.test.ts packages/next/src/client/components/segment-cache/vary-path.test.ts
  • pnpm testonly packages/next/src/client/components/router-reducer/compute-changed-path.test.ts packages/next/src/client/flight-data-helpers.test.ts packages/next/src/server/app-render/postponed-state.test.ts
  • pnpm test-start-turbo test/e2e/app-dir-export/test/dynamic-fallback-cache-components.test.ts test/e2e/app-dir-export/test/dynamic-fallback-route-shapes-cache-components.test.ts test/e2e/app-dir-export/test/dynamic-fallback-cache-components-basepath.test.ts test/e2e/app-dir-export/test/dynamic-fallback-optimizations-cache-components.test.ts test/e2e/app-dir-export/test/dynamic-fallback-known-params-cache-components.test.ts test/e2e/app-dir-export/test/dynamic-fallback-conflict.test.ts
  • pnpm test-start-turbo test/e2e/app-dir/output-export-dynamic-fallbacks/output-export-dynamic-fallbacks.test.ts test/e2e/app-dir-export/test/output-export-server-io.test.ts test/e2e/app-dir-export/test/output-export-server-io-use-cache.test.ts test/e2e/app-dir-export/test/dynamic-fallback-server-params.test.ts

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

Tests Passed

Commit: fb8e4f1

@feedthejim feedthejim force-pushed the feedthejim/export-dynamic-fallback-client-cache branch from 3eca55a to 7a9eacd Compare May 7, 2026 04:25
@feedthejim feedthejim force-pushed the feedthejim/export-dynamic-fallback-client-cache-miss branch from 0e6580c to 7a471a9 Compare May 7, 2026 04:25
@feedthejim feedthejim force-pushed the feedthejim/export-dynamic-fallback-client-cache branch from 7a9eacd to a97b092 Compare May 7, 2026 04:55
@feedthejim feedthejim force-pushed the feedthejim/export-dynamic-fallback-client-cache-miss branch 2 times, most recently from 6c6ac1d to dadbf87 Compare May 7, 2026 05:09
@feedthejim feedthejim force-pushed the feedthejim/export-dynamic-fallback-client-cache branch 2 times, most recently from 774720d to b60b9a7 Compare May 7, 2026 05:37
@feedthejim feedthejim force-pushed the feedthejim/export-dynamic-fallback-client-cache-miss branch from dadbf87 to 18c94c5 Compare May 7, 2026 05:37
@feedthejim feedthejim force-pushed the feedthejim/export-dynamic-fallback-client-cache branch from b60b9a7 to 0443cfc Compare May 7, 2026 06:20
@feedthejim feedthejim force-pushed the feedthejim/export-dynamic-fallback-client-cache-miss branch from 18c94c5 to 317b643 Compare May 7, 2026 06:20
@feedthejim feedthejim force-pushed the feedthejim/export-dynamic-fallback-client-cache branch from 0443cfc to a2740f7 Compare May 7, 2026 13:56
@feedthejim feedthejim force-pushed the feedthejim/export-dynamic-fallback-client-cache-miss branch from 317b643 to 91f7a43 Compare May 7, 2026 13:56
@feedthejim feedthejim force-pushed the feedthejim/export-dynamic-fallback-client-cache-miss branch from 91f7a43 to fb8e4f1 Compare May 7, 2026 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant