Skip to content

Commit fe6c00d

Browse files
committed
merge main
2 parents bc1a4ca + fd08cb0 commit fe6c00d

File tree

36 files changed

+166
-50
lines changed

36 files changed

+166
-50
lines changed

.changeset/early-tips-prove.md

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

.changeset/flat-points-kick.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+
fix: reset `is_flushing` if `flushSync` is called and there's no scheduled effect

packages/svelte/CHANGELOG.md

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

3+
## 5.33.18
4+
5+
### Patch Changes
6+
7+
- chore: bump `esrap` dependency ([#16106](https://github.com/sveltejs/svelte/pull/16106))
8+
9+
- fix: destructuring state in ssr ([#16102](https://github.com/sveltejs/svelte/pull/16102))
10+
11+
## 5.33.17
12+
13+
### Patch Changes
14+
15+
- chore: update acorn parser `ecmaVersion` to parse import attributes ([#16098](https://github.com/sveltejs/svelte/pull/16098))
16+
17+
## 5.33.16
18+
19+
### Patch Changes
20+
21+
- fix: visit expression when destructuring state declarations ([#16081](https://github.com/sveltejs/svelte/pull/16081))
22+
23+
- fix: move xmlns attribute from SVGAttributes to to DOMAttributes ([#16080](https://github.com/sveltejs/svelte/pull/16080))
24+
25+
## 5.33.15
26+
27+
### Patch Changes
28+
29+
- fix: invoke parent boundary of deriveds that throw ([#16091](https://github.com/sveltejs/svelte/pull/16091))
30+
331
## 5.33.14
432

533
### Patch Changes

packages/svelte/elements.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,8 @@ export interface DOMAttributes<T extends EventTarget> {
463463
'on:fullscreenerror'?: EventHandler<Event, T> | undefined | null;
464464
onfullscreenerror?: EventHandler<Event, T> | undefined | null;
465465
onfullscreenerrorcapture?: EventHandler<Event, T> | undefined | null;
466+
467+
xmlns?: string | undefined | null;
466468
}
467469

468470
// All the WAI-ARIA 1.1 attributes from https://www.w3.org/TR/wai-aria-1.1/
@@ -1809,7 +1811,6 @@ export interface SVGAttributes<T extends EventTarget> extends AriaAttributes, DO
18091811
'xlink:type'?: string | undefined | null;
18101812
'xml:base'?: string | undefined | null;
18111813
'xml:lang'?: string | undefined | null;
1812-
xmlns?: string | undefined | null;
18131814
'xmlns:xlink'?: string | undefined | null;
18141815
'xml:space'?: string | undefined | null;
18151816
y1?: number | string | undefined | null;

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.33.14",
5+
"version": "5.33.18",
66
"type": "module",
77
"types": "./types/index.d.ts",
88
"engines": {
@@ -174,7 +174,7 @@
174174
"axobject-query": "^4.1.0",
175175
"clsx": "^2.1.1",
176176
"esm-env": "^1.2.1",
177-
"esrap": "^1.4.6",
177+
"esrap": "^1.4.8",
178178
"is-reference": "^3.0.3",
179179
"locate-character": "^3.0.0",
180180
"magic-string": "^0.30.11",

packages/svelte/src/compiler/phases/1-parse/acorn.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export function parse(source, typescript, is_script) {
3636
ast = parser.parse(source, {
3737
onComment,
3838
sourceType: 'module',
39-
ecmaVersion: 13,
39+
ecmaVersion: 16,
4040
locations: true
4141
});
4242
} finally {
@@ -64,7 +64,7 @@ export function parse_expression_at(source, typescript, index) {
6464
const ast = parser.parseExpressionAt(source, index, {
6565
onComment,
6666
sourceType: 'module',
67-
ecmaVersion: 13,
67+
ecmaVersion: 16,
6868
locations: true
6969
});
7070

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ export function VariableDeclaration(node, context) {
148148
const { inserts, paths } = extract_paths(declarator.id, tmp);
149149

150150
declarations.push(
151-
b.declarator(tmp, value),
151+
b.declarator(tmp, /** @type {Expression} */ (context.visit(value))),
152152
...inserts.map(({ id, value }) => {
153153
id.name = context.state.scope.generate('$$array');
154154
context.state.transform[id.name] = { read: get_value };

packages/svelte/src/compiler/phases/3-transform/server/visitors/VariableDeclaration.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,13 @@ function create_state_declarators(declarator, scope, value) {
197197
}
198198

199199
const tmp = b.id(scope.generate('tmp'));
200-
const { paths } = extract_paths(declarator.id, tmp);
200+
const { paths, inserts } = extract_paths(declarator.id, tmp);
201201
return [
202202
b.declarator(tmp, value), // TODO inject declarator for opts, so we can use it below
203+
...inserts.map(({ id, value }) => {
204+
id.name = scope.generate('$$array');
205+
return b.declarator(id, value);
206+
}),
203207
...paths.map((path) => {
204208
const value = path.expression;
205209
return b.declarator(path.node, value);

packages/svelte/src/internal/client/runtime.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -724,6 +724,14 @@ export function flushSync(fn) {
724724
batch.flush();
725725
}
726726

727+
// this would be reset in `flush_queued_root_effects` but since we are early returning here,
728+
// we need to reset it here as well in case the first time there's 0 queued root effects
729+
last_scheduled_effect = null;
730+
731+
if (DEV) {
732+
dev_effect_stack = [];
733+
}
734+
727735
return /** @type {T} */ (result);
728736
}
729737

packages/svelte/src/version.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
* The current version, as set in package.json.
55
* @type {string}
66
*/
7-
export const VERSION = '5.33.14';
7+
export const VERSION = '5.33.18';
88
export const PUBLIC_VERSION = '5';

0 commit comments

Comments
 (0)