mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[PR #984] [MERGED] perf: fuse RSC stream tees reducing allocs from 3 to 2 #1003
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#1003
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/984
Author: @Divkix
Created: 4/30/2026
Status: ✅ Merged
Merged: 5/1/2026
Merged by: @james-elicx
Base:
main← Head:fix/981-fuse-ssr-tees📝 Commits (4)
5e7d11cperf: fuse RSC stream tees reducing allocs from 3 to 225ed8cbfix: address PR review feedback for fused RSC stream tees (#981)626b591fix: repair CSP nonce handling and update snapshots for #9818b081e9Merge origin/main into fix/981-fuse-ssr-tees - resolve app-page-render.ts conflict📊 Changes
10 files changed (+227 additions, -41 deletions)
View changed files
📝
packages/vinext/src/entries/app-rsc-entry.ts(+6 -2)📝
packages/vinext/src/server/app-page-execution.ts(+11 -8)📝
packages/vinext/src/server/app-page-render.ts(+16 -4)📝
packages/vinext/src/server/app-page-stream.ts(+15 -3)📝
packages/vinext/src/server/app-ssr-entry.ts(+26 -3)📝
packages/vinext/src/server/app-ssr-stream.ts(+22 -0)📝
tests/__snapshots__/entry-templates.test.ts.snap(+36 -12)📝
tests/app-page-execution.test.ts(+20 -6)📝
tests/app-page-render.test.ts(+22 -1)📝
tests/app-ssr-stream.test.ts(+53 -2)📄 Description
Fixes #981
Summary
stream.tee()call, reducing from 3 tees to 2 in the ISR cache pathcreateRscEmbedTransformnow accumulates rawUint8Arraychunks alongside decoded text, exposed viagetRawBuffer()teeAppPageRscStreamForCapturereturns{ssrStream, sideStream}— sideStream feeds both embed transform and byte accumulationhandleSsraccepts optionalsideStream+capturedRscDataRefout-parameter, skipping internal tee when pre-splitTest plan
createRscEmbedTransformraw buffer accumulation (app-ssr-stream.test.ts)teeAppPageRscStreamForCapturereturningssrStream/sideStream(app-page-execution.test.ts)capturedRscDataRefout-param (app-page-render.test.ts)entry-templates.test.ts)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.