Skip to content
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 114] Extract getTypeAnnotationFromProperty from buildPropertiesForEvent into specific parsers #37573

Conversation

MaeIg
Copy link
Contributor

@MaeIg MaeIg commented May 25, 2023

Summary:

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

[Codegen 114 - Assigned to @MaeIg] Add a function getTypeAnnotationFromProperty(property) in the Parser object and implement it in FlowParser and TypeScriptParser, using the implementation you can find in the parsers/flow/components/events.js and parsers/typescript/components/events.js. Use the parsers in the buildPropertiesForEvent.

Changelog:

[Internal] [Changed] - Extract getTypeAnnotationFromProperty from buildPropertiesForEvent into specific parsers

Test Plan:

Flow:
image

Eslint:
image

Jest:
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 May 25, 2023
@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 8,740,158 +2
android hermes armeabi-v7a 8,051,267 +3
android hermes x86 9,230,363 -1
android hermes x86_64 9,081,998 +3
android jsc arm64-v8a 9,302,092 -1
android jsc armeabi-v7a 8,490,791 +1
android jsc x86 9,363,378 +0
android jsc x86_64 9,619,122 -2

Base commit: 1a1e399
Branch: main

@Pranav-yadav Pranav-yadav added the Tech: Codegen Related to react-native-codegen label May 25, 2023
Copy link
Contributor

@cipolleschi cipolleschi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing work, thank you so much for doing this! 👏

@facebook-github-bot
Copy link
Contributor

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

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

@cipolleschi merged this pull request in 663a018.

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. Tech: Codegen Related to react-native-codegen
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants