Merge remote-tracking branch 'origin/main' into svelte-custom-renderer

svelte-custom-renderer
paoloricciuti 2 weeks ago
commit 128023f08b

@ -1,5 +0,0 @@
---
'svelte': patch
---
fix: block template store subscriptions on the promise that assigns the store

@ -1,5 +0,0 @@
---
'svelte': patch
---
fix: route $derived teardown errors through invoke_error_boundary

@ -1,5 +0,0 @@
---
'svelte': patch
---
fix: track SvelteDate snapshots in reactions

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: cancel deferred event listeners during cleanup

@ -1,5 +0,0 @@
---
'svelte': patch
---
fix: remove `<svelte:head>` anchors on unmount

@ -1,5 +0,0 @@
---
'svelte': patch
---
fix: warn on undeclared shorthand event handlers on `<svelte:window>`, `<svelte:document>` and `<svelte:body>`

@ -1,5 +0,0 @@
---
'svelte': patch
---
perf: reuse the cached value in the `<option>`/`<select>` value guard

@ -1,5 +0,0 @@
---
'svelte': patch
---
fix: prevent malformed AST output for `<select>` with static `value` attribute

@ -1,5 +0,0 @@
---
'svelte': patch
---
fix: apply ownership mutation ignores to binding assignments

@ -1,5 +0,0 @@
---
'svelte': patch
---
fix: prevent onoutroend from firing twice when compilerOptions.hmr is true

@ -1,5 +0,0 @@
---
'svelte': patch
---
fix: preserve whitespace after inline elements when printing

@ -1,5 +0,0 @@
---
'svelte': patch
---
perf: fold SSR block-open markers into the branch's first push

@ -1,5 +0,0 @@
---
'svelte': patch
---
fix: run `onDestroy` callbacks when a server render throws

@ -1,5 +0,0 @@
---
'svelte': patch
---
fix: report `derived_invalid_export` for `export let x = $derived(...)` in runes mode

@ -1,5 +0,0 @@
---
'svelte': patch
---
fix: never apply class hash to elements inside `<svelte:head>`

@ -1,5 +0,0 @@
---
'svelte': patch
---
fix: keep `defaultChecked` on hydrated radio inputs with spread attributes

@ -1,5 +0,0 @@
---
'svelte': patch
---
fix: accept `onfocusin`/`onfocusout` in `a11y_mouse_events_have_key_events`

@ -1,5 +0,0 @@
---
'svelte': patch
---
perf: O(n²)→O(n) Map lookups for legacy `$:` reactive statement ordering

@ -1,5 +0,0 @@
---
'svelte': patch
---
fix: distinct memoizer on style/class directives

@ -1,5 +0,0 @@
---
'svelte': patch
---
fix: measure nested transitions before applying their starting styles

@ -1,5 +0,0 @@
---
'svelte': patch
---
fix: don't turn component instances stored in `$state` into state proxies

@ -1,5 +0,0 @@
---
'svelte': minor
---
feat: export `RenderOutput`, `SyncRenderOutput`, `Csp` and `Sha256Source` from `svelte/server`

@ -1,5 +0,0 @@
---
'svelte': patch
---
perf: emit `$.only_child` for elements with a single child

@ -1,5 +0,0 @@
---
'svelte': patch
---
fix: omit `bind:focused` from SSR output (it has no HTML attribute)

@ -1,5 +0,0 @@
---
'svelte': patch
---
fix: more robust rendering of Svelte custom element slots

@ -1,5 +0,0 @@
---
"svelte": patch
---
perf: optimize simple object destructuring in `@const` tags

@ -1,5 +0,0 @@
---
'svelte': patch
---
fix: properly apply static textarea value attribute during CSR

@ -1,5 +0,0 @@
---
'svelte': patch
---
fix: end a restored reaction context at the end of its synchronous segment

@ -1,5 +0,0 @@
---
'svelte': patch
---
fix: keep the dependencies of a reaction that throws, so deriveds it read are neither leaked nor stuck in their error

@ -1,5 +0,0 @@
---
'svelte': patch
---
fix: don't resurrect outroing elements when an ancestor block is paused and resumed

@ -1,5 +0,0 @@
---
'svelte': patch
---
perf: use `$.comment()` for single-comment templates

@ -1,5 +0,0 @@
---
'svelte': patch
---
perf: store setters cache as `Set` instead of `Array`

@ -1,5 +0,0 @@
---
'svelte': minor
---
feat: add `has` function to `createContext`

@ -1,5 +0,0 @@
---
'svelte': patch
---
fix: transform derived assignments and select function bindings correctly during server-side rendering

@ -1,5 +0,0 @@
---
'svelte': patch
---
fix: keep boolean attributes with an empty string value when rendering attribute objects on the server

@ -1,5 +0,0 @@
---
'svelte': patch
---
fix: sync `SvelteURL` port signal when the protocol setter clears the port

@ -1,5 +0,0 @@
---
'svelte': minor
---
feat: support `defaultValue` on `<select>`

@ -1,5 +0,0 @@
---
'svelte': minor
---
feat: add getOrInsert/getOrInsertComputed to SvelteMap

@ -1,5 +0,0 @@
---
'svelte': patch
---
fix: block declaration tags and `{@const}` on async values read inside closures

@ -1,5 +0,0 @@
---
'svelte': patch
---
fix: avoid css tree-shaking for exported Snippet

@ -1,5 +0,0 @@
---
'svelte': patch
---
perf: treat `<img loading>` as a static element again

@ -1,5 +0,0 @@
---
'svelte': patch
---
fix: prevent `selectedcontent` mutation from changing the selected option

@ -1,5 +0,0 @@
---
'svelte': patch
---
fix: avoid `NaN` keyframe values in `slide` transition for elements without a layout box

@ -1,5 +0,0 @@
---
'svelte': patch
---
fix: preserve line feed character references in attribute values

@ -1,5 +0,0 @@
---
'svelte': patch
---
fix: decode uppercase-`X` hex numeric character references (`&#X...;`)

@ -1,5 +0,0 @@
---
'svelte': patch
---
chore: clarify when `$effect.pre` runs relative to DOM updates

@ -1,5 +0,0 @@
---
'svelte': patch
---
fix: scope SSR boundary failed snippets to their boundary

