dillon1000/react

Commit

[compiler] Phase 4 (batch 1): Update validation passes to record errors on env (#35875)

Update 9 validation passes to record errors directly on fn.env instead
of
returning Result<void, CompilerError>:
- validateHooksUsage
- validateNoCapitalizedCalls (also changed throwInvalidReact to
recordError)
- validateUseMemo
- dropManualMemoization
- validateNoRefAccessInRender
- validateNoSetStateInRender
- validateNoImpureFunctionsInRender
- validateNoFreezingKnownMutableFunctions
- validateExhaustiveDependencies

Each pass now calls fn.env.recordErrors() instead of returning
errors.asResult().
Pipeline.ts call sites updated to remove tryRecord() wrappers and
.unwrap().

---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/facebook/react/pull/35875).
* #35888
* #35884
* #35883
* #35882
* #35881
* #35880
* #35879
* #35878
* #35877
* #35876
* __->__ #35875
Browse files
Changed paths12 files
First-parent comparison
M compiler/fault-tolerance-overview.md ModifiedM compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Pipeline.ts ModifiedM compiler/packages/babel-plugin-react-compiler/src/Inference/DropManualMemoization.ts ModifiedM compiler/packages/babel-plugin-react-compiler/src/Validation/ValidateExhaustiveDependencies.ts ModifiedM compiler/packages/babel-plugin-react-compiler/src/Validation/ValidateHooksUsage.ts ModifiedM compiler/packages/babel-plugin-react-compiler/src/Validation/ValidateNoCapitalizedCalls.ts ModifiedM compiler/packages/babel-plugin-react-compiler/src/Validation/ValidateNoFreezingKnownMutableFunctions.ts ModifiedM compiler/packages/babel-plugin-react-compiler/src/Validation/ValidateNoImpureFunctionsInRender.ts ModifiedM compiler/packages/babel-plugin-react-compiler/src/Validation/ValidateNoRefAccessInRender.ts ModifiedM compiler/packages/babel-plugin-react-compiler/src/Validation/ValidateNoSetStateInRender.ts ModifiedM compiler/packages/babel-plugin-react-compiler/src/Validation/ValidateUseMemo.ts ModifiedM compiler/packages/eslint-plugin-react-compiler/__tests__/NoCapitalizedCallsRule-test.ts Modified
Patch

Files changed

Rendering syntax-highlighted changes…