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
9 changes: 2 additions & 7 deletions packages/react-dom/src/server/ReactDOMFizzServerBrowser.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,9 @@ function renderToReadableStream(
return new Promise((resolve, reject) => {
function onCompleteShell() {
const stream = new ReadableStream({
type: 'bytes',
pull(controller) {
// Pull is called immediately even if the stream is not passed to anything.
// That's buffering too early. We want to start buffering once the stream
// is actually used by something so we can give it the best result possible
// at that point.
if (stream.locked) {
startFlowing(request, controller);
}
startFlowing(request, controller);
},
cancel(reason) {},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,12 @@ function renderToReadableStream(
options ? options.onError : undefined,
);
const stream = new ReadableStream({
type: 'bytes',
start(controller) {
startWork(request);
},
pull(controller) {
// Pull is called immediately even if the stream is not passed to anything.
// That's buffering too early. We want to start buffering once the stream
// is actually used by something so we can give it the best result possible
// at that point.
if (stream.locked) {
startFlowing(request, controller);
}
startFlowing(request, controller);
},
cancel(reason) {},
});
Expand Down