[compiler] clean up retry pipeline: `fireRetry` flag -> compileMode
Removes `EnvironmentConfig.enableMinimalTransformsForRetry` in favor of `run` modes. This is a minimal difference but lets us explicitly opt certain compiler passes in/out of different modes. Retry flags don't really make sense to have in `EnvironmentConfig` anyways as the config is user-facing API, while retrying is a compiler implementation detail. (per @josephsavona's feedback https://github.com/facebook/react/pull/32164#issuecomment-2608616479) > Re the "hacky" framing of this in the PR title: I think this is fine. I can see having something like a compilation or output mode that we use when running the pipeline. Rather than changing environment settings when we re-run, various passes could take effect based on the combination of the mode + env flags. The modes might be: > > * Full: transform, validate, memoize. This is the default today. > * Transform: Along the lines of the backup mode in this PR. Only applies transforms that do not require following the rules of React, like `fire()`. > * Validate: This could be used for ESLint.
Showing
- compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Pipeline.ts 46 additions, 27 deletions...es/babel-plugin-react-compiler/src/Entrypoint/Pipeline.ts
- compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Program.ts 4 additions, 5 deletions...ges/babel-plugin-react-compiler/src/Entrypoint/Program.ts
- compiler/packages/babel-plugin-react-compiler/src/HIR/Environment.ts 12 additions, 13 deletions...ckages/babel-plugin-react-compiler/src/HIR/Environment.ts
- compiler/packages/babel-plugin-react-compiler/src/Inference/InferFunctionEffects.ts 12 additions, 7 deletions...ugin-react-compiler/src/Inference/InferFunctionEffects.ts
- compiler/packages/babel-plugin-react-compiler/src/Inference/InferReferenceEffects.ts 12 additions, 5 deletions...gin-react-compiler/src/Inference/InferReferenceEffects.ts
Please register or sign in to comment