Skip to content

Commit

Permalink
[Fizz] Allow passing a reason to abortStream (#26992)
Browse files Browse the repository at this point in the history
## Summary

Currently `ReactFizzServer.abort` allows you to pass in the a `reason`
error, which then gets passed to the `onError` handler for each task
that ends up getting aborted. This adds in the ability to pass down that
same `reason` error to `ReactDOMServerFB.abortStream` as well.

## How did you test this change?

Added a test case to ReactDOMServerFB-test.internal.js

DiffTrain build for [1f49366](1f49366)
  • Loading branch information
mofeiZ committed Sep 20, 2023
1 parent fe4d7ee commit ca0b9f4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion compiled/facebook-www/REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
b775564d35d6fe9f9acead0f380bbc86bb6bdd2c
1f4936660dcaba2e5722013f0ad12d7369543a9f
4 changes: 2 additions & 2 deletions compiled/facebook-www/ReactDOMServerStreaming-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -12848,8 +12848,8 @@ function renderToStream(children, options) {
};
}

function abortStream(stream) {
abort(stream.request);
function abortStream(stream, reason) {
abort(stream.request, reason);
}

function renderNextChunk(stream) {
Expand Down
4 changes: 2 additions & 2 deletions compiled/facebook-www/ReactDOMServerStreaming-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -4633,8 +4633,8 @@ function abort(request, reason) {
logRecoverableError(request, error$34), fatalError(request, error$34);
}
}
exports.abortStream = function (stream) {
abort(stream.request);
exports.abortStream = function (stream, reason) {
abort(stream.request, reason);
};
exports.debug = function (stream) {
stream = stream.request;
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/ReactTestRenderer-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -24360,7 +24360,7 @@ function createFiberRoot(
return root;
}

var ReactVersion = "18.3.0-www-modern-5efbcf55";
var ReactVersion = "18.3.0-www-modern-6126abbd";

// Might add PROFILE later.

Expand Down

0 comments on commit ca0b9f4

Please sign in to comment.