Skip to content

Commit 67628e7

Browse files
committed
Warn if addTransitionType is called when there are no pending Actions (#32793)
Stacked on #32792. It's tricky to associate a specific `addTransitionType` call to a specific `startTransition` call because we don't have `AsyncContext` in browsers yet. However, we can keep track if there are any async transitions running at all, and if not, warn. This should cover most cases. This also errors when inside a React render which might be a legit way to associate a Transition Type to a specific render (e.g. based on props changing) but we want to be a more conservative about allowing that yet. If we wanted to support calling it in render, we might want to set which Transition object is currently rendering but it's still tricky if the render has `async function` components. So it might at least be restricted to sync components (like Hooks). DiffTrain build for [deca965](deca965)
1 parent 70814b1 commit 67628e7

23 files changed

+133
-92
lines changed

compiled-rn/VERSION_NATIVE_FB

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
19.2.0-native-fb-b286430c-20250331
1+
19.2.0-native-fb-deca9652-20250401

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-dev.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<5329b26e083ced8e01ca71d18411534c>>
10+
* @generated SignedSource<<803fd46b3166276b31d08d0133d3ec20>>
1111
*/
1212

1313
"use strict";
@@ -404,5 +404,5 @@ __DEV__ &&
404404
exports.useFormStatus = function () {
405405
return resolveDispatcher().useHostTransitionStatus();
406406
};
407-
exports.version = "19.2.0-native-fb-b286430c-20250331";
407+
exports.version = "19.2.0-native-fb-deca9652-20250401";
408408
})();

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-prod.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<a7139f6c4e605c1ce49060e28fdc3973>>
10+
* @generated SignedSource<<882ab99202282c0a9d015739d9271881>>
1111
*/
1212

