[PR #638] [MERGED] refactor: extract app page render lifecycle #738

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

📋 Pull Request Information

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

Base: mainHead: codex/app-page-render-lifecycle-runtime


📝 Commits (2)

  • a9e510e refactor: extract app page render lifecycle
  • b30bbee test: refresh page render lifecycle generator assertions

📊 Changes

5 files changed (+913 additions, -1742 deletions)

View changed files

📝 packages/vinext/src/entries/app-rsc-entry.ts (+51 -257)
packages/vinext/src/server/app-page-render.ts (+313 -0)
📝 tests/__snapshots__/entry-templates.test.ts.snap (+301 -1432)
tests/app-page-render.test.ts (+219 -0)
📝 tests/app-router.test.ts (+29 -53)

📄 Description

Summary

  • extract the remaining App Router page render lifecycle into a typed runtime helper in app-page-render.ts
  • keep app-rsc-entry.ts focused on route-specific closures while delegating probe, RSC/HTML response orchestration, and page cache finalization to the helper
  • add direct lifecycle tests and update generated-entry assertions/snapshots for the new contract

Verification

  • vp check packages/vinext/src/server/app-page-render.ts packages/vinext/src/entries/app-rsc-entry.ts tests/app-page-render.test.ts tests/app-router.test.ts
  • vp test run tests/app-page-render.test.ts tests/app-page-boundary-render.test.ts tests/app-page-cache.test.ts tests/app-page-response.test.ts tests/app-page-stream.test.ts tests/app-page-probe.test.ts
  • vp test run tests/app-router.test.ts --testTimeout=120000 -t "page ISR \+ searchParams|renders custom not-found.tsx for unmatched routes|notFound\(\) escalates to nearest ancestor not-found.tsx|forbidden\(\) from Server Component returns 403 with forbidden.tsx|unauthorized\(\) from Server Component returns 401 with unauthorized.tsx|renders error boundary wrapper for routes with error.tsx|generated code delegates page render lifecycle to a typed helper|generated code handles SSR special errors without a legacy handleRenderError helper|generated code delegates page HTML stream plumbing to typed helpers|generated code delegates live page rendering to the typed lifecycle helper|generated code stores rscData in the ISR cache entry|generated code threads page cache keys into the typed lifecycle helper|generated code delegates two-phase page cache logic to the typed lifecycle helper"
  • vp test run tests/entry-templates.test.ts -u
  • vp test run tests/nextjs-compat/global-error.test.ts
  • vp run vinext#build

Stacked on #637.

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/638 **Author:** [@southpolesteve](https://github.com/southpolesteve) **Created:** 3/22/2026 **Status:** ✅ Merged **Merged:** 3/22/2026 **Merged by:** [@southpolesteve](https://github.com/southpolesteve) **Base:** `main` ← **Head:** `codex/app-page-render-lifecycle-runtime` --- ### 📝 Commits (2) - [`a9e510e`](https://github.com/cloudflare/vinext/commit/a9e510e235db94c6132f4564694d2c729bc894a3) refactor: extract app page render lifecycle - [`b30bbee`](https://github.com/cloudflare/vinext/commit/b30bbee14f3f3444f00d25f57b0c25607dbb2f70) test: refresh page render lifecycle generator assertions ### 📊 Changes **5 files changed** (+913 additions, -1742 deletions) <details> <summary>View changed files</summary> 📝 `packages/vinext/src/entries/app-rsc-entry.ts` (+51 -257) ➕ `packages/vinext/src/server/app-page-render.ts` (+313 -0) 📝 `tests/__snapshots__/entry-templates.test.ts.snap` (+301 -1432) ➕ `tests/app-page-render.test.ts` (+219 -0) 📝 `tests/app-router.test.ts` (+29 -53) </details> ### 📄 Description ## Summary - extract the remaining App Router page render lifecycle into a typed runtime helper in `app-page-render.ts` - keep `app-rsc-entry.ts` focused on route-specific closures while delegating probe, RSC/HTML response orchestration, and page cache finalization to the helper - add direct lifecycle tests and update generated-entry assertions/snapshots for the new contract ## Verification - `vp check packages/vinext/src/server/app-page-render.ts packages/vinext/src/entries/app-rsc-entry.ts tests/app-page-render.test.ts tests/app-router.test.ts` - `vp test run tests/app-page-render.test.ts tests/app-page-boundary-render.test.ts tests/app-page-cache.test.ts tests/app-page-response.test.ts tests/app-page-stream.test.ts tests/app-page-probe.test.ts` - `vp test run tests/app-router.test.ts --testTimeout=120000 -t "page ISR \+ searchParams|renders custom not-found.tsx for unmatched routes|notFound\(\) escalates to nearest ancestor not-found.tsx|forbidden\(\) from Server Component returns 403 with forbidden.tsx|unauthorized\(\) from Server Component returns 401 with unauthorized.tsx|renders error boundary wrapper for routes with error.tsx|generated code delegates page render lifecycle to a typed helper|generated code handles SSR special errors without a legacy handleRenderError helper|generated code delegates page HTML stream plumbing to typed helpers|generated code delegates live page rendering to the typed lifecycle helper|generated code stores rscData in the ISR cache entry|generated code threads page cache keys into the typed lifecycle helper|generated code delegates two-phase page cache logic to the typed lifecycle helper"` - `vp test run tests/entry-templates.test.ts -u` - `vp test run tests/nextjs-compat/global-error.test.ts` - `vp run vinext#build` Stacked on #637. 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:52 +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#738
No description provided.