mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #952] [MERGED] refactor(app-router): delegate RSC preload hint normalization #979
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#979
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/952
Author: @NathanDrake2406
Created: 4/29/2026
Status: ✅ Merged
Merged: 4/29/2026
Merged by: @james-elicx
Base:
main← Head:nathan/rsc-stream-hints📝 Commits (2)
f8da42crefactor(app-router): delegate RSC preload hint normalization36e34fetest(app-router): cover mixed Flight preload hints📊 Changes
6 files changed (+178 additions, -258 deletions)
View changed files
📝
packages/vinext/src/entries/app-rsc-entry.ts(+6 -27)➕
packages/vinext/src/server/rsc-stream-hints.ts(+43 -0)📝
tests/__snapshots__/entry-templates.test.ts.snap(+30 -162)📝
tests/app-router.test.ts(+4 -69)➕
tests/app-rsc-stream-hints.test.ts(+85 -0)📝
tests/entry-templates.test.ts(+10 -0)📄 Description
What this changes
The App Router RSC entry now delegates React Flight preload hint stream normalization to a typed server helper instead of carrying the TransformStream implementation inline in generated code.
Why
The generated RSC entry should mostly contain import tables, manifests, and thin runtime wiring. Keeping byte-stream buffering and hint rewriting inside the entry made the behavior harder to test directly and kept generated snapshots responsible for runtime stream semantics.
Approach
normalizeReactFlightPreloadHints()inpackages/vinext/src/server/rsc-stream-hints.ts.generateRscEntry()to import that helper and keeprenderToReadableStream()as a one-line delegation wrapper.Validation
vp test run tests/app-rsc-stream-hints.test.ts tests/entry-templates.test.tsvp test run tests/app-router.test.ts -t "RSC Flight hint fix"vp check tests/app-rsc-stream-hints.test.ts tests/entry-templates.test.ts tests/app-router.test.ts packages/vinext/src/server/rsc-stream-hints.ts packages/vinext/src/entries/app-rsc-entry.tstests/entry-templates.test.ts,vp check --fix, andknip --no-progressRisks / follow-ups
This is intentionally limited to the low-conflict stream hint helper slice. It avoids metadata, middleware, ISR, route-handler cache, server action, and boundary code paths that currently have active overlapping PRs.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.