@samitouri / QOS-React-1 / commits / f994737d14

[Flight] Allow temporary references in `decodeReplyFromBusboy` (#29219)

Sebastian Silbermann committed May 22, 2024 at 21:15 UTC f994737d14e83f22ead70e6a41f87353008b73cf
3 files changed +18 -3
packages/react-server-dom-esm/src/ReactFlightDOMServerNode.js
+6 -1
@@ -126,8 +126,13 @@ function renderToPipeableStream(
126 function decodeReplyFromBusboy<T>(
127 busboyStream: Busboy,
128 moduleBasePath: ServerManifest,
129 + options?: {temporaryReferences?: TemporaryReferenceSet},
130 ): Thenable<T> {
130 - const response = createResponse(moduleBasePath, '');
131 + const response = createResponse(
132 + moduleBasePath,
133 + '',
134 + options ? options.temporaryReferences : undefined,
135 + );
136 let pendingFiles = 0;
137 const queuedFields: Array<string> = [];
138 busboyStream.on('field', (name, value) => {
packages/react-server-dom-turbopack/src/ReactFlightDOMServerNode.js
+6 -1
@@ -127,8 +127,13 @@ function renderToPipeableStream(
127 function decodeReplyFromBusboy<T>(
128 busboyStream: Busboy,
129 turbopackMap: ServerManifest,
130 + options?: {temporaryReferences?: TemporaryReferenceSet},
131 ): Thenable<T> {
131 - const response = createResponse(turbopackMap, '');
132 + const response = createResponse(
133 + turbopackMap,
134 + '',
135 + options ? options.temporaryReferences : undefined,
136 + );
137 let pendingFiles = 0;
138 const queuedFields: Array<string> = [];
139 busboyStream.on('field', (name, value) => {
packages/react-server-dom-webpack/src/ReactFlightDOMServerNode.js
+6 -1
@@ -127,8 +127,13 @@ function renderToPipeableStream(
127 function decodeReplyFromBusboy<T>(
128 busboyStream: Busboy,
129 webpackMap: ServerManifest,
130 + options?: {temporaryReferences?: TemporaryReferenceSet},
131 ): Thenable<T> {
131 - const response = createResponse(webpackMap, '');
132 + const response = createResponse(
133 + webpackMap,
134 + '',
135 + options ? options.temporaryReferences : undefined,
136 + );
137 let pendingFiles = 0;
138 const queuedFields: Array<string> = [];
139 busboyStream.on('field', (name, value) => {