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] Extracts modules/utils.js files from the flow and typescript folders in parsers-commons #34898

Conversation

AntoineDoubovetzky
Copy link

@AntoineDoubovetzky AntoineDoubovetzky commented Oct 7, 2022

Summary

This PR is a task from #34872
Extract the modules/utils.js from the flow and typescript folders in a shared parsers-commons.js file. Then, have the two parsers use the same wrapModuleSchema function for modules.
(wrapModuleSchema is a copy-paste mistake, in this case it is wrapNullable and unwrapNullable)

Changelog

[Internal] [Changed] - Extracts Codegen's modules/utils.js files from the flow and typescript folders in parsers-commons

Test Plan

I ran yarn jest react-native-codegen:
Capture d’écran 2022-10-07 à 21 29 48

@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 7, 2022
@AntoineDoubovetzky AntoineDoubovetzky changed the title Refactor/extract codegen module utils [Codegen] Extracts modules/utils.js files from the flow and typescript folders in parsers-commons Oct 7, 2022
@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 7,746,611 -599
android hermes armeabi-v7a 7,148,393 -590
android hermes x86 8,057,589 -598
android hermes x86_64 8,028,527 -598
android jsc arm64-v8a 9,608,123 -311
android jsc armeabi-v7a 8,373,374 -315
android jsc x86 9,555,376 -320
android jsc x86_64 10,147,920 -316

Base commit: c48cb04
Branch: main

@AntoineDoubovetzky AntoineDoubovetzky force-pushed the refactor/extract-codegen-module-utils branch from 196db97 to 39d55a0 Compare October 7, 2022 20:41
@analysis-bot
Copy link

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

Base commit: c48cb04
Branch: main

@facebook-github-bot
Copy link
Contributor

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

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @AntoineDoubovetzky in 24efebf.

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 8, 2022
facebook-github-bot pushed a commit that referenced this pull request Oct 10, 2022
…escript folders in parsers-primitives (#34901)

Summary:
This PR aims to reduce code duplication by extracting `emitRootTag` logic from the flow and typescript folders into a shared parsers-primitives file. It is a task of #34872:
> Extract the content of the case 'RootTag' (Flow TypeScript) into a single emitRootTag function in the parsers-primitives.js file. Use the new function in the parsers.

~~Note that #34898 should be merged first. I rebased on it's branch.~~

## 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 RootTag case of translateTypeAnnotation from the flow and typescript folders in parsers-primitives

Pull Request resolved: #34901

Test Plan:
All tests are passing, with `yarn jest react-native-codegen`:
<img width="934" alt="image" src="https://user-images.githubusercontent.com/40902940/194777150-6136c1b6-11f8-4e21-829b-fda418b6925c.png">

Reviewed By: cipolleschi

Differential Revision: D40212553

Pulled By: cipolleschi

fbshipit-source-id: eadbbfb5cf6dfa6c966f4c08a5d9372a3470b621
facebook-github-bot pushed a commit that referenced this pull request Oct 10, 2022
Summary:
This PR is part of #34872
This PR adds unit test for method that were refactored into parsers-commons.js in codegen in #34898

## 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] - Add unit test for common parsers method

Pull Request resolved: #34915

Test Plan: `yarn jest react-native-codegen`

Reviewed By: cipolleschi

Differential Revision: D40219036

Pulled By: cipolleschi

fbshipit-source-id: 2fb666c016f7822feaf2156d23ce7ffb9572c756
OlimpiaZurek pushed a commit to OlimpiaZurek/react-native that referenced this pull request May 22, 2023
…in parsers-commons (facebook#34898)

Summary:
This PR is a task from facebook#34872
_Extract the modules/utils.js from the flow and typescript folders in a shared parsers-commons.js file. Then, have the two parsers use the same wrapModuleSchema function for modules._
(`wrapModuleSchema` is a copy-paste mistake, in this case it is `wrapNullable` and `unwrapNullable`)

## 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] - Extracts Codegen's modules/utils.js files from the flow and typescript folders in parsers-commons

Pull Request resolved: facebook#34898

Test Plan:
I ran `yarn jest react-native-codegen`:
<img width="775" alt="Capture d’écran 2022-10-07 à 21 29 48" src="https://user-images.githubusercontent.com/17070498/194639515-a446c2cf-daf3-43a1-9833-cd546ca5865e.png">

Reviewed By: cipolleschi

Differential Revision: D40193740

Pulled By: cipolleschi

fbshipit-source-id: 02cbacc215fe5dd9bdd0839d8796587ab2821906
OlimpiaZurek pushed a commit to OlimpiaZurek/react-native that referenced this pull request May 22, 2023
…escript folders in parsers-primitives (facebook#34901)

Summary:
This PR aims to reduce code duplication by extracting `emitRootTag` logic from the flow and typescript folders into a shared parsers-primitives file. It is a task of facebook#34872:
> Extract the content of the case 'RootTag' (Flow TypeScript) into a single emitRootTag function in the parsers-primitives.js file. Use the new function in the parsers.

~~Note that facebook#34898 should be merged first. I rebased on it's branch.~~

## 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 RootTag case of translateTypeAnnotation from the flow and typescript folders in parsers-primitives

Pull Request resolved: facebook#34901

Test Plan:
All tests are passing, with `yarn jest react-native-codegen`:
<img width="934" alt="image" src="https://user-images.githubusercontent.com/40902940/194777150-6136c1b6-11f8-4e21-829b-fda418b6925c.png">

Reviewed By: cipolleschi

Differential Revision: D40212553

Pulled By: cipolleschi

fbshipit-source-id: eadbbfb5cf6dfa6c966f4c08a5d9372a3470b621
OlimpiaZurek pushed a commit to OlimpiaZurek/react-native that referenced this pull request May 22, 2023
Summary:
This PR is part of facebook#34872
This PR adds unit test for method that were refactored into parsers-commons.js in codegen in facebook#34898

## 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] - Add unit test for common parsers method

Pull Request resolved: facebook#34915

Test Plan: `yarn jest react-native-codegen`

Reviewed By: cipolleschi

Differential Revision: D40219036

Pulled By: cipolleschi

fbshipit-source-id: 2fb666c016f7822feaf2156d23ce7ffb9572c756
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