mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #965] [MERGED] refactor: extract app prerender endpoints #987
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#987
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/965
Author: @NathanDrake2406
Created: 4/29/2026
Status: ✅ Merged
Merged: 4/29/2026
Merged by: @james-elicx
Base:
main← Head:nathan/extract-prerender-endpoints📝 Commits (1)
026ffe9refactor: extract app prerender endpoints📊 Changes
5 files changed (+449 additions, -254 deletions)
View changed files
📝
packages/vinext/src/entries/app-rsc-entry.ts(+29 -74)➕
packages/vinext/src/server/app-prerender-endpoints.ts(+156 -0)📝
tests/__snapshots__/entry-templates.test.ts.snap(+66 -180)➕
tests/app-prerender-endpoints.test.ts(+180 -0)📝
tests/entry-templates.test.ts(+18 -0)📄 Description
Summary
server/app-prerender-endpoints.ts.generateStaticParamsMapand the optional Pages Router SSR route-loader closure are still emitted by the entry.getStaticPaths, disabled prerender mode, malformed/absent route data, and endpoint errors./__vinext/prerender/*request handling does not drift back into generated code.Why
The generated RSC entry had accumulated request parsing, prerender-mode gating, static params dispatch, Pages
getStaticPathsdispatch, JSON response shaping, and error handling for/__vinext/prerender/*. That violates the intended boundary: codegen should describe the app shape; normal modules should implement behavior.This keeps route-specific app data in codegen while moving the runtime behavior into a typed module that can be tested without generating or executing the full entry.
Next.js references
workerResult.prerenderedRoutes:packages/next/src/build/index.ts#L2384-L2408packages/next/src/server/base-server.ts#L1949-L1971packages/next/src/server/base-server.ts#L2351-L2367getStaticPathsfrom userland into route modules:packages/next/src/build/templates/pages.ts#L17-L23packages/next/src/build/templates/app-page.ts#L1108-L1124Validation
vp test run tests/app-prerender-endpoints.test.ts tests/entry-templates.test.ts tests/prerender.test.tsvp checkvp run vinext#build🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.