mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #721] [MERGED] test: regression tests for inherited intercepting route slot deduplication #798
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#798
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/721
Author: @Debbl
Created: 3/30/2026
Status: ✅ Merged
Merged: 4/5/2026
Merged by: @james-elicx
Base:
main← Head:fix/intercepting-routes📝 Commits (7)
3fa9df7fix: allow inherited intercepting routes to share target patterns60b3796fix: validate intercepting route target consistency per page3b05f17refactor: simplify intercept target pattern collection by using Set for deduplication97882cbmerge: sync with main and address bonk review commentse988757fixup: use main's inline Set dedup, remove helper export, restore .gitignore90dcd9efix(test): pass explicit out dirs and appDir to buildApp to fix UNRESOLVED_IMPORT in RSC build9479f3dchore: restore .gitignore to match main📊 Changes
10 files changed (+439 additions, -1 deletions)
View changed files
📝
examples/app-router-playground/app/_internal/_data.ts(+6 -0)➕
examples/app-router-playground/app/intercepting-routes/@modal/(.)photo/[id]/page.tsx(+73 -0)➕
examples/app-router-playground/app/intercepting-routes/@modal/default.tsx(+3 -0)➕
examples/app-router-playground/app/intercepting-routes/layout.tsx(+44 -0)➕
examples/app-router-playground/app/intercepting-routes/page.tsx(+33 -0)➕
examples/app-router-playground/app/intercepting-routes/photo/[id]/page.tsx(+57 -0)➕
examples/app-router-playground/app/intercepting-routes/readme.mdx(+7 -0)📝
packages/vinext/src/routing/app-router.ts(+5 -1)➕
tests/intercepting-routes-build.test.ts(+157 -0)📝
tests/routing.test.ts(+54 -0)📄 Description
Summary
The fix for this bug (inherited parallel slots causing the same intercepting page to be counted multiple times during validation) has already been merged into main. This PR retains the regression tests and the
intercepting-routesplayground example so the behavior stays covered going forward.What's included
tests/intercepting-routes-build.test.ts— production build regression test: verifies a route structure with an inherited@modalslot and an intercepting(.)photo/[id]route builds successfullytests/routing.test.ts— unit regression test: verifies that inherited intercepting slots sharing the same target pattern are correctly allowed (not rejected as duplicates)examples/app-router-playground/app/intercepting-routes/— playground demo showing the intercepting routes pattern with a modal slotBackground
When a parallel slot is inherited by child routes, the same intercepting page can appear on multiple discovered routes. The old validation flattened all intercepted target patterns and treated repeated entries from inherited slots as separate route definitions, incorrectly throwing:
You cannot have two routes that resolve to the same pathThe fix (de-duplicating by target pattern before validation) landed in main separately. These tests guard against regressions.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.