Skip to content

Commit 8f0fd1a

Browse files
committed
Make startFlowing explicit in Flight
This is already an explicit call in Fizz. This moves flowing to be explicit. That way we can avoid calling it in start() for web streams and therefore avoid the reentrant call.
1 parent 3aacb60 commit 8f0fd1a

File tree

4 files changed

+13
-3
lines changed

4 files changed

+13
-3
lines changed

packages/react-noop-renderer/src/ReactNoopFlightServer.js

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ function render(model: ReactModel, options?: Options): Destination {
6868
options ? options.onError : undefined,
6969
);
7070
ReactNoopFlightServer.startWork(request);
71+
ReactNoopFlightServer.startFlowing(request);
7172
return destination;
7273
}
7374

packages/react-server-dom-relay/src/ReactFlightDOMRelayServer.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ import type {
1313
Destination,
1414
} from './ReactFlightDOMRelayServerHostConfig';
1515

16-
import {createRequest, startWork} from 'react-server/src/ReactFlightServer';
16+
import {
17+
createRequest,
18+
startWork,
19+
startFlowing,
20+
} from 'react-server/src/ReactFlightServer';
1721

1822
type Options = {
1923
onError?: (error: mixed) => void,
@@ -32,6 +36,7 @@ function render(
3236
options ? options.onError : undefined,
3337
);
3438
startWork(request);
39+
startFlowing(request);
3540
}
3641

3742
export {render};

packages/react-server-native-relay/src/ReactFlightNativeRelayServer.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@ import type {
1313
Destination,
1414
} from './ReactFlightNativeRelayServerHostConfig';
1515

16-
import {createRequest, startWork} from 'react-server/src/ReactFlightServer';
16+
import {
17+
createRequest,
18+
startWork,
19+
startFlowing,
20+
} from 'react-server/src/ReactFlightServer';
1721

1822
function render(
1923
model: ReactModel,
@@ -22,6 +26,7 @@ function render(
2226
): void {
2327
const request = createRequest(model, destination, config);
2428
startWork(request);
29+
startFlowing(request);
2530
}
2631

2732
export {render};

packages/react-server/src/ReactFlightServer.js

-1
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,6 @@ function flushCompletedChunks(request: Request): void {
763763
}
764764

765765
export function startWork(request: Request): void {
766-
request.flowing = true;
767766
scheduleWork(() => performWork(request));
768767
}
769768

0 commit comments

Comments
 (0)