Skip to content

Conversation

jorge-cab
Copy link
Contributor

Summary

How did you test this change?

jorge-cab and others added 11 commits August 8, 2025 08:50
Adds some new test cases for ValidateNoDerivedComputationsInEffects.
…ps derived effects

This PR adds infra to disambiguate between two types of derived state in effects:
  1. State derived from props
  2. State derived from other state

TODO:
- [ ] Props tracking through destructuring and property access does not seem to be propagated correctly inside of Functions' instructions (or i might be misunderstanding how we track aliasing effects)
- [ ] compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useEffect/invalid-derived-state-from-props-computed.js should be failing
- [ ] Handle "mixed" case where deps flow from at least one prop AND state. Should probably have a different error reason, to aid with categorization
@meta-cla meta-cla bot added the CLA Signed label Aug 21, 2025
@jorge-cab jorge-cab changed the title Disambiguate no derived computations in effect compiler validation [wip] Disambiguate no derived computations in effect compiler validation Aug 21, 2025
@jorge-cab jorge-cab changed the title [wip] Disambiguate no derived computations in effect compiler validation [compiler][wip] Disambiguate no derived computations in effect compiler validation Aug 21, 2025
@jorge-cab jorge-cab changed the title [compiler][wip] Disambiguate no derived computations in effect compiler validation [compiler] Disambiguate no derived computations in effect compiler validation Aug 28, 2025
@jorge-cab jorge-cab marked this pull request as ready for review August 28, 2025 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants