Skip to content

Commit 07d044a

Browse files
committed
[Fizz] Track Current debugTask and run it for onError Callbacks (#30182)
Stacked on #30174. This tracks the current debugTask on the Task so that when an error is thrown we can use it to run the `onError` (and `onShellError` and `onFatalError`) callbacks within the Context of that task. Ideally it would be associated with the error object but neither console.error [nor reportError](https://crbug.com/350426235) reports this as the async stack so we have to manually restore it. That way when you inspect Fizz using node `--inspect` we show the right async stack. <img width="616" alt="Screenshot 2024-07-01 at 10 52 29 PM" src="https://github.com/facebook/react/assets/63648/db68133e-124e-4509-8241-c67160db94fc"> This is equivalent to how we track the task that created the parent server component or the Fiber: https://github.com/facebook/react/blob/6d2a97a7113dfac2ad45067001b7e49a98718324/packages/react-reconciler/src/ReactChildFiber.js#L1985 Then use them when invoking the error callbacks: https://github.com/facebook/react/blob/6d2a97a7113dfac2ad45067001b7e49a98718324/packages/react-reconciler/src/ReactFiberThrow.js#L104-L108 --------- Co-authored-by: Sebastian Silbermann <silbermann.sebastian@gmail.com> DiffTrain build for [3db98c9](3db98c9)
1 parent a3323b7 commit 07d044a

36 files changed

+183
-219
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
cfb8945f511add040e1d5427d9961337f98f7618
1+
3db98c917701d59f62cf1fbe45cbf01b0b61c704
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
cfb8945f511add040e1d5427d9961337f98f7618
1+
3db98c917701d59f62cf1fbe45cbf01b0b61c704

compiled/facebook-www/React-dev.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1991,7 +1991,7 @@ __DEV__ &&
19911991
exports.useTransition = function () {
19921992
return resolveDispatcher().useTransition();
19931993
};
1994-
exports.version = "19.0.0-www-classic-cfb8945f51-20240702";
1994+
exports.version = "19.0.0-www-classic-3db98c9177-20240702";
19951995
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
19961996
"function" ===
19971997
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/React-dev.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1971,7 +1971,7 @@ __DEV__ &&
19711971
exports.useTransition = function () {
19721972
return resolveDispatcher().useTransition();
19731973
};
1974-
exports.version = "19.0.0-www-modern-cfb8945f51-20240702";
1974+
exports.version = "19.0.0-www-modern-3db98c9177-20240702";
19751975
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
19761976
"function" ===
19771977
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/React-prod.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,4 +669,4 @@ exports.useSyncExternalStore = function (
669669
exports.useTransition = function () {
670670
return ReactSharedInternals.H.useTransition();
671671
};
672-
exports.version = "19.0.0-www-classic-cfb8945f51-20240702";
672+
exports.version = "19.0.0-www-classic-3db98c9177-20240702";

compiled/facebook-www/React-prod.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,4 +669,4 @@ exports.useSyncExternalStore = function (
669669
exports.useTransition = function () {
670670
return ReactSharedInternals.H.useTransition();
671671
};
672-
exports.version = "19.0.0-www-modern-cfb8945f51-20240702";
672+
exports.version = "19.0.0-www-modern-3db98c9177-20240702";

compiled/facebook-www/React-profiling.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ exports.useSyncExternalStore = function (
673673
exports.useTransition = function () {
674674
return ReactSharedInternals.H.useTransition();
675675
};
676-
exports.version = "19.0.0-www-classic-cfb8945f51-20240702";
676+
exports.version = "19.0.0-www-classic-3db98c9177-20240702";
677677
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
678678
"function" ===
679679
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/React-profiling.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ exports.useSyncExternalStore = function (
673673
exports.useTransition = function () {
674674
return ReactSharedInternals.H.useTransition();
675675
};
676-
exports.version = "19.0.0-www-modern-cfb8945f51-20240702";
676+
exports.version = "19.0.0-www-modern-3db98c9177-20240702";
677677
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
678678
"function" ===
679679
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/ReactART-dev.classic.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16934,14 +16934,14 @@ __DEV__ &&
1693416934
scheduleRoot: scheduleRoot,
1693516935
setRefreshHandler: setRefreshHandler,
1693616936
getCurrentFiber: getCurrentFiberForDevTools,
16937-
reconcilerVersion: "19.0.0-www-classic-cfb8945f51-20240702"
16937+
reconcilerVersion: "19.0.0-www-classic-3db98c9177-20240702"
1693816938
});
1693916939
})({
1694016940
findFiberByHostInstance: function () {
1694116941
return null;
1694216942
},
1694316943
bundleType: 1,
16944-
version: "19.0.0-www-classic-cfb8945f51-20240702",
16944+
version: "19.0.0-www-classic-3db98c9177-20240702",
1694516945
rendererPackageName: "react-art"
1694616946
});
1694716947
var ClippingRectangle = TYPES.CLIPPING_RECTANGLE,

compiled/facebook-www/ReactART-dev.modern.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16364,14 +16364,14 @@ __DEV__ &&
1636416364
scheduleRoot: scheduleRoot,
1636516365
setRefreshHandler: setRefreshHandler,
1636616366
getCurrentFiber: getCurrentFiberForDevTools,
16367-
reconcilerVersion: "19.0.0-www-modern-cfb8945f51-20240702"
16367+
reconcilerVersion: "19.0.0-www-modern-3db98c9177-20240702"
1636816368
});
1636916369
})({
1637016370
findFiberByHostInstance: function () {
1637116371
return null;
1637216372
},
1637316373
bundleType: 1,
16374-
version: "19.0.0-www-modern-cfb8945f51-20240702",
16374+
version: "19.0.0-www-modern-3db98c9177-20240702",
1637516375
rendererPackageName: "react-art"
1637616376
});
1637716377
var ClippingRectangle = TYPES.CLIPPING_RECTANGLE,

0 commit comments

Comments
 (0)