Merge branch 'main' into svelte-custom-renderer

pull/18505/head
Paolo Ricciuti 3 months ago committed by GitHub
commit 4116e9f25e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1,5 +0,0 @@
---
'svelte': patch
---
fix: properly track effect end node for async sibling component

@ -1,5 +0,0 @@
---
'svelte': patch
---
fix: prevent false-positive reactivity loss warning

@ -1,5 +0,0 @@
---
'svelte': patch
---
chore: bump esrap dependency

@ -1,5 +0,0 @@
---
'svelte': patch
---
fix: ignore declaration tags for animation directive

@ -1,5 +0,0 @@
---
'svelte': patch
---
fix: reject pending async deriveds on discard

@ -1,5 +1,27 @@
# svelte # svelte
## 5.56.3
### Patch Changes
- fix: ignore errors that occur in destroyed effects ([#18384](https://github.com/sveltejs/svelte/pull/18384))
- fix: type BigInts in `$state.snapshot(...)` return values ([#18388](https://github.com/sveltejs/svelte/pull/18388))
## 5.56.2
### Patch Changes
- fix: properly track effect end node for async sibling component ([#18371](https://github.com/sveltejs/svelte/pull/18371))
- fix: prevent false-positive reactivity loss warning ([#18373](https://github.com/sveltejs/svelte/pull/18373))
- chore: bump esrap dependency ([#18372](https://github.com/sveltejs/svelte/pull/18372))
- fix: ignore declaration tags for animation directive ([#18366](https://github.com/sveltejs/svelte/pull/18366))
- fix: reject pending async deriveds on discard ([#18308](https://github.com/sveltejs/svelte/pull/18308))
## 5.56.1 ## 5.56.1
### Patch Changes ### Patch Changes

@ -2,7 +2,7 @@
"name": "svelte", "name": "svelte",
"description": "Cybernetically enhanced web apps", "description": "Cybernetically enhanced web apps",
"license": "MIT", "license": "MIT",
"version": "5.56.1", "version": "5.56.3",
"type": "module", "type": "module",
"types": "./types/index.d.ts", "types": "./types/index.d.ts",
"engines": { "engines": {

@ -24,7 +24,7 @@ declare function $state<T>(initial: T): T;
declare function $state<T>(): T | undefined; declare function $state<T>(): T | undefined;
declare namespace $state { declare namespace $state {
type Primitive = string | number | boolean | null | undefined; type Primitive = string | number | bigint | boolean | null | undefined;
type TypedArray = type TypedArray =
| Int8Array | Int8Array

@ -3,7 +3,7 @@
import { DEV } from 'esm-env'; import { DEV } from 'esm-env';
import { FILENAME } from '../../constants.js'; import { FILENAME } from '../../constants.js';
import { is_firefox } from './dom/operations.js'; import { is_firefox } from './dom/operations.js';
import { ERROR_VALUE, BOUNDARY_EFFECT, REACTION_RAN, EFFECT } from './constants.js'; import { ERROR_VALUE, BOUNDARY_EFFECT, REACTION_RAN, EFFECT, DESTROYED } from './constants.js';
import { define_property, get_descriptor } from '../shared/utils.js'; import { define_property, get_descriptor } from '../shared/utils.js';
import { active_effect, active_reaction } from './runtime.js'; import { active_effect, active_reaction } from './runtime.js';
@ -45,6 +45,10 @@ export function handle_error(error) {
* @param {Effect | null} effect * @param {Effect | null} effect
*/ */
export function invoke_error_boundary(error, effect) { export function invoke_error_boundary(error, effect) {
if (effect !== null && (effect.f & DESTROYED) !== 0) {
return;
}
while (effect !== null) { while (effect !== null) {
if ((effect.f & BOUNDARY_EFFECT) !== 0) { if ((effect.f & BOUNDARY_EFFECT) !== 0) {
if ((effect.f & REACTION_RAN) === 0) { if ((effect.f & REACTION_RAN) === 0) {

@ -185,5 +185,4 @@ export {
} from '../shared/validate.js'; } from '../shared/validate.js';
export { strict_equals, equals } from './dev/equality.js'; export { strict_equals, equals } from './dev/equality.js';
export { log_if_contains_state } from './dev/console-log.js'; export { log_if_contains_state } from './dev/console-log.js';
export { invoke_error_boundary } from './error-handling.js';
export { push_renderer } from './custom-renderer/state.js'; export { push_renderer } from './custom-renderer/state.js';

@ -4,5 +4,5 @@
* The current version, as set in package.json. * The current version, as set in package.json.
* @type {string} * @type {string}
*/ */
export const VERSION = '5.56.1'; export const VERSION = '5.56.3';
export const PUBLIC_VERSION = '5'; export const PUBLIC_VERSION = '5';

@ -0,0 +1,6 @@
<script>
const data = $derived(await Promise.reject(new Error('oops')));
const model = $derived({ title: data.title });
</script>
<h4>{model.title}</h4>

@ -0,0 +1,13 @@
import { tick } from 'svelte';
import { test } from '../../test';
export default test({
async test({ assert, target }) {
const [button] = target.querySelectorAll('button');
button.click();
await tick();
assert.htmlEqual(target.innerHTML, '<button>show</button><p>error was contained</p>');
}
});

@ -0,0 +1,27 @@
<script>
import Child from './Child.svelte';
let open = $state(false);
</script>
<svelte:boundary>
<button onclick={() => (open = true)}>show</button>
{#if open}
<svelte:boundary>
<Child />
{#snippet pending()}
<p>loading…</p>
{/snippet}
{#snippet failed()}
<p>error was contained</p>
{/snippet}
</svelte:boundary>
{/if}
{#snippet failed()}
<p>error escaped containment</p>
{/snippet}
</svelte:boundary>

@ -3407,7 +3407,7 @@ declare function $state<T>(initial: T): T;
declare function $state<T>(): T | undefined; declare function $state<T>(): T | undefined;
declare namespace $state { declare namespace $state {
type Primitive = string | number | boolean | null | undefined; type Primitive = string | number | bigint | boolean | null | undefined;
type TypedArray = type TypedArray =
| Int8Array | Int8Array

Loading…
Cancel
Save