-
Notifications
You must be signed in to change notification settings - Fork 25k
chore: Extract codegen translateFunctionTypeAnnotation into a common function #35182
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
Conversation
Base commit: 46de03a |
Base commit: 46de03a |
|
PR build artifact for ff7c875 is ready. |
|
@rshest has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
| } | ||
|
|
||
| function getTypeAnnotationParameters( | ||
| typeAnnotation: $FlowFixMe, |
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.
@gabrieldonadel The amount of $FlowFixMes increased quite a bit after the refactoring, is it something that could be avoided?..
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.
That's because FunctionTypeAnnotation is still not typed yet and as most of these functions use some property of it and I'm not sure how to type it. There are two TODOs tho, of which I'm not 100% aware of the details, TODO(T71778680) and TODO(T108222691)
|
This pull request was successfully merged by @gabrieldonadel in 62244d4. When will my fix make it into a release? | Upcoming Releases |
…function (facebook#35182) Summary: This PR extracts the codegen `translateFunctionTypeAnnotation` Flow and TypeScript functions into a single common function in the `parsers-primitives.js` file that can be used by both parsers as requested on facebook#34872. ## Changelog [Internal] [Changed] - Extract codegen `translateFunctionTypeAnnotation` into a common function in the` parsers-primitives.js` file Pull Request resolved: facebook#35182 Test Plan: Run `yarn jest react-native-codegen` and ensure CI is green  Reviewed By: cortinico Differential Revision: D41030544 Pulled By: rshest fbshipit-source-id: bc93c21e31ed4e8c3293cafe3d808d9f36cf8ecc
Summary
This PR extracts the codegen
translateFunctionTypeAnnotationFlow and TypeScript functions into a single common function in theparsers-primitives.jsfile that can be used by both parsers as requested on #34872.Changelog
[Internal] [Changed] - Extract codegen
translateFunctionTypeAnnotationinto a common function in theparsers-primitives.jsfileTest Plan
Run
yarn jest react-native-codegenand ensure CI is green