Skip to content

feat(app-router): send X-Vinext-Router-Skip on navigation requests [4/6]#841

Closed
NathanDrake2406 wants to merge 4 commits intocloudflare:mainfrom
NathanDrake2406:feat/pr-768-4-skip-header-transport
Closed

feat(app-router): send X-Vinext-Router-Skip on navigation requests [4/6]#841
NathanDrake2406 wants to merge 4 commits intocloudflare:mainfrom
NathanDrake2406:feat/pr-768-4-skip-header-transport

Conversation

@NathanDrake2406
Copy link
Copy Markdown
Contributor

Summary

PR 4 of 6 — restack of #768. Stacked on #840.

Introduces `buildSkipHeaderValue` and `createRscNavigationRequestHeaders` in `app-elements.ts`. The client-side browser entry now uses the centralized request-header builder for navigation fetches and forwards the current layout flags so subsequent navigations can signal which static layouts the server may omit from the response body.

PR 3's server-side filter remains gated by `supportsFilteredRscStream: false`, so this PR only wires the transport; no behavior change until a later PR flips the gate.

Stack

  1. [1/6] refactor(app-rsc-entry): centralize request-derived page inputs [1/6] #838 — centralize request-derived page inputs
  2. [2/6] feat(app-router): emit per-layout flags in the RSC payload [2/6] #839 — emit per-layout flags in the RSC payload
  3. [3/6] feat(app-router): filter skipped layouts from RSC responses and cached reads [3/6] #840 — filter skipped layouts from RSC responses and cached reads
  4. [4/6] this PR — send X-Vinext-Router-Skip on navigation requests
  5. [5/6] wire build-time layout classification
  6. [6/6] classification reasons sidecar

Test plan

  • `tests/app-elements.test.ts` (35 tests, includes header builder cases)
  • `tests/app-browser-entry.test.ts` (24 tests)

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 14, 2026

Open in StackBlitz

npm i https://pkg.pr.new/vinext@841

commit: 73f3470

…d reads

Introduce app-page-skip-filter.ts with the canonical-bytes guarantee:
the render path always produces the full RSC payload and writes it to
the cache; the egress branch applies a byte-level filter that omits
layouts the client asked to skip, but only if the server independently
classified them as static (computeSkipDecision).

Wire the filter into renderAppPageLifecycle and buildAppPageCachedResponse
so both fresh renders and cache hits honor the skip header. Parse the
incoming X-Vinext-Router-Skip header at the handler scope and thread
the resulting set through render and ISR.

Gate the filter behind supportsFilteredRscStream: false in the generated
entry so this PR is dormant at runtime until the canonical-stream story
is validated. Tests exercise the filter directly by injecting the skip
set into renderAppPageLifecycle options.
Introduce buildSkipHeaderValue and createRscNavigationRequestHeaders
in app-elements. The client-side browser entry now uses the centralized
request-header builder for navigation fetches and forwards the current
layout flags so subsequent navigations can signal which static layouts
the server may omit from the response body.
@NathanDrake2406 NathanDrake2406 force-pushed the feat/pr-768-4-skip-header-transport branch from 939d4b7 to 73f3470 Compare April 16, 2026 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant