Skip to content

refactor(rsc): share canonical prefetch request resolution - #3019

Open
james-elicx wants to merge 1 commit into
codex/rsc-prewarm-promotion-delayfrom
codex/rsc-prewarm-canonical-dedupe
Open

refactor(rsc): share canonical prefetch request resolution#3019
james-elicx wants to merge 1 commit into
codex/rsc-prewarm-promotion-delayfrom
codex/rsc-prewarm-canonical-dedupe

Conversation

@james-elicx

Copy link
Copy Markdown
Member

Summary

  • extract the shared canonical RSC request decision used by Link and router.prefetch()
  • centralize full/loading-shell header normalization, canonical URL selection, and rewrite alias generation
  • preserve contextual identities for rewrites, interceptions, mounted slots, route-tree prefetches, and prefetch inlining
  • keep Link and programmatic prefetch scheduling/cache behavior separate

Next.js similarly routes Link and programmatic prefetches through shared segment-cache scheduling primitives:

Test plan

  • vp test run tests/app-prefetch-rsc-request.test.ts tests/prefetch-cache.test.ts tests/link-navigation.test.ts
  • vp test run tests/app-rsc-cache-busting.test.ts tests/link.test.ts
  • vp check packages/vinext/src/shims/internal/app-prefetch-rsc-request.ts packages/vinext/src/shims/navigation.ts packages/vinext/src/shims/link.tsx tests/app-prefetch-rsc-request.test.ts
  • vp run vinext#build

Stacked on #3017.

@pkg-pr-new

pkg-pr-new Bot commented Aug 21, 2026

Copy link
Copy Markdown

Open in StackBlitz

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

commit: d7f6655

@github-actions

Copy link
Copy Markdown
Contributor
Example Preview Production Original
app-router-cloudflare preview production
pages-router-cloudflare preview production
app-router-playground preview production original
realworld-api-rest preview production
nextra-docs-template preview production
benchmarks preview production
hackernews preview production original
workers-cache preview production
web preview production

@github-actions

Copy link
Copy Markdown
Contributor

Performance benchmarks

Compared d7f6655 against base 134a34b 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 141.8 KB 142.0 KB ⚫ +0.1%
Client entry size (gzip) vinext 129.2 KB 129.3 KB ⚫ +0.1%
Dev server cold start vinext 2.57 s 2.56 s ⚫ -0.4%
Production build time vinext 2.73 s 2.76 s ⚫ +1.1%
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
james-elicx marked this pull request as ready for review August 21, 2026 23:22
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