Skip to content

Commit def8123

Browse files
committed
[compiler] enablePreserveMemo treats manual deps as non-nullable (#34503)
The `@enablePreserveExistingMemoizationGuarantees` mode can still fail to preserve manual memoization due to mismtached dependencies. Specifically, where the user's dependencies are more precise than the compiler infers bc the compiler is being conservative about what might be nullable. In this mode though we're intentionally using information from the manual memoization and can also rely on the deps as a signal for what's non-nullable. The idea of the PR is that we treat manual memo deps just like other inferred-as-non-nullable objects during PropagateScopeDeps. We're careful to not treat the full path as non-nullable, only up to the last property index. So `x.y.z` as a manual dep treats `x` and `x.y` as non-nullable, allowing us to preserve a conditional dependency on `x.y.z`. Optionals within manual dependencies are a bit trickier and aren't handled yet, but hopefully that's less common and something we can improve in a follow-up. Not handling them just means that developers may hit false positives on validating existing memoization if they use optional chains in manual dependencies. --- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/react/pull/34503). * #34689 * __->__ #34503 DiffTrain build for [57d5a59](57d5a59)
1 parent 44686cc commit def8123

26 files changed

+135
-89
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-ae74234e-20251001
1+
19.3.0-native-fb-57d5a597-20251002

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<<8c7bbb1b7da61fe0c31aa4bc3d973f31>>
10+
* @generated SignedSource<<44a58f1c25f5d340803e6a2f02d44d58>>
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-ae74234e-20251001";
407+
exports.version = "19.3.0-native-fb-57d5a597-20251002";
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<<c4a7d61291385a50bd4e9432bfd69b65>>
10+
* @generated SignedSource<<d4734ed2e0b7fa344b87331c99ca6536>>
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-ae74234e-20251001";
206+
exports.version = "19.3.0-native-fb-57d5a597-20251002";

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<<c4a7d61291385a50bd4e9432bfd69b65>>
10+
* @generated SignedSource<<d4734ed2e0b7fa344b87331c99ca6536>>
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-ae74234e-20251001";
206+
exports.version = "19.3.0-native-fb-57d5a597-20251002";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMClient-dev.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<<0cceebe14b823fb2b4a752c96f542990>>
10+
* @generated SignedSource<<91b00c527532a1488188e3b7fba59e1d>>
1111
*/
1212

1313
/*
@@ -30061,11 +30061,11 @@ __DEV__ &&
3006130061
};
3006230062
(function () {
3006330063
var isomorphicReactPackageVersion = React.version;
30064-
if ("19.2.0-native-fb-ae74234e-20251001" !== isomorphicReactPackageVersion)
30064+
if ("19.3.0-native-fb-57d5a597-20251002" !== isomorphicReactPackageVersion)
3006530065
throw Error(
3006630066
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
3006730067
(isomorphicReactPackageVersion +
30068-
"\n - react-dom: 19.2.0-native-fb-ae74234e-20251001\nLearn more: https://react.dev/warnings/version-mismatch")
30068+
"\n - react-dom: 19.3.0-native-fb-57d5a597-20251002\nLearn more: https://react.dev/warnings/version-mismatch")
3006930069
);
3007030070
})();
3007130071
("function" === typeof Map &&
@@ -30102,10 +30102,10 @@ __DEV__ &&
3010230102
!(function () {
3010330103
var internals = {
3010430104
bundleType: 1,
30105-
version: "19.2.0-native-fb-ae74234e-20251001",
30105+
version: "19.3.0-native-fb-57d5a597-20251002",
3010630106
rendererPackageName: "react-dom",
3010730107
currentDispatcherRef: ReactSharedInternals,
30108-
reconcilerVersion: "19.2.0-native-fb-ae74234e-20251001"
30108+
reconcilerVersion: "19.3.0-native-fb-57d5a597-20251002"
3010930109
};
3011030110
internals.overrideHookState = overrideHookState;
3011130111
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -30255,5 +30255,5 @@ __DEV__ &&
3025530255
listenToAllSupportedEvents(container);
3025630256
return new ReactDOMHydrationRoot(initialChildren);
3025730257
};
30258-
exports.version = "19.2.0-native-fb-ae74234e-20251001";
30258+
exports.version = "19.3.0-native-fb-57d5a597-20251002";
3025930259
})();

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<<ff4ac2ea3404d6bae9ec6dcac83dbf0c>>
10+
* @generated SignedSource<<11b6ad11c4ce1326f6620ffcd53ce388>>
1111
*/
1212

