Skip to content

Commit 16dca21

Browse files
committed
[compiler] Fix bug w functions depending on hoisted primitives (#35284)
Fixes an edge case where a function expression would fail to take a dependency if it referenced a hoisted `const` inferred as a primitive value. We were incorrectly skipping primitve-typed operands when determing scopes for merging in InferReactiveScopeVariables. This was super tricky to debug, for posterity the trick is that Context variables (StoreContext etc) are modeled just like a mutable object, where assignment to the variable is equivalent to `object.value = ...` and reading the variable is equivalent to `object.value` property access. Comparing to an equivalent version of the repro case replaced with an object and property read/writes showed that everything was exactly right, except that InferReactiveScopeVariables wasn't merging the scopes of the function and the context variable, which led me right to the problematic line. Closes #35122 DiffTrain build for [2cb08e6](2cb08e6)
1 parent 40b90e0 commit 16dca21

23 files changed

+74
-86
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.3.0-native-fb-f99241b2-20251204
1+
19.3.0-native-fb-2cb08e65-20251205

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<<323afa1a4ada6d6e382b3c9aef7ade13>>
10+
* @generated SignedSource<<359af50665fa40e8d9afba56cd3d17df>>
1111
*/
1212

1313
"use strict";
@@ -410,5 +410,5 @@ __DEV__ &&
410410
exports.useFormStatus = function () {
411411
return resolveDispatcher().useHostTransitionStatus();
412412
};
413-
exports.version = "19.3.0-native-fb-f99241b2-20251204";
413+
exports.version = "19.3.0-native-fb-2cb08e65-20251205";
414414
})();

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<<4f10b1d5fb39c07c19d4e7e3a625c1aa>>
10+
* @generated SignedSource<<fe7884e809f0c20557d1889e366c31f4>>
1111
*/
1212

