Skip to content

Commit 115c587

Browse files
committed
[compiler] Adjustments to exhaustive deps messages, disable the lint rule (#35192)
Similar to ValidateHookUsage, we implement this check in the compiler for safety but (for now) continue to rely on the existing rule for actually reporting errors to users. --- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/react/pull/35192). * #35201 * #35202 * __->__ #35192 DiffTrain build for [9599e7a](9599e7a)
1 parent 0cf92e7 commit 115c587

35 files changed

+93
-91
lines changed

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18353,7 +18353,7 @@ function getRuleForCategoryImpl(category) {
1835318353
severity: ErrorSeverity.Error,
1835418354
name: 'memo-dependencies',
1835518355
description: 'Validates that useMemo() and useCallback() specify comprehensive dependencies without extraneous values. See [`useMemo()` docs](https://react.dev/reference/react/useMemo) for more information.',
18356-
preset: LintRulePreset.RecommendedLatest,
18356+
preset: LintRulePreset.Off,
1835718357
};
1835818358
}
1835918359
case ErrorCategory.IncompatibleLibrary: {
@@ -53621,7 +53621,7 @@ function validateExhaustiveDependencies(fn) {
5362153621
if (missing.length !== 0) {
5362253622
const diagnostic = CompilerDiagnostic.create({
5362353623
category: ErrorCategory.MemoDependencies,
53624-
reason: 'Found non-exhaustive dependencies',
53624+
reason: 'Found missing memoization dependencies',
5362553625
description: 'Missing dependencies can cause a value not to update when those inputs change, ' +
5362653626
'resulting in stale UI',
5362753627
suggestions,
@@ -53645,7 +53645,7 @@ function validateExhaustiveDependencies(fn) {
5364553645
category: ErrorCategory.MemoDependencies,
5364653646
reason: 'Found unnecessary memoization dependencies',
5364753647
description: 'Unnecessary dependencies can cause a value to update more often than necessary, ' +
53648-
'which can cause effects to run more than expected',
53648+
'causing performance regressions and effects to fire more often than expected',
5364953649
});
5365053650
diagnostic.withDetails({
5365153651
kind: 'error',
@@ -54170,8 +54170,10 @@ function runWithEnvironment(func, env) {
5417054170
}
5417154171
inferReactivePlaces(hir);
5417254172
log({ kind: 'hir', name: 'InferReactivePlaces', value: hir });
54173-
if (env.config.validateExhaustiveMemoizationDependencies) {
54174-
validateExhaustiveDependencies(hir).unwrap();
54173+
if (env.enableValidations) {
54174+
if (env.config.validateExhaustiveMemoizationDependencies) {
54175+
validateExhaustiveDependencies(hir).unwrap();
54176+
}
5417554177
}
5417654178
rewriteInstructionKindsBasedOnReassignment(hir);
5417754179
log({

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
67c1487ffd872c95a3bb7d8104eac6eca79fe8cb
1+
9599e7a787cce2a41c35d783d45a160dfebab277
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
67c1487ffd872c95a3bb7d8104eac6eca79fe8cb
1+
9599e7a787cce2a41c35d783d45a160dfebab277

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-67c1487f-20251124";
1502+
exports.version = "19.3.0-www-classic-9599e7a7-20251124";
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-67c1487f-20251124";
1502+
exports.version = "19.3.0-www-modern-9599e7a7-20251124";
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-67c1487f-20251124";
609+
exports.version = "19.3.0-www-classic-9599e7a7-20251124";

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-67c1487f-20251124";
609+
exports.version = "19.3.0-www-modern-9599e7a7-20251124";

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-67c1487f-20251124";
613+
exports.version = "19.3.0-www-classic-9599e7a7-20251124";
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-67c1487f-20251124";
613+
exports.version = "19.3.0-www-modern-9599e7a7-20251124";
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: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20468,10 +20468,10 @@ __DEV__ &&
2046820468
(function () {
2046920469
var internals = {
2047020470
bundleType: 1,
20471-
version: "19.3.0-www-classic-67c1487f-20251124",
20471+
version: "19.3.0-www-classic-9599e7a7-20251124",
2047220472
rendererPackageName: "react-art",
2047320473
currentDispatcherRef: ReactSharedInternals,
20474-
reconcilerVersion: "19.3.0-www-classic-67c1487f-20251124"
20474+
reconcilerVersion: "19.3.0-www-classic-9599e7a7-20251124"
2047520475
};
2047620476
internals.overrideHookState = overrideHookState;
2047720477
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -20506,7 +20506,7 @@ __DEV__ &&
2050620506
exports.Shape = Shape;
2050720507
exports.Surface = Surface;
2050820508
exports.Text = Text;
20509-
exports.version = "19.3.0-www-classic-67c1487f-20251124";
20509+
exports.version = "19.3.0-www-classic-9599e7a7-20251124";
2051020510
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
2051120511
"function" ===
2051220512
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

0 commit comments

Comments
 (0)