1313
/*
@@ -17578,14 +17578,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
1757817578
};
1757917579
var isomorphicReactPackageVersion$jscomp$inline_2059 = React.version;
1758017580
if (
17581-
"19.2.0-native-fb-ae74234e-20251001" !==
17581+
"19.3.0-native-fb-57d5a597-20251002" !==
1758217582
isomorphicReactPackageVersion$jscomp$inline_2059
1758317583
)
1758417584
throw Error(
1758517585
formatProdErrorMessage(
1758617586
527,
1758717587
isomorphicReactPackageVersion$jscomp$inline_2059,
17588-
"19.2.0-native-fb-ae74234e-20251001"
17588+
"19.3.0-native-fb-57d5a597-20251002"
1758917589
)
1759017590
);
1759117591
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
@@ -17607,10 +17607,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
1760717607
};
1760817608
var internals$jscomp$inline_2636 = {
1760917609
bundleType: 0,
17610-
version: "19.2.0-native-fb-ae74234e-20251001",
17610+
version: "19.3.0-native-fb-57d5a597-20251002",
1761117611
rendererPackageName: "react-dom",
1761217612
currentDispatcherRef: ReactSharedInternals,
17613-
reconcilerVersion: "19.2.0-native-fb-ae74234e-20251001"
17613+
reconcilerVersion: "19.3.0-native-fb-57d5a597-20251002"
1761417614
};
1761517615
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
1761617616
var hook$jscomp$inline_2637 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -17717,4 +17717,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
1771717717
listenToAllSupportedEvents(container);
1771817718
return new ReactDOMHydrationRoot(initialChildren);
1771917719
};
17720-
exports.version = "19.2.0-native-fb-ae74234e-20251001";
17720+
exports.version = "19.3.0-native-fb-57d5a597-20251002";

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<<4887fd747289f8cd1f3cb68a2b04b490>>
10+
* @generated SignedSource<<3f4913ddb2ace3afebef375803f9c060>>
1111
*/
1212

1313
/*
@@ -19716,14 +19716,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
1971619716
};
1971719717
var isomorphicReactPackageVersion$jscomp$inline_2374 = React.version;
1971819718
if (
19719-
"19.2.0-native-fb-ae74234e-20251001" !==
19719+
"19.3.0-native-fb-57d5a597-20251002" !==
1972019720
isomorphicReactPackageVersion$jscomp$inline_2374
1972119721
)
1972219722
throw Error(
1972319723
formatProdErrorMessage(
1972419724
527,
1972519725
isomorphicReactPackageVersion$jscomp$inline_2374,
19726-
"19.2.0-native-fb-ae74234e-20251001"
19726+
"19.3.0-native-fb-57d5a597-20251002"
1972719727
)
1972819728
);
1972919729
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
@@ -19745,10 +19745,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
1974519745
};
1974619746
var internals$jscomp$inline_2381 = {
1974719747
bundleType: 0,
19748-
version: "19.2.0-native-fb-ae74234e-20251001",
19748+
version: "19.3.0-native-fb-57d5a597-20251002",
1974919749
rendererPackageName: "react-dom",
1975019750
currentDispatcherRef: ReactSharedInternals,
19751-
reconcilerVersion: "19.2.0-native-fb-ae74234e-20251001",
19751+
reconcilerVersion: "19.3.0-native-fb-57d5a597-20251002",
1975219752
getLaneLabelMap: function () {
1975319753
for (
1975419754
var map = new Map(), lane = 1, index$331 = 0;
@@ -19871,4 +19871,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
1987119871
listenToAllSupportedEvents(container);
1987219872
return new ReactDOMHydrationRoot(initialChildren);
1987319873
};
19874-
exports.version = "19.2.0-native-fb-ae74234e-20251001";
19874+
exports.version = "19.3.0-native-fb-57d5a597-20251002";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMProfiling-dev.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<<135c96374256ecad4d89ffdf56a29046>>
10+
* @generated SignedSource<<dc93e27f80d641970f9c9b52e8c38767>>
1111
*/
1212

1313
/*
@@ -30117,11 +30117,11 @@ __DEV__ &&
3011730117
};
3011830118
(function () {
3011930119
var isomorphicReactPackageVersion = React.version;
30120-
if ("19.2.0-native-fb-ae74234e-20251001" !== isomorphicReactPackageVersion)
30120+
if ("19.3.0-native-fb-57d5a597-20251002" !== isomorphicReactPackageVersion)
3012130121
throw Error(
3012230122
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
3012330123
(isomorphicReactPackageVersion +
30124-
"\n - react-dom: 19.2.0-native-fb-ae74234e-20251001\nLearn more: https://react.dev/warnings/version-mismatch")
30124+
"\n - react-dom: 19.3.0-native-fb-57d5a597-20251002\nLearn more: https://react.dev/warnings/version-mismatch")
3012530125
);
3012630126
})();
3012730127
("function" === typeof Map &&
@@ -30158,10 +30158,10 @@ __DEV__ &&
3015830158
!(function () {
3015930159
var internals = {
3016030160
bundleType: 1,
30161-
version: "19.2.0-native-fb-ae74234e-20251001",
30161+
version: "19.3.0-native-fb-57d5a597-20251002",
3016230162
rendererPackageName: "react-dom",
3016330163
currentDispatcherRef: ReactSharedInternals,
30164-
reconcilerVersion: "19.2.0-native-fb-ae74234e-20251001"
30164+
reconcilerVersion: "19.3.0-native-fb-57d5a597-20251002"
3016530165
};
3016630166
internals.overrideHookState = overrideHookState;
3016730167
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -30627,7 +30627,7 @@ __DEV__ &&
3062730627
exports.useFormStatus = function () {
3062830628
return resolveDispatcher().useHostTransitionStatus();
3062930629
};
30630-
exports.version = "19.2.0-native-fb-ae74234e-20251001";
30630+
exports.version = "19.3.0-native-fb-57d5a597-20251002";
3063130631
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
3063230632
"function" ===
3063330633
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<<fdbd86fccbb29ada5169972a10e04177>>
10+
* @generated SignedSource<<4ff8a16c21a2635e6f0d627adcfbccdf>>
1111
*/
1212

