Commit 9907a06
Add nested error formatting for all error types (#55376)
Summary:
Pull Request resolved: #55376
Reviewer, read `ErrorFormatting-test.snap.js` first, to see the impact of this change.
Previously, only `incompatibleTypes` errors showed hierarchical nesting with full path context. Other error types (addedEnumCases, removedUnionCases, addedProps, etc.) displayed flat messages that made it difficult to trace where in the type hierarchy an issue occurred.
This change enriches ComparisonResult types with an optional `errorLog` field that carries path context from TypeDiffing through VersionDiffing to ErrorFormatting. Now all error types display with the same recursive nesting format, making it easier for developers to understand exactly where compatibility issues occur in deeply nested structures.
Changelog: [Internal]
Reviewed By: makovkastar
Differential Revision: D91251882
fbshipit-source-id: 3d6f9676e68e5a8471f7870bbd02d35a257d44161 parent 31f7e84 commit 9907a06
7 files changed
Lines changed: 655 additions & 185 deletions
File tree
- packages/react-native-compatibility-check/src
- __tests__
- __snapshots__
Lines changed: 30 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
144 | 168 | | |
145 | 169 | | |
146 | 170 | | |
| |||
Lines changed: 16 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
45 | | - | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
46 | 54 | | |
47 | 55 | | |
48 | 56 | | |
| |||
188 | 196 | | |
189 | 197 | | |
190 | 198 | | |
191 | | - | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
192 | 206 | | |
193 | 207 | | |
194 | 208 | | |
| |||
Lines changed: 67 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
569 | 569 | | |
570 | 570 | | |
571 | 571 | | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
572 | 577 | | |
573 | 578 | | |
574 | 579 | | |
575 | 580 | | |
576 | 581 | | |
577 | 582 | | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
578 | 588 | | |
579 | 589 | | |
580 | 590 | | |
| |||
602 | 612 | | |
603 | 613 | | |
604 | 614 | | |
605 | | - | |
606 | 615 | | |
607 | | - | |
608 | 616 | | |
609 | 617 | | |
610 | 618 | | |
611 | 619 | | |
612 | | - | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
613 | 629 | | |
614 | 630 | | |
615 | 631 | | |
| |||
856 | 872 | | |
857 | 873 | | |
858 | 874 | | |
859 | | - | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
860 | 884 | | |
861 | 885 | | |
862 | 886 | | |
| |||
895 | 919 | | |
896 | 920 | | |
897 | 921 | | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
898 | 927 | | |
899 | 928 | | |
900 | 929 | | |
| |||
917 | 946 | | |
918 | 947 | | |
919 | 948 | | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
920 | 954 | | |
921 | 955 | | |
922 | 956 | | |
| |||
928 | 962 | | |
929 | 963 | | |
930 | 964 | | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
931 | 971 | | |
932 | 972 | | |
933 | 973 | | |
| |||
977 | 1017 | | |
978 | 1018 | | |
979 | 1019 | | |
980 | | - | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
981 | 1029 | | |
982 | 1030 | | |
983 | 1031 | | |
| |||
1128 | 1176 | | |
1129 | 1177 | | |
1130 | 1178 | | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
1131 | 1184 | | |
1132 | 1185 | | |
1133 | 1186 | | |
| |||
1206 | 1259 | | |
1207 | 1260 | | |
1208 | 1261 | | |
1209 | | - | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
1210 | 1271 | | |
1211 | 1272 | | |
1212 | 1273 | | |
| |||
0 commit comments