[PR #625] [MERGED] refactor: extract app route handler cache helpers #722

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

📋 Pull Request Information

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

Base: mainHead: codex/app-route-handler-cache-runtime


📝 Commits (2)

  • 416965c refactor: extract app route handler cache helpers
  • a6fb9bf chore: remove dead app route cache import

📊 Changes

6 files changed (+698 additions, -535 deletions)

View changed files

📝 packages/vinext/src/entries/app-rsc-entry.ts (+41 -75)
packages/vinext/src/server/app-route-handler-cache.ts (+138 -0)
📝 packages/vinext/src/server/app-route-handler-execution.ts (+6 -6)
📝 tests/__snapshots__/entry-templates.test.ts.snap (+228 -450)
tests/app-route-handler-cache.test.ts (+278 -0)
📝 tests/app-router.test.ts (+7 -4)

📄 Description

Summary

  • extract App Router route-handler ISR cache HIT/STALE/background-regeneration flow into a typed app-route-handler-cache.ts runtime module
  • make app-rsc-entry.ts delegate route-handler cache orchestration instead of inlining cache reads, stale response construction, and background regeneration wiring
  • add focused cache-helper unit coverage and update generator assertions/snapshots for the helper-based route-handler ISR path

Verification

  • vp check packages/vinext/src/server/app-route-handler-cache.ts packages/vinext/src/server/app-route-handler-execution.ts packages/vinext/src/entries/app-rsc-entry.ts tests/app-route-handler-cache.test.ts tests/app-router.test.ts
  • vp test run tests/app-route-handler-cache.test.ts tests/app-route-handler-execution.test.ts tests/app-route-handler-runtime.test.ts tests/app-route-handler-response.test.ts tests/app-route-handler-policy.test.ts
  • vp test run tests/entry-templates.test.ts -u
  • vp test run tests/app-router.test.ts -t 'route handler'
  • vp test run tests/nextjs-compat/app-routes.test.ts
  • vp run vinext#build

Stacked on #624.

Written by Codex.


🔄 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/625 **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-route-handler-cache-runtime` --- ### 📝 Commits (2) - [`416965c`](https://github.com/cloudflare/vinext/commit/416965c03291660827975d029f16a9e1baab824e) refactor: extract app route handler cache helpers - [`a6fb9bf`](https://github.com/cloudflare/vinext/commit/a6fb9bf7eafa0e6270fbbf19f8ccc1043662a220) chore: remove dead app route cache import ### 📊 Changes **6 files changed** (+698 additions, -535 deletions) <details> <summary>View changed files</summary> 📝 `packages/vinext/src/entries/app-rsc-entry.ts` (+41 -75) ➕ `packages/vinext/src/server/app-route-handler-cache.ts` (+138 -0) 📝 `packages/vinext/src/server/app-route-handler-execution.ts` (+6 -6) 📝 `tests/__snapshots__/entry-templates.test.ts.snap` (+228 -450) ➕ `tests/app-route-handler-cache.test.ts` (+278 -0) 📝 `tests/app-router.test.ts` (+7 -4) </details> ### 📄 Description ## Summary - extract App Router route-handler ISR cache HIT/STALE/background-regeneration flow into a typed `app-route-handler-cache.ts` runtime module - make `app-rsc-entry.ts` delegate route-handler cache orchestration instead of inlining cache reads, stale response construction, and background regeneration wiring - add focused cache-helper unit coverage and update generator assertions/snapshots for the helper-based route-handler ISR path ## Verification - `vp check packages/vinext/src/server/app-route-handler-cache.ts packages/vinext/src/server/app-route-handler-execution.ts packages/vinext/src/entries/app-rsc-entry.ts tests/app-route-handler-cache.test.ts tests/app-router.test.ts` - `vp test run tests/app-route-handler-cache.test.ts tests/app-route-handler-execution.test.ts tests/app-route-handler-runtime.test.ts tests/app-route-handler-response.test.ts tests/app-route-handler-policy.test.ts` - `vp test run tests/entry-templates.test.ts -u` - `vp test run tests/app-router.test.ts -t 'route handler'` - `vp test run tests/nextjs-compat/app-routes.test.ts` - `vp run vinext#build` Stacked on #624. Written by Codex. --- <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:48 +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#722
No description provided.