Skip to content

Commit f2c6459

Browse files
[devtools] Allow inspecting cause, name, message, stack of Errors in props (facebook#33023)
DiffTrain build for [c498bfc](facebook@c498bfc)
1 parent fb993c2 commit f2c6459

39 files changed

+58470
-43214
lines changed

compiled/eslint-plugin-react-hooks/index.js

Lines changed: 25788 additions & 24475 deletions
Large diffs are not rendered by default.

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
313332d111a2fba2db94c584334d8895e8d73c61
1+
c498bfce8b9baa3dd21bd0d5124eb3a4549886f1
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
313332d111a2fba2db94c584334d8895e8d73c61
1+
c498bfce8b9baa3dd21bd0d5124eb3a4549886f1

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

Lines changed: 69 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,72 @@ __DEV__ &&
598598
function useMemoCache(size) {
599599
return resolveDispatcher().useMemoCache(size);
600600
}
601+
function releaseAsyncTransition() {
602+
ReactSharedInternals.asyncTransitions--;
603+
}
604+
function startTransition(scope, options) {
605+
var prevTransition = ReactSharedInternals.T,
606+
currentTransition = {};
607+
enableViewTransition &&
608+
(currentTransition.types =
609+
null !== prevTransition ? prevTransition.types : null);
610+
enableTransitionTracing &&
611+
((currentTransition.name =
612+
void 0 !== options && void 0 !== options.name ? options.name : null),
613+
(currentTransition.startTime = -1));
614+
currentTransition._updatedFibers = new Set();
615+
ReactSharedInternals.T = currentTransition;
616+
try {
617+
var returnValue = scope(),
618+
onStartTransitionFinish = ReactSharedInternals.S;
619+
null !== onStartTransitionFinish &&
620+
onStartTransitionFinish(currentTransition, returnValue);
621+
"object" === typeof returnValue &&
622+
null !== returnValue &&
623+
"function" === typeof returnValue.then &&
624+
(ReactSharedInternals.asyncTransitions++,
625+
returnValue.then(releaseAsyncTransition, releaseAsyncTransition),
626+
returnValue.then(noop, reportGlobalError));
627+
} catch (error) {
628+
reportGlobalError(error);
629+
} finally {
630+
null === prevTransition &&
631+
currentTransition._updatedFibers &&
632+
((scope = currentTransition._updatedFibers.size),
633+
currentTransition._updatedFibers.clear(),
634+
10 < scope &&
635+
console.warn(
636+
"Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."
637+
)),
638+
null !== prevTransition &&
639+
null !== currentTransition.types &&
640+
(null !== prevTransition.types &&
641+
prevTransition.types !== currentTransition.types &&
642+
console.error(
643+
"We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."
644+
),
645+
(prevTransition.types = currentTransition.types)),
646+
(ReactSharedInternals.T = prevTransition);
647+
}
648+
}
601649
function noop() {}
650+
function addTransitionType(type) {
651+
if (enableViewTransition) {
652+
var transition = ReactSharedInternals.T;
653+
if (null !== transition) {
654+
var transitionTypes = transition.types;
655+
null === transitionTypes
656+
? (transition.types = [type])
657+
: -1 === transitionTypes.indexOf(type) &&
658+
transitionTypes.push(type);
659+
} else
660+
0 === ReactSharedInternals.asyncTransitions &&
661+
console.error(
662+
"addTransitionType can only be called inside a `startTransition()` callback. It must be associated with a specific Transition."
663+
),
664+
startTransition(addTransitionType.bind(null, type));
665+
}
666+
}
602667
function enqueueTask(task) {
603668
if (null === enqueueTaskImpl)
604669
try {
@@ -773,8 +838,8 @@ __DEV__ &&
773838
A: null,
774839
T: null,
775840
S: null,
776-
V: null,
777841
actQueue: null,
842+
asyncTransitions: 0,
778843
isBatchingLegacy: !1,
779844
didScheduleLegacyUpdate: !1,
780845
didUsePromise: !1,
@@ -1372,52 +1437,14 @@ __DEV__ &&
13721437
});
13731438
return compare;
13741439
};
1375-
exports.startTransition = function (scope, options) {
1376-
var prevTransition = ReactSharedInternals.T,
1377-
currentTransition = {};
1378-
ReactSharedInternals.T = currentTransition;
1379-
currentTransition._updatedFibers = new Set();
1380-
enableTransitionTracing &&
1381-
void 0 !== options &&
1382-
void 0 !== options.name &&
1383-
((currentTransition.name = options.name),
1384-
(currentTransition.startTime = -1));
1385-
try {
1386-
var returnValue = scope(),
1387-
onStartTransitionFinish = ReactSharedInternals.S;
1388-
null !== onStartTransitionFinish &&
1389-
onStartTransitionFinish(currentTransition, returnValue);
1390-
"object" === typeof returnValue &&
1391-
null !== returnValue &&
1392-
"function" === typeof returnValue.then &&
1393-
returnValue.then(noop, reportGlobalError);
1394-
} catch (error) {
1395-
reportGlobalError(error);
1396-
} finally {
1397-
null === prevTransition &&
1398-
currentTransition._updatedFibers &&
1399-
((scope = currentTransition._updatedFibers.size),
1400-
currentTransition._updatedFibers.clear(),
1401-
10 < scope &&
1402-
console.warn(
1403-
"Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."
1404-
)),
1405-
(ReactSharedInternals.T = prevTransition);
1406-
}
1407-
};
1440+
exports.startTransition = startTransition;
14081441
exports.unstable_Activity = REACT_ACTIVITY_TYPE;
14091442
exports.unstable_LegacyHidden = dynamicFeatureFlags;
14101443
exports.unstable_Scope = renameElementSymbol;
14111444
exports.unstable_SuspenseList = REACT_SUSPENSE_LIST_TYPE;
14121445
exports.unstable_TracingMarker = REACT_TRACING_MARKER_TYPE;
14131446
exports.unstable_ViewTransition = REACT_VIEW_TRANSITION_TYPE;
1414-
exports.unstable_addTransitionType = function (type) {
1415-
var pendingTransitionTypes = ReactSharedInternals.V;
1416-
null === pendingTransitionTypes
1417-
? (ReactSharedInternals.V = [type])
1418-
: -1 === pendingTransitionTypes.indexOf(type) &&
1419-
pendingTransitionTypes.push(type);
1420-
};
1447+
exports.unstable_addTransitionType = addTransitionType;
14211448
exports.unstable_getCacheForType = function (resourceType) {
14221449
var dispatcher = ReactSharedInternals.A;
14231450
return dispatcher
@@ -1511,7 +1538,7 @@ __DEV__ &&
15111538
exports.useTransition = function () {
15121539
return resolveDispatcher().useTransition();
15131540
};
1514-
exports.version = "19.1.0-www-classic-313332d1-20250326";
1541+
exports.version = "19.2.0-www-classic-c498bfce-20250426";
15151542
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
15161543
"function" ===
15171544
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 69 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,72 @@ __DEV__ &&
598598
function useMemoCache(size) {
599599
return resolveDispatcher().useMemoCache(size);
600600
}
601+
function releaseAsyncTransition() {
602+
ReactSharedInternals.asyncTransitions--;
603+
}
604+
function startTransition(scope, options) {
605+
var prevTransition = ReactSharedInternals.T,
606+
currentTransition = {};
607+
enableViewTransition &&
608+
(currentTransition.types =
609+
null !== prevTransition ? prevTransition.types : null);
610+
enableTransitionTracing &&
611+
((currentTransition.name =
612+
void 0 !== options && void 0 !== options.name ? options.name : null),
613+
(currentTransition.startTime = -1));
614+
currentTransition._updatedFibers = new Set();
615+
ReactSharedInternals.T = currentTransition;
616+
try {
617+
var returnValue = scope(),
618+
onStartTransitionFinish = ReactSharedInternals.S;
619+
null !== onStartTransitionFinish &&
620+
onStartTransitionFinish(currentTransition, returnValue);
621+
"object" === typeof returnValue &&
622+
null !== returnValue &&
623+
"function" === typeof returnValue.then &&
624+
(ReactSharedInternals.asyncTransitions++,
625+
returnValue.then(releaseAsyncTransition, releaseAsyncTransition),
626+
returnValue.then(noop, reportGlobalError));
627+
} catch (error) {
628+
reportGlobalError(error);
629+
} finally {
630+
null === prevTransition &&
631+
currentTransition._updatedFibers &&
632+
((scope = currentTransition._updatedFibers.size),
633+
currentTransition._updatedFibers.clear(),
634+
10 < scope &&
635+
console.warn(
636+
"Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."
637+
)),
638+
null !== prevTransition &&
639+
null !== currentTransition.types &&
640+
(null !== prevTransition.types &&
641+
prevTransition.types !== currentTransition.types &&
642+
console.error(
643+
"We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."
644+
),
645+
(prevTransition.types = currentTransition.types)),
646+
(ReactSharedInternals.T = prevTransition);
647+
}
648+
}
601649
function noop() {}
650+
function addTransitionType(type) {
651+
if (enableViewTransition) {
652+
var transition = ReactSharedInternals.T;
653+
if (null !== transition) {
654+
var transitionTypes = transition.types;
655+
null === transitionTypes
656+
? (transition.types = [type])
657+
: -1 === transitionTypes.indexOf(type) &&
658+
transitionTypes.push(type);
659+
} else
660+
0 === ReactSharedInternals.asyncTransitions &&
661+
console.error(
662+
"addTransitionType can only be called inside a `startTransition()` callback. It must be associated with a specific Transition."
663+
),
664+
startTransition(addTransitionType.bind(null, type));
665+
}
666+
}
602667
function enqueueTask(task) {
603668
if (null === enqueueTaskImpl)
604669
try {
@@ -773,8 +838,8 @@ __DEV__ &&
773838
A: null,
774839
T: null,
775840
S: null,
776-
V: null,
777841
actQueue: null,
842+
asyncTransitions: 0,
778843
isBatchingLegacy: !1,
779844
didScheduleLegacyUpdate: !1,
780845
didUsePromise: !1,
@@ -1372,52 +1437,14 @@ __DEV__ &&
13721437
});
13731438
return compare;
13741439
};
1375-
exports.startTransition = function (scope, options) {
1376-
var prevTransition = ReactSharedInternals.T,
1377-
currentTransition = {};
1378-
ReactSharedInternals.T = currentTransition;
1379-
currentTransition._updatedFibers = new Set();
1380-
enableTransitionTracing &&
1381-
void 0 !== options &&
1382-
void 0 !== options.name &&
1383-
((currentTransition.name = options.name),
1384-
(currentTransition.startTime = -1));
1385-
try {
1386-
var returnValue = scope(),
1387-
onStartTransitionFinish = ReactSharedInternals.S;
1388-
null !== onStartTransitionFinish &&
1389-
onStartTransitionFinish(currentTransition, returnValue);
1390-
"object" === typeof returnValue &&
1391-
null !== returnValue &&
1392-
"function" === typeof returnValue.then &&
1393-
returnValue.then(noop, reportGlobalError);
1394-
} catch (error) {
1395-
reportGlobalError(error);
1396-
} finally {
1397-
null === prevTransition &&
1398-
currentTransition._updatedFibers &&
1399-
((scope = currentTransition._updatedFibers.size),
1400-
currentTransition._updatedFibers.clear(),
1401-
10 < scope &&
1402-
console.warn(
1403-
"Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."
1404-
)),
1405-
(ReactSharedInternals.T = prevTransition);
1406-
}
1407-
};
1440+
exports.startTransition = startTransition;
14081441
exports.unstable_Activity = REACT_ACTIVITY_TYPE;
14091442
exports.unstable_LegacyHidden = dynamicFeatureFlags;
14101443
exports.unstable_Scope = renameElementSymbol;
14111444
exports.unstable_SuspenseList = REACT_SUSPENSE_LIST_TYPE;
14121445
exports.unstable_TracingMarker = REACT_TRACING_MARKER_TYPE;
14131446
exports.unstable_ViewTransition = REACT_VIEW_TRANSITION_TYPE;
1414-
exports.unstable_addTransitionType = function (type) {
1415-
var pendingTransitionTypes = ReactSharedInternals.V;
1416-
null === pendingTransitionTypes
1417-
? (ReactSharedInternals.V = [type])
1418-
: -1 === pendingTransitionTypes.indexOf(type) &&
1419-
pendingTransitionTypes.push(type);
1420-
};
1447+
exports.unstable_addTransitionType = addTransitionType;
14211448
exports.unstable_getCacheForType = function (resourceType) {
14221449
var dispatcher = ReactSharedInternals.A;
14231450
return dispatcher
@@ -1511,7 +1538,7 @@ __DEV__ &&
15111538
exports.useTransition = function () {
15121539
return resolveDispatcher().useTransition();
15131540
};
1514-
exports.version = "19.1.0-www-modern-313332d1-20250326";
1541+
exports.version = "19.2.0-www-modern-c498bfce-20250426";
15151542
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
15161543
"function" ===
15171544
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

0 commit comments

Comments
 (0)