mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #545] [MERGED] fix: use closest ancestor parallel slot instead of farthest #661
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#661
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/545
Author: @NathanDrake2406
Created: 3/15/2026
Status: ✅ Merged
Merged: 3/15/2026
Merged by: @james-elicx
Base:
main← Head:fix/parallel-slot-priority📝 Commits (1)
22d3c03fix: use closest ancestor parallel slot instead of farthest📊 Changes
2 files changed (+39 additions, -4 deletions)
View changed files
📝
packages/vinext/src/routing/app-router.ts(+3 -4)📝
tests/routing.test.ts(+36 -0)📄 Description
Summary
discoverInheritedParallelSlotsiterated root-to-leaf but usedif (!slotMap.has(slot.name))which made the farthest ancestor's slot win instead of the closest@sidebarat bothapp/andapp/dashboard/, the route/dashboard/settingswould incorrectly get the root-level sidebarhas()guard soslotMap.set()is called unconditionally for inherited slots — since iteration goes root-to-leaf, later (closer) ancestors naturally overwrite earlier (farther) onesisOwnDirbranch which already used unconditionalset()Test plan
@sidebarat root and dashboard levels, verifies/dashboard/settingsgets the dashboard-level slot🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.