-
Notifications
You must be signed in to change notification settings - Fork 25k
Extracted UnsupportedFunctionReturnTypeAnnotationParserError to throwIfUnsupportedFunctionReturnTypeAnnotationParserError #34965
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
…IfUnsupportedFunctionReturnTypeAnnotationParserError
Base commit: 31f2199 |
Base commit: 31f2199 |
cipolleschi
left a comment
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.
Hi, thank you so much for taking this task! 👏
I left a very small comment on naming. A part from that, it looks good to me!
|
|
||
| function throwIfUnsupportedFunctionReturnTypeAnnotationParserError( | ||
| nativeModuleName: string, | ||
| flowReturnTypeAnnotation: $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.
nit: can we change the name of the parameter with just returnTypeAnnotation?
At this point, we are not discriminating between the language in the params.
Thank you so much!
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.
Then should I remove the returnTypeAnnotation on line 25? Can both of them be handled from a common variable?
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.
I'm not sure I am following your suggestion. My comment was related to the name of the parameter we are using.
Can you expand on how will you remove the returnTypeAnnotation? Would you like to pass directly the returnTypeAnnotation.type value?
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.
I have made some changes to the parameter name. I hope that works. Please let me know what you think.
|
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
|
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
|
This pull request was successfully merged by @harsh-siriah in 3247436. When will my fix make it into a release? | Upcoming Releases |
…IfUnsupportedFunctionReturnTypeAnnotationParserError (facebook#34965) Summary: This PR is part of facebook#34872 This PR extracts `UnsupportedFunctionReturnTypeAnnotationParserError` exception to a separate function inside an `error-utils.js` file ## Changelog [Internal] [Changed] - Extract `UnsupportedFunctionReturnTypeAnnotationParserError` to a seperate function inside `error-utils.js` Pull Request resolved: facebook#34965 Test Plan: ```sh yarn jest react-native-codegen ``` Added unit case in `error-utils-test.js` file <img width="939" alt="Screenshot 2022-10-13 at 11 46 54 AM" src="https://user-images.githubusercontent.com/86605635/195517350-dcb7a26d-434c-4e45-a174-ce82931073e5.png"> Reviewed By: dmytrorykun Differential Revision: D40338048 Pulled By: cipolleschi fbshipit-source-id: baa41e0e96c9e17a35f316433c8d80c9bf88d334
Summary
This PR is part of #34872
This PR extracts
UnsupportedFunctionReturnTypeAnnotationParserErrorexception to a separate function inside anerror-utils.jsfileChangelog
[Internal] [Changed] - Extract
UnsupportedFunctionReturnTypeAnnotationParserErrorto a seperate function insideerror-utils.jsTest Plan
Added unit case in
error-utils-test.jsfile