GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Remove hacky stream.locked check, declare as byte stream instead (#23… · react/react@75662d6

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages
    • react-dom/src/server
      • ReactDOMFizzServerBrowser.js
    • react-server-dom-webpack/src
      • ReactFlightDOMServerBrowser.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/react-dom/src/server/ReactDOMFizzServerBrowser.js‎

Copy file name to clipboardExpand all lines: packages/react-dom/src/server/ReactDOMFizzServerBrowser.js
+2-7Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,9 @@ function renderToReadableStream(
4343
return new Promise((resolve, reject) => {
4444
function onCompleteShell() {
4545
const stream = new ReadableStream({
46+
type: 'bytes',
4647
pull(controller) {
47-
// Pull is called immediately even if the stream is not passed to anything.
48-
// That's buffering too early. We want to start buffering once the stream
49-
// is actually used by something so we can give it the best result possible
50-
// at that point.
51-
if (stream.locked) {
52-
startFlowing(request, controller);
53-
}
48+
startFlowing(request, controller);
5449
},
5550
cancel(reason) {},
5651
});
Collapse file

‎packages/react-server-dom-webpack/src/ReactFlightDOMServerBrowser.js‎

Copy file name to clipboardExpand all lines: packages/react-server-dom-webpack/src/ReactFlightDOMServerBrowser.js
+2-7Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,12 @@ function renderToReadableStream(
3131
options ? options.onError : undefined,
3232
);
3333
const stream = new ReadableStream({
34+
type: 'bytes',
3435
start(controller) {
3536
startWork(request);
3637
},
3738
pull(controller) {
38-
// Pull is called immediately even if the stream is not passed to anything.
39-
// That's buffering too early. We want to start buffering once the stream
40-
// is actually used by something so we can give it the best result possible
41-
// at that point.
42-
if (stream.locked) {
43-
startFlowing(request, controller);
44-
}
39+
startFlowing(request, controller);
4540
},
4641
cancel(reason) {},
4742
});

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.