mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #449] [CLOSED] fix: App Router RSC dev invalidation parity across requests #579
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#579
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/449
Author: @JaredStowell
Created: 3/11/2026
Status: ❌ Closed
Base:
main← Head:jstowell/fix-app-router-rsc-request-invalidation📝 Commits (10+)
6b22307Ensure static export token header3da870eFix dotted App Router invalidation06efb46Fix App Router invalidation for dots61aca7bFix App Router dot routing invaliddf7d17eFix App Router invalidation bugs607120dFix App Router invalidation regresssdd12f30Fix App Router rewrite invalidationbf97e72Add App Router and headers regressionsf3340fbFix headers shim lint warning2c8c549Harden App Router prepared request handoff📊 Changes
20 files changed (+1823 additions, -132 deletions)
View changed files
📝
packages/vinext/src/build/static-export.ts(+20 -2)📝
packages/vinext/src/entries/app-rsc-entry.ts(+89 -12)📝
packages/vinext/src/index.ts(+647 -23)📝
packages/vinext/src/server/app-router-entry.ts(+10 -0)➕
packages/vinext/src/server/app-router-prepared-state.ts(+120 -0)📝
packages/vinext/src/server/prod-server.ts(+2 -0)📝
packages/vinext/src/shims/headers.ts(+5 -3)📝
tests/__snapshots__/entry-templates.test.ts.snap(+488 -72)📝
tests/app-router.test.ts(+230 -3)➕
tests/fixtures/app-basic/app/nextjs-compat/fresh-metadata/sitemap.ts(+9 -0)➕
tests/fixtures/app-basic/app/nextjs-compat/isr-dotted/[slug]/page.tsx(+12 -0)➕
tests/fixtures/app-basic/app/nextjs-compat/isr-imported-module/data.ts(+1 -0)➕
tests/fixtures/app-basic/app/nextjs-compat/isr-imported-module/page.tsx(+5 -0)➕
tests/fixtures/app-basic/app/nextjs-compat/isr-shared-module/page.tsx(+5 -0)📝
tests/fixtures/app-basic/middleware.ts(+5 -0)📝
tests/fixtures/app-basic/next.config.ts(+17 -0)➕
tests/fixtures/app-basic/pages/mw-pages-to-app-rewrite.tsx(+3 -0)➕
tests/fixtures/shared/rsc-shared-now.ts(+1 -0)📝
tests/nextjs-compat/app-rendering.test.ts(+138 -17)📝
tests/shims.test.ts(+16 -0)📄 Description
Fix App Router dev-mode RSC invalidation so server modules re-execute with request freshness.
This change removes the old root-scoped invalidation heuristic and replaces it with route-closure invalidation:
It also fixes mixed app/pages behavior by invalidating on the actual Pages -> App handoff path after middleware/config rewrites determine the final App Router URL.
Why
The previous approach was inadequate:
Tests
Added regressions for:
Verification
Passed:
pnpm test tests/nextjs-compat/app-rendering.test.tspnpm test tests/app-router.test.ts -t "re-executes App Router modules when middleware rewrites a Pages path into app/"pnpm test tests/app-router.test.ts -t "App Router Static export"pnpm run fmtpnpm run typecheck🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.