Skip to content

[compiler] Remove fallback compilation pipeline dead code#548

Closed
everettbu wants to merge 1 commit into
mainfrom
retry-pipeline-cleanup
Closed

[compiler] Remove fallback compilation pipeline dead code#548
everettbu wants to merge 1 commit into
mainfrom
retry-pipeline-cleanup

Conversation

@everettbu

Copy link
Copy Markdown

Mirror of facebook/react#35827
Original author: josephsavona


Remove dead code left behind after the removal of retryCompileFunction, enableFire, and inferEffectDependencies:

  • Delete ValidateNoUntransformedReferences.ts (always a no-op)
  • Remove CompileProgramMetadata type and retryErrors from ProgramContext
  • Remove 'client-no-memo' output mode
  • Change compileProgram return type from CompileProgramMetadata | null to void

Remove dead code left behind after the removal of retryCompileFunction,
enableFire, and inferEffectDependencies:
- Delete ValidateNoUntransformedReferences.ts (always a no-op)
- Remove CompileProgramMetadata type and retryErrors from ProgramContext
- Remove 'client-no-memo' output mode
- Change compileProgram return type from CompileProgramMetadata | null to void
@everettbu everettbu added CLA Signed React Core Team Opened by a member of the React Core Team labels Feb 20, 2026
@greptile-apps

greptile-apps Bot commented Feb 20, 2026

Copy link
Copy Markdown

Greptile Summary

This PR removes dead code from the React Compiler that was left behind after the removal of retryCompileFunction, enableFire, and inferEffectDependencies. The changes are well-scoped and consistent:

  • Deletes ValidateNoUntransformedReferences.ts, which was always a no-op since moduleLoadChecks was initialized as an empty map and never populated
  • Removes CompileProgramMetadata type and retryErrors from ProgramContext, since they were only used by the now-removed retry pipeline
  • Removes the client-no-memo output mode from the schema and all switch cases in Environment.ts
  • Simplifies compileProgram return type from CompileProgramMetadata | null to void

No remaining references to any of the removed constructs were found across the codebase. One minor nit: the @returns JSDoc on compileProgram is now stale.

Confidence Score: 5/5

  • This PR is safe to merge — it only removes dead code with no behavioral changes.
  • All changes are strictly deletions of dead code (unused types, a no-op validation function, an unused output mode). No remaining references to any removed constructs exist in the codebase. The exhaustive switch statements in Environment.ts correctly handle the reduced set of output modes. The only finding is a stale JSDoc comment, which is cosmetic.
  • No files require special attention

Important Files Changed

Filename Overview
compiler/packages/babel-plugin-react-compiler/src/Babel/BabelPlugin.ts Removed import and call to validateNoUntransformedReferences, and dropped the return value from compileProgram. Clean removal with no issues.
compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Imports.ts Removed unused BabelFn import and retryErrors field from ProgramContext. No remaining references to either.
compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Options.ts Removed client-no-memo from CompilerOutputModeSchema enum. No remaining references in the codebase.
compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Program.ts Removed CompileProgramMetadata type and changed compileProgram return type to void. Stale @returns JSDoc remains.
compiler/packages/babel-plugin-react-compiler/src/Entrypoint/ValidateNoUntransformedReferences.ts File deleted entirely. The function was always a no-op (moduleLoadChecks was always empty). No remaining imports or references.
compiler/packages/babel-plugin-react-compiler/src/HIR/Environment.ts Removed client-no-memo cases from enableDropManualMemoization, enableMemoization, and enableValidations switch statements. The assertExhaustive default cases will correctly catch any invalid output modes.

Last reviewed commit: e52b267

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

6 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@greptile-apps

greptile-apps Bot commented Feb 20, 2026

Copy link
Copy Markdown
Additional Comments (1)

compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Program.ts
Stale @returns JSDoc
The @returns tag still says "Compilation results or null if compilation was skipped" but the function now returns void. This should be updated or removed to match the new signature.

 * Main entrypoint for React Compiler.
 *
 * @param program The Babel program node to compile
 * @param pass Compiler configuration and context
 */
Prompt To Fix With AI
This is a comment left during a code review.
Path: compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Program.ts
Line: 353-359

Comment:
**Stale `@returns` JSDoc**
The `@returns` tag still says "Compilation results or null if compilation was skipped" but the function now returns `void`. This should be updated or removed to match the new signature.

```suggestion
 * Main entrypoint for React Compiler.
 *
 * @param program The Babel program node to compile
 * @param pass Compiler configuration and context
 */
```

How can I resolve this? If you propose a fix, please make it concise.

@everettbu everettbu changed the title Remove fallback compilation pipeline dead code from compiler [compiler] Remove fallback compilation pipeline dead code Feb 20, 2026
@everettbu

Copy link
Copy Markdown
Author

Upstream PR was closed or merged. Code is synced via branch mirror.

@everettbu everettbu closed this Feb 23, 2026
@everettbu
everettbu deleted the retry-pipeline-cleanup branch February 23, 2026 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed React Core Team Opened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants