Skip to content

Commit c20e647

Browse files
committed
[compiler] ValidateExhaustiveDeps disallows unnecessary non-reactive deps (facebook#34472)
Just to be consistent, we disallow unnecessary deps even if they're known to be non-reactive. DiffTrain build for [40b4a5b](facebook@40b4a5b)
1 parent d01c7a5 commit c20e647

23 files changed

+2454
-464
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-194c12d9-20251118
1+
19.3.0-native-fb-40b4a5bf-20251120

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

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

1313
"use strict";
@@ -20,25 +20,30 @@ __DEV__ &&
2020
function createPortal$1(children, containerInfo, implementation) {
2121
var key =
2222
3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;
23-
try {
24-
testStringCoercion(key);
25-
var JSCompiler_inline_result = !1;
26-
} catch (e) {
27-
JSCompiler_inline_result = !0;
23+
if (null == key) key = null;
24+
else if (key === REACT_OPTIMISTIC_KEY) key = REACT_OPTIMISTIC_KEY;
25+
else {
26+
try {
27+
testStringCoercion(key);
28+
var JSCompiler_inline_result = !1;
29+
} catch (e) {
30+
JSCompiler_inline_result = !0;
31+
}
32+
JSCompiler_inline_result &&
33+
(console.error(
34+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
35+
("function" === typeof Symbol &&
36+
Symbol.toStringTag &&
37+
key[Symbol.toStringTag]) ||
38+
key.constructor.name ||
39+
"Object"
40+
),
41+
testStringCoercion(key));
42+
key = "" + key;
2843
}
29-
JSCompiler_inline_result &&
30-
(console.error(
31-
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
32-
("function" === typeof Symbol &&
33-
Symbol.toStringTag &&
34-
key[Symbol.toStringTag]) ||
35-
key.constructor.name ||
36-
"Object"
37-
),
38-
testStringCoercion(key));
3944
return {
4045
$$typeof: REACT_PORTAL_TYPE,
41-
key: null == key ? null : "" + key,
46+
key: key,
4247
children: children,
4348
containerInfo: containerInfo,
4449
implementation: implementation
@@ -100,6 +105,7 @@ __DEV__ &&
100105
findDOMNode: null
101106
},
102107
REACT_PORTAL_TYPE = Symbol.for("react.portal"),
108+
REACT_OPTIMISTIC_KEY = Symbol.for("react.optimistic_key"),
103109
ReactSharedInternals =
104110
React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
105111
("function" === typeof Map &&
@@ -404,5 +410,5 @@ __DEV__ &&
404410
exports.useFormStatus = function () {
405411
return resolveDispatcher().useHostTransitionStatus();
406412
};
407-
exports.version = "19.3.0-native-fb-194c12d9-20251118";
413+
exports.version = "19.3.0-native-fb-40b4a5bf-20251120";
408414
})();

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

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

1313
"use strict";
@@ -45,13 +45,19 @@ var Internals = {
4545
p: 0,
4646
findDOMNode: null
4747
},
48-
REACT_PORTAL_TYPE = Symbol.for("react.portal");
48+
REACT_PORTAL_TYPE = Symbol.for("react.portal"),
49+
REACT_OPTIMISTIC_KEY = Symbol.for("react.optimistic_key");
4950
function createPortal$1(children, containerInfo, implementation) {
5051
var key =
5152
3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;
5253
return {
5354
$$typeof: REACT_PORTAL_TYPE,
54-
key: null == key ? null : "" + key,
55+
key:
56+
null == key
57+
? null
58+
: key === REACT_OPTIMISTIC_KEY
59+
? REACT_OPTIMISTIC_KEY
60+
: "" + key,
5561
children: children,
5662
containerInfo: containerInfo,
5763
implementation: implementation
@@ -203,4 +209,4 @@ exports.useFormState = function (action, initialState, permalink) {
203209
exports.useFormStatus = function () {
204210
return ReactSharedInternals.H.useHostTransitionStatus();
205211
};
206-
exports.version = "19.3.0-native-fb-194c12d9-20251118";
212+
exports.version = "19.3.0-native-fb-40b4a5bf-20251120";

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

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

1313
"use strict";
@@ -45,13 +45,19 @@ var Internals = {
4545
p: 0,
4646
findDOMNode: null
4747
},
48-
REACT_PORTAL_TYPE = Symbol.for("react.portal");
48+
REACT_PORTAL_TYPE = Symbol.for("react.portal"),
49+
REACT_OPTIMISTIC_KEY = Symbol.for("react.optimistic_key");
4950
function createPortal$1(children, containerInfo, implementation) {
5051
var key =
5152
3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;
5253
return {
5354
$$typeof: REACT_PORTAL_TYPE,
54-
key: null == key ? null : "" + key,
55+
key:
56+
null == key
57+
? null
58+
: key === REACT_OPTIMISTIC_KEY
59+
? REACT_OPTIMISTIC_KEY
60+
: "" + key,
5561
children: children,
5662
containerInfo: containerInfo,
5763
implementation: implementation
@@ -203,4 +209,4 @@ exports.useFormState = function (action, initialState, permalink) {
203209
exports.useFormStatus = function () {
204210
return ReactSharedInternals.H.useHostTransitionStatus();
205211
};
206-
exports.version = "19.3.0-native-fb-194c12d9-20251118";
212+
exports.version = "19.3.0-native-fb-40b4a5bf-20251120";

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

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<a945da1e6ade627d9d7244e50fba48ec>>
10+
* @generated SignedSource<<8d9af1e7eace972c967e7cd0421039a3>>
1111
*/
1212

1313
/*
@@ -573,14 +573,16 @@ __DEV__ &&
573573
return requiredContext(contextStackCursor$1.current);
574574
}
575575
function pushHostContext(fiber) {
576-
null !== fiber.memoizedState &&
577-
push(hostTransitionProviderCursor, fiber, fiber);
578-
var context = requiredContext(contextStackCursor$1.current);
576+
var stateHook = fiber.memoizedState;
577+
null !== stateHook &&
578+
((HostTransitionContext._currentValue = stateHook.memoizedState),
579+
push(hostTransitionProviderCursor, fiber, fiber));
580+
stateHook = requiredContext(contextStackCursor$1.current);
579581
var type = fiber.type;
580-
var nextContext = getChildHostContextProd(context.context, type);
581-
type = updatedAncestorInfoDev(context.ancestorInfo, type);
582+
var nextContext = getChildHostContextProd(stateHook.context, type);
583+
type = updatedAncestorInfoDev(stateHook.ancestorInfo, type);
582584
nextContext = { context: nextContext, ancestorInfo: type };
583-
context !== nextContext &&
585+
stateHook !== nextContext &&
584586
(push(contextFiberStackCursor, fiber, fiber),
585587
push(contextStackCursor$1, nextContext, fiber));
586588
}
@@ -6527,9 +6529,9 @@ __DEV__ &&
65276529
}
65286530
function mapRemainingChildren(currentFirstChild) {
65296531
for (var existingChildren = new Map(); null !== currentFirstChild; )
6530-
null !== currentFirstChild.key
6531-
? existingChildren.set(currentFirstChild.key, currentFirstChild)
6532-
: existingChildren.set(currentFirstChild.index, currentFirstChild),
6532+
null === currentFirstChild.key
6533+
? existingChildren.set(currentFirstChild.index, currentFirstChild)
6534+
: existingChildren.set(currentFirstChild.key, currentFirstChild),
65336535
(currentFirstChild = currentFirstChild.sibling);
65346536
return existingChildren;
65356537
}
@@ -7049,10 +7051,11 @@ __DEV__ &&
70497051
knownKeys
70507052
)),
70517053
shouldTrackSideEffects &&
7052-
null !== nextOldFiber.alternate &&
7053-
oldFiber.delete(
7054-
null === nextOldFiber.key ? newIdx : nextOldFiber.key
7055-
),
7054+
((newFiber = nextOldFiber.alternate),
7055+
null !== newFiber &&
7056+
oldFiber.delete(
7057+
null === newFiber.key ? newIdx : newFiber.key
7058+
)),
70567059
(currentFirstChild = placeChild(
70577060
nextOldFiber,
70587061
currentFirstChild,
@@ -7161,10 +7164,9 @@ __DEV__ &&
71617164
knownKeys
71627165
)),
71637166
shouldTrackSideEffects &&
7164-
null !== nextOldFiber.alternate &&
7165-
oldFiber.delete(
7166-
null === nextOldFiber.key ? newIdx : nextOldFiber.key
7167-
),
7167+
((step = nextOldFiber.alternate),
7168+
null !== step &&
7169+
oldFiber.delete(null === step.key ? newIdx : step.key)),
71687170
(currentFirstChild = placeChild(
71697171
nextOldFiber,
71707172
currentFirstChild,
@@ -30242,11 +30244,11 @@ __DEV__ &&
3024230244
};
3024330245
(function () {
3024430246
var isomorphicReactPackageVersion = React.version;
30245-
if ("19.3.0-native-fb-194c12d9-20251118" !== isomorphicReactPackageVersion)
30247+
if ("19.3.0-native-fb-40b4a5bf-20251120" !== isomorphicReactPackageVersion)
3024630248
throw Error(
3024730249
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
3024830250
(isomorphicReactPackageVersion +
30249-
"\n - react-dom: 19.3.0-native-fb-194c12d9-20251118\nLearn more: https://react.dev/warnings/version-mismatch")
30251+
"\n - react-dom: 19.3.0-native-fb-40b4a5bf-20251120\nLearn more: https://react.dev/warnings/version-mismatch")
3025030252
);
3025130253
})();
3025230254
("function" === typeof Map &&
@@ -30283,10 +30285,10 @@ __DEV__ &&
3028330285
!(function () {
3028430286
var internals = {
3028530287
bundleType: 1,
30286-
version: "19.3.0-native-fb-194c12d9-20251118",
30288+
version: "19.3.0-native-fb-40b4a5bf-20251120",
3028730289
rendererPackageName: "react-dom",
3028830290
currentDispatcherRef: ReactSharedInternals,
30289-
reconcilerVersion: "19.3.0-native-fb-194c12d9-20251118"
30291+
reconcilerVersion: "19.3.0-native-fb-40b4a5bf-20251120"
3029030292
};
3029130293
internals.overrideHookState = overrideHookState;
3029230294
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -30436,5 +30438,5 @@ __DEV__ &&
3043630438
listenToAllSupportedEvents(container);
3043730439
return new ReactDOMHydrationRoot(initialChildren);
3043830440
};
30439-
exports.version = "19.3.0-native-fb-194c12d9-20251118";
30441+
exports.version = "19.3.0-native-fb-40b4a5bf-20251120";
3044030442
})();

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

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

1313
/*
@@ -478,10 +478,13 @@ function popHostContainer() {
478478
pop(rootInstanceStackCursor);
479479
}
480480
function pushHostContext(fiber) {
481-
null !== fiber.memoizedState && push(hostTransitionProviderCursor, fiber);
482-
var context = contextStackCursor$1.current;
483-
var JSCompiler_inline_result = getChildHostContextProd(context, fiber.type);
484-
context !== JSCompiler_inline_result &&
481+
var stateHook = fiber.memoizedState;
482+
null !== stateHook &&
483+
((HostTransitionContext._currentValue = stateHook.memoizedState),
484+
push(hostTransitionProviderCursor, fiber));
485+
stateHook = contextStackCursor$1.current;
486+
var JSCompiler_inline_result = getChildHostContextProd(stateHook, fiber.type);
487+
stateHook !== JSCompiler_inline_result &&
485488
(push(contextFiberStackCursor, fiber),
486489
push(contextStackCursor$1, JSCompiler_inline_result));
487490
}
@@ -3578,9 +3581,9 @@ function createChildReconciler(shouldTrackSideEffects) {
35783581
}
35793582
function mapRemainingChildren(currentFirstChild) {
35803583
for (var existingChildren = new Map(); null !== currentFirstChild; )
3581-
null !== currentFirstChild.key
3582-
? existingChildren.set(currentFirstChild.key, currentFirstChild)
3583-
: existingChildren.set(currentFirstChild.index, currentFirstChild),
3584+
null === currentFirstChild.key
3585+
? existingChildren.set(currentFirstChild.index, currentFirstChild)
3586+
: existingChildren.set(currentFirstChild.key, currentFirstChild),
35843587
(currentFirstChild = currentFirstChild.sibling);
35853588
return existingChildren;
35863589
}
@@ -3958,10 +3961,9 @@ function createChildReconciler(shouldTrackSideEffects) {
39583961
)),
39593962
null !== nextOldFiber &&
39603963
(shouldTrackSideEffects &&
3961-
null !== nextOldFiber.alternate &&
3962-
oldFiber.delete(
3963-
null === nextOldFiber.key ? newIdx : nextOldFiber.key
3964-
),
3964+
((newFiber = nextOldFiber.alternate),
3965+
null !== newFiber &&
3966+
oldFiber.delete(null === newFiber.key ? newIdx : newFiber.key)),
39653967
(currentFirstChild = placeChild(
39663968
nextOldFiber,
39673969
currentFirstChild,
@@ -4040,8 +4042,11 @@ function createChildReconciler(shouldTrackSideEffects) {
40404042
(step = updateFromMap(oldFiber, returnFiber, newIdx, step.value, lanes)),
40414043
null !== step &&
40424044
(shouldTrackSideEffects &&
4043-
null !== step.alternate &&
4044-
oldFiber.delete(null === step.key ? newIdx : step.key),
4045+
((nextOldFiber = step.alternate),
4046+
null !== nextOldFiber &&
4047+
oldFiber.delete(
4048+
null === nextOldFiber.key ? newIdx : nextOldFiber.key
4049+
)),
40454050
(currentFirstChild = placeChild(step, currentFirstChild, newIdx)),
40464051
null === previousNewFiber
40474052
? (resultingFirstChild = step)
@@ -17702,14 +17707,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
1770217707
};
1770317708
var isomorphicReactPackageVersion$jscomp$inline_2054 = React.version;
1770417709
if (
17705-
"19.3.0-native-fb-194c12d9-20251118" !==
17710+
"19.3.0-native-fb-40b4a5bf-20251120" !==
1770617711
isomorphicReactPackageVersion$jscomp$inline_2054
1770717712
)
1770817713
throw Error(
1770917714
formatProdErrorMessage(
1771017715
527,
1771117716
isomorphicReactPackageVersion$jscomp$inline_2054,
17712-
"19.3.0-native-fb-194c12d9-20251118"
17717+
"19.3.0-native-fb-40b4a5bf-20251120"
1771317718
)
1771417719
);
1771517720
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
@@ -17731,10 +17736,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
1773117736
};
1773217737
var internals$jscomp$inline_2636 = {
1773317738
bundleType: 0,
17734-
version: "19.3.0-native-fb-194c12d9-20251118",
17739+
version: "19.3.0-native-fb-40b4a5bf-20251120",
1773517740
rendererPackageName: "react-dom",
1773617741
currentDispatcherRef: ReactSharedInternals,
17737-
reconcilerVersion: "19.3.0-native-fb-194c12d9-20251118"
17742+
reconcilerVersion: "19.3.0-native-fb-40b4a5bf-20251120"
1773817743
};
1773917744
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
1774017745
var hook$jscomp$inline_2637 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -17841,4 +17846,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
1784117846
listenToAllSupportedEvents(container);
1784217847
return new ReactDOMHydrationRoot(initialChildren);
1784317848
};
17844-
exports.version = "19.3.0-native-fb-194c12d9-20251118";
17849+
exports.version = "19.3.0-native-fb-40b4a5bf-20251120";

0 commit comments

Comments
 (0)