mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #1060] [MERGED] feat(app-router): mint semantic route graph ids #1059
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#1059
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/1060
Author: @NathanDrake2406
Created: 5/5/2026
Status: ✅ Merged
Merged: 5/5/2026
Merged by: @james-elicx
Base:
main← Head:nathan/726-graph-semantic-ids📝 Commits (1)
ebd6f72feat(app-router): mint semantic route graph ids📊 Changes
6 files changed (+266 additions, -17 deletions)
View changed files
📝
packages/vinext/src/entries/app-rsc-manifest.ts(+2 -0)📝
packages/vinext/src/routing/app-route-graph.ts(+131 -14)📝
packages/vinext/src/routing/app-router.ts(+3 -3)📝
packages/vinext/src/server/app-page-route-wiring.tsx(+4 -0)📝
tests/app-route-graph.test.ts(+53 -0)📝
tests/entry-templates.test.ts(+73 -0)📄 Description
What this changes
Implements
#726-GRAPH-01from #726 by having the existing App Router route graph mint stable semantic IDs for route, page, route handler, layout, template, and parallel slot facts.The generated RSC manifest now carries those graph-owned IDs through route and slot metadata, but this PR intentionally does not promote planner decisions, root-boundary IDs, cache compatibility, or wire-key enforcement. Those are later
#726-GRAPH-*,#726-CORE-*, and#726-WIRE-*tasks.Why
The current flat payload bridge works, but route meaning is still reconstructed from route patterns, tree paths, and slot keys in later layers. For the #726 migration, topology identity needs to be a build-time graph fact before the planner and compatibility layers can stop treating wire keys as semantic authority.
Correctness oracle: Vinext internal invariant. Equivalent app filesystem topology should produce the same semantic IDs regardless of absolute filesystem root, while route groups and dynamic segment markers that affect topology must remain visible in graph IDs.
Approach
AppRouteSemanticIdsto the existing route graph output.idsplus slotidin generated App Router RSC route metadata.#726-GRAPH-01only needs minted graph facts. Exporting canonical constructors can happen when a later PR has an actual import boundary for them.Validation
vp test run tests/app-route-graph.test.ts tests/entry-templates.test.tsvp check packages/vinext/src/routing/app-route-graph.ts packages/vinext/src/entries/app-rsc-manifest.ts packages/vinext/src/server/app-page-route-wiring.tsx tests/app-route-graph.test.ts tests/entry-templates.test.tsvp run knip --no-progressvp stagedvp test run tests/entry-templates.test.ts -uNote: the pre-commit hook currently assumes
tests/__snapshots__/entry-templates.test.ts.snapexists and fails when entry-template files are staged, even after the snapshot update test passes. I ran the hook checks above manually and committed with--no-verifyfor that broken hook path.Risks / follow-ups
This PR preserves current runtime behavior. The new IDs are carried as metadata only; later #726 PRs still need to define root boundary IDs, RouteManifest read models, wire-key fences, planner contracts, and compatibility envelopes before semantic decisions move out of current runtime paths.
Refs #726
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.