-
Notifications
You must be signed in to change notification settings - Fork 24.5k
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 77] Extract the functions to compute partial properties in the Flow and TypeScript parsers. #36373
[Codegen 77] Extract the functions to compute partial properties in the Flow and TypeScript parsers. #36373
Conversation
ba9e359
to
70abd30
Compare
@MaeIg Could you please add tests for that as well? |
Base commit: 24dbb5d |
70abd30
to
9f5bf40
Compare
@rshest has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
* @paramater properties: properties from a Partial types. | ||
* @parameter hasteModuleName: a string with the native module name. | ||
* @paramater types: a map of type declarations. | ||
* @paramater aliasMap: a map of type aliases. | ||
* @paramater enumMap: a map of type enums. | ||
* @paramater tryParse: a parser error capturer. | ||
* @paramater cxxOnly: a boolean specifying if the module is Cxx only. |
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.
"parameter"?.. ;)
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.
Ups sorry for the typo!
I see that you fixed the typo and merged the PR, thank you! :)
…ypeScript parsers. (facebook#36373) Summary: This PR aims to extract the switch(configType) block from the buildSchema function into a separate function in a shared file between typescript and flow. It is a task of facebook#34872: > [Codegen 77 - assigned to MaeIg] Extract the functions to compute partial properties from the index.js file ([Flow](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/flow/modules/index.js#L180-L194) and [TypeScript](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/typescript/modules/index.js#L261-L278))in the Flow and TypeScript parsers. ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. Pick one each for the category and type tags: [ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message For more details, see: https://reactnative.dev/contributing/changelogs-in-pull-requests --> [Internal] [Changed] - Extract the functions to compute partial properties in the Flow and TypeScript parsers. Pull Request resolved: facebook#36373 Test Plan: yarn flow: <img width="560" alt="image" src="https://user-images.githubusercontent.com/40902940/222934040-97e88691-c1d6-44a1-b7ee-e500b4698cd2.png"> yarn lint: <img width="509" alt="image" src="https://user-images.githubusercontent.com/40902940/222934137-05b6f1fd-a755-4323-baac-5954d36fd613.png"> yarn test <img width="388" alt="image" src="https://user-images.githubusercontent.com/40902940/222934145-76a2bc38-7469-4c30-9301-bc21cfadded4.png"> Reviewed By: cipolleschi Differential Revision: D43867937 Pulled By: rshest fbshipit-source-id: f78fe399ff7d7d2cf8f44d1165418566b0a25628
Summary
This PR aims to extract the switch(configType) block from the buildSchema function into a separate function in a shared file between typescript and flow. It is a task of #34872:
Changelog
[Internal] [Changed] - Extract the functions to compute partial properties in the Flow and TypeScript parsers.
Test Plan
yarn flow:
![image](https://user-images.githubusercontent.com/40902940/222934040-97e88691-c1d6-44a1-b7ee-e500b4698cd2.png)
yarn lint:
![image](https://user-images.githubusercontent.com/40902940/222934137-05b6f1fd-a755-4323-baac-5954d36fd613.png)
yarn test
![image](https://user-images.githubusercontent.com/40902940/222934145-76a2bc38-7469-4c30-9301-bc21cfadded4.png)