Skip to content

Commit 3483172

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 376b207 commit 3483172

38 files changed

+1690
-546
lines changed

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

Lines changed: 1031 additions & 87 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-
194c12d949cb142d2f29637fbee2ab4cec057eef
1+
40b4a5bf71ba7864556a5589b270b237f453c032
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
194c12d949cb142d2f29637fbee2ab4cec057eef
1+
40b4a5bf71ba7864556a5589b270b237f453c032

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1499,7 +1499,7 @@ __DEV__ &&
14991499
exports.useTransition = function () {
15001500
return resolveDispatcher().useTransition();
15011501
};
1502-
exports.version = "19.3.0-www-classic-194c12d9-20251118";
1502+
exports.version = "19.3.0-www-classic-40b4a5bf-20251120";
15031503
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
15041504
"function" ===
15051505
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1499,7 +1499,7 @@ __DEV__ &&
14991499
exports.useTransition = function () {
15001500
return resolveDispatcher().useTransition();
15011501
};
1502-
exports.version = "19.3.0-www-modern-194c12d9-20251118";
1502+
exports.version = "19.3.0-www-modern-40b4a5bf-20251120";
15031503
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
15041504
"function" ===
15051505
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,4 +606,4 @@ exports.useSyncExternalStore = function (
606606
exports.useTransition = function () {
607607
return ReactSharedInternals.H.useTransition();
608608
};
609-
exports.version = "19.3.0-www-classic-194c12d9-20251118";
609+
exports.version = "19.3.0-www-classic-40b4a5bf-20251120";

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,4 +606,4 @@ exports.useSyncExternalStore = function (
606606
exports.useTransition = function () {
607607
return ReactSharedInternals.H.useTransition();
608608
};
609-
exports.version = "19.3.0-www-modern-194c12d9-20251118";
609+
exports.version = "19.3.0-www-modern-40b4a5bf-20251120";

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ exports.useSyncExternalStore = function (
610610
exports.useTransition = function () {
611611
return ReactSharedInternals.H.useTransition();
612612
};
613-
exports.version = "19.3.0-www-classic-194c12d9-20251118";
613+
exports.version = "19.3.0-www-classic-40b4a5bf-20251120";
614614
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
615615
"function" ===
616616
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ exports.useSyncExternalStore = function (
610610
exports.useTransition = function () {
611611
return ReactSharedInternals.H.useTransition();
612612
};
613-
exports.version = "19.3.0-www-modern-194c12d9-20251118";
613+
exports.version = "19.3.0-www-modern-40b4a5bf-20251120";
614614
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
615615
"function" ===
616616
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2418,11 +2418,13 @@ __DEV__ &&
24182418
pop(rootInstanceStackCursor, fiber);
24192419
}
24202420
function pushHostContext(fiber) {
2421-
null !== fiber.memoizedState &&
2422-
push(hostTransitionProviderCursor, fiber, fiber);
2423-
var context = requiredContext(contextStackCursor.current),
2424-
nextContext = NO_CONTEXT;
2425-
context !== nextContext &&
2421+
var stateHook = fiber.memoizedState;
2422+
null !== stateHook &&
2423+
((HostTransitionContext._currentValue2 = stateHook.memoizedState),
2424+
push(hostTransitionProviderCursor, fiber, fiber));
2425+
stateHook = requiredContext(contextStackCursor.current);
2426+
var nextContext = NO_CONTEXT;
2427+
stateHook !== nextContext &&
24262428
(push(contextFiberStackCursor, fiber, fiber),
24272429
push(contextStackCursor, nextContext, fiber));
24282430
}
@@ -4065,9 +4067,9 @@ __DEV__ &&
40654067
}
40664068
function mapRemainingChildren(currentFirstChild) {
40674069
for (var existingChildren = new Map(); null !== currentFirstChild; )
4068-
null !== currentFirstChild.key
4069-
? existingChildren.set(currentFirstChild.key, currentFirstChild)
4070-
: existingChildren.set(currentFirstChild.index, currentFirstChild),
4070+
null === currentFirstChild.key
4071+
? existingChildren.set(currentFirstChild.index, currentFirstChild)
4072+
: existingChildren.set(currentFirstChild.key, currentFirstChild),
40714073
(currentFirstChild = currentFirstChild.sibling);
40724074
return existingChildren;
40734075
}
@@ -4584,10 +4586,11 @@ __DEV__ &&
45844586
knownKeys
45854587
)),
45864588
shouldTrackSideEffects &&
4587-
null !== nextOldFiber.alternate &&
4588-
oldFiber.delete(
4589-
null === nextOldFiber.key ? newIdx : nextOldFiber.key
4590-
),
4589+
((newFiber = nextOldFiber.alternate),
4590+
null !== newFiber &&
4591+
oldFiber.delete(
4592+
null === newFiber.key ? newIdx : newFiber.key
4593+
)),
45914594
(currentFirstChild = placeChild(
45924595
nextOldFiber,
45934596
currentFirstChild,
@@ -4692,10 +4695,9 @@ __DEV__ &&
46924695
knownKeys
46934696
)),
46944697
shouldTrackSideEffects &&
4695-
null !== nextOldFiber.alternate &&
4696-
oldFiber.delete(
4697-
null === nextOldFiber.key ? newIdx : nextOldFiber.key
4698-
),
4698+
((step = nextOldFiber.alternate),
4699+
null !== step &&
4700+
oldFiber.delete(null === step.key ? newIdx : step.key)),
46994701
(currentFirstChild = placeChild(
47004702
nextOldFiber,
47014703
currentFirstChild,
@@ -20466,10 +20468,10 @@ __DEV__ &&
2046620468
(function () {
2046720469
var internals = {
2046820470
bundleType: 1,
20469-
version: "19.3.0-www-classic-194c12d9-20251118",
20471+
version: "19.3.0-www-classic-40b4a5bf-20251120",
2047020472
rendererPackageName: "react-art",
2047120473
currentDispatcherRef: ReactSharedInternals,
20472-
reconcilerVersion: "19.3.0-www-classic-194c12d9-20251118"
20474+
reconcilerVersion: "19.3.0-www-classic-40b4a5bf-20251120"
2047320475
};
2047420476
internals.overrideHookState = overrideHookState;
2047520477
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -20504,7 +20506,7 @@ __DEV__ &&
2050420506
exports.Shape = Shape;
2050520507
exports.Surface = Surface;
2050620508
exports.Text = Text;
20507-
exports.version = "19.3.0-www-classic-194c12d9-20251118";
20509+
exports.version = "19.3.0-www-classic-40b4a5bf-20251120";
2050820510
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
2050920511
"function" ===
2051020512
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

0 commit comments

Comments
 (0)