Skip to content

Commit 3feedf0

Browse files
committed
more
1 parent 2fb3b1e commit 3feedf0

18 files changed

+17846
-2
lines changed

src/parser/converts/attr.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export function* convertAttributes(
4949
| SvAST.AttributeOrDirective
5050
| Compiler.Attribute
5151
| Compiler.SpreadAttribute
52+
| Compiler.AttachTag
5253
| Compiler.Directive
5354
)[],
5455
parent: SvelteStartTag,

src/parser/converts/element.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,13 +223,19 @@ export function* convertChildren(
223223
function extractLetDirectives(fragment: {
224224
attributes:
225225
| SvAST.AttributeOrDirective[]
226-
| (Compiler.Attribute | Compiler.SpreadAttribute | Compiler.Directive)[];
226+
| (
227+
| Compiler.Attribute
228+
| Compiler.SpreadAttribute
229+
| Compiler.AttachTag
230+
| Compiler.Directive
231+
)[];
227232
}): {
228233
letDirectives: (SvAST.LetDirective | Compiler.LetDirective)[];
229234
attributes: Exclude<
230235
| SvAST.AttributeOrDirective
231236
| Compiler.Attribute
232237
| Compiler.SpreadAttribute
238+
| Compiler.AttachTag
233239
| Compiler.Directive,
234240
SvAST.LetDirective | Compiler.LetDirective
235241
>[];
@@ -239,6 +245,7 @@ function extractLetDirectives(fragment: {
239245
| SvAST.AttributeOrDirective
240246
| Compiler.Attribute
241247
| Compiler.SpreadAttribute
248+
| Compiler.AttachTag
242249
| Compiler.Directive,
243250
SvAST.LetDirective | Compiler.LetDirective
244251
>[] = [];

src/parser/svelte-ast-types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,6 @@ export interface AttachTag extends BaseNode {
212212
export type AttributeOrDirective =
213213
| Attribute
214214
| Spread
215-
| AttachTag
216215
| Directive
217216
| StyleDirective;
218217

src/visitor-keys.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ const svelteKeys: SvelteKeysType = {
4242
SvelteAttribute: ["key", "value"],
4343
SvelteShorthandAttribute: ["key", "value"],
4444
SvelteSpreadAttribute: ["argument"],
45+
SvelteAttachTag: ["expression"],
4546
SvelteDirective: ["key", "expression"],
4647
SvelteStyleDirective: ["key", "value"],
4748
SvelteSpecialDirective: ["key", "expression"],
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<script>
2+
/** @type {import('svelte/elements').HTMLButtonAttributes} */
3+
let { children, ...props } = $props();
4+
</script>
5+
6+
<!-- `props` includes attachments -->
7+
<button {...props}>
8+
{@render children?.()}
9+
</button>

0 commit comments

Comments
 (0)