[Codegen]: Extract contents of the case 'BooleanTypeAnnotation' into a single emitBoolean function#34907
Closed
tarunrajput wants to merge 2 commits into
Closed
[Codegen]: Extract contents of the case 'BooleanTypeAnnotation' into a single emitBoolean function#34907tarunrajput wants to merge 2 commits into
tarunrajput wants to merge 2 commits into
Conversation
Base commit: 7227bde |
Base commit: 7227bde |
Contributor
|
@rshest has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
cipolleschi
requested changes
Oct 9, 2022
Contributor
cipolleschi
left a comment
There was a problem hiding this comment.
Thanks for taking this. 👏 That's amazing!
We can improve the quality even further by adding a unit test.
The steps should be:
- add the
__tests__subfolder in thepackages/react-native-codegen/src/parsers. - add a
parser-primitives-test.jswhere we unit test this fuction:- we test the output when the
nullableparameter isfalse - we test the output when the
nullableparameter istrue
- we test the output when the
An example of unit test can be found here.
Thank you so much! 🙏
Contributor
|
@rshest has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Collaborator
|
This pull request was successfully merged by @tarunrajput in 7a2e346. When will my fix make it into a release? | Upcoming Releases |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Part of #34872
This PR extracts the content of the case 'BooleanTypeAnnotation' (Flow, TypeScript) into a single emitBoolean function in the parsers-primitives.js file. Use the new function in the parsers.
Changelog
[Internal] [Changed] - Extract contents of the case 'BooleanTypeAnnotation' into a single emitBoolean function
Test Plan
Run
yarn jest react-native-codegen