1313
"use strict";
@@ -209,4 +209,4 @@ exports.useFormState = function (action, initialState, permalink) {
209209
exports.useFormStatus = function () {
210210
return ReactSharedInternals.H.useHostTransitionStatus();
211211
};
212-
exports.version = "19.3.0-native-fb-f99241b2-20251204";
212+
exports.version = "19.3.0-native-fb-2cb08e65-20251205";

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<<4f10b1d5fb39c07c19d4e7e3a625c1aa>>
10+
* @generated SignedSource<<fe7884e809f0c20557d1889e366c31f4>>
1111
*/
1212

1313
"use strict";
@@ -209,4 +209,4 @@ exports.useFormState = function (action, initialState, permalink) {
209209
exports.useFormStatus = function () {
210210
return ReactSharedInternals.H.useHostTransitionStatus();
211211
};
212-
exports.version = "19.3.0-native-fb-f99241b2-20251204";
212+
exports.version = "19.3.0-native-fb-2cb08e65-20251205";

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<<f56c2f78b4ed17637f6b075fb0cb0e15>>
10+
* @generated SignedSource<<91b4516afc19815935509fb4f497e4ab>>
1111
*/
1212

1313
/*
@@ -30244,11 +30244,11 @@ __DEV__ &&
3024430244
};
3024530245
(function () {
3024630246
var isomorphicReactPackageVersion = React.version;
30247-
if ("19.3.0-native-fb-f99241b2-20251204" !== isomorphicReactPackageVersion)
30247+
if ("19.3.0-native-fb-2cb08e65-20251205" !== isomorphicReactPackageVersion)
3024830248
throw Error(
3024930249
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
3025030250
(isomorphicReactPackageVersion +
30251-
"\n - react-dom: 19.3.0-native-fb-f99241b2-20251204\nLearn more: https://react.dev/warnings/version-mismatch")
30251+
"\n - react-dom: 19.3.0-native-fb-2cb08e65-20251205\nLearn more: https://react.dev/warnings/version-mismatch")
3025230252
);
3025330253
})();
3025430254
("function" === typeof Map &&
@@ -30285,10 +30285,10 @@ __DEV__ &&
3028530285
!(function () {
3028630286
var internals = {
3028730287
bundleType: 1,
30288-
version: "19.3.0-native-fb-f99241b2-20251204",
30288+
version: "19.3.0-native-fb-2cb08e65-20251205",
3028930289
rendererPackageName: "react-dom",
3029030290
currentDispatcherRef: ReactSharedInternals,
30291-
reconcilerVersion: "19.3.0-native-fb-f99241b2-20251204"
30291+
reconcilerVersion: "19.3.0-native-fb-2cb08e65-20251205"
3029230292
};
3029330293
internals.overrideHookState = overrideHookState;
3029430294
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -30438,5 +30438,5 @@ __DEV__ &&
3043830438
listenToAllSupportedEvents(container);
3043930439
return new ReactDOMHydrationRoot(initialChildren);
3044030440
};
30441-
exports.version = "19.3.0-native-fb-f99241b2-20251204";
30441+
exports.version = "19.3.0-native-fb-2cb08e65-20251205";
3044230442
})();

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<<ef3ebc45110c5b9ba0b9180cd3d2a041>>
10+
* @generated SignedSource<<84db0c72f5b1e098cd289844d4dd433a>>
1111
*/
1212

1313
/*
@@ -17707,14 +17707,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
1770717707
};
1770817708
var isomorphicReactPackageVersion$jscomp$inline_2054 = React.version;
1770917709
if (
17710-
"19.3.0-native-fb-f99241b2-20251204" !==
17710+
"19.3.0-native-fb-2cb08e65-20251205" !==
1771117711
isomorphicReactPackageVersion$jscomp$inline_2054
1771217712
)
1771317713
throw Error(
1771417714
formatProdErrorMessage(
1771517715
527,
1771617716
isomorphicReactPackageVersion$jscomp$inline_2054,
17717-
"19.3.0-native-fb-f99241b2-20251204"
17717+
"19.3.0-native-fb-2cb08e65-20251205"
1771817718
)
1771917719
);
1772017720
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
@@ -17736,10 +17736,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
1773617736
};
1773717737
var internals$jscomp$inline_2636 = {
1773817738
bundleType: 0,
17739-
version: "19.3.0-native-fb-f99241b2-20251204",
17739+
version: "19.3.0-native-fb-2cb08e65-20251205",
1774017740
rendererPackageName: "react-dom",
1774117741
currentDispatcherRef: ReactSharedInternals,
17742-
reconcilerVersion: "19.3.0-native-fb-f99241b2-20251204"
17742+
reconcilerVersion: "19.3.0-native-fb-2cb08e65-20251205"
1774317743
};
1774417744
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
1774517745
var hook$jscomp$inline_2637 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -17846,4 +17846,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
1784617846
listenToAllSupportedEvents(container);
1784717847
return new ReactDOMHydrationRoot(initialChildren);
1784817848
};
17849-
exports.version = "19.3.0-native-fb-f99241b2-20251204";
17849+
exports.version = "19.3.0-native-fb-2cb08e65-20251205";

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<<c0cfd805d6d581fcd8851857e015b7ab>>
10+
* @generated SignedSource<<bde44458a6907f194d3b29384823d5be>>
1111
*/
1212

1313
/*
@@ -19833,14 +19833,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
1983319833
};
1983419834
var isomorphicReactPackageVersion$jscomp$inline_2369 = React.version;
1983519835
if (
19836-
"19.3.0-native-fb-f99241b2-20251204" !==
19836+
"19.3.0-native-fb-2cb08e65-20251205" !==
1983719837
isomorphicReactPackageVersion$jscomp$inline_2369
1983819838
)
1983919839
throw Error(
1984019840
formatProdErrorMessage(
1984119841
527,
1984219842
isomorphicReactPackageVersion$jscomp$inline_2369,
19843-
"19.3.0-native-fb-f99241b2-20251204"
19843+
"19.3.0-native-fb-2cb08e65-20251205"
1984419844
)
1984519845
);
1984619846
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
@@ -19862,10 +19862,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
1986219862
};
1986319863
var internals$jscomp$inline_2376 = {
1986419864
bundleType: 0,
19865-
version: "19.3.0-native-fb-f99241b2-20251204",
19865+
version: "19.3.0-native-fb-2cb08e65-20251205",
1986619866
rendererPackageName: "react-dom",
1986719867
currentDispatcherRef: ReactSharedInternals,
19868-
reconcilerVersion: "19.3.0-native-fb-f99241b2-20251204",
19868+
reconcilerVersion: "19.3.0-native-fb-2cb08e65-20251205",
1986919869
getLaneLabelMap: function () {
1987019870
for (
1987119871
var map = new Map(), lane = 1, index$336 = 0;
@@ -19988,4 +19988,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
1998819988
listenToAllSupportedEvents(container);
1998919989
return new ReactDOMHydrationRoot(initialChildren);
1999019990
};
19991-
exports.version = "19.3.0-native-fb-f99241b2-20251204";
19991+
exports.version = "19.3.0-native-fb-2cb08e65-20251205";

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<<92d09773320ee9e8e1cba021be4de9df>>
10+
* @generated SignedSource<<30284aafa64330431609a4af830af812>>
1111
*/
1212

1313
/*
@@ -30306,11 +30306,11 @@ __DEV__ &&
3030630306
};
3030730307
(function () {
3030830308
var isomorphicReactPackageVersion = React.version;
30309-
if ("19.3.0-native-fb-f99241b2-20251204" !== isomorphicReactPackageVersion)
30309+
if ("19.3.0-native-fb-2cb08e65-20251205" !== isomorphicReactPackageVersion)
3031030310
throw Error(
3031130311
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
3031230312
(isomorphicReactPackageVersion +
30313-
"\n - react-dom: 19.3.0-native-fb-f99241b2-20251204\nLearn more: https://react.dev/warnings/version-mismatch")
30313+
"\n - react-dom: 19.3.0-native-fb-2cb08e65-20251205\nLearn more: https://react.dev/warnings/version-mismatch")
3031430314
);
3031530315
})();
3031630316
("function" === typeof Map &&
@@ -30347,10 +30347,10 @@ __DEV__ &&
3034730347
!(function () {
3034830348
var internals = {
3034930349
bundleType: 1,
30350-
version: "19.3.0-native-fb-f99241b2-20251204",
30350+
version: "19.3.0-native-fb-2cb08e65-20251205",
3035130351
rendererPackageName: "react-dom",
3035230352
currentDispatcherRef: ReactSharedInternals,
30353-
reconcilerVersion: "19.3.0-native-fb-f99241b2-20251204"
30353+
reconcilerVersion: "19.3.0-native-fb-2cb08e65-20251205"
3035430354
};
3035530355
internals.overrideHookState = overrideHookState;
3035630356
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -30816,7 +30816,7 @@ __DEV__ &&
3081630816
exports.useFormStatus = function () {
3081730817
return resolveDispatcher().useHostTransitionStatus();
3081830818
};
30819-
exports.version = "19.3.0-native-fb-f99241b2-20251204";
30819+
exports.version = "19.3.0-native-fb-2cb08e65-20251205";
3082030820
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
3082130821
"function" ===
3082230822
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<<8fa5b1f67597058222cd09689555a7fe>>
10+
* @generated SignedSource<<4144f99b7d54c9fcb8140151e8e56439>>
1111
*/
1212

1313
/*
@@ -17724,14 +17724,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
1772417724
};
1772517725
var isomorphicReactPackageVersion$jscomp$inline_2055 = React.version;
1772617726
if (
17727-
"19.3.0-native-fb-f99241b2-20251204" !==
17727+
"19.3.0-native-fb-2cb08e65-20251205" !==
1772817728
isomorphicReactPackageVersion$jscomp$inline_2055
1772917729
)
1773017730
throw Error(
1773117731
formatProdErrorMessage(
1773217732
527,
1773317733
isomorphicReactPackageVersion$jscomp$inline_2055,
17734-
"19.3.0-native-fb-f99241b2-20251204"
17734+
"19.3.0-native-fb-2cb08e65-20251205"
1773517735
)
1773617736
);
1773717737
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
@@ -17753,10 +17753,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
1775317753
};
1775417754
var internals$jscomp$inline_2639 = {
1775517755
bundleType: 0,
17756-
version: "19.3.0-native-fb-f99241b2-20251204",
17756+
version: "19.3.0-native-fb-2cb08e65-20251205",
1775717757
rendererPackageName: "react-dom",
1775817758
currentDispatcherRef: ReactSharedInternals,
17759-
reconcilerVersion: "19.3.0-native-fb-f99241b2-20251204"
17759+
reconcilerVersion: "19.3.0-native-fb-2cb08e65-20251205"
1776017760
};
1776117761
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
1776217762
var hook$jscomp$inline_2640 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -18016,4 +18016,4 @@ exports.useFormState = function (action, initialState, permalink) {
1801618016
exports.useFormStatus = function () {
1801718017
return ReactSharedInternals.H.useHostTransitionStatus();
1801818018
};
18019-
exports.version = "19.3.0-native-fb-f99241b2-20251204";
18019+
exports.version = "19.3.0-native-fb-2cb08e65-20251205";

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<<6313f1a5b0b16cc51898f8891f822761>>
10+
* @generated SignedSource<<5905dd71a81a8557a86607f23fe819b1>>
1111
*/
1212

1313
/*
@@ -19854,14 +19854,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
1985419854
};
1985519855
var isomorphicReactPackageVersion$jscomp$inline_2370 = React.version;
1985619856
if (
19857-
"19.3.0-native-fb-f99241b2-20251204" !==
19857+
"19.3.0-native-fb-2cb08e65-20251205" !==
1985819858
isomorphicReactPackageVersion$jscomp$inline_2370
1985919859
)
1986019860
throw Error(
1986119861
formatProdErrorMessage(
1986219862
527,
1986319863
isomorphicReactPackageVersion$jscomp$inline_2370,
19864-
"19.3.0-native-fb-f99241b2-20251204"
19864+
"19.3.0-native-fb-2cb08e65-20251205"
1986519865
)
1986619866
);
1986719867
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
@@ -19883,10 +19883,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
1988319883
};
1988419884
var internals$jscomp$inline_2377 = {
1988519885
bundleType: 0,
19886-
version: "19.3.0-native-fb-f99241b2-20251204",
19886+
version: "19.3.0-native-fb-2cb08e65-20251205",
1988719887
rendererPackageName: "react-dom",
1988819888
currentDispatcherRef: ReactSharedInternals,
19889-
reconcilerVersion: "19.3.0-native-fb-f99241b2-20251204",
19889+
reconcilerVersion: "19.3.0-native-fb-2cb08e65-20251205",
1989019890
getLaneLabelMap: function () {
1989119891
for (
1989219892
var map = new Map(), lane = 1, index$336 = 0;
@@ -20162,7 +20162,7 @@ exports.useFormState = function (action, initialState, permalink) {
2016220162
exports.useFormStatus = function () {
2016320163
return ReactSharedInternals.H.useHostTransitionStatus();
2016420164
};
20165-
exports.version = "19.3.0-native-fb-f99241b2-20251204";
20165+
exports.version = "19.3.0-native-fb-2cb08e65-20251205";
2016620166
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
2016720167
"function" ===
2016820168
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

0 commit comments

Comments
 (0)