[PR #629] [MERGED] fix: skip page RSC ISR caching for dynamic requests #727

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

📋 Pull Request Information

Original PR: https://github.com/cloudflare/vinext/pull/629
Author: @southpolesteve
Created: 3/21/2026
Status: Merged
Merged: 3/21/2026
Merged by: @southpolesteve

Base: mainHead: codex/app-page-rsc-dynamic-isr


📝 Commits (2)

  • 6e97052 fix: skip page RSC ISR caching for dynamic requests
  • f5bc069 test: align page ISR assertions with helper extraction

📊 Changes

9 files changed (+392 additions, -119 deletions)

View changed files

📝 packages/vinext/src/entries/app-rsc-entry.ts (+19 -15)
📝 packages/vinext/src/server/app-page-cache.ts (+52 -0)
📝 packages/vinext/src/server/app-page-response.ts (+7 -3)
📝 tests/__snapshots__/entry-templates.test.ts.snap (+114 -90)
📝 tests/app-page-cache.test.ts (+99 -0)
📝 tests/app-page-response.test.ts (+21 -0)
📝 tests/app-router.test.ts (+58 -10)
📝 tests/e2e/app-router/headers-cookies.spec.ts (+4 -1)
tests/fixtures/app-basic/app/isr-dynamic-search/page.tsx (+18 -0)

📄 Description

Summary

  • redo the #617 fix on top of the extracted page cache/response helpers instead of patching the old inline block
  • skip App Router page RSC ISR caching when dynamic usage is detected, with a two-phase check for both searchParams-driven element construction and stream-time APIs like headers(), cookies(), and noStore()
  • add regression coverage for dynamic searchParams pages plus focused helper tests for the new RSC cache-write path

Written by Codex.

Credit to @NathanDrake2406 (Nathan Nguyen) for the original bug fix direction and regression coverage in #617; this PR ports that work onto the refactored helper structure.

Details

This keeps the current refactor direction intact:

  • resolveAppPageRscResponsePolicy() now treats page requests as dynamic when the build phase already signaled dynamic usage
  • scheduleAppPageRscCacheWrite() centralizes the deferred RSC cache write and performs the second consumeDynamicUsage() check after stream consumption
  • app-rsc-entry.ts delegates the RSC cache-write path to the typed helper instead of keeping that logic inline in the template string

Test plan

  • vp check packages/vinext/src/server/app-page-response.ts packages/vinext/src/server/app-page-cache.ts packages/vinext/src/entries/app-rsc-entry.ts tests/app-page-response.test.ts tests/app-page-cache.test.ts tests/app-router.test.ts tests/fixtures/app-basic/app/isr-dynamic-search/page.tsx
  • vp test run tests/app-page-response.test.ts tests/app-page-cache.test.ts
  • vp test run tests/entry-templates.test.ts -u
  • vp test run tests/app-router.test.ts -t 'page ISR \+ searchParams|generated code applies two-phase dynamic checks'
  • vp run vinext#build

Supersedes the old approach in #617.


🔄 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/629 **Author:** [@southpolesteve](https://github.com/southpolesteve) **Created:** 3/21/2026 **Status:** ✅ Merged **Merged:** 3/21/2026 **Merged by:** [@southpolesteve](https://github.com/southpolesteve) **Base:** `main` ← **Head:** `codex/app-page-rsc-dynamic-isr` --- ### 📝 Commits (2) - [`6e97052`](https://github.com/cloudflare/vinext/commit/6e9705246205bc45271f2aa7ff14c26aaa6e12af) fix: skip page RSC ISR caching for dynamic requests - [`f5bc069`](https://github.com/cloudflare/vinext/commit/f5bc069e78658f1b57908d501ba65e951b4ee15c) test: align page ISR assertions with helper extraction ### 📊 Changes **9 files changed** (+392 additions, -119 deletions) <details> <summary>View changed files</summary> 📝 `packages/vinext/src/entries/app-rsc-entry.ts` (+19 -15) 📝 `packages/vinext/src/server/app-page-cache.ts` (+52 -0) 📝 `packages/vinext/src/server/app-page-response.ts` (+7 -3) 📝 `tests/__snapshots__/entry-templates.test.ts.snap` (+114 -90) 📝 `tests/app-page-cache.test.ts` (+99 -0) 📝 `tests/app-page-response.test.ts` (+21 -0) 📝 `tests/app-router.test.ts` (+58 -10) 📝 `tests/e2e/app-router/headers-cookies.spec.ts` (+4 -1) ➕ `tests/fixtures/app-basic/app/isr-dynamic-search/page.tsx` (+18 -0) </details> ### 📄 Description ## Summary - redo the `#617` fix on top of the extracted page cache/response helpers instead of patching the old inline block - skip App Router page RSC ISR caching when dynamic usage is detected, with a two-phase check for both searchParams-driven element construction and stream-time APIs like `headers()`, `cookies()`, and `noStore()` - add regression coverage for dynamic `searchParams` pages plus focused helper tests for the new RSC cache-write path Written by Codex. Credit to @NathanDrake2406 (Nathan Nguyen) for the original bug fix direction and regression coverage in [#617](https://github.com/cloudflare/vinext/pull/617); this PR ports that work onto the refactored helper structure. ## Details This keeps the current refactor direction intact: - `resolveAppPageRscResponsePolicy()` now treats page requests as dynamic when the build phase already signaled dynamic usage - `scheduleAppPageRscCacheWrite()` centralizes the deferred RSC cache write and performs the second `consumeDynamicUsage()` check after stream consumption - `app-rsc-entry.ts` delegates the RSC cache-write path to the typed helper instead of keeping that logic inline in the template string ## Test plan - `vp check packages/vinext/src/server/app-page-response.ts packages/vinext/src/server/app-page-cache.ts packages/vinext/src/entries/app-rsc-entry.ts tests/app-page-response.test.ts tests/app-page-cache.test.ts tests/app-router.test.ts tests/fixtures/app-basic/app/isr-dynamic-search/page.tsx` - `vp test run tests/app-page-response.test.ts tests/app-page-cache.test.ts` - `vp test run tests/entry-templates.test.ts -u` - `vp test run tests/app-router.test.ts -t 'page ISR \+ searchParams|generated code applies two-phase dynamic checks'` - `vp run vinext#build` Supersedes the old approach in #617. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-06 13:09:49 +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#727
No description provided.