mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[GH-ISSUE #654] RSC parity gap: action redirects use hard navigation instead of soft RSC navigation #136
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#136
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?
Originally created by @southpolesteve on GitHub (Mar 22, 2026).
Original GitHub issue: https://github.com/cloudflare/vinext/issues/654
Background
When a server action calls
redirect(), the server (inapp-rsc-entry.ts) catches the redirect and returns a response with an empty body and anx-action-redirectheader. The client currently detects this header and performs a hard navigation (location.assign()/location.replace()) as a workaround.This is tracked as a known parity gap, introduced in #620 which fixed #589.
What Next.js does
Next.js pre-renders the redirect target's RSC payload as part of the action response body. The client then uses
__VINEXT_RSC_NAVIGATE__(or equivalent) to perform a soft RSC navigation, keeping the existing page shell and only swapping the route content, without a full browser reload.Current vinext behavior
Full page reload on every server action redirect. This is functionally correct but:
router.push()and link clicks workWhat needs to change
In
app-rsc-entry.ts(around line 2060), when a server action response catches aNEXT_REDIRECT, the server should:x-action-redirectandx-action-redirect-typeheaders as it does nowThe client in
app-browser-entry.tscan then remove the hard redirect fallback and resume using__VINEXT_RSC_NAVIGATE__for all same-origin action redirects.References
packages/vinext/src/entries/app-rsc-entry.ts~line 2060,packages/vinext/src/server/app-browser-entry.ts~line 144/cc @yunus25jmi1
@yunus25jmi1 commented on GitHub (Mar 25, 2026):
Hi @southpolesteve @james-elicx — just checking whether either of you is already working on this. If not, I can take it on.
— @yunus25jmi1