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] Extract the function createParserErrorCapturer into a single function in the parsers/utils.js file #34934

Conversation

MaeIg
Copy link
Contributor

@MaeIg MaeIg commented Oct 10, 2022

Summary

This PR aims to reduce code duplication by extracting createParserErrorCapturer function from the flow and typescript folders into a shared parsers/utils.js file. It is a task of #34872:

Extract the function createParserErrorCapturer (Flow TypeScript) into a single function in the parsers/utils.js file and replace its invocation with this new function.

Changelog

[Internal] [Changed] - Extract the function createParserErrorCapturer into a single function in the parsers/utils.js file

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 10, 2022
@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 7,768,182 -312
android hermes armeabi-v7a 7,169,296 -152
android hermes x86 8,081,411 -228
android hermes x86_64 8,053,024 -107
android jsc arm64-v8a 9,629,382 +0
android jsc armeabi-v7a 8,393,808 +0
android jsc x86 9,578,801 +0
android jsc x86_64 10,171,894 +0

Base commit: 1fc27c4
Branch: main

@analysis-bot
Copy link

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

Base commit: 1fc27c4
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.

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 jobs, especially with the unit tests! 👏 👏 👏

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @MaeIg in 38fcafe.

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 11, 2022
@MaeIg MaeIg deleted the refactor/extract-createParserErrorCapturer-function branch October 11, 2022 15:12
OlimpiaZurek pushed a commit to OlimpiaZurek/react-native that referenced this pull request May 22, 2023
… in the parsers/utils.js file (facebook#34934)

Summary:
This PR aims to reduce code duplication by extracting `createParserErrorCapturer` function from the flow and typescript folders into a shared parsers/utils.js file. It is a task of facebook#34872:
> Extract the function createParserErrorCapturer ([Flow](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/flow/utils.js#L122-L143) [TypeScript](https://github.com/facebook/react-native/blob/main/packages/react-native-codegen/src/parsers/typescript/utils.js#L114-L135)) into a single function in the parsers/utils.js file and replace its invocation with this new function.

## 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] - Extract the function createParserErrorCapturer into a single function in the parsers/utils.js file

Pull Request resolved: facebook#34934

Test Plan:
yarn flow:
<img width="628" alt="image" src="https://user-images.githubusercontent.com/40902940/194948886-d6763e39-ea07-4004-86cc-5287c4783012.png">

yarn lint:
<img width="509" alt="image" src="https://user-images.githubusercontent.com/40902940/194948916-3e54afa5-7e0b-4a61-ac18-8ec306d8c6d4.png">

yarn jest react-native-codegen:
<img width="386" alt="image" src="https://user-images.githubusercontent.com/40902940/194948966-d1e5b12e-02ab-4d53-a4bf-6abaf4d70fbe.png">

Reviewed By: cipolleschi

Differential Revision: D40256048

Pulled By: cipolleschi

fbshipit-source-id: 098519a17d6e3128d236c639b246a706f9dbf66d
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.

6 participants