[PR #791] [CLOSED] fix(app-router): preserve same-named parallel slots across layout levels #850

Closed
opened 2026-05-06 13:10:27 +02:00 by BreizhHardware · 0 comments

📋 Pull Request Information

Original PR: https://github.com/cloudflare/vinext/pull/791
Author: @NathanDrake2406
Created: 4/8/2026
Status: Closed

Base: mainHead: fix/bug1-slot-scope-collision


📝 Commits (10+)

  • 22e7e9c fix(app-router): preserve same-named parallel slots across layout levels
  • c1b5be2 test(app-router): update slot collision assertions and snapshots
  • 94b22a6 fix(app-router): resolve ambiguous same-name slot lookups
  • 3d9812b refactor(app-router): require slot wiring names
  • 86dd456 Merge upstream/main into fix/bug1-slot-scope-collision
  • 7ccf8b2 chore: trigger CI
  • 024911b Update packages/vinext/src/routing/app-router.ts
  • b43fdc9 Merge upstream/main into fix/bug1-slot-scope-collision
  • bc83785 fix: use :: separator in slot keys to match origin
  • 3bddc54 Merge origin/fix/bug1-slot-scope-collision

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 packages/vinext/src/routing/app-router.ts (+1 -1)

📄 Description

Summary

  • give each parallel slot a stable key (slotName + owner directory) instead of using only slot.name
  • serialize slots in generated App Router entries by stable key while preserving the original slot prop name for layout props
  • update route wiring to resolve slot overrides by stable key (with name fallback)
  • add regression coverage for same-named parent/child slots in routing, route wiring, and App Router integration tests

Why

When parent and child layouts both define @modal, keying by name causes collisions and one slot silently overwrites the other. This drops one slot subtree and breaks layout behavior.

Testing

  • vp check tests/routing.test.ts tests/app-page-route-wiring.test.ts tests/app-router.test.ts packages/vinext/src/routing/app-router.ts packages/vinext/src/entries/app-rsc-entry.ts packages/vinext/src/server/app-page-route-wiring.tsx
  • vp test run tests/routing.test.ts tests/app-page-route-wiring.test.ts
  • vp test run tests/app-router.test.ts -t "same-named parallel slots"
  • vp test run tests/routing.test.ts tests/app-page-route-wiring.test.ts tests/app-router.test.ts -t "same-named parallel slots|preserves same-named parallel slots|renders same-named slot props"

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/cloudflare/vinext/pull/791 **Author:** [@NathanDrake2406](https://github.com/NathanDrake2406) **Created:** 4/8/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/bug1-slot-scope-collision` --- ### 📝 Commits (10+) - [`22e7e9c`](https://github.com/cloudflare/vinext/commit/22e7e9c1b27b42d4fb425cbca93e9f99e970e077) fix(app-router): preserve same-named parallel slots across layout levels - [`c1b5be2`](https://github.com/cloudflare/vinext/commit/c1b5be214ea5f992856ad37dbce65457d3254eaf) test(app-router): update slot collision assertions and snapshots - [`94b22a6`](https://github.com/cloudflare/vinext/commit/94b22a62b92974a8a2af3e15badf19e56efceb5c) fix(app-router): resolve ambiguous same-name slot lookups - [`3d9812b`](https://github.com/cloudflare/vinext/commit/3d9812be786ec26a3f1bd0715c69df301b75b3aa) refactor(app-router): require slot wiring names - [`86dd456`](https://github.com/cloudflare/vinext/commit/86dd456e1c02383a8280b2f58371e6477e67357e) Merge upstream/main into fix/bug1-slot-scope-collision - [`7ccf8b2`](https://github.com/cloudflare/vinext/commit/7ccf8b2edcf5e43e57c8fc59e925abc60003e153) chore: trigger CI - [`024911b`](https://github.com/cloudflare/vinext/commit/024911b52b9b05350978d908da4abaf4bc36de80) Update packages/vinext/src/routing/app-router.ts - [`b43fdc9`](https://github.com/cloudflare/vinext/commit/b43fdc90eb7301ac6fac73e1722f1c421bf993b8) Merge upstream/main into fix/bug1-slot-scope-collision - [`bc83785`](https://github.com/cloudflare/vinext/commit/bc8378516abae7c72cf66855906516ee140d7040) fix: use :: separator in slot keys to match origin - [`3bddc54`](https://github.com/cloudflare/vinext/commit/3bddc54c3e549c783ccb5554d417879e425c543c) Merge origin/fix/bug1-slot-scope-collision ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/vinext/src/routing/app-router.ts` (+1 -1) </details> ### 📄 Description ## Summary - give each parallel slot a stable key (`slotName + owner directory`) instead of using only `slot.name` - serialize slots in generated App Router entries by stable key while preserving the original slot prop name for layout props - update route wiring to resolve slot overrides by stable key (with name fallback) - add regression coverage for same-named parent/child slots in routing, route wiring, and App Router integration tests ## Why When parent and child layouts both define `@modal`, keying by name causes collisions and one slot silently overwrites the other. This drops one slot subtree and breaks layout behavior. ## Testing - `vp check tests/routing.test.ts tests/app-page-route-wiring.test.ts tests/app-router.test.ts packages/vinext/src/routing/app-router.ts packages/vinext/src/entries/app-rsc-entry.ts packages/vinext/src/server/app-page-route-wiring.tsx` - `vp test run tests/routing.test.ts tests/app-page-route-wiring.test.ts` - `vp test run tests/app-router.test.ts -t "same-named parallel slots"` - `vp test run tests/routing.test.ts tests/app-page-route-wiring.test.ts tests/app-router.test.ts -t "same-named parallel slots|preserves same-named parallel slots|renders same-named slot props"` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-06 13:10:27 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vinext#850
No description provided.