svelte 5.45.7 → 5.45.9
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 +1 -1
- package/src/compiler/phases/1-parse/index.js +2 -15
- package/src/compiler/phases/2-analyze/visitors/VariableDeclarator.js +11 -1
- package/src/compiler/print/index.js +3 -2
- package/src/internal/client/reactivity/batch.js +14 -19
- package/src/version.js +1 -1
- package/types/index.d.ts.map +1 -1
package/package.json
CHANGED
|
@@ -117,21 +117,8 @@ export class Parser {
|
|
|
117
117
|
e.unexpected_eof(this.index);
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
while (regex_whitespace.test(template[start])) start += 1;
|
|
123
|
-
|
|
124
|
-
let end = /** @type {number} */ (
|
|
125
|
-
this.root.fragment.nodes[this.root.fragment.nodes.length - 1].end
|
|
126
|
-
);
|
|
127
|
-
while (regex_whitespace.test(template[end - 1])) end -= 1;
|
|
128
|
-
|
|
129
|
-
this.root.start = start;
|
|
130
|
-
this.root.end = end;
|
|
131
|
-
} else {
|
|
132
|
-
// @ts-ignore
|
|
133
|
-
this.root.start = this.root.end = null;
|
|
134
|
-
}
|
|
120
|
+
this.root.start = 0;
|
|
121
|
+
this.root.end = template.length;
|
|
135
122
|
|
|
136
123
|
const options_index = this.root.fragment.nodes.findIndex(
|
|
137
124
|
/** @param {any} thing */
|
|
@@ -146,5 +146,15 @@ export function VariableDeclarator(node, context) {
|
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
context.
|
|
149
|
+
if (node.init && get_rune(node.init, context.state.scope) === '$props') {
|
|
150
|
+
// prevent erroneous `state_referenced_locally` warnings on prop fallbacks
|
|
151
|
+
context.visit(node.id, {
|
|
152
|
+
...context.state,
|
|
153
|
+
function_depth: context.state.function_depth + 1
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
context.visit(node.init);
|
|
157
|
+
} else {
|
|
158
|
+
context.next();
|
|
159
|
+
}
|
|
150
160
|
}
|
|
@@ -112,12 +112,13 @@ function base_element(node, context) {
|
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
const multiline_attributes = attributes(node.attributes, child_context);
|
|
115
|
-
|
|
115
|
+
const is_doctype_node = node.name.toLowerCase() === '!doctype';
|
|
116
116
|
const is_self_closing =
|
|
117
117
|
is_void(node.name) || (node.type === 'Component' && node.fragment.nodes.length === 0);
|
|
118
118
|
let multiline_content = false;
|
|
119
119
|
|
|
120
|
-
if (
|
|
120
|
+
if (is_doctype_node) child_context.write(`>`);
|
|
121
|
+
else if (is_self_closing) {
|
|
121
122
|
child_context.write(`${multiline_attributes ? '' : ' '}/>`);
|
|
122
123
|
} else {
|
|
123
124
|
child_context.write('>');
|
|
@@ -44,7 +44,6 @@ import { eager_effect, unlink_effect } from './effects.js';
|
|
|
44
44
|
* effect: Effect | null;
|
|
45
45
|
* effects: Effect[];
|
|
46
46
|
* render_effects: Effect[];
|
|
47
|
-
* block_effects: Effect[];
|
|
48
47
|
* }} EffectTarget
|
|
49
48
|
*/
|
|
50
49
|
|
|
@@ -128,15 +127,15 @@ export class Batch {
|
|
|
128
127
|
|
|
129
128
|
/**
|
|
130
129
|
* Deferred effects (which run after async work has completed) that are DIRTY
|
|
131
|
-
* @type {Effect
|
|
130
|
+
* @type {Set<Effect>}
|
|
132
131
|
*/
|
|
133
|
-
#dirty_effects =
|
|
132
|
+
#dirty_effects = new Set();
|
|
134
133
|
|
|
135
134
|
/**
|
|
136
135
|
* Deferred effects that are MAYBE_DIRTY
|
|
137
|
-
* @type {Effect
|
|
136
|
+
* @type {Set<Effect>}
|
|
138
137
|
*/
|
|
139
|
-
#maybe_dirty_effects =
|
|
138
|
+
#maybe_dirty_effects = new Set();
|
|
140
139
|
|
|
141
140
|
/**
|
|
142
141
|
* A set of branches that still exist, but will be destroyed when this batch
|
|
@@ -167,8 +166,7 @@ export class Batch {
|
|
|
167
166
|
parent: null,
|
|
168
167
|
effect: null,
|
|
169
168
|
effects: [],
|
|
170
|
-
render_effects: []
|
|
171
|
-
block_effects: []
|
|
169
|
+
render_effects: []
|
|
172
170
|
};
|
|
173
171
|
|
|
174
172
|
for (const root of root_effects) {
|
|
@@ -187,7 +185,6 @@ export class Batch {
|
|
|
187
185
|
if (this.is_deferred()) {
|
|
188
186
|
this.#defer_effects(target.effects);
|
|
189
187
|
this.#defer_effects(target.render_effects);
|
|
190
|
-
this.#defer_effects(target.block_effects);
|
|
191
188
|
} else {
|
|
192
189
|
// If sources are written to, then work needs to happen in a separate batch, else prior sources would be mixed with
|
|
193
190
|
// newly updated sources, which could lead to infinite loops when effects run over and over again.
|
|
@@ -228,8 +225,7 @@ export class Batch {
|
|
|
228
225
|
parent: target,
|
|
229
226
|
effect,
|
|
230
227
|
effects: [],
|
|
231
|
-
render_effects: []
|
|
232
|
-
block_effects: []
|
|
228
|
+
render_effects: []
|
|
233
229
|
};
|
|
234
230
|
}
|
|
235
231
|
|
|
@@ -241,7 +237,7 @@ export class Batch {
|
|
|
241
237
|
} else if (async_mode_flag && (flags & (RENDER_EFFECT | MANAGED_EFFECT)) !== 0) {
|
|
242
238
|
target.render_effects.push(effect);
|
|
243
239
|
} else if (is_dirty(effect)) {
|
|
244
|
-
if ((effect.f & BLOCK_EFFECT) !== 0)
|
|
240
|
+
if ((effect.f & BLOCK_EFFECT) !== 0) this.#dirty_effects.add(effect);
|
|
245
241
|
update_effect(effect);
|
|
246
242
|
}
|
|
247
243
|
|
|
@@ -263,7 +259,6 @@ export class Batch {
|
|
|
263
259
|
// once the boundary is ready?
|
|
264
260
|
this.#defer_effects(target.effects);
|
|
265
261
|
this.#defer_effects(target.render_effects);
|
|
266
|
-
this.#defer_effects(target.block_effects);
|
|
267
262
|
|
|
268
263
|
target = /** @type {EffectTarget} */ (target.parent);
|
|
269
264
|
}
|
|
@@ -279,8 +274,11 @@ export class Batch {
|
|
|
279
274
|
*/
|
|
280
275
|
#defer_effects(effects) {
|
|
281
276
|
for (const e of effects) {
|
|
282
|
-
|
|
283
|
-
|
|
277
|
+
if ((e.f & DIRTY) !== 0) {
|
|
278
|
+
this.#dirty_effects.add(e);
|
|
279
|
+
} else if ((e.f & MAYBE_DIRTY) !== 0) {
|
|
280
|
+
this.#maybe_dirty_effects.add(e);
|
|
281
|
+
}
|
|
284
282
|
|
|
285
283
|
// Since we're not executing these effects now, we need to clear any WAS_MARKED flags
|
|
286
284
|
// so that other batches can correctly reach these effects during their own traversal
|
|
@@ -390,8 +388,7 @@ export class Batch {
|
|
|
390
388
|
parent: null,
|
|
391
389
|
effect: null,
|
|
392
390
|
effects: [],
|
|
393
|
-
render_effects: []
|
|
394
|
-
block_effects: []
|
|
391
|
+
render_effects: []
|
|
395
392
|
};
|
|
396
393
|
|
|
397
394
|
for (const batch of batches) {
|
|
@@ -484,6 +481,7 @@ export class Batch {
|
|
|
484
481
|
|
|
485
482
|
revive() {
|
|
486
483
|
for (const e of this.#dirty_effects) {
|
|
484
|
+
this.#maybe_dirty_effects.delete(e);
|
|
487
485
|
set_signal_status(e, DIRTY);
|
|
488
486
|
schedule_effect(e);
|
|
489
487
|
}
|
|
@@ -493,9 +491,6 @@ export class Batch {
|
|
|
493
491
|
schedule_effect(e);
|
|
494
492
|
}
|
|
495
493
|
|
|
496
|
-
this.#dirty_effects = [];
|
|
497
|
-
this.#maybe_dirty_effects = [];
|
|
498
|
-
|
|
499
494
|
this.flush();
|
|
500
495
|
}
|
|
501
496
|
|
package/src/version.js
CHANGED
package/types/index.d.ts.map
CHANGED
|
@@ -272,6 +272,6 @@
|
|
|
272
272
|
null,
|
|
273
273
|
null
|
|
274
274
|
],
|
|
275
|
-
"mappings": ";;;;;;;;;kBAUiBA,2BAA2BA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAkC/BC,eAAeA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aA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