-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
[codegen] move remapUnionTypeAnnotationMemberNames to Parser #35314
[codegen] move remapUnionTypeAnnotationMemberNames to Parser #35314
Conversation
0c4c05f
to
ca1a85e
Compare
Base commit: f657d29 |
Base commit: f657d29 |
PR build artifact for ca1a85e is ready. |
PR build artifact for ca1a85e is ready. |
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.
Thanks for doing this, it looks very good to me! :D
Could you rebase to solve conflicts? 🙏 |
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
ca1a85e
to
9aac210
Compare
@cipolleschi it's rebased ! |
PR build artifact for 9aac210 is ready. |
PR build artifact for 9aac210 is ready. |
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Summary: Part of facebook#34872 (comment) > [Assigned to youedd] Create a new function [remapUnionTypeAnnotationMemberNames](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/parsers-commons.js#L110) in the [parser.js file](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/parser.js) and add documentation to it. Implement it properly in the [FlowParser.js](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/flow/parser.js#L15) and in the [TypeScriptParser.js](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/typescript/parser.js#L15). Remove the function [remapUnionTypeAnnotationMemberNames](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/parsers-commons.js#L110) and update the [emitUnionTypeAnnotation](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/parsers-commons.js#L110) signature to accept a Parser parameter instead of a language one. Use the new Parser function instead of the old one [here](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/parsers-commons.js#L139). ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://reactnative.dev/contributing/changelogs-in-pull-requests --> [Internal] [changed] - move remapUnionTypeAnnotationMemberNames to the parsers implementations Pull Request resolved: facebook#35314 Test Plan: `yarn jest react-native-codegen` ![image](https://user-images.githubusercontent.com/19575877/201389910-31d48601-7023-4c94-a6d5-efccb18629cd.png) Reviewed By: christophpurrer Differential Revision: D41247716 Pulled By: cipolleschi fbshipit-source-id: 6f708895392d5bdac5d4edbc67587194321ddb3d
Summary
Part of #34872 (comment)
Changelog
[Internal] [changed] - move remapUnionTypeAnnotationMemberNames to the parsers implementations
Test Plan
yarn jest react-native-codegen