mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #815] [CLOSED] fix: clear stale parallel slots on traversal in mergeElements #865
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#865
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/815
Author: @NathanDrake2406
Created: 4/10/2026
Status: ❌ Closed
Base:
main← Head:fix/traversal-stale-parallel-slots📝 Commits (1)
6e18a7cfix: clear stale parallel slots on traversal in mergeElements📊 Changes
2 files changed (+33 additions, -0 deletions)
View changed files
📝
packages/vinext/src/shims/slot.tsx(+11 -0)📝
tests/slot.test.ts(+22 -0)📄 Description
Summary
mergeElementsnow deletes slot keys fromprevthat are absent fromnext, fixing stale parallel slots persisting through browser back/forwardContext
When navigating back from an intercepted route (e.g.,
/feed-> photo modal -> back), the RSC response for/feedomits the@modalslot entirely. The spread{ ...prev, ...next }silently carried the stale modal forward. Now, a slot absent fromnextis treated as "not in the route tree" and cleared.This is distinct from the existing
UNMATCHED_SLOTcase, where the server acknowledges the slot but no route matched it (preserved for soft navigation continuity).Closes #814
Test plan
mergeElements clears stale slots absent from next responsemergeElementstests still pass (UNMATCHED_SLOT preservation, shallow merge)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.