Commit e441954
Add codegen for ArrayType diffing (#52244)
Summary:
Pull Request resolved: #52244
The ArrayType props converts to std::vector. This prompted the need for `toDynamic(const T&)` conversion functions as this breaks to potential reliance on all type instances having a `toDynamic()` function available. This includes:
- array of arrays types
- array of objects types
- object with arrays
The ArrayType conversion uses the availability of the `toDynamic` conversion methods for all supported types to convert the values stored by the `std::vector` to `folly::dynamic` values to be stored on a `folly::dynamic::array`.
The diff removes unnecessary conversion methods implemented previously for the core components prop diffing. These are now handled by the generic `toDynamic(const std::vector<T>&)` conversion method.
Changelog: [Internal]
Reviewed By: mdvacca
Differential Revision: D77234065
fbshipit-source-id: 97a3b175ff07fe4a6de3adb14ee6cb42db1a2cfe1 parent b50ad49 commit e441954
12 files changed
Lines changed: 179 additions & 23 deletions
File tree
- packages
- react-native-codegen
- e2e
- deep_imports/__tests__/components/__snapshots__
- namespaced/__tests__/components/__snapshots__
- src/generators/components
- __tests__/__snapshots__
- react-native/ReactCommon/react/renderer
- components/textinput/platform/android/react/renderer/components/androidtextinput
- core
- graphics
Lines changed: 39 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
54 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
55 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
56 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
57 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
58 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
59 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
60 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
61 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
62 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
63 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
64 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
65 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
66 | 105 | | |
67 | 106 | | |
68 | 107 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
958 | 958 | | |
959 | 959 | | |
960 | 960 | | |
961 | | - | |
| 961 | + | |
962 | 962 | | |
963 | 963 | | |
964 | 964 | | |
| |||
Lines changed: 39 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
54 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
55 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
56 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
57 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
58 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
59 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
60 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
61 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
62 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
63 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
64 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
65 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
66 | 105 | | |
67 | 106 | | |
68 | 107 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
958 | 958 | | |
959 | 959 | | |
960 | 960 | | |
961 | | - | |
| 961 | + | |
962 | 962 | | |
963 | 963 | | |
964 | 964 | | |
| |||
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
135 | | - | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
136 | 139 | | |
137 | 140 | | |
138 | 141 | | |
| |||
Lines changed: 0 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
756 | 756 | | |
757 | 757 | | |
758 | 758 | | |
759 | | - | |
760 | | - | |
761 | 759 | | |
762 | 760 | | |
763 | 761 | | |
| |||
Lines changed: 42 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
54 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
55 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
56 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
57 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
58 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
59 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
60 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
61 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
62 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
63 | 93 | | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
64 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
65 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
66 | 105 | | |
67 | 106 | | |
68 | 107 | | |
| |||
109 | 148 | | |
110 | 149 | | |
111 | 150 | | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
112 | 154 | | |
113 | 155 | | |
114 | 156 | | |
| |||
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
182 | | - | |
| 182 | + | |
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
| |||
325 | 325 | | |
326 | 326 | | |
327 | 327 | | |
328 | | - | |
329 | | - | |
330 | | - | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
331 | 331 | | |
332 | 332 | | |
333 | 333 | | |
| |||
1316 | 1316 | | |
1317 | 1317 | | |
1318 | 1318 | | |
1319 | | - | |
| 1319 | + | |
1320 | 1320 | | |
1321 | 1321 | | |
1322 | 1322 | | |
| |||
1503 | 1503 | | |
1504 | 1504 | | |
1505 | 1505 | | |
1506 | | - | |
| 1506 | + | |
1507 | 1507 | | |
1508 | 1508 | | |
1509 | 1509 | | |
| |||
Lines changed: 0 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
357 | 357 | | |
358 | 358 | | |
359 | 359 | | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | 360 | | |
370 | 361 | | |
371 | 362 | | |
| |||
Lines changed: 0 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | 46 | | |
50 | 47 | | |
51 | 48 | | |
| |||
0 commit comments