Commit efe8463
authored
fix: implict children tweaks (#2285)
- ignore comments when determining whether or not to add an implicit children prop #2263
- do static analysis of the destructuring to see whether or not children is destructured from `$props()`, and if not, add the implicit children prop if there's a slot. This results in less confusing type errors when transforming to runes mode and using a slot1 parent 19694d6 commit efe8463
File tree
16 files changed
+202
-69
lines changed- packages/svelte2tsx
- src/svelte2tsx
- nodes
- test/svelte2tsx/samples
- runes-with-slots
- runes
- sveltekit-autotypes-$props-rune-no-changes
- sveltekit-autotypes-$props-rune
- ts-runes-generics
- ts-runes-with-slot
- ts-runes
16 files changed
+202
-69
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
| 114 | + | |
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| |||
Lines changed: 57 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
34 | | - | |
| 35 | + | |
| 36 | + | |
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
| |||
135 | 137 | | |
136 | 138 | | |
137 | 139 | | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
138 | 163 | | |
139 | 164 | | |
140 | 165 | | |
| |||
201 | 226 | | |
202 | 227 | | |
203 | 228 | | |
204 | | - | |
| 229 | + | |
| 230 | + | |
205 | 231 | | |
206 | 232 | | |
207 | 233 | | |
| |||
498 | 524 | | |
499 | 525 | | |
500 | 526 | | |
501 | | - | |
| 527 | + | |
502 | 528 | | |
503 | 529 | | |
504 | 530 | | |
505 | 531 | | |
506 | | - | |
| 532 | + | |
507 | 533 | | |
508 | 534 | | |
509 | 535 | | |
| |||
589 | 615 | | |
590 | 616 | | |
591 | 617 | | |
592 | | - | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
593 | 621 | | |
594 | 622 | | |
595 | 623 | | |
| |||
600 | 628 | | |
601 | 629 | | |
602 | 630 | | |
603 | | - | |
604 | | - | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
605 | 648 | | |
606 | 649 | | |
607 | 650 | | |
| |||
666 | 709 | | |
667 | 710 | | |
668 | 711 | | |
669 | | - | |
| 712 | + | |
670 | 713 | | |
671 | 714 | | |
672 | 715 | | |
| |||
676 | 719 | | |
677 | 720 | | |
678 | 721 | | |
679 | | - | |
680 | | - | |
681 | | - | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
682 | 725 | | |
683 | 726 | | |
684 | 727 | | |
| |||
697 | 740 | | |
698 | 741 | | |
699 | 742 | | |
700 | | - | |
701 | | - | |
| 743 | + | |
| 744 | + | |
702 | 745 | | |
703 | 746 | | |
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
Lines changed: 4 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
14 | 11 | | |
15 | 12 | | |
16 | 13 | | |
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
Lines changed: 19 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
| 3 | + | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
7 | 21 | | |
8 | | - | |
9 | | - | |
10 | 22 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
| 23 | + | |
| 24 | + | |
15 | 25 | | |
0 commit comments