Skip to content

Commit

Permalink
Hoist out creation for better inlining
Browse files Browse the repository at this point in the history
The closures prevent inlining otherwise.
  • Loading branch information
sebmarkbage committed Jun 14, 2021
1 parent 9ee183b commit 3045275
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions packages/react-dom/src/server/ReactDOMFizzServerNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ type Controls = {|
startWriting(): void,
|};

function pipeToNodeWritable(
function createRequestImpl(
children: ReactNodeList,
destination: Writable,
options?: Options,
): Controls {
const request = createRequest(
options: void | Options,
) {
return createRequest(
children,
destination,
createResponseState(options ? options.identifierPrefix : undefined),
Expand All @@ -57,6 +57,14 @@ function pipeToNodeWritable(
options ? options.onCompleteAll : undefined,
options ? options.onReadyToStream : undefined,
);
}

function pipeToNodeWritable(
children: ReactNodeList,
destination: Writable,
options?: Options,
): Controls {
const request = createRequestImpl(children, destination, options);
let hasStartedFlowing = false;
startWork(request);
return {
Expand Down

0 comments on commit 3045275

Please sign in to comment.