mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #840] [CLOSED] feat(app-router): filter skipped layouts from RSC responses and cached reads [3/6] #889
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#889
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/840
Author: @NathanDrake2406
Created: 4/14/2026
Status: ❌ Closed
Base:
main← Head:feat/pr-768-3-skip-filter-server📝 Commits (3)
4c2f81ffeat(app-router): filter skipped layouts from RSC responses and cached readsbc703d5fix(app-router): address skip-filter review feedback73d9224fix(app-router): tighten dormant skip-filter defaults📊 Changes
10 files changed (+1617 additions, -6 deletions)
View changed files
📝
packages/vinext/src/entries/app-rsc-entry.ts(+9 -0)📝
packages/vinext/src/server/app-elements.ts(+46 -0)📝
packages/vinext/src/server/app-page-cache.ts(+12 -1)📝
packages/vinext/src/server/app-page-render.ts(+25 -5)➕
packages/vinext/src/server/app-page-skip-filter.ts(+340 -0)📝
tests/__snapshots__/entry-templates.test.ts.snap(+54 -0)📝
tests/app-elements.test.ts(+89 -0)📝
tests/app-page-cache.test.ts(+156 -0)📝
tests/app-page-render.test.ts(+384 -0)➕
tests/app-page-skip-filter.test.ts(+502 -0)📄 Description
Summary
PR 3 of 6 — restack of #768. Stacked on #839.
Introduces `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`).
Wires the filter into `renderAppPageLifecycle` and `buildAppPageCachedResponse` so both fresh renders and cache hits honor the skip header. Parses the incoming `X-Vinext-Router-Skip` header at the handler scope and threads the resulting set through render and ISR.
Dormant until canonical-stream is validated: gated behind `supportsFilteredRscStream: false` in the generated entry so this PR lands inert at runtime. Tests exercise the filter directly by injecting the skip set into `renderAppPageLifecycle` options.
Canonical-bytes invariant
Stack
Test plan
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.