mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 00:09:23 +02:00
[PR #1097] perf(prerender): reuse embedded RSC payload #1093
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#1093
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/1097
Author: @NathanDrake2406
Created: 5/6/2026
Status: 🔄 Open
Base:
main← Head:nathan/prerender-rsc-dedupe📝 Commits (5)
556ca94perf(prerender): reuse embedded RSC payload8810deffix(prerender): address RSC extraction reviewd723196Merge remote-tracking branch 'upstream/main' into nathan/prerender-rsc-dedupeb889c28fix(test): include artifact compatibility metadataae5d956fix(prerender): document RSC extraction invariants📊 Changes
3 files changed (+447 additions, -9 deletions)
View changed files
📝
packages/vinext/src/build/prerender.ts(+189 -9)📝
tests/app-elements.test.ts(+1 -0)📝
tests/prerender.test.ts(+257 -0)📄 Description
What this changes
App Router prerender now reconstructs the canonical
.rscpayload from the RSC bootstrap scripts already embedded in the prerendered HTML response when that protocol is present. Successful extraction avoids the previous secondRSC: 1handler invocation.Why
The prerender pipeline already renders HTML first, and that HTML includes streamed Flight chunks for hydration. Issuing a second App Router RSC request duplicates work and can repeat expensive route rendering during build output generation.
Approach
self.__VINEXT_RSC__={ rsc: [...] }embedded payload shape.Validation
vp test run tests/prerender.test.ts -t "extractRscPayloadFromPrerenderedHtml|writes the .rsc file from rendered HTML|prerenderApp — default mode"vp check tests/prerender.test.tsvp check --fixplusknip --no-progressRisks / follow-ups
Refs #563
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.