You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Small fix to make all descriptions consistently printed with a single
period at the end.
Ran `grep -rn "description:" packages/babel-plugin-react-compiler/src
--include="*.ts" --exclude-dir="__tests__" | grep '\.\s*["\`]'` to find
all descriptions ending in a period and manually fixed them.
---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/facebook/react/pull/34404).
* #34409
* __->__ #34404
DiffTrain build for [80d7aa1](80d7aa1)
reason: 'Cannot access variable before it is declared',
41048
-
description: `${variable !== null && variable !== void 0 ? variable : 'This variable'} is accessed before it is declared, which prevents the earlier access from updating when this value changes over time.`,
41047
+
description: `${variable !== null && variable !== void 0 ? variable : 'This variable'} is accessed before it is declared, which prevents the earlier access from updating when this value changes over time`,
41049
41048
});
41050
41049
if (hoistedAccess != null && hoistedAccess.loc != effect.value.loc) {
@@ -49966,7 +49965,7 @@ class Visitor extends ReactiveFunctionVisitor {
49966
49965
reason: 'Existing memoization could not be preserved',
49967
49966
description: [
49968
49967
'React Compiler has skipped optimizing this component because the existing manual memoization could not be preserved. ',
49969
-
'This dependency may be mutated later, which could cause the value to change unexpectedly.',
49968
+
'This dependency may be mutated later, which could cause the value to change unexpectedly',
49970
49969
].join(''),
49971
49970
}).withDetails({
49972
49971
kind: 'error',
@@ -50007,7 +50006,7 @@ class Visitor extends ReactiveFunctionVisitor {
50007
50006
category: ErrorCategory.PreserveManualMemo,
50008
50007
reason: 'Existing memoization could not be preserved',
50009
50008
description: [
50010
-
'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. ',
50009
+
'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',
50011
50010
'',
50012
50011
]
50013
50012
.join('')
@@ -50082,7 +50081,7 @@ function validateUseMemo(fn) {
50082
50081
errors.pushDiagnostic(CompilerDiagnostic.create({
50083
50082
category: ErrorCategory.UseMemo,
50084
50083
reason: 'useMemo() callbacks may not accept parameters',
50085
-
description: 'useMemo() callbacks are called by React to cache calculations across re-renders. They should not take parameters. Instead, directly reference the props, state, or local variables needed for the computation.',
50084
+
description: 'useMemo() callbacks are called by React to cache calculations across re-renders. They should not take parameters. Instead, directly reference the props, state, or local variables needed for the computation',
50086
50085
suggestions: null,
50087
50086
}).withDetails({
50088
50087
kind: 'error',
@@ -50094,7 +50093,7 @@ function validateUseMemo(fn) {
50094
50093
errors.pushDiagnostic(CompilerDiagnostic.create({
50095
50094
category: ErrorCategory.UseMemo,
50096
50095
reason: 'useMemo() callbacks may not be async or generator functions',
50097
-
description: 'useMemo() callbacks are called once and must synchronously return a value.',
50096
+
description: 'useMemo() callbacks are called once and must synchronously return a value',
50098
50097
suggestions: null,
50099
50098
}).withDetails({
50100
50099
kind: 'error',
@@ -50122,7 +50121,7 @@ function validateLocalsNotReassignedAfterRender(fn) {
50122
50121
errors.pushDiagnostic(CompilerDiagnostic.create({
50123
50122
category: ErrorCategory.Immutability,
50124
50123
reason: 'Cannot reassign variable after render completes',
50125
-
description: `Reassigning ${variable} after render has completed can cause inconsistent behavior on subsequent renders. Consider using state instead.`,
50124
+
description: `Reassigning ${variable} after render has completed can cause inconsistent behavior on subsequent renders. Consider using state instead`,
50126
50125
}).withDetails({
50127
50126
kind: 'error',
50128
50127
loc: reassignment.loc,
@@ -51540,7 +51539,7 @@ function validateStaticComponents(fn) {
51540
51539
error.pushDiagnostic(CompilerDiagnostic.create({
51541
51540
category: ErrorCategory.StaticComponents,
51542
51541
reason: 'Cannot create components during render',
51543
-
description: `Components created during render will reset their state each time they are created. Declare components outside of render. `,
51542
+
description: `Components created during render will reset their state each time they are created. Declare components outside of render`,
51544
51543
})
51545
51544
.withDetails({
51546
51545
kind: 'error',
@@ -51577,7 +51576,7 @@ function validateNoFreezingKnownMutableFunctions(fn) {
51577
51576
errors.pushDiagnostic(CompilerDiagnostic.create({
51578
51577
category: ErrorCategory.Immutability,
51579
51578
reason: 'Cannot modify local variables after render completes',
51580
-
description: `This argument is a function which may reassign or mutate ${variable} after render, which can cause inconsistent behavior on subsequent renders. Consider using state instead.`,
51579
+
description: `This argument is a function which may reassign or mutate ${variable} after render, which can cause inconsistent behavior on subsequent renders. Consider using state instead`,
51581
51580
})
51582
51581
.withDetails({
51583
51582
kind: 'error',
@@ -53311,7 +53310,7 @@ function addImportsToProgram(path, programContext) {
53311
53310
for (const [specifierName, loweredImport] of importsMap) {
0 commit comments