mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #854] [MERGED] Preserve intercepted app-router state across server actions #898
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#898
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/854
Author: @NathanDrake2406
Created: 4/16/2026
Status: ✅ Merged
Merged: 4/20/2026
Merged by: @james-elicx
Base:
main← Head:interception-context📝 Commits (4)
00f14d6Preserve interception context on app-router actionsd8da98bKeep intercept slot overrides on action rerenderseac991aPin React versions in static-export fixture653436crefactor(app-page-request): unify intercept resolution into a single state machine📊 Changes
14 files changed (+916 additions, -63 deletions)
View changed files
📝
packages/vinext/src/entries/app-rsc-entry.ts(+36 -5)📝
packages/vinext/src/server/app-browser-entry.ts(+15 -4)📝
packages/vinext/src/server/app-browser-state.ts(+52 -1)📝
packages/vinext/src/server/app-page-request.ts(+154 -17)📝
pnpm-lock.yaml(+2 -2)📝
tests/__snapshots__/entry-templates.test.ts.snap(+216 -30)📝
tests/app-browser-entry.test.ts(+83 -0)📝
tests/app-page-request.test.ts(+264 -0)📝
tests/e2e/app-router/advanced.spec.ts(+39 -0)📝
tests/entry-templates.test.ts(+10 -1)➕
tests/fixtures/app-basic/app/feed/@modal/(...)photos/[id]/actions.ts(+13 -0)➕
tests/fixtures/app-basic/app/feed/@modal/(...)photos/[id]/like-button.tsx(+24 -0)📝
tests/fixtures/app-basic/app/feed/@modal/(...)photos/[id]/page.tsx(+6 -1)📝
tests/fixtures/static-export/package.json(+2 -2)📄 Description
Summary
reactandreact-domversions in thestatic-exportfixture to match the resolved lockfile stateExamples
/feed, soft-navigate to/photos/42, then trigger a server action from the modal. The POST omitted interception provenance, so the rerender could replace the modal tree with the direct/photos/[id]page.After: the same action keeps the modal mounted, keeps the feed layout visible, and leaves the URL at
/photos/42.interceptOptsfor slot overrides, but the POST rerender path dropped them.After: both GET and POST use the same rerender-target selection logic, so current-route interception shapes keep their slot overrides.
static-exportfixture dependencies now declarereactandreact-domas^19.2.5instead ofcatalog:so the fixture package manifest matches the checked-in lockfile state.Testing
vp test run tests/app-browser-entry.test.ts tests/app-page-request.test.ts tests/entry-templates.test.tsPLAYWRIGHT_PROJECT=app-router vp run test:e2e tests/e2e/app-router/advanced.spec.ts -g 'server action from intercepted modal preserves modal tree'🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.