Skip to content

Commit 8262c2b

Browse files
committed
merge main
2 parents b049086 + 63e4836 commit 8262c2b

File tree

39 files changed

+674
-164
lines changed

39 files changed

+674
-164
lines changed

.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: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,35 @@
11
# svelte
22

3+
## 5.35.3
4+
5+
### Patch Changes
6+
7+
- fix: account for mounting when `select_option` in `attribute_effect` ([#16309](https://github.com/sveltejs/svelte/pull/16309))
8+
9+
- fix: do not proxify the value assigned to a derived ([#16302](https://github.com/sveltejs/svelte/pull/16302))
10+
11+
## 5.35.2
12+
13+
### Patch Changes
14+
15+
- fix: bump esrap ([#16295](https://github.com/sveltejs/svelte/pull/16295))
16+
17+
## 5.35.1
18+
19+
### Patch Changes
20+
21+
- feat: add parent hierarchy to `__svelte_meta` objects ([#16255](https://github.com/sveltejs/svelte/pull/16255))
22+
23+
## 5.35.0
24+
25+
### Minor Changes
26+
27+
- feat: add `getAbortSignal()` ([#16266](https://github.com/sveltejs/svelte/pull/16266))
28+
29+
### Patch Changes
30+
31+
- chore: simplify props ([#16270](https://github.com/sveltejs/svelte/pull/16270))
32+
333
## 5.34.9
434

535
### Patch Changes

packages/svelte/package.json

Lines changed: 2 additions & 2 deletions
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.3",
66
"type": "module",
77
"types": "./types/index.d.ts",
88
"engines": {
@@ -171,7 +171,7 @@
171171
"axobject-query": "^4.1.0",
172172
"clsx": "^2.1.1",
173173
"esm-env": "^1.2.1",
174-
"esrap": "^2.0.0",
174+
"esrap": "^2.1.0",
175175
"is-reference": "^3.0.3",
176176
"locate-character": "^3.0.0",
177177
"magic-string": "^0.30.11",

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ function build_assignment(operator, left, right, context) {
137137
binding.kind !== 'prop' &&
138138
binding.kind !== 'bindable_prop' &&
139139
binding.kind !== 'raw_state' &&
140+
binding.kind !== 'derived' &&
140141
binding.kind !== 'store_sub' &&
141142
context.state.analysis.runes &&
142143
should_proxy(right, context.state.scope) &&

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)