-
Notifications
You must be signed in to change notification settings - Fork 47k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[compiler][ez] Fix reanimated custom type defs for imports #31137
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
installReAnimatedTypes( | ||
this.#moduleTypes, | ||
this.#shapes, | ||
REANIMATED_MODULE_NAME, | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Subtle design feedback here, but it's generally better to avoid mutating functions if possible. In this case, instead of installReanimatedTypes()
this could be buildReanimatedTypes()
which returns the same data type as moduleTypeResolver, and which we then install.
Alternatively, we could just pass #shapes
and then return a type, which the caller (here) adds to moduleTypes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! Thanks for the feedback
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! See comment for a small design tweak but thank you for fixing this!
When we added support for Reanimated, we didn't distinguish between true globals (i.e. identifiers with no static resolutions), module types, and imports #29188. For the past 3-4 months, Reanimated imports were not being matched to the correct hook / function shape we match globals and module imports against two different registries.
This PR fixes our support for Reanimated library functions imported under
react-native-reanimated
. See test fixtures for details