mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #953] [MERGED] refactor(app-router): delegate RSC route matching #980
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#980
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/cloudflare/vinext/pull/953
Author: @NathanDrake2406
Created: 4/29/2026
Status: ✅ Merged
Merged: 4/29/2026
Merged by: @james-elicx
Base:
main← Head:nathan/rsc-route-codegen📝 Commits (1)
2026394refactor(app-router): delegate RSC route matching📊 Changes
5 files changed (+336 additions, -613 deletions)
View changed files
📝
packages/vinext/src/entries/app-rsc-entry.ts(+17 -91)➕
packages/vinext/src/server/app-rsc-route-matching.ts(+139 -0)📝
tests/__snapshots__/entry-templates.test.ts.snap(+60 -522)➕
tests/app-rsc-route-matching.test.ts(+106 -0)📝
tests/entry-templates.test.ts(+14 -0)📄 Description
What this changes
Moves App Router RSC route matching, intercept lookup construction, intercept param merging, and dynamic metadata route pattern matching out of the generated RSC entry and into
server/app-rsc-route-matching.ts.This PR is independent of #952 and is based on
main. It may conflict lightly with otherapp-rsc-entry.tsrefactors if they merge first, but it does not require the stream-hints PR to land.Why
app-rsc-entry.tsstill owned request-path matching behavior inside generated source strings. That made the behavior hard to unit test directly and kept real runtime logic in the codegen layer.Approach
matchRoute,findIntercept, and dynamic metadata route pattern matching to the helper.Validation
vp test run tests/app-rsc-route-matching.test.ts tests/entry-templates.test.tsvp check packages/vinext/src/server/app-rsc-route-matching.ts packages/vinext/src/entries/app-rsc-entry.ts tests/app-rsc-route-matching.test.ts tests/entry-templates.test.ts tests/__snapshots__/entry-templates.test.ts.snapvp run vinext#buildBuild completed with the existing unresolved virtual import warnings for vinext virtual modules.
Risks / follow-ups
This keeps route manifest import emission in
app-rsc-entry.tsbecause those generated imports still need lexical module bindings. A later slice can target another runtime subsystem, but this PR avoids metadata emission, ISR, middleware, actions, and boundary behavior.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.