mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #657] [MERGED] refactor: extract pages page response helpers #750
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#750
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/657
Author: @southpolesteve
Created: 3/22/2026
Status: ✅ Merged
Merged: 3/22/2026
Merged by: @southpolesteve
Base:
main← Head:codex/pages-page-response-runtime📝 Commits (2)
a3a48f9refactor: extract pages page response helperse539f08fix: preserve array-valued pages gssp headers📊 Changes
5 files changed (+590 additions, -281 deletions)
View changed files
📝
packages/vinext/src/entries/pages-server-entry.ts(+61 -140)➕
packages/vinext/src/server/pages-page-response.ts(+291 -0)📝
tests/__snapshots__/entry-templates.test.ts.snap(+58 -140)📝
tests/entry-templates.test.ts(+10 -1)➕
tests/pages-page-response.test.ts(+170 -0)📄 Description
Summary
This PR starts the Pages Router side of the generated-entry refactor by extracting the page HTML shell / stream / response construction out of
pages-server-entry.tsand into a typed runtime helper:packages/vinext/src/server/pages-page-response.ts__NEXT_DATA__serialization, streamed HTML response shaping, and ISR cache fill HTML assembly into that helperpackages/vinext/src/entries/pages-server-entry.tsas thinner route/data wiringtests/pages-page-response.test.tsThis PR was written by Codex.
Why
After the App Router extraction series landed,
pages-server-entry.tsis the next major generated module that still owns too much real runtime behavior. This is the first Pages Router slice: pull the HTML render/response lifecycle into normal typed code, then follow with the data/ISR and API/runtime seams on top of that.Testing
vp check packages/vinext/src/server/pages-page-response.ts packages/vinext/src/entries/pages-server-entry.ts tests/pages-page-response.test.ts tests/entry-templates.test.tsvp test run tests/pages-page-response.test.ts tests/entry-templates.test.ts -t 'pages page response|server entry delegates Pages HTML stream/response shaping to a typed helper'vp test run tests/pages-router.test.ts -t 'getServerSideProps headers and status are applied to the response|getServerSideProps calling res.end\(\) short-circuits the response|renders Suspense \+ React.lazy content via streaming SSR|Production Pages Router SSR streaming'vp test run tests/entry-templates.test.ts -uvp run vinext#build🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.