mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #560] [MERGED] fix: rewrite Flight HL stylesheet hints during client-side navigation #675
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#675
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/560
Author: @NathanDrake2406
Created: 3/16/2026
Status: ✅ Merged
Merged: 3/17/2026
Merged by: @james-elicx
Base:
main← Head:fix/preload-as-client-nav📝 Commits (3)
62db6fffix: rewrite Flight HL "stylesheet" hints at the stream sourceda3b04echore: retrigger CIa840757Merge remote-tracking branch 'origin-https/main' into fix/preload-as-client-nav📊 Changes
4 files changed (+262 additions, -48 deletions)
View changed files
📝
packages/vinext/src/entries/app-rsc-entry.ts(+31 -1)📝
packages/vinext/src/entries/app-ssr-entry.ts(+7 -15)📝
tests/__snapshots__/entry-templates.test.ts.snap(+193 -21)📝
tests/app-router.test.ts(+31 -11)📄 Description
Summary
<link rel=preload>missing validasattribute during client-side navigation (#558)HL["url","stylesheet"]hints for CSS, but"stylesheet"is not a valid HTMLasvalue (should be"style")fixFlightHintsinapp-ssr-entry.tsonly covered SSR-embedded Flight data — client-side navigation, server action, and HMR responses were unpatchedrenderToReadableStreaminapp-rsc-entry.tsso every Flight stream is rewritten at the source — one fix that covers all consumersfixFlightHintsfrom the SSR embed transformApproach
Instead of patching each consumer (SSR embed, browser navigation, server actions, HMR), the fix shadows the
renderToReadableStreamimport with a wrapper that pipes through a TransformStream rewriting"stylesheet"→"style"in HL hints. Every downstream consumer gets clean data automatically.Test plan
generateRscEntrywrapsrenderToReadableStreamwith HL hint fixfixFlightHintsregex tests still pass (updated comment)fixPreloadAs(Fizz HTML stream fix) unchanged and passingnpx vp test run tests/app-router.test.ts -t "CSS preload fix"— all 4 tests passCloses #558
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.