mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #683] [MERGED] refactor: extract Pages API route runtime #768
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#768
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/683
Author: @southpolesteve
Created: 3/25/2026
Status: ✅ Merged
Merged: 3/28/2026
Merged by: @james-elicx
Base:
main← Head:codex/pages-api-route-runtime📝 Commits (3)
89361bbrefactor: extract pages api route runtime740d479refactor: share Pages ISR cache runtime (#684)a8f925efix: address Pages API route review feedback📊 Changes
8 files changed (+717 additions, -539 deletions)
View changed files
📝
packages/vinext/src/entries/pages-server-entry.ts(+40 -252)📝
packages/vinext/src/server/api-handler.ts(+6 -28)➕
packages/vinext/src/server/pages-api-route.ts(+82 -0)➕
packages/vinext/src/server/pages-media-type.ts(+25 -0)➕
packages/vinext/src/server/pages-node-compat.ts(+263 -0)📝
tests/__snapshots__/entry-templates.test.ts.snap(+30 -252)📝
tests/entry-templates.test.ts(+33 -7)➕
tests/pages-api-route.test.ts(+238 -0)📄 Description
Summary
pages-server-entry.tsfocused on generated wiring by delegating API route execution tohandlePagesApiRouteVerification
vp check packages/vinext/src/server/pages-node-compat.ts packages/vinext/src/server/pages-api-route.ts packages/vinext/src/entries/pages-server-entry.ts tests/pages-api-route.test.ts tests/entry-templates.test.tsvp test run tests/pages-api-route.test.ts tests/entry-templates.test.tsvp test run tests/pages-router.test.ts -t "handles API routes returning JSON|handles dynamic API routes with query params|returns 400 for invalid JSON bodies on Pages API routes|preserves duplicate urlencoded body keys on Pages API routes|sends Buffer payloads from res.send\(\) as raw bytes|preserves invalid JSON failures for Pages API routes in production|preserves duplicate urlencoded body keys for Pages API routes in production|parses empty JSON bodies for Pages API routes in production as \{}|sends Buffer payloads from res.send\(\) as raw bytes in production|preserves content-length for getServerSideProps res.end\(\) short-circuit responses in production"vp run vinext#buildWritten by Codex.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.