Skip to content

[Codegen] Wrap the content of the case Array and case $ReadOnlyArray in Flow into a separate function#34948

Closed
MaeIg wants to merge 2 commits into
facebook:mainfrom
MaeIg:refactor/extract-translateArrayTypeAnnotation-function
Closed

[Codegen] Wrap the content of the case Array and case $ReadOnlyArray in Flow into a separate function#34948
MaeIg wants to merge 2 commits into
facebook:mainfrom
MaeIg:refactor/extract-translateArrayTypeAnnotation-function

Conversation

@MaeIg
Copy link
Copy Markdown
Contributor

@MaeIg MaeIg commented Oct 11, 2022

Summary

This PR aims to extract translateArrayTypeAnnotation logic into a separate function as it is done in typescript folder. This will enable us to extract translateArrayTypeAnnotation function into a shared folder in a later step. It is a task of #34872:

Wrap the content of the case Array: and case ReadOnlyArray in Flow into a separate function, as it is for the TypeScript parser. This will enable us to unify the two parsers in a later step.

Changelog

[Internal] [Changed] - Wrap the content of the case Array and case $ReadOnlyArray in Flow into a separate function

Test Plan

yarn flow:
image

yarn lint:
image

yarn jest react-native-codegen:
image

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 11, 2022
@MaeIg
Copy link
Copy Markdown
Contributor Author

MaeIg commented Oct 11, 2022

Note: No new test because translateArrayTypeAnnotation is not exported. We can create new tests on this when the function will be extracted to be shared with typescript folder.

@analysis-bot
Copy link
Copy Markdown

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 7,772,336 +0
android hermes armeabi-v7a 7,173,428 +0
android hermes x86 8,085,593 +0
android hermes x86_64 8,057,158 +0
android jsc arm64-v8a 9,633,511 +0
android jsc armeabi-v7a 8,397,929 +0
android jsc x86 9,582,973 +0
android jsc x86_64 10,176,011 +0

Base commit: 14456e7
Branch: main

@analysis-bot
Copy link
Copy Markdown

Platform Engine Arch Size (bytes) Diff
ios - universal n/a --

Base commit: b33961d
Branch: main

@facebook-github-bot
Copy link
Copy Markdown
Contributor

@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@react-native-bot
Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @MaeIg in c388e6c.

When will my fix make it into a release? | Upcoming Releases

@react-native-bot react-native-bot added the Merged This PR has been merged. label Oct 14, 2022
@MaeIg MaeIg deleted the refactor/extract-translateArrayTypeAnnotation-function branch October 15, 2022 10:03
mohitcharkha pushed a commit to mohitcharkha/react-native that referenced this pull request Oct 17, 2022
…to a separate function (facebook#34948)

Summary:
This PR aims to extract translateArrayTypeAnnotation logic into a separate function as it is done in typescript folder. This will enable us to extract translateArrayTypeAnnotation function into a shared folder in a later step. It is a task of facebook#34872:
> Wrap the content of the case Array: and case ReadOnlyArray in [Flow](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/flow/modules/index.js#L106-L107) into a separate function, as it is for the [TypeScript](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/typescript/modules/index.js#L218-L234) parser. This will enable us to unify the two parsers in a later step.

## 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] - Wrap the content of the case Array and case $ReadOnlyArray in Flow into a separate function

Pull Request resolved: facebook#34948

Test Plan:
yarn flow:
<img width="645" alt="image" src="https://user-images.githubusercontent.com/40902940/195200715-7f60d927-e262-4a94-ad91-a884d37726b8.png">

yarn lint:
<img width="502" alt="image" src="https://user-images.githubusercontent.com/40902940/195200799-7959e068-b5b7-4242-a7b1-7afd80866d7f.png">

yarn jest react-native-codegen:
<img width="381" alt="image" src="https://user-images.githubusercontent.com/40902940/195200775-76957c19-d06d-431c-8555-889a4205374e.png">

Reviewed By: dmytrorykun

Differential Revision: D40296730

Pulled By: cipolleschi

fbshipit-source-id: ad2d965046e25ee000ae6e07075976e5a0c78f1a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. hacktoberfest-accepted Merged This PR has been merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants