[Codegen] Extracts modules/utils.js files from the flow and typescript folders in parsers-commons#34898
Closed
AntoineDoubovetzky wants to merge 3 commits into
Closed
Conversation
Base commit: c48cb04 |
added 3 commits
October 7, 2022 22:41
196db97 to
39d55a0
Compare
Base commit: c48cb04 |
Contributor
|
@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
Collaborator
|
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
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
(
wrapModuleSchemais a copy-paste mistake, in this case it iswrapNullableandunwrapNullable)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: