Skip to content

Commit cff7ed6

Browse files
committed
merge main
2 parents 99f0464 + 32882a9 commit cff7ed6

File tree

27 files changed

+420
-40
lines changed

27 files changed

+420
-40
lines changed

.changeset/hot-buses-end.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'svelte': patch
3+
---
4+
5+
feat: add parent hierarchy to `__svelte_meta` objects

.changeset/new-trees-behave.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/short-fireants-flow.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

packages/svelte/CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# svelte
22

3+
## 5.35.0
4+
5+
### Minor Changes
6+
7+
- feat: add `getAbortSignal()` ([#16266](https://github.com/sveltejs/svelte/pull/16266))
8+
9+
### Patch Changes
10+
11+
- chore: simplify props ([#16270](https://github.com/sveltejs/svelte/pull/16270))
12+
313
## 5.34.9
414

515
### Patch Changes

packages/svelte/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "svelte",
33
"description": "Cybernetically enhanced web apps",
44
"license": "MIT",
5-
"version": "5.34.9",
5+
"version": "5.35.0",
66
"type": "module",
77
"types": "./types/index.d.ts",
88
"engines": {

packages/svelte/src/compiler/phases/3-transform/client/visitors/AwaitBlock.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { extract_identifiers } from '../../../../utils/ast.js';
55
import * as b from '#compiler/builders';
66
import { create_derived } from '../utils.js';
77
import { get_value } from './shared/declarations.js';
8-
import { build_expression } from './shared/utils.js';
8+
import { build_expression, add_svelte_meta } from './shared/utils.js';
99

1010
/**
1111
* @param {AST.AwaitBlock} node
@@ -54,7 +54,7 @@ export function AwaitBlock(node, context) {
5454
}
5555

5656
context.state.init.push(
57-
b.stmt(
57+
add_svelte_meta(
5858
b.call(
5959
'$.await',
6060
context.state.node,
@@ -64,7 +64,9 @@ export function AwaitBlock(node, context) {
6464
: b.null,
6565
then_block,
6666
catch_block
67-
)
67+
),
68+
node,
69+
'await'
6870
)
6971
);
7072
}

packages/svelte/src/compiler/phases/3-transform/client/visitors/EachBlock.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { dev } from '../../../../state.js';
1313
import { extract_paths, object } from '../../../../utils/ast.js';
1414
import * as b from '#compiler/builders';
1515
import { get_value } from './shared/declarations.js';
16-
import { build_expression } from './shared/utils.js';
16+
import { build_expression, add_svelte_meta } from './shared/utils.js';
1717

1818
/**
1919
* @param {AST.EachBlock} node
@@ -337,7 +337,7 @@ export function EachBlock(node, context) {
337337
);
338338
}
339339

340-
context.state.init.push(b.stmt(b.call('$.each', ...args)));
340+
context.state.init.push(add_svelte_meta(b.call('$.each', ...args), node, 'each'));
341341
}
342342

343343
/**

packages/svelte/src/compiler/phases/3-transform/client/visitors/IfBlock.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/** @import { AST } from '#compiler' */
33
/** @import { ComponentContext } from '../types' */
44
import * as b from '#compiler/builders';
5-
import { build_expression } from './shared/utils.js';
5+
import { build_expression, add_svelte_meta } from './shared/utils.js';
66

77
/**
88
* @param {AST.IfBlock} node
@@ -74,7 +74,7 @@ export function IfBlock(node, context) {
7474
args.push(b.id('$$elseif'));
7575
}
7676

77-
statements.push(b.stmt(b.call('$.if', ...args)));
77+
statements.push(add_svelte_meta(b.call('$.if', ...args), node, 'if'));
7878

7979
context.state.init.push(b.block(statements));
8080
}

packages/svelte/src/compiler/phases/3-transform/client/visitors/KeyBlock.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/** @import { AST } from '#compiler' */
33
/** @import { ComponentContext } from '../types' */
44
import * as b from '#compiler/builders';
5-
import { build_expression } from './shared/utils.js';
5+
import { build_expression, add_svelte_meta } from './shared/utils.js';
66

77
/**
88
* @param {AST.KeyBlock} node
@@ -15,6 +15,10 @@ export function KeyBlock(node, context) {
1515
const body = /** @type {Expression} */ (context.visit(node.fragment));
1616

1717
context.state.init.push(
18-
b.stmt(b.call('$.key', context.state.node, b.thunk(key), b.arrow([b.id('$$anchor')], body)))
18+
add_svelte_meta(
19+
b.call('$.key', context.state.node, b.thunk(key), b.arrow([b.id('$$anchor')], body)),
20+
node,
21+
'key'
22+
)
1923
);
2024
}

packages/svelte/src/compiler/phases/3-transform/client/visitors/RenderTag.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
/** @import { ComponentContext } from '../types' */
44
import { unwrap_optional } from '../../../../utils/ast.js';
55
import * as b from '#compiler/builders';
6-
import { build_expression } from './shared/utils.js';
6+
import { add_svelte_meta, build_expression } from './shared/utils.js';
77

88
/**
99
* @param {AST.RenderTag} node
@@ -48,16 +48,22 @@ export function RenderTag(node, context) {
4848
}
4949

5050
context.state.init.push(
51-
b.stmt(b.call('$.snippet', context.state.node, b.thunk(snippet_function), ...args))
51+
add_svelte_meta(
52+
b.call('$.snippet', context.state.node, b.thunk(snippet_function), ...args),
53+
node,
54+
'render'
55+
)
5256
);
5357
} else {
5458
context.state.init.push(
55-
b.stmt(
59+
add_svelte_meta(
5660
(node.expression.type === 'CallExpression' ? b.call : b.maybe_call)(
5761
snippet_function,
5862
context.state.node,
5963
...args
60-
)
64+
),
65+
node,
66+
'render'
6167
)
6268
);
6369
}

0 commit comments

Comments
 (0)