Skip to content

Commit

Permalink
[Fizz] Pass cancellation reason to abort (#27536)
Browse files Browse the repository at this point in the history
This was implemented correctly for Flight but not Fizz. Hard to keep
these many wrappers in sync.
  • Loading branch information
sebmarkbage authored Oct 18, 2023
1 parent a419575 commit e3748a0
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions packages/react-dom/src/server/ReactDOMFizzServerBrowser.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function renderToReadableStream(
},
cancel: (reason): ?Promise<void> => {
stopFlowing(request);
abort(request);
abort(request, reason);
},
},
// $FlowFixMe[prop-missing] size() methods are not allowed on byte streams.
Expand Down Expand Up @@ -161,7 +161,7 @@ function resume(
},
cancel: (reason): ?Promise<void> => {
stopFlowing(request);
abort(request);
abort(request, reason);
},
},
// $FlowFixMe[prop-missing] size() methods are not allowed on byte streams.
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/src/server/ReactDOMFizzServerBun.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function renderToReadableStream(
},
cancel: (reason): ?Promise<void> => {
stopFlowing(request);
abort(request);
abort(request, reason);
},
},
// $FlowFixMe[prop-missing] size() methods are not allowed on byte streams.
Expand Down
4 changes: 2 additions & 2 deletions packages/react-dom/src/server/ReactDOMFizzServerEdge.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function renderToReadableStream(
},
cancel: (reason): ?Promise<void> => {
stopFlowing(request);
abort(request);
abort(request, reason);
},
},
// $FlowFixMe[prop-missing] size() methods are not allowed on byte streams.
Expand Down Expand Up @@ -161,7 +161,7 @@ function resume(
},
cancel: (reason): ?Promise<void> => {
stopFlowing(request);
abort(request);
abort(request, reason);
},
},
// $FlowFixMe[prop-missing] size() methods are not allowed on byte streams.
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/src/server/ReactDOMFizzStaticBrowser.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function prerender(
},
cancel: (reason): ?Promise<void> => {
stopFlowing(request);
abort(request);
abort(request, reason);
},
},
// $FlowFixMe[prop-missing] size() methods are not allowed on byte streams.
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/src/server/ReactDOMFizzStaticEdge.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function prerender(
},
cancel: (reason): ?Promise<void> => {
stopFlowing(request);
abort(request);
abort(request, reason);
},
},
// $FlowFixMe[prop-missing] size() methods are not allowed on byte streams.
Expand Down

0 comments on commit e3748a0

Please sign in to comment.