[PR #811] [MERGED] Fix parallel slot persistence and cache variants #863

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

📋 Pull Request Information

Original PR: https://github.com/cloudflare/vinext/pull/811
Author: @NathanDrake2406
Created: 4/10/2026
Status: Merged
Merged: 4/10/2026
Merged by: @james-elicx

Base: mainHead: fix/parallel-slot-persistence-soft-nav


📝 Commits (7)

  • 5da3aa2 Fix parallel slot persistence and cache variants
  • 8d8fbe1 Address App Router review follow-ups
  • 203a430 Fix generated mounted-slot regex escaping
  • 7304bef Address review feedback on slot normalization and cache comments
  • 7072036 Remove redundant .map(trim) and clarify regen slot context
  • fd44d39 Clarify regen dedup and prefetch slot-mismatch tradeoffs
  • 3ef5218 Document storePrefetchResponse slot-awareness gap

📊 Changes

14 files changed (+750 additions, -67 deletions)

View changed files

📝 packages/vinext/src/entries/app-rsc-entry.ts (+40 -3)
📝 packages/vinext/src/server/app-browser-entry.ts (+25 -3)
📝 packages/vinext/src/server/app-elements.ts (+25 -0)
📝 packages/vinext/src/server/app-page-cache.ts (+43 -20)
📝 packages/vinext/src/server/app-page-render.ts (+4 -1)
📝 packages/vinext/src/server/app-page-response.ts (+4 -0)
📝 packages/vinext/src/server/app-page-route-wiring.tsx (+20 -4)
📝 packages/vinext/src/shims/link.tsx (+8 -1)
📝 packages/vinext/src/shims/navigation.ts (+51 -6)
📝 tests/__snapshots__/entry-templates.test.ts.snap (+240 -18)
📝 tests/app-browser-entry.test.ts (+35 -0)
📝 tests/app-page-cache.test.ts (+75 -11)
📝 tests/app-page-route-wiring.test.ts (+136 -0)
📝 tests/prefetch-cache.test.ts (+44 -0)

📄 Description

Fixes bugs in slot components introduced in https://github.com/cloudflare/vinext/pull/750 that https://github.com/cloudflare/vinext/pull/752 caught

This tightens App Router slot behavior in three places:

  • preserve default.tsx fallback behavior correctly on soft navigation by distinguishing already-mounted slots from first entry into a layout
  • make prefetch, visited-response, and ISR RSC caches vary by mounted-slot state so stale slot payloads are not replayed across incompatible trees
  • keep the generated App Router entry and snapshots aligned with the new mounted-slot normalization and cache threading

Verification:

  • vp test run tests/app-page-cache.test.ts tests/prefetch-cache.test.ts tests/app-browser-entry.test.ts tests/app-page-route-wiring.test.ts
  • vp test run tests/app-router.test.ts -t "generated code|ISR cache read fires|generated handler exports async function handler"
  • vp test run tests/entry-templates.test.ts -u
  • vp check

Risks:

  • App Router RSC cache keys now vary on mounted-slot context for slot-sensitive responses, so cache behavior changed in a targeted way around parallel routes and intercepted routes.

🔄 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/811 **Author:** [@NathanDrake2406](https://github.com/NathanDrake2406) **Created:** 4/10/2026 **Status:** ✅ Merged **Merged:** 4/10/2026 **Merged by:** [@james-elicx](https://github.com/james-elicx) **Base:** `main` ← **Head:** `fix/parallel-slot-persistence-soft-nav` --- ### 📝 Commits (7) - [`5da3aa2`](https://github.com/cloudflare/vinext/commit/5da3aa210ca7177e3db22a0c4614f28cf67465d0) Fix parallel slot persistence and cache variants - [`8d8fbe1`](https://github.com/cloudflare/vinext/commit/8d8fbe13315ed2f2eb214c69ddac679cb6740a60) Address App Router review follow-ups - [`203a430`](https://github.com/cloudflare/vinext/commit/203a430e92a352a7ca552f9eb2b887f43cda0a2f) Fix generated mounted-slot regex escaping - [`7304bef`](https://github.com/cloudflare/vinext/commit/7304bef1ad467f155e8a31ead67a077fef6592f8) Address review feedback on slot normalization and cache comments - [`7072036`](https://github.com/cloudflare/vinext/commit/70720361572c5b925b5e4ddc82b40e26642d1d57) Remove redundant .map(trim) and clarify regen slot context - [`fd44d39`](https://github.com/cloudflare/vinext/commit/fd44d3935c70845cef7f0d8ec1fdcaa07f422290) Clarify regen dedup and prefetch slot-mismatch tradeoffs - [`3ef5218`](https://github.com/cloudflare/vinext/commit/3ef5218e56033fcc39b507843a5e4c6cb402f09d) Document storePrefetchResponse slot-awareness gap ### 📊 Changes **14 files changed** (+750 additions, -67 deletions) <details> <summary>View changed files</summary> 📝 `packages/vinext/src/entries/app-rsc-entry.ts` (+40 -3) 📝 `packages/vinext/src/server/app-browser-entry.ts` (+25 -3) 📝 `packages/vinext/src/server/app-elements.ts` (+25 -0) 📝 `packages/vinext/src/server/app-page-cache.ts` (+43 -20) 📝 `packages/vinext/src/server/app-page-render.ts` (+4 -1) 📝 `packages/vinext/src/server/app-page-response.ts` (+4 -0) 📝 `packages/vinext/src/server/app-page-route-wiring.tsx` (+20 -4) 📝 `packages/vinext/src/shims/link.tsx` (+8 -1) 📝 `packages/vinext/src/shims/navigation.ts` (+51 -6) 📝 `tests/__snapshots__/entry-templates.test.ts.snap` (+240 -18) 📝 `tests/app-browser-entry.test.ts` (+35 -0) 📝 `tests/app-page-cache.test.ts` (+75 -11) 📝 `tests/app-page-route-wiring.test.ts` (+136 -0) 📝 `tests/prefetch-cache.test.ts` (+44 -0) </details> ### 📄 Description Fixes bugs in slot components introduced in https://github.com/cloudflare/vinext/pull/750 that https://github.com/cloudflare/vinext/pull/752 caught This tightens App Router slot behavior in three places: - preserve `default.tsx` fallback behavior correctly on soft navigation by distinguishing already-mounted slots from first entry into a layout - make prefetch, visited-response, and ISR RSC caches vary by mounted-slot state so stale slot payloads are not replayed across incompatible trees - keep the generated App Router entry and snapshots aligned with the new mounted-slot normalization and cache threading Verification: - `vp test run tests/app-page-cache.test.ts tests/prefetch-cache.test.ts tests/app-browser-entry.test.ts tests/app-page-route-wiring.test.ts` - `vp test run tests/app-router.test.ts -t "generated code|ISR cache read fires|generated handler exports async function handler"` - `vp test run tests/entry-templates.test.ts -u` - `vp check` Risks: - App Router RSC cache keys now vary on mounted-slot context for slot-sensitive responses, so cache behavior changed in a targeted way around parallel routes and intercepted routes. --- <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:31 +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#863
No description provided.