@ -1,5 +1,105 @@
# svelte
## 5.57.0
### Minor Changes
- feat: export `RenderOutput`, `SyncRenderOutput`, `Csp` and `Sha256Source` from `svelte/server` ([#18648](https://github.com/sveltejs/svelte/pull/18648))
- feat: add `has` function to `createContext` ([#18472](https://github.com/sveltejs/svelte/pull/18472))
- feat: support `defaultValue` on `<select>` ([#18591](https://github.com/sveltejs/svelte/pull/18591))
- feat: add getOrInsert/getOrInsertComputed to SvelteMap ([#18728](https://github.com/sveltejs/svelte/pull/18728))
### Patch Changes
- fix: block template store subscriptions on the promise that assigns the store ([#18582](https://github.com/sveltejs/svelte/pull/18582))
- fix: route $derived teardown errors through invoke_error_boundary ([#18486](https://github.com/sveltejs/svelte/pull/18486))
- fix: track SvelteDate snapshots in reactions ([#18700](https://github.com/sveltejs/svelte/pull/18700))
- fix: remove `<svelte:head>` anchors on unmount ([#18697](https://github.com/sveltejs/svelte/pull/18697))
- fix: warn on undeclared shorthand event handlers on `<svelte:window>`, `<svelte:document>` and `<svelte:body>` ([#18480](https://github.com/sveltejs/svelte/pull/18480))
- perf: reuse the cached value in the `<option>`/`<select>` value guard ([#18713](https://github.com/sveltejs/svelte/pull/18713))
- fix: prevent malformed AST output for `<select>` with static `value` attribute ([#18449](https://github.com/sveltejs/svelte/pull/18449))
- fix: apply ownership mutation ignores to binding assignments ([#18718](https://github.com/sveltejs/svelte/pull/18718))
- fix: prevent onoutroend from firing twice when compilerOptions.hmr is true ([#18655](https://github.com/sveltejs/svelte/pull/18655))
- fix: preserve whitespace after inline elements when printing ([#18685](https://github.com/sveltejs/svelte/pull/18685))
- perf: fold SSR block-open markers into the branch's first push ([#18712](https://github.com/sveltejs/svelte/pull/18712))
- fix: run `onDestroy` callbacks when a server render throws ([#18585](https://github.com/sveltejs/svelte/pull/18585))
- fix: report `derived_invalid_export` for `export let x = $derived(...)` in runes mode ([#18692](https://github.com/sveltejs/svelte/pull/18692))
- fix: never apply class hash to elements inside `<svelte:head>` ([#18160](https://github.com/sveltejs/svelte/pull/18160))
- fix: keep `defaultChecked` on hydrated radio inputs with spread attributes ([#18701](https://github.com/sveltejs/svelte/pull/18701))
- fix: accept `onfocusin`/`onfocusout` in `a11y_mouse_events_have_key_events` ([#18689](https://github.com/sveltejs/svelte/pull/18689))
- perf: O(n²)→O(n) Map lookups for legacy `$:` reactive statement ordering ([#18602](https://github.com/sveltejs/svelte/pull/18602))
- fix: distinct memoizer on style/class directives ([#18466](https://github.com/sveltejs/svelte/pull/18466))
- fix: measure nested transitions before applying their starting styles ([#18647](https://github.com/sveltejs/svelte/pull/18647))
- fix: don't turn component instances stored in `$state` into state proxies ([#18646](https://github.com/sveltejs/svelte/pull/18646))
- perf: emit `$.only_child` for elements with a single child ([#18717](https://github.com/sveltejs/svelte/pull/18717))
- fix: omit `bind:focused` from SSR output (it has no HTML attribute) ([#18724](https://github.com/sveltejs/svelte/pull/18724))
- fix: more robust rendering of Svelte custom element slots ([#18710](https://github.com/sveltejs/svelte/pull/18710))
- perf: optimize simple object destructuring in `@const` tags ([#18390](https://github.com/sveltejs/svelte/pull/18390))
- fix: properly apply static textarea value attribute during CSR ([#18727](https://github.com/sveltejs/svelte/pull/18727))
- fix: end a restored reaction context at the end of its synchronous segment ([#18694](https://github.com/sveltejs/svelte/pull/18694))
- fix: keep the dependencies of a reaction that throws, so deriveds it read are neither leaked nor stuck in their error ([#18703](https://github.com/sveltejs/svelte/pull/18703))
- fix: don't resurrect outroing elements when an ancestor block is paused and resumed ([#18431](https://github.com/sveltejs/svelte/pull/18431))
- perf: use `$.comment()` for single-comment templates ([#18714](https://github.com/sveltejs/svelte/pull/18714))
- chore: move `@types/trusted-types` to devDependencies ([#18730](https://github.com/sveltejs/svelte/pull/18730))
- perf: store setters cache as `Set` instead of `Array` ([#18251](https://github.com/sveltejs/svelte/pull/18251))
- fix: transform derived assignments and select function bindings correctly during server-side rendering ([#18669](https://github.com/sveltejs/svelte/pull/18669))
- fix: keep boolean attributes with an empty string value when rendering attribute objects on the server ([#18721](https://github.com/sveltejs/svelte/pull/18721))
- fix: sync `SvelteURL` port signal when the protocol setter clears the port ([#18705](https://github.com/sveltejs/svelte/pull/18705))
- fix: block declaration tags and `{@const}` on async values read inside closures ([#18533](https://github.com/sveltejs/svelte/pull/18533))
- fix: avoid css tree-shaking for exported Snippet ([#18540](https://github.com/sveltejs/svelte/pull/18540))
- perf: treat `<img loading>` as a static element again ([#18711](https://github.com/sveltejs/svelte/pull/18711))
- fix: prevent `selectedcontent` mutation from changing the selected option ([#18495](https://github.com/sveltejs/svelte/pull/18495))
- fix: avoid `NaN` keyframe values in `slide` transition for elements without a layout box ([#18430](https://github.com/sveltejs/svelte/pull/18430))
- fix: preserve line feed character references in attribute values ([#18691](https://github.com/sveltejs/svelte/pull/18691))
- fix: decode uppercase-`X` hex numeric character references (`&#X...;`) ([#18708](https://github.com/sveltejs/svelte/pull/18708))
- chore: clarify when `$effect.pre` runs relative to DOM updates ([#18534](https://github.com/sveltejs/svelte/pull/18534))
- fix: scope SSR boundary failed snippets to their boundary ([#18593](https://github.com/sveltejs/svelte/pull/18593))
## 5.56.10
### Patch Changes

@ -2,7 +2,7 @@
"name": "svelte",
"description": "Cybernetically enhanced web apps",
"license": "MIT",
"version": "5.56.10",
"version": "5.57.0",
"type": "module",
"types": "./types/index.d.ts",
"engines": {
@ -166,6 +166,7 @@
"@rollup/plugin-virtual": "^3.0.2",
"@types/aria-query": "^5.0.4",
"@types/node": "^20.11.5",
"@types/trusted-types": "^2.0.7",
"baseline-browser-mapping": "^2.10.32",
"dts-buddy": "^0.5.5",
"esbuild": "^0.28.1",
@ -181,7 +182,6 @@
"@jridgewell/sourcemap-codec": "^1.5.0",
"@sveltejs/acorn-typescript": "^1.0.10",
"@types/estree": "^1.0.5",
"@types/trusted-types": "^2.0.7",
"acorn": "^8.12.1",
"aria-query": "5.3.1",
"axobject-query": "^4.1.0",

@ -98,8 +98,11 @@ export function create_event(event_name, dom, handler, options = {}) {
!is_custom_renderer &&
(event_name.startsWith('pointer') || event_name.startsWith('touch') || event_name === 'wheel')
) {
target_handler.__removed = false;
queue_micro_task(() => {
if (!target_handler.__removed) {
add_event_listener(dom, event_name, target_handler, options);
}
});
} else {
add_event_listener(dom, event_name, target_handler, options);
@ -122,6 +125,7 @@ export function on(element, type, handler, options = {}) {
var target_handler = create_event(type, element, handler, options);
return () => {
target_handler.__removed = true;
remove_event_listener(element, type, target_handler, options);
};
}
@ -150,6 +154,7 @@ export function event(event_name, dom, handler, capture, passive) {
dom instanceof HTMLMediaElement)
) {
teardown(() => {
target_handler.__removed = true;
remove_event_listener(dom, event_name, target_handler, options);
});
}

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

@ -0,0 +1 @@
<svelte:document onpointerdown={() => console.log('template')} />

@ -0,0 +1,8 @@
import { test } from '../../test';
export default test({
async test({ assert, logs }) {
await new Promise((resolve) => setTimeout(resolve));
assert.deepEqual(logs, []);
}
});

@ -0,0 +1,21 @@
<script>
import { mount, onMount, unmount } from 'svelte';
import { on } from 'svelte/events';
import Child from './Child.svelte';
let target;
onMount(async () => {
const off = on(document, 'wheel', () => console.log('on'));
off();
const child = mount(Child, { target });
unmount(child);
await Promise.resolve();
document.dispatchEvent(new Event('wheel'));
document.dispatchEvent(new Event('pointerdown'));
});
</script>
<div bind:this={target}></div>

@ -80,9 +80,6 @@ importers:
'@types/estree':
specifier: ^1.0.5
version: 1.0.8
'@types/trusted-types':
specifier: ^2.0.7
version: 2.0.7
acorn:
specifier: ^8.12.1
version: 8.16.0
@ -141,6 +138,9 @@ importers:
'@types/node':
specifier: ^20.11.5
version: 20.19.17
'@types/trusted-types':
specifier: ^2.0.7
version: 2.0.7
baseline-browser-mapping:
specifier: ^2.10.32
version: 2.10.32

Loading…
Cancel
Save