svelte 5.55.7 → 5.55.8
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/print/index.js +6 -1
- package/src/constants.js +1 -1
- package/src/internal/client/reactivity/async.js +15 -8
- package/src/internal/client/reactivity/deriveds.js +9 -4
- package/src/internal/client/reactivity/store.js +1 -1
- package/src/reactivity/url-search-params.js +1 -1
- package/src/version.js +1 -1
package/package.json
CHANGED
|
@@ -247,7 +247,7 @@ const css_visitors = {
|
|
|
247
247
|
},
|
|
248
248
|
|
|
249
249
|
Percentage(node, context) {
|
|
250
|
-
context.write(
|
|
250
|
+
context.write(node.value);
|
|
251
251
|
},
|
|
252
252
|
|
|
253
253
|
PseudoClassSelector(node, context) {
|
|
@@ -417,6 +417,7 @@ const svelte_visitors = (comments) => ({
|
|
|
417
417
|
const is_block_element =
|
|
418
418
|
child_node.type === 'RegularElement' ||
|
|
419
419
|
child_node.type === 'Component' ||
|
|
420
|
+
child_node.type === 'SvelteBody' ||
|
|
420
421
|
child_node.type === 'SvelteHead' ||
|
|
421
422
|
child_node.type === 'SvelteFragment' ||
|
|
422
423
|
child_node.type === 'SvelteBoundary' ||
|
|
@@ -821,6 +822,10 @@ const svelte_visitors = (comments) => ({
|
|
|
821
822
|
context.write('</style>');
|
|
822
823
|
},
|
|
823
824
|
|
|
825
|
+
SvelteBody(node, context) {
|
|
826
|
+
base_element(node, context, comments);
|
|
827
|
+
},
|
|
828
|
+
|
|
824
829
|
SvelteBoundary(node, context) {
|
|
825
830
|
base_element(node, context, comments);
|
|
826
831
|
},
|
package/src/constants.js
CHANGED
|
@@ -32,7 +32,7 @@ export const ELEMENT_IS_NAMESPACED = 1;
|
|
|
32
32
|
export const ELEMENT_PRESERVE_ATTRIBUTE_CASE = 1 << 1;
|
|
33
33
|
export const ELEMENT_IS_INPUT = 1 << 2;
|
|
34
34
|
|
|
35
|
-
export const UNINITIALIZED = Symbol();
|
|
35
|
+
export const UNINITIALIZED = Symbol('uninitialized');
|
|
36
36
|
|
|
37
37
|
// Dev-time component properties
|
|
38
38
|
export const FILENAME = Symbol('filename');
|
|
@@ -303,15 +303,21 @@ export function run(thunks) {
|
|
|
303
303
|
.then(() => {
|
|
304
304
|
restore();
|
|
305
305
|
|
|
306
|
-
|
|
307
|
-
|
|
306
|
+
try {
|
|
307
|
+
if (errored) {
|
|
308
|
+
throw errored.error;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
if (aborted(active)) {
|
|
312
|
+
throw STALE_REACTION;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
return fn();
|
|
316
|
+
} finally {
|
|
317
|
+
// We gotta unset context directly in case the function returns a promise, in which case
|
|
318
|
+
// unset_context in .finally() would be too late ...
|
|
319
|
+
unset_context();
|
|
308
320
|
}
|
|
309
|
-
|
|
310
|
-
if (aborted(active)) {
|
|
311
|
-
throw STALE_REACTION;
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
return fn();
|
|
315
321
|
})
|
|
316
322
|
.catch(handle_error);
|
|
317
323
|
|
|
@@ -320,6 +326,7 @@ export function run(thunks) {
|
|
|
320
326
|
|
|
321
327
|
promise.finally(() => {
|
|
322
328
|
blocker.settled = true;
|
|
329
|
+
// ... but we also need it after such a promise has resolved in case it restores our context
|
|
323
330
|
unset_context();
|
|
324
331
|
});
|
|
325
332
|
}
|
|
@@ -338,7 +338,12 @@ export function execute_derived(derived) {
|
|
|
338
338
|
var prev_active_effect = active_effect;
|
|
339
339
|
var parent = derived.parent;
|
|
340
340
|
|
|
341
|
-
if (
|
|
341
|
+
if (
|
|
342
|
+
!is_destroying_effect &&
|
|
343
|
+
parent !== null &&
|
|
344
|
+
derived.v !== UNINITIALIZED && // if it was never evaluated before, it's guaranteed to fail downstream, so we try to execute instead
|
|
345
|
+
(parent.f & (DESTROYED | INERT)) !== 0
|
|
346
|
+
) {
|
|
342
347
|
w.derived_inert();
|
|
343
348
|
|
|
344
349
|
return derived.v;
|
|
@@ -447,8 +452,8 @@ export function freeze_derived_effects(derived) {
|
|
|
447
452
|
// make it a noop so it doesn't get called again if the derived
|
|
448
453
|
// is unfrozen. we don't set it to `null`, because the existence
|
|
449
454
|
// of a teardown function is what determines whether the
|
|
450
|
-
// effect runs again during unfreezing
|
|
451
|
-
e.teardown = noop;
|
|
455
|
+
// effect runs again during unfreezing (but not for teardown-only effects)
|
|
456
|
+
if (e.fn !== null) e.teardown = noop;
|
|
452
457
|
e.ac = null;
|
|
453
458
|
|
|
454
459
|
remove_reactions(e, 0);
|
|
@@ -466,7 +471,7 @@ export function unfreeze_derived_effects(derived) {
|
|
|
466
471
|
for (const e of derived.effects) {
|
|
467
472
|
// if the effect was previously frozen — indicated by the presence
|
|
468
473
|
// of a teardown function — unfreeze it
|
|
469
|
-
if (e.teardown) {
|
|
474
|
+
if (e.teardown && e.fn !== null) {
|
|
470
475
|
update_effect(e);
|
|
471
476
|
}
|
|
472
477
|
}
|
|
@@ -21,7 +21,7 @@ export let legacy_is_updating_store = false;
|
|
|
21
21
|
*/
|
|
22
22
|
let is_store_binding = false;
|
|
23
23
|
|
|
24
|
-
let IS_UNMOUNTED = Symbol();
|
|
24
|
+
let IS_UNMOUNTED = Symbol('unmounted');
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* Gets the current value of a store. If the store isn't subscribed to yet, it will create a proxy
|
|
@@ -4,7 +4,7 @@ import { tag } from '../internal/client/dev/tracing.js';
|
|
|
4
4
|
import { get } from '../internal/client/runtime.js';
|
|
5
5
|
import { get_current_url } from './url.js';
|
|
6
6
|
|
|
7
|
-
export const REPLACE = Symbol();
|
|
7
|
+
export const REPLACE = Symbol('replace');
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* A reactive version of the built-in [`URLSearchParams`](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams) object.
|
package/src/version.js
CHANGED