[PR #838] [MERGED] refactor(app-rsc-entry): centralize request-derived page inputs [1/6] #886

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

📋 Pull Request Information

Original PR: https://github.com/cloudflare/vinext/pull/838
Author: @NathanDrake2406
Created: 4/14/2026
Status: Merged
Merged: 4/14/2026
Merged by: @james-elicx

Base: mainHead: feat/pr-768-1-page-inputs-refactor


📝 Commits (1)

  • 431df18 refactor(app-rsc-entry): centralize request-derived page inputs

📊 Changes

2 files changed (+343 additions, -154 deletions)

View changed files

📝 packages/vinext/src/entries/app-rsc-entry.ts (+49 -22)
📝 tests/__snapshots__/entry-templates.test.ts.snap (+294 -132)

📄 Description

Summary

PR 1 of 6 — restack of #768. Pure refactor, no behavior change. Reshapes buildPageElements to take a single pageRequest object and lifts the x-vinext-mounted-slots header read to handler scope so every call site shares one source of truth.

Previously, both the handler and buildPageElements read and normalized x-vinext-mounted-slots independently. A future refactor changing only one of those paths would silently drift. This PR collapses the two reads into one at the handler scope and passes the normalized value through the pageRequest bag.

Stack (in order)

  1. [1/6] this PR — centralize request-derived page inputs
  2. [2/6] emit per-layout flags in the RSC payload
  3. [3/6] filter skipped layouts from RSC responses and cached reads
  4. [4/6] send X-Vinext-Router-Skip on navigation requests
  5. [5/6] wire build-time layout classification into the generated RSC entry
  6. [6/6] classification reasons sidecar behind VINEXT_DEBUG_CLASSIFICATION

Sibling: #837 (chore: shim error boundary import).

Test plan

  • vp test run tests/entry-templates.test.ts tests/app-router.test.ts (327 tests)
  • Snapshot regenerated and inspected for PR 1 concerns only

🔄 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/838 **Author:** [@NathanDrake2406](https://github.com/NathanDrake2406) **Created:** 4/14/2026 **Status:** ✅ Merged **Merged:** 4/14/2026 **Merged by:** [@james-elicx](https://github.com/james-elicx) **Base:** `main` ← **Head:** `feat/pr-768-1-page-inputs-refactor` --- ### 📝 Commits (1) - [`431df18`](https://github.com/cloudflare/vinext/commit/431df188271795f7801293488ddd860d289c4512) refactor(app-rsc-entry): centralize request-derived page inputs ### 📊 Changes **2 files changed** (+343 additions, -154 deletions) <details> <summary>View changed files</summary> 📝 `packages/vinext/src/entries/app-rsc-entry.ts` (+49 -22) 📝 `tests/__snapshots__/entry-templates.test.ts.snap` (+294 -132) </details> ### 📄 Description ## Summary **PR 1 of 6 — restack of #768.** Pure refactor, no behavior change. Reshapes `buildPageElements` to take a single `pageRequest` object and lifts the `x-vinext-mounted-slots` header read to handler scope so every call site shares one source of truth. Previously, both the handler and `buildPageElements` read and normalized `x-vinext-mounted-slots` independently. A future refactor changing only one of those paths would silently drift. This PR collapses the two reads into one at the handler scope and passes the normalized value through the `pageRequest` bag. ## Stack (in order) 1. **[1/6] this PR** — centralize request-derived page inputs 2. [2/6] emit per-layout flags in the RSC payload 3. [3/6] filter skipped layouts from RSC responses and cached reads 4. [4/6] send X-Vinext-Router-Skip on navigation requests 5. [5/6] wire build-time layout classification into the generated RSC entry 6. [6/6] classification reasons sidecar behind VINEXT_DEBUG_CLASSIFICATION Sibling: #837 (chore: shim error boundary import). ## Test plan - [x] `vp test run tests/entry-templates.test.ts tests/app-router.test.ts` (327 tests) - [x] Snapshot regenerated and inspected for PR 1 concerns only --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
BreizhHardware 2026-05-06 13:10:39 +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#886
No description provided.