mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 00:09:23 +02:00
[PR #737] [MERGED] feat: implement parallelRoutesKey support in useSelectedLayoutSegment(s) #808
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#808
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/737
Author: @NathanDrake2406
Created: 4/1/2026
Status: ✅ Merged
Merged: 4/1/2026
Merged by: @james-elicx
Base:
main← Head:feat/layout-persistence-foundations📝 Commits (8)
3ac653cfeat: migrate LayoutSegmentContext to segmentMap for parallelRoutesKeycf88a7crefactor: update all LayoutSegmentProvider consumers to segmentMap6f9660atest: add parallelRoutesKey integration tests9bb5e48refactor: remove as cast from useSelectedLayoutSegmentsbebb2f2Update packages/vinext/src/shims/layout-segment-context.tsxae64510Update packages/vinext/src/shims/navigation.tsc0a594eUpdate packages/vinext/src/shims/layout-segment-context.tsx7689fafMerge remote-tracking branch 'origin/main' into feat/layout-persistence-foundations📊 Changes
10 files changed (+175 additions, -51 deletions)
View changed files
📝
packages/vinext/src/entries/app-rsc-entry.ts(+2 -2)📝
packages/vinext/src/server/app-page-boundary-render.ts(+2 -2)📝
packages/vinext/src/server/app-page-boundary.ts(+5 -2)📝
packages/vinext/src/shims/layout-segment-context.tsx(+12 -7)📝
packages/vinext/src/shims/navigation.ts(+26 -23)📝
tests/__snapshots__/entry-templates.test.ts.snap(+12 -12)📝
tests/app-page-boundary.test.ts(+2 -2)📝
tests/app-router.test.ts(+31 -0)📝
tests/fixtures/app-basic/app/dashboard/segment-display.tsx(+7 -0)📝
tests/shims.test.ts(+76 -1)📄 Description
Summary
Implements
parallelRoutesKeysupport inuseSelectedLayoutSegment(s)(#726). This was previously accepted but silently ignored.Migrates
LayoutSegmentContextfromstring[]toSegmentMap— a record with a requiredchildrenkey plus optional parallel route keys:SegmentMaptype:{ readonly children: string[] } & Readonly<Record<string, string[]>>useChildSegments()accepts aparallelRoutesKeyparameter to index into the mapLayoutSegmentProviderprop changes fromchildSegmentstosegmentMap"children"keyTest plan
tests/shims.test.ts— parallelRoutesKey unit + SSR tests, cross-module context test updatedtests/app-router.test.ts— integration tests for parallelRoutesKey with dashboard parallel routestests/entry-templates.test.ts— snapshots updated for segmentMap proptests/app-page-boundary.test.ts— boundary helper test updated for new type signaturepnpm run check— 0 lint/type errors🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.