1313
"use strict";
@@ -203,4 +203,4 @@ exports.useFormState = function (action, initialState, permalink) {
203203
exports.useFormStatus = function () {
204204
return ReactSharedInternals.H.useHostTransitionStatus();
205205
};
206-
exports.version = "19.2.0-native-fb-b286430c-20250331";
206+
exports.version = "19.2.0-native-fb-deca9652-20250401";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-profiling.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<a7139f6c4e605c1ce49060e28fdc3973>>
10+
* @generated SignedSource<<882ab99202282c0a9d015739d9271881>>
1111
*/
1212

1313
"use strict";
@@ -203,4 +203,4 @@ exports.useFormState = function (action, initialState, permalink) {
203203
exports.useFormStatus = function () {
204204
return ReactSharedInternals.H.useHostTransitionStatus();
205205
};
206-
exports.version = "19.2.0-native-fb-b286430c-20250331";
206+
exports.version = "19.2.0-native-fb-deca9652-20250401";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMClient-dev.js

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<c489d87a7728ce8717f15f5330525f3d>>
10+
* @generated SignedSource<<ed17a76810dddcd4c7fa661ff930c5ae>>
1111
*/
1212

1313
/*
@@ -7565,7 +7565,9 @@ __DEV__ &&
75657565
null !== returnValue &&
75667566
"object" === typeof returnValue &&
75677567
"function" === typeof returnValue.then
7568-
? (returnValue.then(
7568+
? (ReactSharedInternals.asyncTransitions++,
7569+
returnValue.then(releaseAsyncTransition, releaseAsyncTransition),
7570+
returnValue.then(
75697571
function (nextState) {
75707572
onActionSuccess(actionQueue, node, nextState);
75717573
},
@@ -7964,6 +7966,9 @@ __DEV__ &&
79647966
workInProgressRootSkippedLanes |= hook;
79657967
return prevValue;
79667968
}
7969+
function releaseAsyncTransition() {
7970+
ReactSharedInternals.asyncTransitions--;
7971+
}
79677972
function startTransition(
79687973
fiber,
79697974
queue,
@@ -7991,6 +7996,8 @@ __DEV__ &&
79917996
"object" === typeof returnValue &&
79927997
"function" === typeof returnValue.then
79937998
) {
7999+
ReactSharedInternals.asyncTransitions++;
8000+
returnValue.then(releaseAsyncTransition, releaseAsyncTransition);
79948001
var thenableForFinishedState = chainThenableValue(
79958002
returnValue,
79968003
finishedState
@@ -25668,11 +25675,11 @@ __DEV__ &&
2566825675
};
2566925676
(function () {
2567025677
var isomorphicReactPackageVersion = React.version;
25671-
if ("19.2.0-native-fb-b286430c-20250331" !== isomorphicReactPackageVersion)
25678+
if ("19.2.0-native-fb-deca9652-20250401" !== isomorphicReactPackageVersion)
2567225679
throw Error(
2567325680
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
2567425681
(isomorphicReactPackageVersion +
25675-
"\n - react-dom: 19.2.0-native-fb-b286430c-20250331\nLearn more: https://react.dev/warnings/version-mismatch")
25682+
"\n - react-dom: 19.2.0-native-fb-deca9652-20250401\nLearn more: https://react.dev/warnings/version-mismatch")
2567625683
);
2567725684
})();
2567825685
("function" === typeof Map &&
@@ -25709,10 +25716,10 @@ __DEV__ &&
2570925716
!(function () {
2571025717
var internals = {
2571125718
bundleType: 1,
25712-
version: "19.2.0-native-fb-b286430c-20250331",
25719+
version: "19.2.0-native-fb-deca9652-20250401",
2571325720
rendererPackageName: "react-dom",
2571425721
currentDispatcherRef: ReactSharedInternals,
25715-
reconcilerVersion: "19.2.0-native-fb-b286430c-20250331"
25722+
reconcilerVersion: "19.2.0-native-fb-deca9652-20250401"
2571625723
};
2571725724
internals.overrideHookState = overrideHookState;
2571825725
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -25856,5 +25863,5 @@ __DEV__ &&
2585625863
listenToAllSupportedEvents(container);
2585725864
return new ReactDOMHydrationRoot(initialChildren);
2585825865
};
25859-
exports.version = "19.2.0-native-fb-b286430c-20250331";
25866+
exports.version = "19.2.0-native-fb-deca9652-20250401";
2586025867
})();

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMClient-prod.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<ff374b046de583603d8eb78eec0d1aa4>>
10+
* @generated SignedSource<<7fa9bfe51aa88c5fd2d798f95a78d6c1>>
1111
*/
1212

1313
/*
@@ -15983,14 +15983,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
1598315983
};
1598415984
var isomorphicReactPackageVersion$jscomp$inline_1796 = React.version;
1598515985
if (
15986-
"19.2.0-native-fb-b286430c-20250331" !==
15986+
"19.2.0-native-fb-deca9652-20250401" !==
1598715987
isomorphicReactPackageVersion$jscomp$inline_1796
1598815988
)
1598915989
throw Error(
1599015990
formatProdErrorMessage(
1599115991
527,
1599215992
isomorphicReactPackageVersion$jscomp$inline_1796,
15993-
"19.2.0-native-fb-b286430c-20250331"
15993+
"19.2.0-native-fb-deca9652-20250401"
1599415994
)
1599515995
);
1599615996
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
@@ -16012,10 +16012,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
1601216012
};
1601316013
var internals$jscomp$inline_2246 = {
1601416014
bundleType: 0,
16015-
version: "19.2.0-native-fb-b286430c-20250331",
16015+
version: "19.2.0-native-fb-deca9652-20250401",
1601616016
rendererPackageName: "react-dom",
1601716017
currentDispatcherRef: ReactSharedInternals,
16018-
reconcilerVersion: "19.2.0-native-fb-b286430c-20250331"
16018+
reconcilerVersion: "19.2.0-native-fb-deca9652-20250401"
1601916019
};
1602016020
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
1602116021
var hook$jscomp$inline_2247 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -16119,4 +16119,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
1611916119
listenToAllSupportedEvents(container);
1612016120
return new ReactDOMHydrationRoot(initialChildren);
1612116121
};
16122-
exports.version = "19.2.0-native-fb-b286430c-20250331";
16122+
exports.version = "19.2.0-native-fb-deca9652-20250401";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMClient-profiling.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<7b526f635c5f93fa8e8e3d4bb6eb6b0c>>
10+
* @generated SignedSource<<a7a52cf058c75109625c626d09a39836>>
1111
*/
1212

1313
/*
@@ -16631,14 +16631,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
1663116631
};
1663216632
var isomorphicReactPackageVersion$jscomp$inline_1891 = React.version;
1663316633
if (
16634-
"19.2.0-native-fb-b286430c-20250331" !==
16634+
"19.2.0-native-fb-deca9652-20250401" !==
1663516635
isomorphicReactPackageVersion$jscomp$inline_1891
1663616636
)
1663716637
throw Error(
1663816638
formatProdErrorMessage(
1663916639
527,
1664016640
isomorphicReactPackageVersion$jscomp$inline_1891,
16641-
"19.2.0-native-fb-b286430c-20250331"
16641+
"19.2.0-native-fb-deca9652-20250401"
1664216642
)
1664316643
);
1664416644
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
@@ -16660,10 +16660,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
1666016660
};
1666116661
var internals$jscomp$inline_1898 = {
1666216662
bundleType: 0,
16663-
version: "19.2.0-native-fb-b286430c-20250331",
16663+
version: "19.2.0-native-fb-deca9652-20250401",
1666416664
rendererPackageName: "react-dom",
1666516665
currentDispatcherRef: ReactSharedInternals,
16666-
reconcilerVersion: "19.2.0-native-fb-b286430c-20250331",
16666+
reconcilerVersion: "19.2.0-native-fb-deca9652-20250401",
1666716667
getLaneLabelMap: function () {
1666816668
for (
1666916669
var map = new Map(), lane = 1, index$293 = 0;
@@ -16782,4 +16782,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
1678216782
listenToAllSupportedEvents(container);
1678316783
return new ReactDOMHydrationRoot(initialChildren);
1678416784
};
16785-
exports.version = "19.2.0-native-fb-b286430c-20250331";
16785+
exports.version = "19.2.0-native-fb-deca9652-20250401";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMProfiling-dev.js

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<544bf7bdd43891aa8eadf2f68a1944e0>>
10+
* @generated SignedSource<<2c4bccd5a1a1107505ca922fa0904e09>>
1111
*/
1212

1313
/*
@@ -7573,7 +7573,9 @@ __DEV__ &&
75737573
null !== returnValue &&
75747574
"object" === typeof returnValue &&
75757575
"function" === typeof returnValue.then
7576-
? (returnValue.then(
7576+
? (ReactSharedInternals.asyncTransitions++,
7577+
returnValue.then(releaseAsyncTransition, releaseAsyncTransition),
7578+
returnValue.then(
75777579
function (nextState) {
75787580
onActionSuccess(actionQueue, node, nextState);
75797581
},
@@ -7972,6 +7974,9 @@ __DEV__ &&
79727974
workInProgressRootSkippedLanes |= hook;
79737975
return prevValue;
79747976
}
7977+
function releaseAsyncTransition() {
7978+
ReactSharedInternals.asyncTransitions--;
7979+
}
79757980
function startTransition(
79767981
fiber,
79777982
queue,
@@ -7999,6 +8004,8 @@ __DEV__ &&
79998004
"object" === typeof returnValue &&
80008005
"function" === typeof returnValue.then
80018006
) {
8007+
ReactSharedInternals.asyncTransitions++;
8008+
returnValue.then(releaseAsyncTransition, releaseAsyncTransition);
80028009
var thenableForFinishedState = chainThenableValue(
80038010
returnValue,
80048011
finishedState
@@ -25729,11 +25736,11 @@ __DEV__ &&
2572925736
};
2573025737
(function () {
2573125738
var isomorphicReactPackageVersion = React.version;
25732-
if ("19.2.0-native-fb-b286430c-20250331" !== isomorphicReactPackageVersion)
25739+
if ("19.2.0-native-fb-deca9652-20250401" !== isomorphicReactPackageVersion)
2573325740
throw Error(
2573425741
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
2573525742
(isomorphicReactPackageVersion +
25736-
"\n - react-dom: 19.2.0-native-fb-b286430c-20250331\nLearn more: https://react.dev/warnings/version-mismatch")
25743+
"\n - react-dom: 19.2.0-native-fb-deca9652-20250401\nLearn more: https://react.dev/warnings/version-mismatch")
2573725744
);
2573825745
})();
2573925746
("function" === typeof Map &&
@@ -25770,10 +25777,10 @@ __DEV__ &&
2577025777
!(function () {
2577125778
var internals = {
2577225779
bundleType: 1,
25773-
version: "19.2.0-native-fb-b286430c-20250331",
25780+
version: "19.2.0-native-fb-deca9652-20250401",
2577425781
rendererPackageName: "react-dom",
2577525782
currentDispatcherRef: ReactSharedInternals,
25776-
reconcilerVersion: "19.2.0-native-fb-b286430c-20250331"
25783+
reconcilerVersion: "19.2.0-native-fb-deca9652-20250401"
2577725784
};
2577825785
internals.overrideHookState = overrideHookState;
2577925786
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -26233,7 +26240,7 @@ __DEV__ &&
2623326240
exports.useFormStatus = function () {
2623426241
return resolveDispatcher().useHostTransitionStatus();
2623526242
};
26236-
exports.version = "19.2.0-native-fb-b286430c-20250331";
26243+
exports.version = "19.2.0-native-fb-deca9652-20250401";
2623726244
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
2623826245
"function" ===
2623926246
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMProfiling-prod.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<11e5d93abb63cad663c3c3a873de9b5a>>
10+
* @generated SignedSource<<adab182d15ca3892ec29be813ee49a74>>
1111
*/
1212

1313
/*
@@ -15994,14 +15994,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
1599415994
};
1599515995
var isomorphicReactPackageVersion$jscomp$inline_1797 = React.version;
1599615996
if (
15997-
"19.2.0-native-fb-b286430c-20250331" !==
15997+
"19.2.0-native-fb-deca9652-20250401" !==
1599815998
isomorphicReactPackageVersion$jscomp$inline_1797
1599915999
)
1600016000
throw Error(
1600116001
formatProdErrorMessage(
1600216002
527,
1600316003
isomorphicReactPackageVersion$jscomp$inline_1797,
16004-
"19.2.0-native-fb-b286430c-20250331"
16004+
"19.2.0-native-fb-deca9652-20250401"
1600516005
)
1600616006
);
1600716007
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
@@ -16023,10 +16023,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
1602316023
};
1602416024
var internals$jscomp$inline_2249 = {
1602516025
bundleType: 0,
16026-
version: "19.2.0-native-fb-b286430c-20250331",
16026+
version: "19.2.0-native-fb-deca9652-20250401",
1602716027
rendererPackageName: "react-dom",
1602816028
currentDispatcherRef: ReactSharedInternals,
16029-
reconcilerVersion: "19.2.0-native-fb-b286430c-20250331"
16029+
reconcilerVersion: "19.2.0-native-fb-deca9652-20250401"
1603016030
};
1603116031
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
1603216032
var hook$jscomp$inline_2250 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -16284,4 +16284,4 @@ exports.useFormState = function (action, initialState, permalink) {
1628416284
exports.useFormStatus = function () {
1628516285
return ReactSharedInternals.H.useHostTransitionStatus();
1628616286
};
16287-
exports.version = "19.2.0-native-fb-b286430c-20250331";
16287+
exports.version = "19.2.0-native-fb-deca9652-20250401";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMProfiling-profiling.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<ce95ed93979c8a60e4e9c28b0756831f>>
10+
* @generated SignedSource<<e9ced66ccb568a2414b16621451a08fc>>
1111
*/
1212

1313
/*
@@ -16646,14 +16646,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
1664616646
};
1664716647
var isomorphicReactPackageVersion$jscomp$inline_1892 = React.version;
1664816648
if (
16649-
"19.2.0-native-fb-b286430c-20250331" !==
16649+
"19.2.0-native-fb-deca9652-20250401" !==
1665016650
isomorphicReactPackageVersion$jscomp$inline_1892
1665116651
)
1665216652
throw Error(
1665316653
formatProdErrorMessage(
1665416654
527,
1665516655
isomorphicReactPackageVersion$jscomp$inline_1892,
16656-
"19.2.0-native-fb-b286430c-20250331"
16656+
"19.2.0-native-fb-deca9652-20250401"
1665716657
)
1665816658
);
1665916659
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
@@ -16675,10 +16675,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
1667516675
};
1667616676
var internals$jscomp$inline_1899 = {
1667716677
bundleType: 0,
16678-
version: "19.2.0-native-fb-b286430c-20250331",
16678+
version: "19.2.0-native-fb-deca9652-20250401",
1667916679
rendererPackageName: "react-dom",
1668016680
currentDispatcherRef: ReactSharedInternals,
16681-
reconcilerVersion: "19.2.0-native-fb-b286430c-20250331",
16681+
reconcilerVersion: "19.2.0-native-fb-deca9652-20250401",
1668216682
getLaneLabelMap: function () {
1668316683
for (
1668416684
var map = new Map(), lane = 1, index$293 = 0;
@@ -16951,7 +16951,7 @@ exports.useFormState = function (action, initialState, permalink) {
1695116951
exports.useFormStatus = function () {
1695216952
return ReactSharedInternals.H.useHostTransitionStatus();
1695316953
};
16954-
exports.version = "19.2.0-native-fb-b286430c-20250331";
16954+
exports.version = "19.2.0-native-fb-deca9652-20250401";
1695516955
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1695616956
"function" ===
1695716957
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

0 commit comments

Comments
 (0)