[Fizz] Pass cancellation reason to abort (#27536)
This was implemented correctly for Flight but not Fizz. Hard to keep these many wrappers in sync.
Sebastian Markbåge committed
Oct 17, 2023 at 21:43 UTC
e3748a0bde80dd1f097fd8000702aba9fca454ef
5 files changed
+7
-7
packages/react-dom/src/server/ReactDOMFizzServerBrowser.js
+2
-2
@@ -80,7 +80,7 @@ function renderToReadableStream(
80
},
81
cancel: (reason): ?Promise<void> => {
82
stopFlowing(request);
83
- abort(request);
83
+ abort(request, reason);
84
},
85
},
86
// $FlowFixMe[prop-missing] size() methods are not allowed on byte streams.
@@ -161,7 +161,7 @@ function resume(
161
},
162
cancel: (reason): ?Promise<void> => {
163
stopFlowing(request);
164
- abort(request);
164
+ abort(request, reason);
165
},
166
},
167
// $FlowFixMe[prop-missing] size() methods are not allowed on byte streams.
packages/react-dom/src/server/ReactDOMFizzServerBun.js
+1
-1
@@ -70,7 +70,7 @@ function renderToReadableStream(
70
},
71
cancel: (reason): ?Promise<void> => {
72
stopFlowing(request);
73
- abort(request);
73
+ abort(request, reason);
74
},
75
},
76
// $FlowFixMe[prop-missing] size() methods are not allowed on byte streams.
packages/react-dom/src/server/ReactDOMFizzServerEdge.js
+2
-2
@@ -80,7 +80,7 @@ function renderToReadableStream(
80
},
81
cancel: (reason): ?Promise<void> => {
82
stopFlowing(request);
83
- abort(request);
83
+ abort(request, reason);
84
},
85
},
86
// $FlowFixMe[prop-missing] size() methods are not allowed on byte streams.
@@ -161,7 +161,7 @@ function resume(
161
},
162
cancel: (reason): ?Promise<void> => {
163
stopFlowing(request);
164
- abort(request);
164
+ abort(request, reason);
165
},
166
},
167
// $FlowFixMe[prop-missing] size() methods are not allowed on byte streams.
packages/react-dom/src/server/ReactDOMFizzStaticBrowser.js
+1
-1
@@ -64,7 +64,7 @@ function prerender(
64
},
65
cancel: (reason): ?Promise<void> => {
66
stopFlowing(request);
67
- abort(request);
67
+ abort(request, reason);
68
},
69
},
70
// $FlowFixMe[prop-missing] size() methods are not allowed on byte streams.
packages/react-dom/src/server/ReactDOMFizzStaticEdge.js
+1
-1
@@ -64,7 +64,7 @@ function prerender(
64
},
65
cancel: (reason): ?Promise<void> => {
66
stopFlowing(request);
67
- abort(request);
67
+ abort(request, reason);
68
},
69
},
70
// $FlowFixMe[prop-missing] size() methods are not allowed on byte streams.