From 9c2eeb4198bfd392bb903d93d3456d352931e816 Mon Sep 17 00:00:00 2001 From: Christoph Pader Date: Wed, 17 Dec 2025 10:04:54 -0500 Subject: [PATCH 1/4] fix: update log for manual memo errors --- scripts/react-compiler-compliance-check.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/react-compiler-compliance-check.ts b/scripts/react-compiler-compliance-check.ts index 8ccb03f85ce3..e38d848aa289 100644 --- a/scripts/react-compiler-compliance-check.ts +++ b/scripts/react-compiler-compliance-check.ts @@ -650,7 +650,7 @@ class ResultsPrinter { } log(); - logError(`The following newly added components should be auto memoized by the React Compiler (manual memoization is not allowed):`); + logError(`The following components should be auto memoized by the React Compiler and therefore manual memoization should be removed:`); for (const [filePath, manualMemoizationMatches] of manualMemoFailures) { log(); From 88a4653cb7e04e3c5a8446862415b2c97ea6b1b9 Mon Sep 17 00:00:00 2001 From: Christoph Pader Date: Wed, 17 Dec 2025 13:53:18 -0500 Subject: [PATCH 2/4] refactor: accept Set in `ManualMemoizationChecker.findViolations` --- scripts/react-compiler-compliance-check.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/react-compiler-compliance-check.ts b/scripts/react-compiler-compliance-check.ts index e38d848aa289..270beb50dfd0 100644 --- a/scripts/react-compiler-compliance-check.ts +++ b/scripts/react-compiler-compliance-check.ts @@ -425,7 +425,7 @@ class ManualMemoizationChecker { } } - const manualMemoFailures = this.findViolations([...enforcedAutoMemoFiles]); + const manualMemoFailures = this.findViolations(enforcedAutoMemoFiles); return { manualMemoFailures, @@ -465,7 +465,7 @@ class ManualMemoizationChecker { return {addedFiles, enforcedAutoMemoFiles}; } - private static findViolations(files: string[]): Map { + private static findViolations(files: Set): Map { const manualMemoFailures = new Map(); for (const file of files) { From d325980fcf7557d0c8a2ff33aebbd77e44829b42 Mon Sep 17 00:00:00 2001 From: Christoph Pader Date: Wed, 17 Dec 2025 13:53:30 -0500 Subject: [PATCH 3/4] fix: only show manual memo errors in added files --- scripts/react-compiler-compliance-check.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/react-compiler-compliance-check.ts b/scripts/react-compiler-compliance-check.ts index 270beb50dfd0..cbb8938d0614 100644 --- a/scripts/react-compiler-compliance-check.ts +++ b/scripts/react-compiler-compliance-check.ts @@ -450,14 +450,15 @@ class ManualMemoizationChecker { filesWithFailures.add(filePath); - if (file.diffType === 'added') { + const isAddedFile = file.diffType === 'added'; + if (isAddedFile) { addedFiles.add(filePath); } const isReactComponentSourceFile = this.FILE_EXTENSIONS.some((extension) => filePath.endsWith(extension)); - const isSuccessfullyCompiled = successFiles.has(filePath); - if (isReactComponentSourceFile && isSuccessfullyCompiled) { + + if (isReactComponentSourceFile && isSuccessfullyCompiled && isAddedFile) { enforcedAutoMemoFiles.add(filePath); } } From 27059372a285e0559f695c5ce84247acd0cbdd45 Mon Sep 17 00:00:00 2001 From: Christoph Pader Date: Wed, 17 Dec 2025 13:54:33 -0500 Subject: [PATCH 4/4] Revert "fix: update log for manual memo errors" This reverts commit 9c2eeb4198bfd392bb903d93d3456d352931e816. --- scripts/react-compiler-compliance-check.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/react-compiler-compliance-check.ts b/scripts/react-compiler-compliance-check.ts index cbb8938d0614..7ed344a77846 100644 --- a/scripts/react-compiler-compliance-check.ts +++ b/scripts/react-compiler-compliance-check.ts @@ -651,7 +651,7 @@ class ResultsPrinter { } log(); - logError(`The following components should be auto memoized by the React Compiler and therefore manual memoization should be removed:`); + logError(`The following newly added components should be auto memoized by the React Compiler (manual memoization is not allowed):`); for (const [filePath, manualMemoizationMatches] of manualMemoFailures) { log();