mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #867] [MERGED] Fix sibling intercepted App Router routes #906
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#906
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/867
Author: @NathanDrake2406
Created: 4/21/2026
Status: ✅ Merged
Merged: 4/21/2026
Merged by: @james-elicx
Base:
main← Head:fix/sibling-interception📝 Commits (5)
5867692fix app router sibling interception41e913fupdate app router entry snapshots0413015preserve chained intercepted navigations1d1abf1address intercepted route review feedback6e727eeguard probePage() against undefined PageComponent for slot-only routes📊 Changes
21 files changed (+475 additions, -51 deletions)
View changed files
📝
packages/vinext/src/entries/app-rsc-entry.ts(+29 -7)📝
packages/vinext/src/routing/app-router.ts(+50 -2)📝
tests/__snapshots__/entry-templates.test.ts.snap(+174 -42)📝
tests/e2e/app-router/advanced.spec.ts(+64 -0)➕
tests/fixtures/app-basic/app/film/[imdbId]/page.tsx(+8 -0)➕
tests/fixtures/app-basic/app/parallel-sibling-modal/[username]/@feed/default.tsx(+5 -0)➕
tests/fixtures/app-basic/app/parallel-sibling-modal/[username]/@feed/page.tsx(+12 -0)➕
tests/fixtures/app-basic/app/parallel-sibling-modal/[username]/@modal/(..)photo/[id]/page.tsx(+3 -0)➕
tests/fixtures/app-basic/app/parallel-sibling-modal/[username]/@modal/default.tsx(+3 -0)➕
tests/fixtures/app-basic/app/parallel-sibling-modal/[username]/layout.tsx(+15 -0)➕
tests/fixtures/app-basic/app/parallel-sibling-modal/photo/[id]/page.tsx(+3 -0)➕
tests/fixtures/app-basic/app/sibling-source/@modal/(..)sibling-target/[id]/page.tsx(+8 -0)➕
tests/fixtures/app-basic/app/sibling-source/@modal/default.tsx(+3 -0)➕
tests/fixtures/app-basic/app/sibling-source/layout.tsx(+14 -0)➕
tests/fixtures/app-basic/app/sibling-source/page.tsx(+12 -0)➕
tests/fixtures/app-basic/app/sibling-target/[id]/page.tsx(+7 -0)➕
tests/fixtures/app-basic/app/top/@modal/(..)film/[imdbId]/page.tsx(+8 -0)➕
tests/fixtures/app-basic/app/top/@modal/default.tsx(+3 -0)➕
tests/fixtures/app-basic/app/top/layout.tsx(+14 -0)➕
tests/fixtures/app-basic/app/top/page.tsx(+12 -0)...and 1 more files
📄 Description
Summary
Fixes sibling intercepted App Router navigation when the source route is a layout-owned parallel-slot route.
This now matches the Next.js
intercepting-parallel-modalreference shape where/[username]renders@feedand@modal, and navigating to a sibling target mounts the modal while preserving source content.Fixes #866
What Changed
page.tsx.(..), the reported/topto/film/[imdbId]shape, and the Next.js@feed+@modal/(..)photo/[id]shape.Why It Matters
Apps using modal/detail routes from a listing page can now keep the listing tree mounted while rendering the intercepted sibling route. Source params such as
usernameno longer disappear when they are not present in the target URL.Risks Or Limits
This changes route discovery for layout segments with parallel slots but no child page. The added route is only created when that layout owns parallel slots and no existing route pattern already exists.
Verification
npx vp test run tests/routing.test.ts -t "layout routes whose own content is parallel slot pages"npx vp test run tests/app-router.test.ts -t "intercept"PLAYWRIGHT_PROJECT=app-router npx playwright test tests/e2e/app-router/advanced.spec.ts -g "sibling|top-level"npx vp check packages/vinext/src/routing/app-router.ts packages/vinext/src/entries/app-rsc-entry.ts tests/routing.test.ts tests/e2e/app-router/advanced.spec.ts tests/fixtures/app-basic/app/sibling-source tests/fixtures/app-basic/app/sibling-target tests/fixtures/app-basic/app/top tests/fixtures/app-basic/app/film tests/fixtures/app-basic/app/parallel-sibling-modal🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.