mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #872] [MERGED] Render intercept route layouts inside App Router slots #909
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#909
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/872
Author: @NathanDrake2406
Created: 4/22/2026
Status: ✅ Merged
Merged: 4/23/2026
Merged by: @james-elicx
Base:
main← Head:nathan/intercept-layout-chain📝 Commits (3)
1577977Render intercept route layouts inside App Router slots4ce70b6Avoid repeated intercept layout scans and slot param wrappingbf70a02Clarify intercept layout plumbing and cover nested layout chains📊 Changes
7 files changed (+272 additions, -12 deletions)
View changed files
📝
packages/vinext/src/entries/app-rsc-entry.ts(+10 -2)📝
packages/vinext/src/routing/app-router.ts(+10 -0)📝
packages/vinext/src/server/app-page-route-wiring.tsx(+18 -4)📝
tests/__snapshots__/entry-templates.test.ts.snap(+30 -6)📝
tests/app-page-route-wiring.test.ts(+73 -0)📝
tests/app-router.test.ts(+52 -0)📝
tests/routing.test.ts(+79 -0)📄 Description
What this changes
App Router intercepting routes now keep and render
layout.tsxfiles that live inside the intercepting route tree instead of rendering the intercepted page bare inside the slot.Why
Current vinext behavior drops those intercept-local layouts during discovery, so a modal intercept can match the right page but still miss required wrappers that Next.js applies. That breaks cases like
@modal/(.)explicit-layout/layout.tsxwith a nested intercepted page.Approach
Collect intercept layout paths during App Router discovery, carry them through generated RSC entry serialization, and apply the resulting layout modules around the intercepted slot override before the slot layout renders.
This stays within the existing intercept pipeline rather than adding a separate render path.
Validation
vp test run /Users/nathan/Projects/vinext/tests/routing.test.ts /Users/nathan/Projects/vinext/tests/app-page-route-wiring.test.ts /Users/nathan/Projects/vinext/tests/app-router.test.tsRisks / follow-ups
The generated entry now carries one more intercept field through the serialization path. The added codegen test covers that contract directly.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.