1313
/*
@@ -17589,14 +17589,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
1758917589
};
1759017590
var isomorphicReactPackageVersion$jscomp$inline_2060 = React.version;
1759117591
if (
17592-
"19.2.0-native-fb-ae74234e-20251001" !==
17592+
"19.3.0-native-fb-57d5a597-20251002" !==
1759317593
isomorphicReactPackageVersion$jscomp$inline_2060
1759417594
)
1759517595
throw Error(
1759617596
formatProdErrorMessage(
1759717597
527,
1759817598
isomorphicReactPackageVersion$jscomp$inline_2060,
17599-
"19.2.0-native-fb-ae74234e-20251001"
17599+
"19.3.0-native-fb-57d5a597-20251002"
1760017600
)
1760117601
);
1760217602
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
@@ -17618,10 +17618,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
1761817618
};
1761917619
var internals$jscomp$inline_2639 = {
1762017620
bundleType: 0,
17621-
version: "19.2.0-native-fb-ae74234e-20251001",
17621+
version: "19.3.0-native-fb-57d5a597-20251002",
1762217622
rendererPackageName: "react-dom",
1762317623
currentDispatcherRef: ReactSharedInternals,
17624-
reconcilerVersion: "19.2.0-native-fb-ae74234e-20251001"
17624+
reconcilerVersion: "19.3.0-native-fb-57d5a597-20251002"
1762517625
};
1762617626
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
1762717627
var hook$jscomp$inline_2640 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -17881,4 +17881,4 @@ exports.useFormState = function (action, initialState, permalink) {
1788117881
exports.useFormStatus = function () {
1788217882
return ReactSharedInternals.H.useHostTransitionStatus();
1788317883
};
17884-
exports.version = "19.2.0-native-fb-ae74234e-20251001";
17884+
exports.version = "19.3.0-native-fb-57d5a597-20251002";

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<<489a3a3e0993130a45f60933bdd9d15c>>
10+
* @generated SignedSource<<270cae553112e9c9d9146f1123e105ca>>
1111
*/
1212

1313
/*
@@ -19731,14 +19731,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
1973119731
};
1973219732
var isomorphicReactPackageVersion$jscomp$inline_2375 = React.version;
1973319733
if (
19734-
"19.2.0-native-fb-ae74234e-20251001" !==
19734+
"19.3.0-native-fb-57d5a597-20251002" !==
1973519735
isomorphicReactPackageVersion$jscomp$inline_2375
1973619736
)
1973719737
throw Error(
1973819738
formatProdErrorMessage(
1973919739
527,
1974019740
isomorphicReactPackageVersion$jscomp$inline_2375,
19741-
"19.2.0-native-fb-ae74234e-20251001"
19741+
"19.3.0-native-fb-57d5a597-20251002"
1974219742
)
1974319743
);
1974419744
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
@@ -19760,10 +19760,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
1976019760
};
1976119761
var internals$jscomp$inline_2382 = {
1976219762
bundleType: 0,
19763-
version: "19.2.0-native-fb-ae74234e-20251001",
19763+
version: "19.3.0-native-fb-57d5a597-20251002",
1976419764
rendererPackageName: "react-dom",
1976519765
currentDispatcherRef: ReactSharedInternals,
19766-
reconcilerVersion: "19.2.0-native-fb-ae74234e-20251001",
19766+
reconcilerVersion: "19.3.0-native-fb-57d5a597-20251002",
1976719767
getLaneLabelMap: function () {
1976819768
for (
1976919769
var map = new Map(), lane = 1, index$331 = 0;
@@ -20039,7 +20039,7 @@ exports.useFormState = function (action, initialState, permalink) {
2003920039
exports.useFormStatus = function () {
2004020040
return ReactSharedInternals.H.useHostTransitionStatus();
2004120041
};
20042-
exports.version = "19.2.0-native-fb-ae74234e-20251001";
20042+
exports.version = "19.3.0-native-fb-57d5a597-20251002";
2004320043
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
2004420044
"function" ===
2004520045
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

0 commit comments

Comments
 (0)