Skip to content

fix(router): reuse warmed RSC on locale-prefixed hybrid routes - #3027

Closed
james-elicx wants to merge 1 commit into
codex/rsc-prewarm-deploy-safetyfrom
codex/rsc-prewarm-hybrid-client-ownership
Closed

fix(router): reuse warmed RSC on locale-prefixed hybrid routes#3027
james-elicx wants to merge 1 commit into
codex/rsc-prewarm-deploy-safetyfrom
codex/rsc-prewarm-hybrid-client-ownership

Conversation

@james-elicx

Copy link
Copy Markdown
Member

Summary

Aligns browser hybrid-route ownership with the runtime and CDN warm-path discovery rules introduced by the RSC prewarming stack.

  • match App routes against the raw, basePath-stripped pathname so an App route such as /:locale/api/status still owns /fr/api/status
  • locale-normalize only the Pages pathname
  • select the Pages API versus page manifest partition from the raw pathname, so /fr/api/status is not reclassified as the unprefixed Pages API route /api/status
  • preserve existing locale-normalized Pages page matching and rewrite matching

This lets Link prefetch, router.prefetch(), and soft navigation reuse the App RSC entry that deploy-time discovery warmed for locale-prefixed hybrid routes.

This is stacked on #3026.

Validation

  • 173 focused tests across hybrid client ownership, Link behavior, prerender path discovery, and hybrid i18n runtime handoff
  • targeted formatting, lint, and type checks
  • vp run vinext#build

The API-path distinction follows Next.js' test/e2e/i18n-api-support/index.test.ts behavior for locale-prefixed /fr/api/* paths.

@pkg-pr-new

pkg-pr-new Bot commented Aug 22, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@vinext/cloudflare@3027
npm i https://pkg.pr.new/create-vinext-app@3027
npm i https://pkg.pr.new/@vinext/types@3027
npm i https://pkg.pr.new/vinext@3027

commit: 956065f

@github-actions

Copy link
Copy Markdown
Contributor

Performance benchmarks

Compared 956065f against base b88d125 using alternating same-runner rounds. Next.js was unchanged and skipped.

0 improved · 0 regressed · 6 within ±1.5%

Scenario Framework Baseline Current Change
Client bundle size (gzip) vinext 142.0 KB 142.1 KB ⚫ +0.1%
Client entry size (gzip) vinext 129.3 KB 129.4 KB ⚫ +0.1%
Dev server cold start vinext 3.14 s 3.13 s ⚫ -0.3%
Production build time vinext 3.56 s 3.58 s ⚫ +0.7%
RSC entry closure size (gzip) vinext 116.0 KB 116.0 KB ⚫ -0.0%
Server bundle size (gzip) vinext 197.5 KB 197.5 KB ⚫ -0.0%

View detailed results and traces

🟢 improvement · 🔴 regression · ⚫ change below 1.5% · paired base/head

@james-elicx

Copy link
Copy Markdown
Member Author

Superseded by consolidated PR #3040. No commits were dropped or rewritten: #3040 now contains this exact linear commit as part of #3021#3040. Closing only the redundant draft PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant