Commit 524ab52
committed
Update for TS7
I am testing Typescript 7's JS support, which I've largely rewritten
during the switch to Go. The new code processes tags by converting them
into synthetic nodes just after parsing their host node. For unified,
that means that `@template` tags can't be shared between multiple
`@overload` tags like before.
This PR also has to convert function declarations with `@type` on them
to variables initialised with a function expression. TS7 doesn't
currently support this feature on function declarations--but both unified and
svelte use this feature a lot, so I think we'll need to add it before
TS7's JS features are ready. At that point the shuffling of functions in
the test files won't be needed anymore.
In addition, microsoft/typescript-go#1444 makes
it possible to have rest parameters in `@overload`, and is needed for
this change to work in TS7, so it won't compile with the nightly until
that PR is merged.
Because TS7 is quite a way off, I don't know whether you'll want to take this PR. I created it to see how hard it would be to update popular JS code that uses TS for checking.1 parent 45d8fa5 commit 524ab52
3 files changed
+55
-54
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
538 | 538 | | |
539 | 539 | | |
540 | 540 | | |
541 | | - | |
542 | 541 | | |
543 | 542 | | |
544 | 543 | | |
| |||
547 | 546 | | |
548 | 547 | | |
549 | 548 | | |
| 549 | + | |
550 | 550 | | |
551 | 551 | | |
552 | 552 | | |
553 | 553 | | |
| 554 | + | |
554 | 555 | | |
555 | 556 | | |
556 | 557 | | |
557 | 558 | | |
558 | 559 | | |
| 560 | + | |
559 | 561 | | |
560 | 562 | | |
561 | 563 | | |
| |||
805 | 807 | | |
806 | 808 | | |
807 | 809 | | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
808 | 818 | | |
809 | 819 | | |
810 | 820 | | |
| |||
815 | 825 | | |
816 | 826 | | |
817 | 827 | | |
818 | | - | |
819 | | - | |
820 | | - | |
821 | | - | |
822 | | - | |
823 | | - | |
824 | | - | |
825 | | - | |
826 | | - | |
827 | 828 | | |
828 | 829 | | |
829 | 830 | | |
| |||
940 | 941 | | |
941 | 942 | | |
942 | 943 | | |
943 | | - | |
944 | | - | |
945 | | - | |
946 | | - | |
947 | | - | |
948 | | - | |
949 | | - | |
950 | 944 | | |
951 | 945 | | |
952 | 946 | | |
953 | | - | |
| 947 | + | |
954 | 948 | | |
955 | 949 | | |
956 | 950 | | |
957 | 951 | | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
958 | 959 | | |
959 | 960 | | |
960 | 961 | | |
| |||
1029 | 1030 | | |
1030 | 1031 | | |
1031 | 1032 | | |
1032 | | - | |
1033 | | - | |
1034 | | - | |
1035 | | - | |
1036 | 1033 | | |
1037 | 1034 | | |
1038 | 1035 | | |
| |||
1041 | 1038 | | |
1042 | 1039 | | |
1043 | 1040 | | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
1044 | 1044 | | |
1045 | 1045 | | |
1046 | 1046 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
11 | 27 | | |
12 | 28 | | |
13 | 29 | | |
| |||
219 | 235 | | |
220 | 236 | | |
221 | 237 | | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
11 | 28 | | |
12 | 29 | | |
13 | 30 | | |
| |||
63 | 80 | | |
64 | 81 | | |
65 | 82 | | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
| |||
0 commit comments