Commit 5f05b07
Extract RootTag case of translateTypeAnnotation from the flow and typescript 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: eadbbfb5cf6dfa6c966f4c08a5d9372a3470b6211 parent 7b345bc commit 5f05b07
File tree
4 files changed
+41
-9
lines changed- packages/react-native-codegen/src/parsers
- __tests__
- flow/modules
- typescript/modules
4 files changed
+41
-9
lines changedLines changed: 28 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
94 | 95 | | |
95 | 96 | | |
96 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
Lines changed: 2 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
87 | 88 | | |
88 | 89 | | |
89 | 90 | | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
| 91 | + | |
94 | 92 | | |
95 | 93 | | |
96 | 94 | | |
| |||
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
42 | 50 | | |
43 | 51 | | |
44 | 52 | | |
45 | 53 | | |
| 54 | + | |
46 | 55 | | |
Lines changed: 2 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
199 | 200 | | |
200 | 201 | | |
201 | 202 | | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
| 203 | + | |
206 | 204 | | |
207 | 205 | | |
208 | 206 | | |
| |||
0 commit comments