Skip to content

Conversation

@MaeIg
Copy link
Contributor

@MaeIg MaeIg commented Mar 25, 2023

Summary

This PR aims to remove the duplicated logic in [flow|typescript]/components/index.js files to move it in parsers-commons. It is a task of #34872:

[Codegen 98 - assigned to @MaeIg] Extract the namedExports.map(statement => (Flow, TS) function in parser-commons, so that it accept a Parser parameter to unify the behaviors between flow and typescript. The Parser object needs to be enriched with all the methods to extract the required information from the Node, if they are not there yet.

Changelog

[Internal] [Changed] - Extract getCommandTypeNameAndOptionsExpression from component folders into parsers-common

Test Plan

yarn flow:
image

yarn lint:
image

yarn test
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 Mar 25, 2023
@MaeIg MaeIg changed the title [Codegen 98] Extract getCommandTypeNameAndOptionsExpression from components folders to parsers-common [Codegen 98] Extract getCommandTypeNameAndOptionsExpression from component folders to parsers-common Mar 25, 2023
@MaeIg MaeIg changed the title [Codegen 98] Extract getCommandTypeNameAndOptionsExpression from component folders to parsers-common [Codegen 98] Extract getCommandTypeNameAndOptionsExpression from component folders into parsers-common Mar 25, 2023
@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 8,519,412 +0
android hermes armeabi-v7a 7,835,707 +0
android hermes x86 8,998,551 +0
android hermes x86_64 8,854,715 +0
android jsc arm64-v8a 9,140,564 +0
android jsc armeabi-v7a 8,332,777 +0
android jsc x86 9,194,234 +0
android jsc x86_64 9,453,310 +0

Base commit: 92b8981
Branch: main

@facebook-github-bot
Copy link
Contributor

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

@cipolleschi
Copy link
Contributor

Great work here, Thank you for doing this.

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Mar 27, 2023
@facebook-github-bot
Copy link
Contributor

@rshest merged this pull request in 5ff01bc.

jeongshin pushed a commit to jeongshin/react-native that referenced this pull request May 7, 2023
… into parsers-common (facebook#36640)

Summary:
This PR aims to remove the duplicated logic in [flow|typescript]/components/index.js files to move it in parsers-commons. It is a task of facebook#34872:
> [Codegen 98 - assigned to MaeIg] Extract the namedExports.map(statement => ([Flow](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/flow/components/index.js#L76-L108), [TS](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/typescript/components/index.js#L77-L109)) function in parser-commons, so that it accept a Parser parameter to unify the behaviors between flow and typescript. The Parser object needs to be enriched with all the methods to extract the required information from the Node, if they are not there yet.

## 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 getCommandTypeNameAndOptionsExpression from component folders into parsers-common

Pull Request resolved: facebook#36640

Test Plan:
yarn flow:
<img width="151" alt="image" src="https://user-images.githubusercontent.com/40902940/227719831-1a67f588-3bb2-48d7-8a43-4c5c8972155e.png">

yarn lint:
<img width="499" alt="image" src="https://user-images.githubusercontent.com/40902940/227719839-e5b591c3-9f3a-4da4-b3a5-67275c58584f.png">

yarn test
<img width="389" alt="image" src="https://user-images.githubusercontent.com/40902940/227719849-f3adfc4a-9215-4b1a-8807-c01801c54628.png">

Reviewed By: cipolleschi

Differential Revision: D44416032

Pulled By: rshest

fbshipit-source-id: eb682834d3da7a89661612667d9fc1df99ff3df0
OlimpiaZurek pushed a commit to OlimpiaZurek/react-native that referenced this pull request May 22, 2023
… into parsers-common (facebook#36640)

Summary:
This PR aims to remove the duplicated logic in [flow|typescript]/components/index.js files to move it in parsers-commons. It is a task of facebook#34872:
> [Codegen 98 - assigned to MaeIg] Extract the namedExports.map(statement => ([Flow](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/flow/components/index.js#L76-L108), [TS](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/typescript/components/index.js#L77-L109)) function in parser-commons, so that it accept a Parser parameter to unify the behaviors between flow and typescript. The Parser object needs to be enriched with all the methods to extract the required information from the Node, if they are not there yet.

## 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 getCommandTypeNameAndOptionsExpression from component folders into parsers-common

Pull Request resolved: facebook#36640

Test Plan:
yarn flow:
<img width="151" alt="image" src="https://user-images.githubusercontent.com/40902940/227719831-1a67f588-3bb2-48d7-8a43-4c5c8972155e.png">

yarn lint:
<img width="499" alt="image" src="https://user-images.githubusercontent.com/40902940/227719839-e5b591c3-9f3a-4da4-b3a5-67275c58584f.png">

yarn test
<img width="389" alt="image" src="https://user-images.githubusercontent.com/40902940/227719849-f3adfc4a-9215-4b1a-8807-c01801c54628.png">

Reviewed By: cipolleschi

Differential Revision: D44416032

Pulled By: rshest

fbshipit-source-id: eb682834d3da7a89661612667d9fc1df99ff3df0
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. Merged This PR has been merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants