oxlint
Ben McCann 3 weeks ago
commit 6ef72390d6

@ -1,5 +0,0 @@
---
'svelte': patch
---
fix: ensure infinite effect loops are cleared after flushing

@ -1,5 +0,0 @@
---
'svelte': patch
---
fix: allow `{#key NaN}`

@ -1,5 +0,0 @@
---
'svelte': patch
---
fix: detect store in each block expression regardless of AST shape

@ -1,5 +0,0 @@
---
'svelte': patch
---
fix: treat `<menu>` like `<ul>`/`<ol>` for a11y role checks

@ -1,5 +0,0 @@
---
'svelte': patch
---
fix: add vite-ignore comment inside dynamic crypto import

@ -1,5 +0,0 @@
---
'svelte': patch
---
chore: wrap JSDoc URLs in `@see` and `@link` tags

@ -1,5 +0,0 @@
---
'svelte': minor
---
feat: allow use of createContext when instantiating components programmatically

@ -1,5 +0,0 @@
---
"svelte": patch
---
fix: properly hydrate already-resolved async blocks

@ -1,5 +0,0 @@
---
'svelte': patch
---
fix: emit `each_key_duplicate` error in production

@ -1,5 +0,0 @@
---
'svelte': patch
---
fix: exit resolved async blocks on correct node when hydrating

@ -120,6 +120,7 @@
"coverage/**",
"playgrounds/sandbox/**",
"*.config.js",
"vitest-xhtml-environment.ts",
"documentation",
"tmp/**"
],

@ -82,6 +82,14 @@ Attachments can also be created inline ([demo](/playground/untitled#H4sIAAAAAAAA
> [!NOTE]
> The nested effect runs whenever `color` changes, while the outer effect (where `canvas.getContext(...)` is called) only runs once, since it doesn't read any reactive state.
## Conditional attachments
Falsy values like `false` or `undefined` are treated as no attachment, enabling conditional usage:
```svelte
<div {@attach enabled && myAttachment}>...</div>
```
## Passing attachments to components
When used on a component, `{@attach ...}` will create a prop whose key is a [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol). If the component then [spreads](/tutorial/svelte/spread-props) props onto an element, the element will receive those attachments.

@ -1,5 +1,31 @@
# svelte
## 5.50.0
### Minor Changes
- feat: allow use of createContext when instantiating components programmatically ([#17575](https://github.com/sveltejs/svelte/pull/17575))
### Patch Changes
- fix: ensure infinite effect loops are cleared after flushing ([#17601](https://github.com/sveltejs/svelte/pull/17601))
- fix: allow `{#key NaN}` ([#17642](https://github.com/sveltejs/svelte/pull/17642))
- fix: detect store in each block expression regardless of AST shape ([#17636](https://github.com/sveltejs/svelte/pull/17636))
- fix: treat `<menu>` like `<ul>`/`<ol>` for a11y role checks ([#17638](https://github.com/sveltejs/svelte/pull/17638))
- fix: add vite-ignore comment inside dynamic crypto import ([#17623](https://github.com/sveltejs/svelte/pull/17623))
- chore: wrap JSDoc URLs in `@see` and `@link` tags ([#17617](https://github.com/sveltejs/svelte/pull/17617))
- fix: properly hydrate already-resolved async blocks ([#17641](https://github.com/sveltejs/svelte/pull/17641))
- fix: emit `each_key_duplicate` error in production ([#16724](https://github.com/sveltejs/svelte/pull/16724))
- fix: exit resolved async blocks on correct node when hydrating ([#17640](https://github.com/sveltejs/svelte/pull/17640))
## 5.49.2
### Patch Changes

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

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

@ -9,7 +9,9 @@ function clean_children(node, opts) {
let previous = null;
let has_element_children = false;
let template =
node.nodeName === 'TEMPLATE' ? /** @type {HTMLTemplateElement} */ (node) : undefined;
node.nodeName.toUpperCase() === 'TEMPLATE'
? /** @type {HTMLTemplateElement} */ (node)
: undefined;
if (template) {
const div = document.createElement('div');
@ -23,22 +25,20 @@ function clean_children(node, opts) {
});
attributes.forEach((attr) => {
node.removeAttribute(attr.name);
if (attr.name !== 'xmlns') node.removeAttribute(attr.name);
});
attributes.forEach((attr) => {
attributes.forEach(({ name, value }) => {
// Strip out the special onload/onerror hydration events from the test output
if ((attr.name === 'onload' || attr.name === 'onerror') && attr.value === 'this.__e=event') {
if (['onload', 'onerror', 'xmlns'].includes(name) && value === 'this.__e=event') {
return;
}
let value = attr.value;
if (attr.name === 'class') {
if (name === 'class') {
value = value.replace(/svelte-\w+/, 'svelte-xyz123');
}
node.setAttribute(attr.name, value);
node.setAttribute(name, value);
});
for (let child of [...node.childNodes]) {

@ -0,0 +1,3 @@
import { test } from '../../test';
export default test({});

@ -0,0 +1,2 @@
<div foo=bar></div>
<div foo='bar baz'></div>

@ -0,0 +1,3 @@
import { test } from '../../test';
export default test({});

@ -0,0 +1,6 @@
<ul><li><li></ul>
<dl><dt><dd><dd></dl>
<p><p><div></div>
<ruby><rp><rt><rt></ruby>
<select><option><optgroup><optgroup></select>
<table><thead><tbody><tfoot><tbody><tr><td><th></tr><tr></table>

@ -0,0 +1,5 @@
import { test } from '../../test';
export default test({
skip: true
});

@ -0,0 +1,3 @@
import { test } from '../../test';
export default test({});

@ -0,0 +1,8 @@
import { test } from '../../test';
export default test({
mode: ['client'],
test({ assert, target }) {
assert.htmlEqual(target.innerHTML, `<div>div</div>`);
}
});

@ -0,0 +1,5 @@
<script>
let elem = $state();
let nodeName = $derived(elem?.nodeName);
</script>
<div bind:this={elem}>{nodeName}</div>

@ -0,0 +1,3 @@
import { test } from '../../test';
export default test({});

@ -0,0 +1,15 @@
<area alt="">
<base>
<br>
<col>
<embed>
<hr>
<img alt="">
<input>
<keygen>
<link>
<meta>
<param>
<source>
<track>
<wbr>

@ -0,0 +1,9 @@
// @vitest-environment vitest-xhtml-environment.ts
import { runtime_suite, ok } from '../runtime-legacy/shared';
const { test, run } = runtime_suite(true);
export { test, ok };
await run(__dirname);

@ -0,0 +1,19 @@
import { type Environment, builtinEnvironments } from 'vitest/environments';
const xhtml_page = `<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body></body></html>`;
export default <Environment>{
name: 'jsdom-xhtml',
transformMode: 'web',
setup(global, { jsdom = {} }) {
return builtinEnvironments.jsdom.setup(global, {
jsdom: {
...jsdom,
html: xhtml_page,
contentType: 'application/xhtml+xml'
}
});
}
};
Loading…
Cancel
Save