[PR #622] [MERGED] refactor: extract app route handler policy helpers #721

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/622
Author: @southpolesteve
Created: 3/21/2026
Status: Merged
Merged: 3/21/2026
Merged by: @southpolesteve

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


📝 Commits (1)

  • afef02d refactor: extract app route handler policy helpers

📊 Changes

5 files changed (+678 additions, -352 deletions)

View changed files

📝 packages/vinext/src/entries/app-rsc-entry.ts (+57 -50)
packages/vinext/src/server/app-route-handler-policy.ts (+160 -0)
📝 packages/vinext/src/server/app-route-handler-runtime.ts (+2 -2)
📝 tests/__snapshots__/entry-templates.test.ts.snap (+324 -300)
tests/app-route-handler-policy.test.ts (+135 -0)

📄 Description

Summary

  • extract route-handler method/revalidate/cache-policy decisions out of app-rsc-entry.ts into a typed app-route-handler-policy.ts runtime module
  • keep the generated App Router RSC entry focused on wiring by delegating route-handler ISR/read/write eligibility and special digest handling to the new helper layer
  • add focused unit coverage for the extracted policy helpers and update the App Router entry snapshots

Verification

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

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/622 **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-policy-runtime` --- ### 📝 Commits (1) - [`afef02d`](https://github.com/cloudflare/vinext/commit/afef02da7e2c97eda1a501a4fd543dfa36e4e6dd) refactor: extract app route handler policy helpers ### 📊 Changes **5 files changed** (+678 additions, -352 deletions) <details> <summary>View changed files</summary> 📝 `packages/vinext/src/entries/app-rsc-entry.ts` (+57 -50) ➕ `packages/vinext/src/server/app-route-handler-policy.ts` (+160 -0) 📝 `packages/vinext/src/server/app-route-handler-runtime.ts` (+2 -2) 📝 `tests/__snapshots__/entry-templates.test.ts.snap` (+324 -300) ➕ `tests/app-route-handler-policy.test.ts` (+135 -0) </details> ### 📄 Description ## Summary - extract route-handler method/revalidate/cache-policy decisions out of `app-rsc-entry.ts` into a typed `app-route-handler-policy.ts` runtime module - keep the generated App Router RSC entry focused on wiring by delegating route-handler ISR/read/write eligibility and special digest handling to the new helper layer - add focused unit coverage for the extracted policy helpers and update the App Router entry snapshots ## Verification - `vp check packages/vinext/src/server/app-route-handler-runtime.ts packages/vinext/src/server/app-route-handler-policy.ts packages/vinext/src/entries/app-rsc-entry.ts tests/app-route-handler-policy.test.ts tests/app-route-handler-runtime.test.ts tests/app-route-handler-response.test.ts tests/app-router.test.ts tests/entry-templates.test.ts` - `vp test run tests/app-route-handler-policy.test.ts tests/app-route-handler-runtime.test.ts tests/app-route-handler-response.test.ts tests/entry-templates.test.ts tests/app-router.test.ts -t 'route handler'` - `vp test run tests/nextjs-compat/app-routes.test.ts` - `vp run vinext#build` 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#721
No description provided.