-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
Closed
AntoineDoubovetzky
wants to merge
3
commits into
facebook:main
from
AntoineDoubovetzky:refactor/extract-codegen-module-utils
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
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
Base commit: c48cb04 |
AntoineDoubovetzky
force-pushed
the
refactor/extract-codegen-module-utils
branch
from
October 7, 2022 20:41
196db97
to
39d55a0
Compare
Base commit: c48cb04 |
@hramos has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
cipolleschi
approved these changes
Oct 8, 2022
This pull request was successfully merged by @AntoineDoubovetzky in 24efebf. When will my fix make it into a release? | Upcoming Releases |
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 iswrapNullable
andunwrapNullable
)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
: