mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #927] [MERGED] fix(router): ignore pre-root parallel slots for routed layouts #955
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#955
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/927
Author: @NathanDrake2406
Created: 4/28/2026
Status: ✅ Merged
Merged: 4/28/2026
Merged by: @james-elicx
Base:
main← Head:nathan/pre-root-parallel-slot-ownership📝 Commits (1)
56e02adfix(router): ignore pre-root parallel slots for routed layouts📊 Changes
2 files changed (+58 additions, -4 deletions)
View changed files
📝
packages/vinext/src/routing/app-router.ts(+12 -4)📝
tests/routing.test.ts(+46 -0)📄 Description
Summary
parallelSlots.app/@modal/default.tsxwith the selected root layout atapp/(group)/layout.tsx.app/(group)/@modal/default.tsx.Root cause / Why
discoverInheritedParallelSlotsinitializedlayoutIdxto-1whenapp/layout.*was absent, but immediately clamped that value to0forappDirand every segment before the first actual layout. A slot above the selected root layout, such asapp/@modal/default.tsx, was therefore recorded as owned bylayoutIndex: 0and injected intoapp/(group)/layout.tsx.That diverges from Next.js multiple-root-layout semantics. Next.js documents that omitting
app/layout.jslets subdirectory layouts become root layouts: multiple root layout docs. The server tree construction also notes that parallel route children cannot exist above the root layout: create-component-tree note.The fix keeps the pre-layout sentinel while scanning and skips those slots once the route has a real layout. Layout-less scanner metadata is intentionally preserved here; scanner validation fixes are intentionally separate in another PR.
Verification
vp test run tests/routing.test.tsvp check packages/vinext/src/routing/app-router.ts tests/routing.test.ts🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.