[PR #574] [MERGED] refactor: use vinext startProdServer HTTP for prerendering #683

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

📋 Pull Request Information

Original PR: https://github.com/cloudflare/vinext/pull/574
Author: @james-elicx
Created: 3/17/2026
Status: Merged
Merged: 3/17/2026
Merged by: @james-elicx

Base: mainHead: opencode/jolly-nebula


📝 Commits (6)

  • 99a923a refactor: remove wrangler from prerender, use startProdServer HTTP for all builds
  • e6bfb0f .
  • 314ad1b fix: redirect:manual for prerender fetch, remove wrangler peer dep
  • 5deec37 refactor: extract readPrerenderSecret to shared utility, fix server-manifest secret rotation
  • d68f266 fix: warn on non-OK response from pages-static-paths prerender endpoint
  • a008ccf fix: guard static-params fetch against non-OK responses in prerenderApp

📊 Changes

13 files changed (+447 additions, -455 deletions)

View changed files

📝 packages/vinext/package.json (+2 -7)
📝 packages/vinext/src/build/prerender.ts (+223 -345)
📝 packages/vinext/src/build/run-prerender.ts (+43 -59)
packages/vinext/src/build/server-manifest.ts (+27 -0)
📝 packages/vinext/src/index.ts (+37 -0)
📝 packages/vinext/src/server/prod-server.ts (+80 -2)
📝 pnpm-lock.yaml (+0 -3)
📝 tests/app-router.test.ts (+4 -4)
📝 tests/helpers.ts (+3 -4)
📝 tests/pages-i18n-prod.test.ts (+1 -1)
📝 tests/pages-router-concurrency.test.ts (+5 -5)
📝 tests/pages-router.test.ts (+16 -16)
📝 tests/prerender.test.ts (+6 -9)

📄 Description

Summary

  • Removes all wrangler-specific code from the prerender pipeline (findWranglerConfig, loadWrangler, WranglerWorker, isWorkersBuild branching, _wranglerDev/sharedWranglerDev internals, and the isWorkersBuild/wranglerConfigPath/root fields from PrerenderAppOptions)
  • All builds — plain Node and Cloudflare Workers — now prerender via HTTP against a locally-spawned startProdServer instance, using the existing prerender secret mechanism
  • Fixes generateStaticParamsMap not being accessible from CF bundles (named exports are stripped): prod-server.ts now falls through to the RSC handler for /__vinext/prerender/static-params and /__vinext/prerender/pages-static-paths, where the map is available in the handler's closure

Test results

  • vp check — clean
  • tests/prerender.test.ts — 46/46 pass (including CF Workers dynamic route tests that were previously failing)
  • tests/static-export.test.ts — 14/14 pass

🔄 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/574 **Author:** [@james-elicx](https://github.com/james-elicx) **Created:** 3/17/2026 **Status:** ✅ Merged **Merged:** 3/17/2026 **Merged by:** [@james-elicx](https://github.com/james-elicx) **Base:** `main` ← **Head:** `opencode/jolly-nebula` --- ### 📝 Commits (6) - [`99a923a`](https://github.com/cloudflare/vinext/commit/99a923ab1790ef00ebb6f293c77ae69d5903d184) refactor: remove wrangler from prerender, use startProdServer HTTP for all builds - [`e6bfb0f`](https://github.com/cloudflare/vinext/commit/e6bfb0fa7b8380b4c264eaedd62c94358df3b1d2) . - [`314ad1b`](https://github.com/cloudflare/vinext/commit/314ad1b413ee07dde60cc08bdda1a40128188582) fix: redirect:manual for prerender fetch, remove wrangler peer dep - [`5deec37`](https://github.com/cloudflare/vinext/commit/5deec37705738a59c80743527bcb988b4c99e4b4) refactor: extract readPrerenderSecret to shared utility, fix server-manifest secret rotation - [`d68f266`](https://github.com/cloudflare/vinext/commit/d68f266f568c115f40874371c282fd131da178c1) fix: warn on non-OK response from pages-static-paths prerender endpoint - [`a008ccf`](https://github.com/cloudflare/vinext/commit/a008ccfac1223b41d9ccc9d6117a9bb83b2d2a1f) fix: guard static-params fetch against non-OK responses in prerenderApp ### 📊 Changes **13 files changed** (+447 additions, -455 deletions) <details> <summary>View changed files</summary> 📝 `packages/vinext/package.json` (+2 -7) 📝 `packages/vinext/src/build/prerender.ts` (+223 -345) 📝 `packages/vinext/src/build/run-prerender.ts` (+43 -59) ➕ `packages/vinext/src/build/server-manifest.ts` (+27 -0) 📝 `packages/vinext/src/index.ts` (+37 -0) 📝 `packages/vinext/src/server/prod-server.ts` (+80 -2) 📝 `pnpm-lock.yaml` (+0 -3) 📝 `tests/app-router.test.ts` (+4 -4) 📝 `tests/helpers.ts` (+3 -4) 📝 `tests/pages-i18n-prod.test.ts` (+1 -1) 📝 `tests/pages-router-concurrency.test.ts` (+5 -5) 📝 `tests/pages-router.test.ts` (+16 -16) 📝 `tests/prerender.test.ts` (+6 -9) </details> ### 📄 Description ## Summary - Removes all wrangler-specific code from the prerender pipeline (`findWranglerConfig`, `loadWrangler`, `WranglerWorker`, `isWorkersBuild` branching, `_wranglerDev`/`sharedWranglerDev` internals, and the `isWorkersBuild`/`wranglerConfigPath`/`root` fields from `PrerenderAppOptions`) - All builds — plain Node and Cloudflare Workers — now prerender via HTTP against a locally-spawned `startProdServer` instance, using the existing prerender secret mechanism - Fixes `generateStaticParamsMap` not being accessible from CF bundles (named exports are stripped): `prod-server.ts` now falls through to the RSC handler for `/__vinext/prerender/static-params` and `/__vinext/prerender/pages-static-paths`, where the map is available in the handler's closure ## Test results - `vp check` — clean - `tests/prerender.test.ts` — 46/46 pass (including CF Workers dynamic route tests that were previously failing) - `tests/static-export.test.ts` — 14/14 pass --- <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:31 +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#683
No description provided.