Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions packages/react-dom/src/__tests__/ReactDOMFizzServerNode-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,21 @@ describe('ReactDOMFizzServerNode', () => {
expect(output.result).toMatchInlineSnapshot(`"<div>hello world</div>"`);
});

it('flush fully if piping in on onShellReady', async () => {
const {writable, output} = getTestWritable();
await act(() => {
const {pipe} = ReactDOMFizzServer.renderToPipeableStream(
<div>hello world</div>,
{
onShellReady() {
pipe(writable);
},
},
);
});
expect(output.result).toMatchInlineSnapshot(`"<div>hello world</div>"`);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could even move this into the onShellReady callback after the pipe. I think it will flush everything sync

});

it('should emit DOCTYPE at the root of the document', async () => {
const {writable, output} = getTestWritable();
await act(() => {
Expand Down
2 changes: 1 addition & 1 deletion packages/react-server/src/ReactFizzServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4335,6 +4335,7 @@ function finishedTask(
boundary: Root | SuspenseBoundary,
segment: null | Segment,
) {
request.allPendingTasks--;
if (boundary === null) {
if (segment !== null && segment.parentFlushed) {
if (request.completedRootSegment !== null) {
Expand Down Expand Up @@ -4417,7 +4418,6 @@ function finishedTask(
}
}

request.allPendingTasks--;
if (request.allPendingTasks === 0) {
completeAll(request);
}
Expand Down
Loading