mirror of
https://github.com/zebrajr/react.git
synced 2025-12-06 12:20:20 +01:00
[compiler] Update diagnostics for ValidatePreservedManualMemoization (#33759)
Uses the new diagnostic infrastructure for this validation, which lets us provide a more targeted message on the text that we highlight (eg "This dependency may be mutated later") separately from the overall error message. --- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/react/pull/33759). * #33981 * #33777 * #33767 * #33765 * #33760 * __->__ #33759 * #33758
This commit is contained in:
parent
72848027a5
commit
48bc166428
|
|
@ -5,7 +5,11 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {CompilerError, ErrorSeverity} from '../CompilerError';
|
import {
|
||||||
|
CompilerDiagnostic,
|
||||||
|
CompilerError,
|
||||||
|
ErrorSeverity,
|
||||||
|
} from '../CompilerError';
|
||||||
import {
|
import {
|
||||||
DeclarationId,
|
DeclarationId,
|
||||||
Effect,
|
Effect,
|
||||||
|
|
@ -275,27 +279,37 @@ function validateInferredDep(
|
||||||
errorDiagnostic = merge(errorDiagnostic ?? compareResult, compareResult);
|
errorDiagnostic = merge(errorDiagnostic ?? compareResult, compareResult);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
errorState.push({
|
errorState.pushDiagnostic(
|
||||||
severity: ErrorSeverity.CannotPreserveMemoization,
|
CompilerDiagnostic.create({
|
||||||
reason:
|
severity: ErrorSeverity.CannotPreserveMemoization,
|
||||||
'React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected',
|
category:
|
||||||
description:
|
'Compilation skipped because existing memoization could not be preserved',
|
||||||
DEBUG ||
|
description: [
|
||||||
// If the dependency is a named variable then we can report it. Otherwise only print in debug mode
|
'React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. ',
|
||||||
(dep.identifier.name != null && dep.identifier.name.kind === 'named')
|
'The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected. ',
|
||||||
? `The inferred dependency was \`${prettyPrintScopeDependency(
|
DEBUG ||
|
||||||
dep,
|
// If the dependency is a named variable then we can report it. Otherwise only print in debug mode
|
||||||
)}\`, but the source dependencies were [${validDepsInMemoBlock
|
(dep.identifier.name != null && dep.identifier.name.kind === 'named')
|
||||||
.map(dep => printManualMemoDependency(dep, true))
|
? `The inferred dependency was \`${prettyPrintScopeDependency(
|
||||||
.join(', ')}]. ${
|
dep,
|
||||||
errorDiagnostic
|
)}\`, but the source dependencies were [${validDepsInMemoBlock
|
||||||
? getCompareDependencyResultDescription(errorDiagnostic)
|
.map(dep => printManualMemoDependency(dep, true))
|
||||||
: 'Inferred dependency not present in source'
|
.join(', ')}]. ${
|
||||||
}`
|
errorDiagnostic
|
||||||
: null,
|
? getCompareDependencyResultDescription(errorDiagnostic)
|
||||||
loc: memoLocation,
|
: 'Inferred dependency not present in source'
|
||||||
suggestions: null,
|
}.`
|
||||||
});
|
: '',
|
||||||
|
]
|
||||||
|
.join('')
|
||||||
|
.trim(),
|
||||||
|
suggestions: null,
|
||||||
|
}).withDetail({
|
||||||
|
kind: 'error',
|
||||||
|
loc: memoLocation,
|
||||||
|
message: 'Could not preserve existing manual memoization',
|
||||||
|
}),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
class Visitor extends ReactiveFunctionVisitor<VisitorState> {
|
class Visitor extends ReactiveFunctionVisitor<VisitorState> {
|
||||||
|
|
@ -519,14 +533,21 @@ class Visitor extends ReactiveFunctionVisitor<VisitorState> {
|
||||||
!this.scopes.has(identifier.scope.id) &&
|
!this.scopes.has(identifier.scope.id) &&
|
||||||
!this.prunedScopes.has(identifier.scope.id)
|
!this.prunedScopes.has(identifier.scope.id)
|
||||||
) {
|
) {
|
||||||
state.errors.push({
|
state.errors.pushDiagnostic(
|
||||||
reason:
|
CompilerDiagnostic.create({
|
||||||
'React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. This dependency may be mutated later, which could cause the value to change unexpectedly',
|
severity: ErrorSeverity.CannotPreserveMemoization,
|
||||||
description: null,
|
category:
|
||||||
severity: ErrorSeverity.CannotPreserveMemoization,
|
'Compilation skipped because existing memoization could not be preserved',
|
||||||
loc,
|
description: [
|
||||||
suggestions: null,
|
'React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. ',
|
||||||
});
|
'This dependency may be mutated later, which could cause the value to change unexpectedly.',
|
||||||
|
].join(''),
|
||||||
|
}).withDetail({
|
||||||
|
kind: 'error',
|
||||||
|
loc,
|
||||||
|
message: 'This dependency may be modified later',
|
||||||
|
}),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -560,16 +581,25 @@ class Visitor extends ReactiveFunctionVisitor<VisitorState> {
|
||||||
|
|
||||||
for (const identifier of decls) {
|
for (const identifier of decls) {
|
||||||
if (isUnmemoized(identifier, this.scopes)) {
|
if (isUnmemoized(identifier, this.scopes)) {
|
||||||
state.errors.push({
|
state.errors.pushDiagnostic(
|
||||||
reason:
|
CompilerDiagnostic.create({
|
||||||
'React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. This value was memoized in source but not in compilation output.',
|
severity: ErrorSeverity.CannotPreserveMemoization,
|
||||||
description: DEBUG
|
category:
|
||||||
? `${printIdentifier(identifier)} was not memoized`
|
'Compilation skipped because existing memoization could not be preserved',
|
||||||
: null,
|
description: [
|
||||||
severity: ErrorSeverity.CannotPreserveMemoization,
|
'React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. This value was memoized in source but not in compilation output. ',
|
||||||
loc,
|
DEBUG
|
||||||
suggestions: null,
|
? `${printIdentifier(identifier)} was not memoized.`
|
||||||
});
|
: '',
|
||||||
|
]
|
||||||
|
.join('')
|
||||||
|
.trim(),
|
||||||
|
}).withDetail({
|
||||||
|
kind: 'error',
|
||||||
|
loc,
|
||||||
|
message: 'Could not preserve existing memoization',
|
||||||
|
}),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,9 +25,9 @@ function Component(props) {
|
||||||
|
|
||||||
```
|
```
|
||||||
Found 1 error:
|
Found 1 error:
|
||||||
Memoization: React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected
|
Memoization: Compilation skipped because existing memoization could not be preserved
|
||||||
|
|
||||||
The inferred dependency was `props.items`, but the source dependencies were [props?.items, props.cond]. Inferred different dependency than source.
|
React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected. The inferred dependency was `props.items`, but the source dependencies were [props?.items, props.cond]. Inferred different dependency than source.
|
||||||
|
|
||||||
error.hoist-optional-member-expression-with-conditional-optional.ts:4:23
|
error.hoist-optional-member-expression-with-conditional-optional.ts:4:23
|
||||||
2 | import {ValidateMemoization} from 'shared-runtime';
|
2 | import {ValidateMemoization} from 'shared-runtime';
|
||||||
|
|
@ -47,12 +47,10 @@ error.hoist-optional-member-expression-with-conditional-optional.ts:4:23
|
||||||
> 10 | return x;
|
> 10 | return x;
|
||||||
| ^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^
|
||||||
> 11 | }, [props?.items, props.cond]);
|
> 11 | }, [props?.items, props.cond]);
|
||||||
| ^^^^ React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected
|
| ^^^^ Could not preserve existing manual memoization
|
||||||
12 | return (
|
12 | return (
|
||||||
13 | <ValidateMemoization inputs={[props?.items, props.cond]} output={data} />
|
13 | <ValidateMemoization inputs={[props?.items, props.cond]} output={data} />
|
||||||
14 | );
|
14 | );
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -25,9 +25,9 @@ function Component(props) {
|
||||||
|
|
||||||
```
|
```
|
||||||
Found 1 error:
|
Found 1 error:
|
||||||
Memoization: React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected
|
Memoization: Compilation skipped because existing memoization could not be preserved
|
||||||
|
|
||||||
The inferred dependency was `props.items`, but the source dependencies were [props?.items, props.cond]. Inferred different dependency than source.
|
React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected. The inferred dependency was `props.items`, but the source dependencies were [props?.items, props.cond]. Inferred different dependency than source.
|
||||||
|
|
||||||
error.hoist-optional-member-expression-with-conditional.ts:4:23
|
error.hoist-optional-member-expression-with-conditional.ts:4:23
|
||||||
2 | import {ValidateMemoization} from 'shared-runtime';
|
2 | import {ValidateMemoization} from 'shared-runtime';
|
||||||
|
|
@ -47,12 +47,10 @@ error.hoist-optional-member-expression-with-conditional.ts:4:23
|
||||||
> 10 | return x;
|
> 10 | return x;
|
||||||
| ^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^
|
||||||
> 11 | }, [props?.items, props.cond]);
|
> 11 | }, [props?.items, props.cond]);
|
||||||
| ^^^^ React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected
|
| ^^^^ Could not preserve existing manual memoization
|
||||||
12 | return (
|
12 | return (
|
||||||
13 | <ValidateMemoization inputs={[props?.items, props.cond]} output={data} />
|
13 | <ValidateMemoization inputs={[props?.items, props.cond]} output={data} />
|
||||||
14 | );
|
14 | );
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -19,9 +19,9 @@ function Component(props) {
|
||||||
|
|
||||||
```
|
```
|
||||||
Found 1 error:
|
Found 1 error:
|
||||||
Memoization: React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected
|
Memoization: Compilation skipped because existing memoization could not be preserved
|
||||||
|
|
||||||
The inferred dependency was `props.items.edges.nodes`, but the source dependencies were [props.items?.edges?.nodes]. Inferred different dependency than source.
|
React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected. The inferred dependency was `props.items.edges.nodes`, but the source dependencies were [props.items?.edges?.nodes]. Inferred different dependency than source.
|
||||||
|
|
||||||
error.invalid-optional-member-expression-as-memo-dep-non-optional-in-body.ts:3:23
|
error.invalid-optional-member-expression-as-memo-dep-non-optional-in-body.ts:3:23
|
||||||
1 | // @validatePreserveExistingMemoizationGuarantees
|
1 | // @validatePreserveExistingMemoizationGuarantees
|
||||||
|
|
@ -35,12 +35,10 @@ error.invalid-optional-member-expression-as-memo-dep-non-optional-in-body.ts:3:2
|
||||||
> 6 | // deps are optional
|
> 6 | // deps are optional
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
> 7 | }, [props.items?.edges?.nodes]);
|
> 7 | }, [props.items?.edges?.nodes]);
|
||||||
| ^^^^ React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected
|
| ^^^^ Could not preserve existing manual memoization
|
||||||
8 | return <Foo data={data} />;
|
8 | return <Foo data={data} />;
|
||||||
9 | }
|
9 | }
|
||||||
10 |
|
10 |
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -32,9 +32,9 @@ export const FIXTURE_ENTRYPOINT = {
|
||||||
|
|
||||||
```
|
```
|
||||||
Found 1 error:
|
Found 1 error:
|
||||||
Memoization: React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected
|
Memoization: Compilation skipped because existing memoization could not be preserved
|
||||||
|
|
||||||
The inferred dependency was `Ref.current`, but the source dependencies were []. Inferred dependency not present in source.
|
React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected. The inferred dependency was `Ref.current`, but the source dependencies were []. Inferred dependency not present in source.
|
||||||
|
|
||||||
error.ref-like-name-not-Ref.ts:11:30
|
error.ref-like-name-not-Ref.ts:11:30
|
||||||
9 | const Ref = useCustomRef();
|
9 | const Ref = useCustomRef();
|
||||||
|
|
@ -44,12 +44,10 @@ error.ref-like-name-not-Ref.ts:11:30
|
||||||
> 12 | Ref.current?.click();
|
> 12 | Ref.current?.click();
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
> 13 | }, []);
|
> 13 | }, []);
|
||||||
| ^^^^ React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected
|
| ^^^^ Could not preserve existing manual memoization
|
||||||
14 |
|
14 |
|
||||||
15 | return <button onClick={onClick} />;
|
15 | return <button onClick={onClick} />;
|
||||||
16 | }
|
16 | }
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -32,9 +32,9 @@ export const FIXTURE_ENTRYPOINT = {
|
||||||
|
|
||||||
```
|
```
|
||||||
Found 1 error:
|
Found 1 error:
|
||||||
Memoization: React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected
|
Memoization: Compilation skipped because existing memoization could not be preserved
|
||||||
|
|
||||||
The inferred dependency was `notaref.current`, but the source dependencies were []. Inferred dependency not present in source.
|
React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected. The inferred dependency was `notaref.current`, but the source dependencies were []. Inferred dependency not present in source.
|
||||||
|
|
||||||
error.ref-like-name-not-a-ref.ts:11:30
|
error.ref-like-name-not-a-ref.ts:11:30
|
||||||
9 | const notaref = useCustomRef();
|
9 | const notaref = useCustomRef();
|
||||||
|
|
@ -44,12 +44,10 @@ error.ref-like-name-not-a-ref.ts:11:30
|
||||||
> 12 | notaref.current?.click();
|
> 12 | notaref.current?.click();
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
> 13 | }, []);
|
> 13 | }, []);
|
||||||
| ^^^^ React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected
|
| ^^^^ Could not preserve existing manual memoization
|
||||||
14 |
|
14 |
|
||||||
15 | return <button onClick={onClick} />;
|
15 | return <button onClick={onClick} />;
|
||||||
16 | }
|
16 | }
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -43,18 +43,18 @@ component Component() {
|
||||||
|
|
||||||
```
|
```
|
||||||
Found 1 error:
|
Found 1 error:
|
||||||
Memoization: React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. This value was memoized in source but not in compilation output.
|
Memoization: Compilation skipped because existing memoization could not be preserved
|
||||||
|
|
||||||
|
React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. This value was memoized in source but not in compilation output.
|
||||||
|
|
||||||
undefined:18:20
|
undefined:18:20
|
||||||
16 | // We infer that getIsEnabled returns a mutable value, such that
|
16 | // We infer that getIsEnabled returns a mutable value, such that
|
||||||
17 | // isEnabled is mutable
|
17 | // isEnabled is mutable
|
||||||
> 18 | const isEnabled = useMemo(() => getIsEnabled(), [getIsEnabled]);
|
> 18 | const isEnabled = useMemo(() => getIsEnabled(), [getIsEnabled]);
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. This value was memoized in source but not in compilation output.
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Could not preserve existing memoization
|
||||||
19 |
|
19 |
|
||||||
20 | // We then infer getLoggingData as capturing that mutable value,
|
20 | // We then infer getLoggingData as capturing that mutable value,
|
||||||
21 | // so any calls to this function are then inferred as extending
|
21 | // so any calls to this function are then inferred as extending
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -53,7 +53,9 @@ component Component(id) {
|
||||||
|
|
||||||
```
|
```
|
||||||
Found 3 errors:
|
Found 3 errors:
|
||||||
Memoization: React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. This value was memoized in source but not in compilation output.
|
Memoization: Compilation skipped because existing memoization could not be preserved
|
||||||
|
|
||||||
|
React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. This value was memoized in source but not in compilation output.
|
||||||
|
|
||||||
undefined:11:18
|
undefined:11:18
|
||||||
9 | const [index, setIndex] = useState(0);
|
9 | const [index, setIndex] = useState(0);
|
||||||
|
|
@ -69,25 +71,25 @@ undefined:11:18
|
||||||
> 15 | };
|
> 15 | };
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
> 16 | }, [index, items]);
|
> 16 | }, [index, items]);
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^ React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. This value was memoized in source but not in compilation output.
|
| ^^^^^^^^^^^^^^^^^^^^^ Could not preserve existing memoization
|
||||||
17 |
|
17 |
|
||||||
18 | const setCurrentIndex = useCallback(
|
18 | const setCurrentIndex = useCallback(
|
||||||
19 | (index: number) => {
|
19 | (index: number) => {
|
||||||
|
Memoization: Compilation skipped because existing memoization could not be preserved
|
||||||
|
|
||||||
|
React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. This dependency may be mutated later, which could cause the value to change unexpectedly.
|
||||||
Memoization: React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. This dependency may be mutated later, which could cause the value to change unexpectedly
|
|
||||||
|
|
||||||
undefined:28:12
|
undefined:28:12
|
||||||
26 | setIndex(index);
|
26 | setIndex(index);
|
||||||
27 | },
|
27 | },
|
||||||
> 28 | [index, logData, items]
|
> 28 | [index, logData, items]
|
||||||
| ^^^^^^^ React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. This dependency may be mutated later, which could cause the value to change unexpectedly
|
| ^^^^^^^ This dependency may be modified later
|
||||||
29 | );
|
29 | );
|
||||||
30 |
|
30 |
|
||||||
31 | if (prevId !== id) {
|
31 | if (prevId !== id) {
|
||||||
|
Memoization: Compilation skipped because existing memoization could not be preserved
|
||||||
|
|
||||||
|
React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. This value was memoized in source but not in compilation output.
|
||||||
Memoization: React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. This value was memoized in source but not in compilation output.
|
|
||||||
|
|
||||||
undefined:19:4
|
undefined:19:4
|
||||||
17 |
|
17 |
|
||||||
|
|
@ -109,12 +111,10 @@ undefined:19:4
|
||||||
> 26 | setIndex(index);
|
> 26 | setIndex(index);
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||||
> 27 | },
|
> 27 | },
|
||||||
| ^^^^^^ React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. This value was memoized in source but not in compilation output.
|
| ^^^^^^ Could not preserve existing memoization
|
||||||
28 | [index, logData, items]
|
28 | [index, logData, items]
|
||||||
29 | );
|
29 | );
|
||||||
30 |
|
30 |
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -51,18 +51,18 @@ export const FIXTURE_ENTRYPOINT = {
|
||||||
|
|
||||||
```
|
```
|
||||||
Found 1 error:
|
Found 1 error:
|
||||||
Memoization: React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. This value was memoized in source but not in compilation output.
|
Memoization: Compilation skipped because existing memoization could not be preserved
|
||||||
|
|
||||||
|
React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. This value was memoized in source but not in compilation output.
|
||||||
|
|
||||||
error.todo-repro-unmemoized-callback-captured-in-context-variable.ts:11:12
|
error.todo-repro-unmemoized-callback-captured-in-context-variable.ts:11:12
|
||||||
9 | const a = useHook();
|
9 | const a = useHook();
|
||||||
10 | // Because b is also part of that same mutable range, it can't be memoized either
|
10 | // Because b is also part of that same mutable range, it can't be memoized either
|
||||||
> 11 | const b = useMemo(() => ({}), []);
|
> 11 | const b = useMemo(() => ({}), []);
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^ React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. This value was memoized in source but not in compilation output.
|
| ^^^^^^^^^^^^^^^^^^^^^^^ Could not preserve existing memoization
|
||||||
12 |
|
12 |
|
||||||
13 | // Conditional assignment without a subsequent mutation normally doesn't create a mutable
|
13 | // Conditional assignment without a subsequent mutation normally doesn't create a mutable
|
||||||
14 | // range, but in this case we're reassigning a context variable
|
14 | // range, but in this case we're reassigning a context variable
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -58,7 +58,7 @@ export const FIXTURE_ENTRYPOINT = {
|
||||||
## Logs
|
## Logs
|
||||||
|
|
||||||
```
|
```
|
||||||
{"kind":"CompileError","fnLoc":{"start":{"line":6,"column":0,"index":206},"end":{"line":16,"column":1,"index":433},"filename":"dynamic-gating-bailout-nopanic.ts"},"detail":{"options":{"reason":"React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected","description":"The inferred dependency was `value`, but the source dependencies were []. Inferred dependency not present in source","severity":"CannotPreserveMemoization","suggestions":null,"loc":{"start":{"line":9,"column":31,"index":288},"end":{"line":9,"column":52,"index":309},"filename":"dynamic-gating-bailout-nopanic.ts"}}}}
|
{"kind":"CompileError","fnLoc":{"start":{"line":6,"column":0,"index":206},"end":{"line":16,"column":1,"index":433},"filename":"dynamic-gating-bailout-nopanic.ts"},"detail":{"options":{"severity":"CannotPreserveMemoization","category":"Compilation skipped because existing memoization could not be preserved","description":"React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected. The inferred dependency was `value`, but the source dependencies were []. Inferred dependency not present in source.","suggestions":null,"details":[{"kind":"error","loc":{"start":{"line":9,"column":31,"index":288},"end":{"line":9,"column":52,"index":309},"filename":"dynamic-gating-bailout-nopanic.ts"},"message":"Could not preserve existing manual memoization"}]}}}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Eval output
|
### Eval output
|
||||||
|
|
|
||||||
|
|
@ -30,30 +30,30 @@ export const FIXTURE_ENTRYPOINT = {
|
||||||
|
|
||||||
```
|
```
|
||||||
Found 2 errors:
|
Found 2 errors:
|
||||||
Memoization: React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. This dependency may be mutated later, which could cause the value to change unexpectedly
|
Memoization: Compilation skipped because existing memoization could not be preserved
|
||||||
|
|
||||||
|
React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. This dependency may be mutated later, which could cause the value to change unexpectedly.
|
||||||
|
|
||||||
error.invalid-useCallback-captures-reassigned-context.ts:11:37
|
error.invalid-useCallback-captures-reassigned-context.ts:11:37
|
||||||
9 |
|
9 |
|
||||||
10 | // makeArray() is captured, but depsList contains [props]
|
10 | // makeArray() is captured, but depsList contains [props]
|
||||||
> 11 | const cb = useCallback(() => [x], [x]);
|
> 11 | const cb = useCallback(() => [x], [x]);
|
||||||
| ^ React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. This dependency may be mutated later, which could cause the value to change unexpectedly
|
| ^ This dependency may be modified later
|
||||||
12 |
|
12 |
|
||||||
13 | x = makeArray();
|
13 | x = makeArray();
|
||||||
14 |
|
14 |
|
||||||
|
Memoization: Compilation skipped because existing memoization could not be preserved
|
||||||
|
|
||||||
|
React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. This value was memoized in source but not in compilation output.
|
||||||
Memoization: React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. This value was memoized in source but not in compilation output.
|
|
||||||
|
|
||||||
error.invalid-useCallback-captures-reassigned-context.ts:11:25
|
error.invalid-useCallback-captures-reassigned-context.ts:11:25
|
||||||
9 |
|
9 |
|
||||||
10 | // makeArray() is captured, but depsList contains [props]
|
10 | // makeArray() is captured, but depsList contains [props]
|
||||||
> 11 | const cb = useCallback(() => [x], [x]);
|
> 11 | const cb = useCallback(() => [x], [x]);
|
||||||
| ^^^^^^^^^ React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. This value was memoized in source but not in compilation output.
|
| ^^^^^^^^^ Could not preserve existing memoization
|
||||||
12 |
|
12 |
|
||||||
13 | x = makeArray();
|
13 | x = makeArray();
|
||||||
14 |
|
14 |
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -31,18 +31,18 @@ export const FIXTURE_ENTRYPOINT = {
|
||||||
|
|
||||||
```
|
```
|
||||||
Found 1 error:
|
Found 1 error:
|
||||||
Memoization: React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. This value was memoized in source but not in compilation output.
|
Memoization: Compilation skipped because existing memoization could not be preserved
|
||||||
|
|
||||||
|
React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. This value was memoized in source but not in compilation output.
|
||||||
|
|
||||||
error.false-positive-useMemo-dropped-infer-always-invalidating.ts:15:9
|
error.false-positive-useMemo-dropped-infer-always-invalidating.ts:15:9
|
||||||
13 | x.push(props);
|
13 | x.push(props);
|
||||||
14 |
|
14 |
|
||||||
> 15 | return useMemo(() => [x], [x]);
|
> 15 | return useMemo(() => [x], [x]);
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^ React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. This value was memoized in source but not in compilation output.
|
| ^^^^^^^^^^^^^^^^^^^^^^^ Could not preserve existing memoization
|
||||||
16 | }
|
16 | }
|
||||||
17 |
|
17 |
|
||||||
18 | export const FIXTURE_ENTRYPOINT = {
|
18 | export const FIXTURE_ENTRYPOINT = {
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -30,18 +30,18 @@ export const FIXTURE_ENTRYPOINT = {
|
||||||
|
|
||||||
```
|
```
|
||||||
Found 1 error:
|
Found 1 error:
|
||||||
Memoization: React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. This dependency may be mutated later, which could cause the value to change unexpectedly
|
Memoization: Compilation skipped because existing memoization could not be preserved
|
||||||
|
|
||||||
|
React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. This dependency may be mutated later, which could cause the value to change unexpectedly.
|
||||||
|
|
||||||
error.false-positive-useMemo-infer-mutate-deps.ts:14:6
|
error.false-positive-useMemo-infer-mutate-deps.ts:14:6
|
||||||
12 | return useMemo(() => {
|
12 | return useMemo(() => {
|
||||||
13 | return identity(val);
|
13 | return identity(val);
|
||||||
> 14 | }, [val]);
|
> 14 | }, [val]);
|
||||||
| ^^^ React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. This dependency may be mutated later, which could cause the value to change unexpectedly
|
| ^^^ This dependency may be modified later
|
||||||
15 | }
|
15 | }
|
||||||
16 |
|
16 |
|
||||||
17 | export const FIXTURE_ENTRYPOINT = {
|
17 | export const FIXTURE_ENTRYPOINT = {
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -41,18 +41,18 @@ export const FIXTURE_ENTRYPOINT = {
|
||||||
|
|
||||||
```
|
```
|
||||||
Found 1 error:
|
Found 1 error:
|
||||||
Memoization: React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. This dependency may be mutated later, which could cause the value to change unexpectedly
|
Memoization: Compilation skipped because existing memoization could not be preserved
|
||||||
|
|
||||||
|
React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. This dependency may be mutated later, which could cause the value to change unexpectedly.
|
||||||
|
|
||||||
error.false-positive-useMemo-overlap-scopes.ts:23:9
|
error.false-positive-useMemo-overlap-scopes.ts:23:9
|
||||||
21 | const result = useMemo(() => {
|
21 | const result = useMemo(() => {
|
||||||
22 | return [Math.max(x[1], a)];
|
22 | return [Math.max(x[1], a)];
|
||||||
> 23 | }, [a, x]);
|
> 23 | }, [a, x]);
|
||||||
| ^ React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. This dependency may be mutated later, which could cause the value to change unexpectedly
|
| ^ This dependency may be modified later
|
||||||
24 | arrayPush(y, 3);
|
24 | arrayPush(y, 3);
|
||||||
25 | return {result, y};
|
25 | return {result, y};
|
||||||
26 | }
|
26 | }
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -27,9 +27,9 @@ export const FIXTURE_ENTRYPOINT = {
|
||||||
|
|
||||||
```
|
```
|
||||||
Found 1 error:
|
Found 1 error:
|
||||||
Memoization: React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected
|
Memoization: Compilation skipped because existing memoization could not be preserved
|
||||||
|
|
||||||
The inferred dependency was `propB`, but the source dependencies were [propA, propB.x.y]. Inferred less specific property than source.
|
React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected. The inferred dependency was `propB`, but the source dependencies were [propA, propB.x.y]. Inferred less specific property than source.
|
||||||
|
|
||||||
error.hoist-useCallback-conditional-access-own-scope.ts:5:21
|
error.hoist-useCallback-conditional-access-own-scope.ts:5:21
|
||||||
3 |
|
3 |
|
||||||
|
|
@ -47,12 +47,10 @@ error.hoist-useCallback-conditional-access-own-scope.ts:5:21
|
||||||
> 10 | }
|
> 10 | }
|
||||||
| ^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^
|
||||||
> 11 | }, [propA, propB.x.y]);
|
> 11 | }, [propA, propB.x.y]);
|
||||||
| ^^^^ React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected
|
| ^^^^ Could not preserve existing manual memoization
|
||||||
12 | }
|
12 | }
|
||||||
13 |
|
13 |
|
||||||
14 | export const FIXTURE_ENTRYPOINT = {
|
14 | export const FIXTURE_ENTRYPOINT = {
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -30,9 +30,9 @@ export const FIXTURE_ENTRYPOINT = {
|
||||||
|
|
||||||
```
|
```
|
||||||
Found 2 errors:
|
Found 2 errors:
|
||||||
Memoization: React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected
|
Memoization: Compilation skipped because existing memoization could not be preserved
|
||||||
|
|
||||||
The inferred dependency was `propA`, but the source dependencies were [propA.a, propB.x.y]. Inferred less specific property than source.
|
React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected. The inferred dependency was `propA`, but the source dependencies were [propA.a, propB.x.y]. Inferred less specific property than source.
|
||||||
|
|
||||||
error.hoist-useCallback-infer-conditional-value-block.ts:6:21
|
error.hoist-useCallback-infer-conditional-value-block.ts:6:21
|
||||||
4 |
|
4 |
|
||||||
|
|
@ -54,15 +54,13 @@ error.hoist-useCallback-infer-conditional-value-block.ts:6:21
|
||||||
> 13 | }
|
> 13 | }
|
||||||
| ^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^
|
||||||
> 14 | }, [propA.a, propB.x.y]);
|
> 14 | }, [propA.a, propB.x.y]);
|
||||||
| ^^^^ React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected
|
| ^^^^ Could not preserve existing manual memoization
|
||||||
15 | }
|
15 | }
|
||||||
16 |
|
16 |
|
||||||
17 | export const FIXTURE_ENTRYPOINT = {
|
17 | export const FIXTURE_ENTRYPOINT = {
|
||||||
|
Memoization: Compilation skipped because existing memoization could not be preserved
|
||||||
|
|
||||||
|
React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected. The inferred dependency was `propB`, but the source dependencies were [propA.a, propB.x.y]. Inferred less specific property than source.
|
||||||
Memoization: React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected
|
|
||||||
|
|
||||||
The inferred dependency was `propB`, but the source dependencies were [propA.a, propB.x.y]. Inferred less specific property than source.
|
|
||||||
|
|
||||||
error.hoist-useCallback-infer-conditional-value-block.ts:6:21
|
error.hoist-useCallback-infer-conditional-value-block.ts:6:21
|
||||||
4 |
|
4 |
|
||||||
|
|
@ -84,12 +82,10 @@ error.hoist-useCallback-infer-conditional-value-block.ts:6:21
|
||||||
> 13 | }
|
> 13 | }
|
||||||
| ^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^
|
||||||
> 14 | }, [propA.a, propB.x.y]);
|
> 14 | }, [propA.a, propB.x.y]);
|
||||||
| ^^^^ React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected
|
| ^^^^ Could not preserve existing manual memoization
|
||||||
15 | }
|
15 | }
|
||||||
16 |
|
16 |
|
||||||
17 | export const FIXTURE_ENTRYPOINT = {
|
17 | export const FIXTURE_ENTRYPOINT = {
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -31,30 +31,30 @@ export const FIXTURE_ENTRYPOINT = {
|
||||||
|
|
||||||
```
|
```
|
||||||
Found 2 errors:
|
Found 2 errors:
|
||||||
Memoization: React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. This dependency may be mutated later, which could cause the value to change unexpectedly
|
Memoization: Compilation skipped because existing memoization could not be preserved
|
||||||
|
|
||||||
|
React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. This dependency may be mutated later, which could cause the value to change unexpectedly.
|
||||||
|
|
||||||
error.invalid-useCallback-captures-reassigned-context.ts:12:37
|
error.invalid-useCallback-captures-reassigned-context.ts:12:37
|
||||||
10 |
|
10 |
|
||||||
11 | // makeArray() is captured, but depsList contains [props]
|
11 | // makeArray() is captured, but depsList contains [props]
|
||||||
> 12 | const cb = useCallback(() => [x], [x]);
|
> 12 | const cb = useCallback(() => [x], [x]);
|
||||||
| ^ React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. This dependency may be mutated later, which could cause the value to change unexpectedly
|
| ^ This dependency may be modified later
|
||||||
13 |
|
13 |
|
||||||
14 | x = makeArray();
|
14 | x = makeArray();
|
||||||
15 |
|
15 |
|
||||||
|
Memoization: Compilation skipped because existing memoization could not be preserved
|
||||||
|
|
||||||
|
React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. This value was memoized in source but not in compilation output.
|
||||||
Memoization: React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. This value was memoized in source but not in compilation output.
|
|
||||||
|
|
||||||
error.invalid-useCallback-captures-reassigned-context.ts:12:25
|
error.invalid-useCallback-captures-reassigned-context.ts:12:25
|
||||||
10 |
|
10 |
|
||||||
11 | // makeArray() is captured, but depsList contains [props]
|
11 | // makeArray() is captured, but depsList contains [props]
|
||||||
> 12 | const cb = useCallback(() => [x], [x]);
|
> 12 | const cb = useCallback(() => [x], [x]);
|
||||||
| ^^^^^^^^^ React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. This value was memoized in source but not in compilation output.
|
| ^^^^^^^^^ Could not preserve existing memoization
|
||||||
13 |
|
13 |
|
||||||
14 | x = makeArray();
|
14 | x = makeArray();
|
||||||
15 |
|
15 |
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -18,9 +18,9 @@ function useHook(maybeRef) {
|
||||||
|
|
||||||
```
|
```
|
||||||
Found 1 error:
|
Found 1 error:
|
||||||
Memoization: React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected
|
Memoization: Compilation skipped because existing memoization could not be preserved
|
||||||
|
|
||||||
The inferred dependency was `maybeRef.current`, but the source dependencies were [maybeRef]. Differences in ref.current access.
|
React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected. The inferred dependency was `maybeRef.current`, but the source dependencies were [maybeRef]. Differences in ref.current access.
|
||||||
|
|
||||||
error.maybe-invalid-useCallback-read-maybeRef.ts:5:21
|
error.maybe-invalid-useCallback-read-maybeRef.ts:5:21
|
||||||
3 |
|
3 |
|
||||||
|
|
@ -30,11 +30,9 @@ error.maybe-invalid-useCallback-read-maybeRef.ts:5:21
|
||||||
> 6 | return [maybeRef.current];
|
> 6 | return [maybeRef.current];
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
> 7 | }, [maybeRef]);
|
> 7 | }, [maybeRef]);
|
||||||
| ^^^^ React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected
|
| ^^^^ Could not preserve existing manual memoization
|
||||||
8 | }
|
8 | }
|
||||||
9 |
|
9 |
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -18,9 +18,9 @@ function useHook(maybeRef, shouldRead) {
|
||||||
|
|
||||||
```
|
```
|
||||||
Found 1 error:
|
Found 1 error:
|
||||||
Memoization: React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected
|
Memoization: Compilation skipped because existing memoization could not be preserved
|
||||||
|
|
||||||
The inferred dependency was `maybeRef.current`, but the source dependencies were [shouldRead, maybeRef]. Differences in ref.current access.
|
React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected. The inferred dependency was `maybeRef.current`, but the source dependencies were [shouldRead, maybeRef]. Differences in ref.current access.
|
||||||
|
|
||||||
error.maybe-invalid-useMemo-read-maybeRef.ts:5:17
|
error.maybe-invalid-useMemo-read-maybeRef.ts:5:17
|
||||||
3 |
|
3 |
|
||||||
|
|
@ -30,11 +30,9 @@ error.maybe-invalid-useMemo-read-maybeRef.ts:5:17
|
||||||
> 6 | return () => [maybeRef.current];
|
> 6 | return () => [maybeRef.current];
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
> 7 | }, [shouldRead, maybeRef]);
|
> 7 | }, [shouldRead, maybeRef]);
|
||||||
| ^^^^ React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected
|
| ^^^^ Could not preserve existing manual memoization
|
||||||
8 | }
|
8 | }
|
||||||
9 |
|
9 |
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -29,9 +29,9 @@ export const FIXTURE_ENTRYPOINT = {
|
||||||
|
|
||||||
```
|
```
|
||||||
Found 1 error:
|
Found 1 error:
|
||||||
Memoization: React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected
|
Memoization: Compilation skipped because existing memoization could not be preserved
|
||||||
|
|
||||||
The inferred dependency was `ref`, but the source dependencies were []. Inferred dependency not present in source.
|
React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected. The inferred dependency was `ref`, but the source dependencies were []. Inferred dependency not present in source.
|
||||||
|
|
||||||
error.preserve-use-memo-ref-missing-reactive.ts:9:21
|
error.preserve-use-memo-ref-missing-reactive.ts:9:21
|
||||||
7 | const ref = cond ? ref1 : ref2;
|
7 | const ref = cond ? ref1 : ref2;
|
||||||
|
|
@ -45,12 +45,10 @@ error.preserve-use-memo-ref-missing-reactive.ts:9:21
|
||||||
> 12 | }
|
> 12 | }
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||||
> 13 | }, []);
|
> 13 | }, []);
|
||||||
| ^^^^ React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected
|
| ^^^^ Could not preserve existing manual memoization
|
||||||
14 | }
|
14 | }
|
||||||
15 |
|
15 |
|
||||||
16 | export const FIXTURE_ENTRYPOINT = {
|
16 | export const FIXTURE_ENTRYPOINT = {
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -29,18 +29,18 @@ export const FIXTURE_ENTRYPOINT = {
|
||||||
|
|
||||||
```
|
```
|
||||||
Found 1 error:
|
Found 1 error:
|
||||||
Memoization: React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. This value was memoized in source but not in compilation output.
|
Memoization: Compilation skipped because existing memoization could not be preserved
|
||||||
|
|
||||||
|
React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. This value was memoized in source but not in compilation output.
|
||||||
|
|
||||||
error.todo-useCallback-captures-invalidating-value.ts:13:21
|
error.todo-useCallback-captures-invalidating-value.ts:13:21
|
||||||
11 | x.push(props);
|
11 | x.push(props);
|
||||||
12 |
|
12 |
|
||||||
> 13 | return useCallback(() => [x], [x]);
|
> 13 | return useCallback(() => [x], [x]);
|
||||||
| ^^^^^^^^^ React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. This value was memoized in source but not in compilation output.
|
| ^^^^^^^^^ Could not preserve existing memoization
|
||||||
14 | }
|
14 | }
|
||||||
15 |
|
15 |
|
||||||
16 | export const FIXTURE_ENTRYPOINT = {
|
16 | export const FIXTURE_ENTRYPOINT = {
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -20,19 +20,17 @@ function useHook(x) {
|
||||||
|
|
||||||
```
|
```
|
||||||
Found 1 error:
|
Found 1 error:
|
||||||
Memoization: React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected
|
Memoization: Compilation skipped because existing memoization could not be preserved
|
||||||
|
|
||||||
The inferred dependency was `aliasedX`, but the source dependencies were [x, aliasedProp]. Inferred different dependency than source.
|
React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected. The inferred dependency was `aliasedX`, but the source dependencies were [x, aliasedProp]. Inferred different dependency than source.
|
||||||
|
|
||||||
error.useCallback-aliased-var.ts:9:21
|
error.useCallback-aliased-var.ts:9:21
|
||||||
7 | const aliasedProp = x.y.z;
|
7 | const aliasedProp = x.y.z;
|
||||||
8 |
|
8 |
|
||||||
> 9 | return useCallback(() => [aliasedX, x.y.z], [x, aliasedProp]);
|
> 9 | return useCallback(() => [aliasedX, x.y.z], [x, aliasedProp]);
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^ React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected
|
| ^^^^^^^^^^^^^^^^^^^^^^^ Could not preserve existing manual memoization
|
||||||
10 | }
|
10 | }
|
||||||
11 |
|
11 |
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -26,9 +26,9 @@ export const FIXTURE_ENTRYPOINT = {
|
||||||
|
|
||||||
```
|
```
|
||||||
Found 1 error:
|
Found 1 error:
|
||||||
Memoization: React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected
|
Memoization: Compilation skipped because existing memoization could not be preserved
|
||||||
|
|
||||||
The inferred dependency was `propB?.x.y`, but the source dependencies were [propA, propB.x.y]. Inferred different dependency than source.
|
React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected. The inferred dependency was `propB?.x.y`, but the source dependencies were [propA, propB.x.y]. Inferred different dependency than source.
|
||||||
|
|
||||||
error.useCallback-conditional-access-noAlloc.ts:5:21
|
error.useCallback-conditional-access-noAlloc.ts:5:21
|
||||||
3 |
|
3 |
|
||||||
|
|
@ -44,12 +44,10 @@ error.useCallback-conditional-access-noAlloc.ts:5:21
|
||||||
> 9 | };
|
> 9 | };
|
||||||
| ^^^^^^^^^^^^
|
| ^^^^^^^^^^^^
|
||||||
> 10 | }, [propA, propB.x.y]);
|
> 10 | }, [propA, propB.x.y]);
|
||||||
| ^^^^ React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected
|
| ^^^^ Could not preserve existing manual memoization
|
||||||
11 | }
|
11 | }
|
||||||
12 |
|
12 |
|
||||||
13 | export const FIXTURE_ENTRYPOINT = {
|
13 | export const FIXTURE_ENTRYPOINT = {
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -25,9 +25,9 @@ function Component({propA, propB}) {
|
||||||
|
|
||||||
```
|
```
|
||||||
Found 1 error:
|
Found 1 error:
|
||||||
Memoization: React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected
|
Memoization: Compilation skipped because existing memoization could not be preserved
|
||||||
|
|
||||||
The inferred dependency was `propB`, but the source dependencies were [propA?.a, propB.x.y]. Inferred less specific property than source.
|
React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected. The inferred dependency was `propB`, but the source dependencies were [propA?.a, propB.x.y]. Inferred less specific property than source.
|
||||||
|
|
||||||
error.useCallback-infer-less-specific-conditional-access.ts:6:21
|
error.useCallback-infer-less-specific-conditional-access.ts:6:21
|
||||||
4 |
|
4 |
|
||||||
|
|
@ -49,11 +49,9 @@ error.useCallback-infer-less-specific-conditional-access.ts:6:21
|
||||||
> 13 | }
|
> 13 | }
|
||||||
| ^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^
|
||||||
> 14 | }, [propA?.a, propB.x.y]);
|
> 14 | }, [propA?.a, propB.x.y]);
|
||||||
| ^^^^ React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected
|
| ^^^^ Could not preserve existing manual memoization
|
||||||
15 | }
|
15 | }
|
||||||
16 |
|
16 |
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -18,9 +18,9 @@ function Component({propA}) {
|
||||||
|
|
||||||
```
|
```
|
||||||
Found 1 error:
|
Found 1 error:
|
||||||
Memoization: React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected
|
Memoization: Compilation skipped because existing memoization could not be preserved
|
||||||
|
|
||||||
The inferred dependency was `propA`, but the source dependencies were [propA.x]. Inferred less specific property than source.
|
React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected. The inferred dependency was `propA`, but the source dependencies were [propA.x]. Inferred less specific property than source.
|
||||||
|
|
||||||
error.useCallback-property-call-dep.ts:5:21
|
error.useCallback-property-call-dep.ts:5:21
|
||||||
3 |
|
3 |
|
||||||
|
|
@ -30,11 +30,9 @@ error.useCallback-property-call-dep.ts:5:21
|
||||||
> 6 | return propA.x();
|
> 6 | return propA.x();
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^
|
||||||
> 7 | }, [propA.x]);
|
> 7 | }, [propA.x]);
|
||||||
| ^^^^ React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected
|
| ^^^^ Could not preserve existing manual memoization
|
||||||
8 | }
|
8 | }
|
||||||
9 |
|
9 |
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -20,19 +20,17 @@ function useHook(x) {
|
||||||
|
|
||||||
```
|
```
|
||||||
Found 1 error:
|
Found 1 error:
|
||||||
Memoization: React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected
|
Memoization: Compilation skipped because existing memoization could not be preserved
|
||||||
|
|
||||||
The inferred dependency was `x`, but the source dependencies were [aliasedX, aliasedProp]. Inferred different dependency than source.
|
React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected. The inferred dependency was `x`, but the source dependencies were [aliasedX, aliasedProp]. Inferred different dependency than source.
|
||||||
|
|
||||||
error.useMemo-aliased-var.ts:9:17
|
error.useMemo-aliased-var.ts:9:17
|
||||||
7 | const aliasedProp = x.y.z;
|
7 | const aliasedProp = x.y.z;
|
||||||
8 |
|
8 |
|
||||||
> 9 | return useMemo(() => [x, x.y.z], [aliasedX, aliasedProp]);
|
> 9 | return useMemo(() => [x, x.y.z], [aliasedX, aliasedProp]);
|
||||||
| ^^^^^^^^^^^^^^^^ React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected
|
| ^^^^^^^^^^^^^^^^ Could not preserve existing manual memoization
|
||||||
10 | }
|
10 | }
|
||||||
11 |
|
11 |
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -25,9 +25,9 @@ function Component({propA, propB}) {
|
||||||
|
|
||||||
```
|
```
|
||||||
Found 1 error:
|
Found 1 error:
|
||||||
Memoization: React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected
|
Memoization: Compilation skipped because existing memoization could not be preserved
|
||||||
|
|
||||||
The inferred dependency was `propB`, but the source dependencies were [propA?.a, propB.x.y]. Inferred less specific property than source.
|
React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected. The inferred dependency was `propB`, but the source dependencies were [propA?.a, propB.x.y]. Inferred less specific property than source.
|
||||||
|
|
||||||
error.useMemo-infer-less-specific-conditional-access.ts:6:17
|
error.useMemo-infer-less-specific-conditional-access.ts:6:17
|
||||||
4 |
|
4 |
|
||||||
|
|
@ -49,11 +49,9 @@ error.useMemo-infer-less-specific-conditional-access.ts:6:17
|
||||||
> 13 | }
|
> 13 | }
|
||||||
| ^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^
|
||||||
> 14 | }, [propA?.a, propB.x.y]);
|
> 14 | }, [propA?.a, propB.x.y]);
|
||||||
| ^^^^ React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected
|
| ^^^^ Could not preserve existing manual memoization
|
||||||
15 | }
|
15 | }
|
||||||
16 |
|
16 |
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -25,9 +25,9 @@ function Component({propA, propB}) {
|
||||||
|
|
||||||
```
|
```
|
||||||
Found 2 errors:
|
Found 2 errors:
|
||||||
Memoization: React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected
|
Memoization: Compilation skipped because existing memoization could not be preserved
|
||||||
|
|
||||||
The inferred dependency was `propA`, but the source dependencies were [propA.a, propB.x.y]. Inferred less specific property than source.
|
React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected. The inferred dependency was `propA`, but the source dependencies were [propA.a, propB.x.y]. Inferred less specific property than source.
|
||||||
|
|
||||||
error.useMemo-infer-less-specific-conditional-value-block.ts:6:17
|
error.useMemo-infer-less-specific-conditional-value-block.ts:6:17
|
||||||
4 |
|
4 |
|
||||||
|
|
@ -49,14 +49,12 @@ error.useMemo-infer-less-specific-conditional-value-block.ts:6:17
|
||||||
> 13 | }
|
> 13 | }
|
||||||
| ^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^
|
||||||
> 14 | }, [propA.a, propB.x.y]);
|
> 14 | }, [propA.a, propB.x.y]);
|
||||||
| ^^^^ React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected
|
| ^^^^ Could not preserve existing manual memoization
|
||||||
15 | }
|
15 | }
|
||||||
16 |
|
16 |
|
||||||
|
Memoization: Compilation skipped because existing memoization could not be preserved
|
||||||
|
|
||||||
|
React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected. The inferred dependency was `propB`, but the source dependencies were [propA.a, propB.x.y]. Inferred less specific property than source.
|
||||||
Memoization: React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected
|
|
||||||
|
|
||||||
The inferred dependency was `propB`, but the source dependencies were [propA.a, propB.x.y]. Inferred less specific property than source.
|
|
||||||
|
|
||||||
error.useMemo-infer-less-specific-conditional-value-block.ts:6:17
|
error.useMemo-infer-less-specific-conditional-value-block.ts:6:17
|
||||||
4 |
|
4 |
|
||||||
|
|
@ -78,11 +76,9 @@ error.useMemo-infer-less-specific-conditional-value-block.ts:6:17
|
||||||
> 13 | }
|
> 13 | }
|
||||||
| ^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^
|
||||||
> 14 | }, [propA.a, propB.x.y]);
|
> 14 | }, [propA.a, propB.x.y]);
|
||||||
| ^^^^ React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected
|
| ^^^^ Could not preserve existing manual memoization
|
||||||
15 | }
|
15 | }
|
||||||
16 |
|
16 |
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -20,9 +20,9 @@ function Component({propA}) {
|
||||||
|
|
||||||
```
|
```
|
||||||
Found 1 error:
|
Found 1 error:
|
||||||
Memoization: React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected
|
Memoization: Compilation skipped because existing memoization could not be preserved
|
||||||
|
|
||||||
The inferred dependency was `propA`, but the source dependencies were [propA.x]. Inferred less specific property than source.
|
React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected. The inferred dependency was `propA`, but the source dependencies were [propA.x]. Inferred less specific property than source.
|
||||||
|
|
||||||
error.useMemo-property-call-chained-object.ts:5:17
|
error.useMemo-property-call-chained-object.ts:5:17
|
||||||
3 |
|
3 |
|
||||||
|
|
@ -36,11 +36,9 @@ error.useMemo-property-call-chained-object.ts:5:17
|
||||||
> 8 | };
|
> 8 | };
|
||||||
| ^^^^^^^^^^^^
|
| ^^^^^^^^^^^^
|
||||||
> 9 | }, [propA.x]);
|
> 9 | }, [propA.x]);
|
||||||
| ^^^^ React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected
|
| ^^^^ Could not preserve existing manual memoization
|
||||||
10 | }
|
10 | }
|
||||||
11 |
|
11 |
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -18,9 +18,9 @@ function Component({propA}) {
|
||||||
|
|
||||||
```
|
```
|
||||||
Found 1 error:
|
Found 1 error:
|
||||||
Memoization: React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected
|
Memoization: Compilation skipped because existing memoization could not be preserved
|
||||||
|
|
||||||
The inferred dependency was `propA`, but the source dependencies were [propA.x]. Inferred less specific property than source.
|
React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected. The inferred dependency was `propA`, but the source dependencies were [propA.x]. Inferred less specific property than source.
|
||||||
|
|
||||||
error.useMemo-property-call-dep.ts:5:17
|
error.useMemo-property-call-dep.ts:5:17
|
||||||
3 |
|
3 |
|
||||||
|
|
@ -30,11 +30,9 @@ error.useMemo-property-call-dep.ts:5:17
|
||||||
> 6 | return propA.x();
|
> 6 | return propA.x();
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^
|
||||||
> 7 | }, [propA.x]);
|
> 7 | }, [propA.x]);
|
||||||
| ^^^^ React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected
|
| ^^^^ Could not preserve existing manual memoization
|
||||||
8 | }
|
8 | }
|
||||||
9 |
|
9 |
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -31,9 +31,9 @@ function useFoo(input1) {
|
||||||
|
|
||||||
```
|
```
|
||||||
Found 1 error:
|
Found 1 error:
|
||||||
Memoization: React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected
|
Memoization: Compilation skipped because existing memoization could not be preserved
|
||||||
|
|
||||||
The inferred dependency was `input1`, but the source dependencies were [y]. Inferred different dependency than source.
|
React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected. The inferred dependency was `input1`, but the source dependencies were [y]. Inferred different dependency than source.
|
||||||
|
|
||||||
error.useMemo-unrelated-mutation-in-depslist.ts:16:27
|
error.useMemo-unrelated-mutation-in-depslist.ts:16:27
|
||||||
14 | const x = {};
|
14 | const x = {};
|
||||||
|
|
@ -43,12 +43,10 @@ error.useMemo-unrelated-mutation-in-depslist.ts:16:27
|
||||||
> 17 | return [y];
|
> 17 | return [y];
|
||||||
| ^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^
|
||||||
> 18 | }, [(mutate(x), y)]);
|
> 18 | }, [(mutate(x), y)]);
|
||||||
| ^^^^ React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected
|
| ^^^^ Could not preserve existing manual memoization
|
||||||
19 |
|
19 |
|
||||||
20 | return [x, memoized];
|
20 | return [x, memoized];
|
||||||
21 | }
|
21 | }
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -25,9 +25,9 @@ function Component(props) {
|
||||||
|
|
||||||
```
|
```
|
||||||
Found 1 error:
|
Found 1 error:
|
||||||
Memoization: React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected
|
Memoization: Compilation skipped because existing memoization could not be preserved
|
||||||
|
|
||||||
The inferred dependency was `props.items`, but the source dependencies were [props?.items, props.cond]. Inferred different dependency than source.
|
React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected. The inferred dependency was `props.items`, but the source dependencies were [props?.items, props.cond]. Inferred different dependency than source.
|
||||||
|
|
||||||
error.todo-optional-member-expression-with-conditional-optional.ts:4:23
|
error.todo-optional-member-expression-with-conditional-optional.ts:4:23
|
||||||
2 | import {ValidateMemoization} from 'shared-runtime';
|
2 | import {ValidateMemoization} from 'shared-runtime';
|
||||||
|
|
@ -47,12 +47,10 @@ error.todo-optional-member-expression-with-conditional-optional.ts:4:23
|
||||||
> 10 | return x;
|
> 10 | return x;
|
||||||
| ^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^
|
||||||
> 11 | }, [props?.items, props.cond]);
|
> 11 | }, [props?.items, props.cond]);
|
||||||
| ^^^^ React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected
|
| ^^^^ Could not preserve existing manual memoization
|
||||||
12 | return (
|
12 | return (
|
||||||
13 | <ValidateMemoization inputs={[props?.items, props.cond]} output={data} />
|
13 | <ValidateMemoization inputs={[props?.items, props.cond]} output={data} />
|
||||||
14 | );
|
14 | );
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -25,9 +25,9 @@ function Component(props) {
|
||||||
|
|
||||||
```
|
```
|
||||||
Found 1 error:
|
Found 1 error:
|
||||||
Memoization: React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected
|
Memoization: Compilation skipped because existing memoization could not be preserved
|
||||||
|
|
||||||
The inferred dependency was `props.items`, but the source dependencies were [props?.items, props.cond]. Inferred different dependency than source.
|
React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected. The inferred dependency was `props.items`, but the source dependencies were [props?.items, props.cond]. Inferred different dependency than source.
|
||||||
|
|
||||||
error.todo-optional-member-expression-with-conditional.ts:4:23
|
error.todo-optional-member-expression-with-conditional.ts:4:23
|
||||||
2 | import {ValidateMemoization} from 'shared-runtime';
|
2 | import {ValidateMemoization} from 'shared-runtime';
|
||||||
|
|
@ -47,12 +47,10 @@ error.todo-optional-member-expression-with-conditional.ts:4:23
|
||||||
> 10 | return x;
|
> 10 | return x;
|
||||||
| ^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^
|
||||||
> 11 | }, [props?.items, props.cond]);
|
> 11 | }, [props?.items, props.cond]);
|
||||||
| ^^^^ React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. The inferred dependencies did not match the manually specified dependencies, which could cause the value to change more or less frequently than expected
|
| ^^^^ Could not preserve existing manual memoization
|
||||||
12 | return (
|
12 | return (
|
||||||
13 | <ValidateMemoization inputs={[props?.items, props.cond]} output={data} />
|
13 | <ValidateMemoization inputs={[props?.items, props.cond]} output={data} />
|
||||||
14 | );
|
14 | );
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
Loading…
Reference in New Issue
Block a user