svelte 5.56.3 → 5.56.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/compiler/index.js +1 -1
- package/package.json +3 -3
- package/src/compiler/phases/1-parse/remove_typescript_nodes.js +6 -0
- package/src/compiler/phases/1-parse/state/tag.js +5 -1
- package/src/internal/client/reactivity/async.js +2 -0
- package/src/reactivity/url-search-params.js +15 -0
- package/src/version.js +1 -1
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "svelte",
|
|
3
3
|
"description": "Cybernetically enhanced web apps",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "5.56.
|
|
5
|
+
"version": "5.56.4",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"types": "./types/index.d.ts",
|
|
8
8
|
"engines": {
|
|
@@ -148,7 +148,7 @@
|
|
|
148
148
|
"@types/node": "^20.11.5",
|
|
149
149
|
"baseline-browser-mapping": "^2.10.32",
|
|
150
150
|
"dts-buddy": "^0.5.5",
|
|
151
|
-
"esbuild": "^0.
|
|
151
|
+
"esbuild": "^0.28.1",
|
|
152
152
|
"rollup": "^4.59.0",
|
|
153
153
|
"source-map": "^0.7.4",
|
|
154
154
|
"tinyglobby": "^0.2.12",
|
|
@@ -168,7 +168,7 @@
|
|
|
168
168
|
"clsx": "^2.1.1",
|
|
169
169
|
"devalue": "^5.8.1",
|
|
170
170
|
"esm-env": "^1.2.1",
|
|
171
|
-
"esrap": "^2.2.
|
|
171
|
+
"esrap": "^2.2.12",
|
|
172
172
|
"is-reference": "^3.0.3",
|
|
173
173
|
"locate-character": "^3.0.0",
|
|
174
174
|
"magic-string": "^0.30.11",
|
|
@@ -30,6 +30,12 @@ const visitors = {
|
|
|
30
30
|
delete n.readonly;
|
|
31
31
|
delete n.definite;
|
|
32
32
|
delete n.override;
|
|
33
|
+
|
|
34
|
+
// `optional` is reused by JS optional chaining (`a?.b`, `a?.()`), so only
|
|
35
|
+
// strip the TypeScript optional marker (`x?: T`, `m?(): T`, `x?: T` fields)
|
|
36
|
+
if (n.type !== 'MemberExpression' && n.type !== 'CallExpression') {
|
|
37
|
+
delete n.optional;
|
|
38
|
+
}
|
|
33
39
|
},
|
|
34
40
|
Decorator(node) {
|
|
35
41
|
e.typescript_invalid_feature(node, 'decorators (related TSC proposal is not stage 4 yet)');
|
|
@@ -783,6 +783,8 @@ function special(parser) {
|
|
|
783
783
|
|
|
784
784
|
const expression_start = parser.index;
|
|
785
785
|
const init = read_expression(parser);
|
|
786
|
+
// parser is past wrapping parens, but `init.end` is not — use the parser position
|
|
787
|
+
const declarator_end = parser.index;
|
|
786
788
|
if (
|
|
787
789
|
init.type === 'SequenceExpression' &&
|
|
788
790
|
!parser.template.substring(expression_start, init.start).includes('(')
|
|
@@ -801,7 +803,9 @@ function special(parser) {
|
|
|
801
803
|
declaration: {
|
|
802
804
|
type: 'VariableDeclaration',
|
|
803
805
|
kind: 'const',
|
|
804
|
-
declarations: [
|
|
806
|
+
declarations: [
|
|
807
|
+
{ type: 'VariableDeclarator', id, init, start: id.start, end: declarator_end }
|
|
808
|
+
],
|
|
805
809
|
start: start + 2, // start at const, not at @const
|
|
806
810
|
end: parser.index - 1
|
|
807
811
|
},
|
|
@@ -25,6 +25,7 @@ import {
|
|
|
25
25
|
set_reactivity_loss_tracker
|
|
26
26
|
} from './deriveds.js';
|
|
27
27
|
import { aborted } from './effects.js';
|
|
28
|
+
import { queue_micro_task } from '../dom/task.js';
|
|
28
29
|
|
|
29
30
|
/**
|
|
30
31
|
* @param {Blocker[]} blockers
|
|
@@ -169,6 +170,7 @@ export async function save(promise) {
|
|
|
169
170
|
|
|
170
171
|
return () => {
|
|
171
172
|
restore();
|
|
173
|
+
queue_micro_task(unset_context);
|
|
172
174
|
return value;
|
|
173
175
|
};
|
|
174
176
|
}
|
|
@@ -54,6 +54,11 @@ export class SvelteURLSearchParams extends URLSearchParams {
|
|
|
54
54
|
*/
|
|
55
55
|
[REPLACE](params) {
|
|
56
56
|
if (this.#updating) return;
|
|
57
|
+
|
|
58
|
+
// the URL may have changed in a way that leaves the search string untouched —
|
|
59
|
+
// don't rebuild the params or notify readers if nothing changed
|
|
60
|
+
if (params.toString() === super.toString()) return;
|
|
61
|
+
|
|
57
62
|
this.#updating = true;
|
|
58
63
|
|
|
59
64
|
for (const key of [...super.keys()]) {
|
|
@@ -126,6 +131,16 @@ export class SvelteURLSearchParams extends URLSearchParams {
|
|
|
126
131
|
return super.keys();
|
|
127
132
|
}
|
|
128
133
|
|
|
134
|
+
/**
|
|
135
|
+
* @param {(value: string, key: string, parent: URLSearchParams) => void} callback
|
|
136
|
+
* @param {any} [this_arg]
|
|
137
|
+
* @returns {void}
|
|
138
|
+
*/
|
|
139
|
+
forEach(callback, this_arg) {
|
|
140
|
+
get(this.#version);
|
|
141
|
+
super.forEach(callback, this_arg);
|
|
142
|
+
}
|
|
143
|
+
|
|
129
144
|
/**
|
|
130
145
|
* @param {string} name
|
|
131
146
|
* @param {string} value
|
package/src/version.js
CHANGED