Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch React with fix for write-after-close for ReadableStream #57011

Merged
merged 1 commit into from
Oct 18, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if (process.env.NODE_ENV !== "production") {
var React = require("next/dist/compiled/react-experimental");
var ReactDOM = require('react-dom');

var ReactVersion = '18.3.0-experimental-d900fadbf-20230929';
var ReactVersion = '18.3.0-experimental-3cfcbc5bc-20231018';

var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;

Expand Down Expand Up @@ -11264,7 +11264,10 @@ function flushCompletedQueues(request, destination) {
} // We're done.


close(destination);
close(destination); // We need to stop flowing now because we do not want any async contexts which might call
// float methods to initiate any flushes after this point

stopFlowing(request);
}
}
}
Expand All @@ -11284,10 +11287,17 @@ function enqueueFlush(request) {
request.pingedTasks.length === 0 && // If there is no destination there is nothing we can flush to. A flush will
// happen when we start flowing again
request.destination !== null) {
var destination = request.destination;
request.flushScheduled = true;
scheduleWork(function () {
return flushCompletedQueues(request, destination);
// We need to existence check destination again here because it might go away
// in between the enqueueFlush call and the work execution
var destination = request.destination;

if (destination) {
flushCompletedQueues(request, destination);
} else {
request.flushScheduled = false;
}
});
}
}
Expand Down Expand Up @@ -11317,6 +11327,9 @@ function startFlowing(request, destination) {
fatalError(request, error);
}
}
function stopFlowing(request) {
request.destination = null;
} // This is called to early terminate a request. It puts all pending boundaries in client rendered state.

function abort(request, reason) {
try {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var React = require("next/dist/compiled/react-experimental");
var ReactDOM = require('react-dom');
var stream = require('stream');

var ReactVersion = '18.3.0-experimental-d900fadbf-20230929';
var ReactVersion = '18.3.0-experimental-3cfcbc5bc-20231018';

var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;

Expand Down Expand Up @@ -11265,7 +11265,10 @@ function flushCompletedQueues(request, destination) {
} // We're done.


close(destination);
close(destination); // We need to stop flowing now because we do not want any async contexts which might call
// float methods to initiate any flushes after this point

stopFlowing(request);
}
}
}
Expand All @@ -11285,10 +11288,17 @@ function enqueueFlush(request) {
request.pingedTasks.length === 0 && // If there is no destination there is nothing we can flush to. A flush will
// happen when we start flowing again
request.destination !== null) {
var destination = request.destination;
request.flushScheduled = true;
scheduleWork(function () {
return flushCompletedQueues(request, destination);
// We need to existence check destination again here because it might go away
// in between the enqueueFlush call and the work execution
var destination = request.destination;

if (destination) {
flushCompletedQueues(request, destination);
} else {
request.flushScheduled = false;
}
});
}
}
Expand Down Expand Up @@ -11318,6 +11328,9 @@ function startFlowing(request, destination) {
fatalError(request, error);
}
}
function stopFlowing(request) {
request.destination = null;
} // This is called to early terminate a request. It puts all pending boundaries in client rendered state.

function abort(request, reason) {
try {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if (process.env.NODE_ENV !== "production") {

var React = require("next/dist/compiled/react-experimental");

var ReactVersion = '18.3.0-experimental-d900fadbf-20230929';
var ReactVersion = '18.3.0-experimental-3cfcbc5bc-20231018';

var Internals = {
usingClientEntryPoint: false,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if (process.env.NODE_ENV !== "production") {
var React = require("next/dist/compiled/react-experimental");
var ReactDOM = require('react-dom');

var ReactVersion = '18.3.0-experimental-d900fadbf-20230929';
var ReactVersion = '18.3.0-experimental-3cfcbc5bc-20231018';

var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;

Expand Down Expand Up @@ -11320,7 +11320,10 @@ function flushCompletedQueues(request, destination) {
} // We're done.


close(destination);
close(destination); // We need to stop flowing now because we do not want any async contexts which might call
// float methods to initiate any flushes after this point

stopFlowing(request);
} else {
completeWriting(destination);
}
Expand All @@ -11342,10 +11345,17 @@ function enqueueFlush(request) {
request.pingedTasks.length === 0 && // If there is no destination there is nothing we can flush to. A flush will
// happen when we start flowing again
request.destination !== null) {
var destination = request.destination;
request.flushScheduled = true;
scheduleWork(function () {
return flushCompletedQueues(request, destination);
// We need to existence check destination again here because it might go away
// in between the enqueueFlush call and the work execution
var destination = request.destination;

if (destination) {
flushCompletedQueues(request, destination);
} else {
request.flushScheduled = false;
}
});
}
}
Expand Down
Loading