Skip to content

Commit 068107d

Browse files
committed
[Fiber] Don't throw away the Error object retaining the owner stack (facebook#33976)
We currently throw away the Error once we've used to the owner stack of a Fiber once. This maybe helps a bit with memory and redoing it but we really don't expect most Fibers to hit this at all. It's not very hot. If we throw away the Error, then we can't use native debugger protocols to inspect the native stack. Instead, we'd have to maintain a url to resource map indefinitely like what Chrome DevTools does to map a url to a resource. Technically it's not even technically correct since the file path might not be reversible and could in theory conflict. DiffTrain build for [4f34cc4](facebook@4f34cc4)
1 parent ed7af1f commit 068107d

34 files changed

+554
-564
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
edac0dded99d56e7d66a88da83e874761e3e937a
1+
4f34cc4a2e1198493375867d1876509ae9771aee
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
edac0dded99d56e7d66a88da83e874761e3e937a
1+
4f34cc4a2e1198493375867d1876509ae9771aee

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1434,7 +1434,7 @@ __DEV__ &&
14341434
exports.useTransition = function () {
14351435
return resolveDispatcher().useTransition();
14361436
};
1437-
exports.version = "19.2.0-www-classic-edac0dde-20250723";
1437+
exports.version = "19.2.0-www-classic-4f34cc4a-20250724";
14381438
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
14391439
"function" ===
14401440
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
@@ -1434,7 +1434,7 @@ __DEV__ &&
14341434
exports.useTransition = function () {
14351435
return resolveDispatcher().useTransition();
14361436
};
1437-
exports.version = "19.2.0-www-modern-edac0dde-20250723";
1437+
exports.version = "19.2.0-www-modern-4f34cc4a-20250724";
14381438
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
14391439
"function" ===
14401440
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
@@ -610,4 +610,4 @@ exports.useSyncExternalStore = function (
610610
exports.useTransition = function () {
611611
return ReactSharedInternals.H.useTransition();
612612
};
613-
exports.version = "19.2.0-www-classic-edac0dde-20250723";
613+
exports.version = "19.2.0-www-classic-4f34cc4a-20250724";

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,4 +610,4 @@ exports.useSyncExternalStore = function (
610610
exports.useTransition = function () {
611611
return ReactSharedInternals.H.useTransition();
612612
};
613-
exports.version = "19.2.0-www-modern-edac0dde-20250723";
613+
exports.version = "19.2.0-www-modern-4f34cc4a-20250724";

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ exports.useSyncExternalStore = function (
614614
exports.useTransition = function () {
615615
return ReactSharedInternals.H.useTransition();
616616
};
617-
exports.version = "19.2.0-www-classic-edac0dde-20250723";
617+
exports.version = "19.2.0-www-classic-4f34cc4a-20250724";
618618
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
619619
"function" ===
620620
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
@@ -614,7 +614,7 @@ exports.useSyncExternalStore = function (
614614
exports.useTransition = function () {
615615
return ReactSharedInternals.H.useTransition();
616616
};
617-
exports.version = "19.2.0-www-modern-edac0dde-20250723";
617+
exports.version = "19.2.0-www-modern-4f34cc4a-20250724";
618618
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
619619
"function" ===
620620
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2640,11 +2640,10 @@ __DEV__ &&
26402640
var fiber = workInProgress;
26412641
workInProgress = fiber._debugOwner;
26422642
var debugStack = fiber._debugStack;
2643-
workInProgress &&
2644-
debugStack &&
2645-
("string" !== typeof debugStack &&
2646-
(fiber._debugStack = debugStack = formatOwnerStack(debugStack)),
2647-
"" !== debugStack && (info += "\n" + debugStack));
2643+
if (workInProgress && debugStack) {
2644+
var formattedStack = formatOwnerStack(debugStack);
2645+
"" !== formattedStack && (info += "\n" + formattedStack);
2646+
}
26482647
} else if (null != workInProgress.debugStack) {
26492648
var ownerStack = workInProgress.debugStack;
26502649
(workInProgress = workInProgress.owner) &&
@@ -19300,10 +19299,10 @@ __DEV__ &&
1930019299
(function () {
1930119300
var internals = {
1930219301
bundleType: 1,
19303-
version: "19.2.0-www-classic-edac0dde-20250723",
19302+
version: "19.2.0-www-classic-4f34cc4a-20250724",
1930419303
rendererPackageName: "react-art",
1930519304
currentDispatcherRef: ReactSharedInternals,
19306-
reconcilerVersion: "19.2.0-www-classic-edac0dde-20250723"
19305+
reconcilerVersion: "19.2.0-www-classic-4f34cc4a-20250724"
1930719306
};
1930819307
internals.overrideHookState = overrideHookState;
1930919308
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -19337,7 +19336,7 @@ __DEV__ &&
1933719336
exports.Shape = Shape;
1933819337
exports.Surface = Surface;
1933919338
exports.Text = Text;
19340-
exports.version = "19.2.0-www-classic-edac0dde-20250723";
19339+
exports.version = "19.2.0-www-classic-4f34cc4a-20250724";
1934119340
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1934219341
"function" ===
1934319342
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2546,11 +2546,10 @@ __DEV__ &&
25462546
var fiber = workInProgress;
25472547
workInProgress = fiber._debugOwner;
25482548
var debugStack = fiber._debugStack;
2549-
workInProgress &&
2550-
debugStack &&
2551-
("string" !== typeof debugStack &&
2552-
(fiber._debugStack = debugStack = formatOwnerStack(debugStack)),
2553-
"" !== debugStack && (info += "\n" + debugStack));
2549+
if (workInProgress && debugStack) {
2550+
var formattedStack = formatOwnerStack(debugStack);
2551+
"" !== formattedStack && (info += "\n" + formattedStack);
2552+
}
25542553
} else if (null != workInProgress.debugStack) {
25552554
var ownerStack = workInProgress.debugStack;
25562555
(workInProgress = workInProgress.owner) &&
@@ -19071,10 +19070,10 @@ __DEV__ &&
1907119070
(function () {
1907219071
var internals = {
1907319072
bundleType: 1,
19074-
version: "19.2.0-www-modern-edac0dde-20250723",
19073+
version: "19.2.0-www-modern-4f34cc4a-20250724",
1907519074
rendererPackageName: "react-art",
1907619075
currentDispatcherRef: ReactSharedInternals,
19077-
reconcilerVersion: "19.2.0-www-modern-edac0dde-20250723"
19076+
reconcilerVersion: "19.2.0-www-modern-4f34cc4a-20250724"
1907819077
};
1907919078
internals.overrideHookState = overrideHookState;
1908019079
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -19108,7 +19107,7 @@ __DEV__ &&
1910819107
exports.Shape = Shape;
1910919108
exports.Surface = Surface;
1911019109
exports.Text = Text;
19111-
exports.version = "19.2.0-www-modern-edac0dde-20250723";
19110+
exports.version = "19.2.0-www-modern-4f34cc4a-20250724";
1911219111
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1911319112
"function" ===
1911419113
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

0 commit comments

Comments
 (0)