[PR #667] [MERGED] refactor: extract Pages page data and ISR runtime #755

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

📋 Pull Request Information

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

Base: mainHead: codex/pages-page-data-runtime


📝 Commits (1)

  • b8f4b0f refactor: extract Pages page data runtime

📊 Changes

6 files changed (+885 additions, -451 deletions)

View changed files

📝 packages/vinext/src/entries/pages-server-entry.ts (+107 -216)
packages/vinext/src/server/pages-page-data.ts (+396 -0)
📝 packages/vinext/src/server/pages-page-response.ts (+1 -1)
📝 tests/__snapshots__/entry-templates.test.ts.snap (+104 -216)
📝 tests/entry-templates.test.ts (+19 -18)
tests/pages-page-data.test.ts (+258 -0)

📄 Description

Summary

  • extract the Pages Router getStaticPaths / getServerSideProps / getStaticProps + ISR decision path into typed runtime code in packages/vinext/src/server/pages-page-data.ts
  • keep packages/vinext/src/entries/pages-server-entry.ts focused on route-specific wiring while delegating page data/cache behavior to the helper layer
  • add direct helper coverage in tests/pages-page-data.test.ts and update generator expectations/snapshots for the new delegation boundary

Why

This keeps another large chunk of real request/cache behavior out of the generated Pages Router entry, following the same pattern we used for App Router and the earlier Pages response extraction. The goal is to make the code easier to typecheck, test, and safely modify.

Verification

  • vp check packages/vinext/src/server/pages-page-data.ts tests/pages-page-data.test.ts packages/vinext/src/entries/pages-server-entry.ts tests/entry-templates.test.ts packages/vinext/src/server/pages-page-response.ts
  • vp test run tests/pages-page-data.test.ts tests/entry-templates.test.ts
  • vp test run tests/pages-router.test.ts -t 'renders pages with getStaticPaths \+ getStaticProps|returns 404 for paths not in getStaticPaths when fallback is false|getServerSideProps calling res.end\(\) short-circuits the response|keeps ISR cache-fill rerenders isolated from the streamed render state|wraps stale regeneration in a fresh unified request context'
  • 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/667 **Author:** [@southpolesteve](https://github.com/southpolesteve) **Created:** 3/23/2026 **Status:** ✅ Merged **Merged:** 3/25/2026 **Merged by:** [@southpolesteve](https://github.com/southpolesteve) **Base:** `main` ← **Head:** `codex/pages-page-data-runtime` --- ### 📝 Commits (1) - [`b8f4b0f`](https://github.com/cloudflare/vinext/commit/b8f4b0f32d8686319d611303f4a2afe700e0d47d) refactor: extract Pages page data runtime ### 📊 Changes **6 files changed** (+885 additions, -451 deletions) <details> <summary>View changed files</summary> 📝 `packages/vinext/src/entries/pages-server-entry.ts` (+107 -216) ➕ `packages/vinext/src/server/pages-page-data.ts` (+396 -0) 📝 `packages/vinext/src/server/pages-page-response.ts` (+1 -1) 📝 `tests/__snapshots__/entry-templates.test.ts.snap` (+104 -216) 📝 `tests/entry-templates.test.ts` (+19 -18) ➕ `tests/pages-page-data.test.ts` (+258 -0) </details> ### 📄 Description ## Summary - extract the Pages Router `getStaticPaths` / `getServerSideProps` / `getStaticProps` + ISR decision path into typed runtime code in `packages/vinext/src/server/pages-page-data.ts` - keep `packages/vinext/src/entries/pages-server-entry.ts` focused on route-specific wiring while delegating page data/cache behavior to the helper layer - add direct helper coverage in `tests/pages-page-data.test.ts` and update generator expectations/snapshots for the new delegation boundary ## Why This keeps another large chunk of real request/cache behavior out of the generated Pages Router entry, following the same pattern we used for App Router and the earlier Pages response extraction. The goal is to make the code easier to typecheck, test, and safely modify. ## Verification - `vp check packages/vinext/src/server/pages-page-data.ts tests/pages-page-data.test.ts packages/vinext/src/entries/pages-server-entry.ts tests/entry-templates.test.ts packages/vinext/src/server/pages-page-response.ts` - `vp test run tests/pages-page-data.test.ts tests/entry-templates.test.ts` - `vp test run tests/pages-router.test.ts -t 'renders pages with getStaticPaths \+ getStaticProps|returns 404 for paths not in getStaticPaths when fallback is false|getServerSideProps calling res.end\(\) short-circuits the response|keeps ISR cache-fill rerenders isolated from the streamed render state|wraps stale regeneration in a fresh unified request context'` - `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:57 +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#755
No description provided.