Merge branch 'main' into async

pull/15844/head
Rich Harris 2 months ago
commit e706cac6b3

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: silence autofocus a11y warning inside `<dialog>`

@ -1,5 +0,0 @@
---
'svelte': patch
---
chore: simplify reaction/source ownership tracking

@ -1,5 +0,0 @@
---
'svelte': patch
---
chore: simplify internal component `pop()`

@ -0,0 +1,5 @@
---
'svelte': patch
---
chore: replace inline regex with variable

@ -50,7 +50,7 @@ todos.push({
}); });
``` ```
> [!NOTE] When you update properties of proxies, the original object is _not_ mutated. > [!NOTE] When you update properties of proxies, the original object is _not_ mutated. If you desire to use your own proxy handlers in a state proxy, [you should wrap the object _after_ wrapping it in `$state`](https://svelte.dev/playground/hello-world?version=latest#H4sIAAAAAAAACpWR3WoDIRCFX2UqhWyIJL3erAulL9C7XnQLMe5ksbUqOpsfln33YuyGFNJC8UKdc2bOhw7Myk9kJXsJ0nttO9jcR5KEG9AWJDwHdzwxznbaYGTl68Do5JM_FRifuh-9X8Y9Gkq1rYx4q66cJbQUWcmqqIL2VDe2IYMEbvuOikBADi-GJDSkXG-phId0G-frye2DO2psQYDFQ0Ys8gQO350dUkEydEg82T0GOs0nsSG9g2IqgxACZueo2ZUlpdvoDC6N64qsg1QKY8T2bpZp8gpIfbCQ85Zn50Ud82HkeY83uDjspenxv3jXcSDyjPWf9L1vJf0GH666J-jLu1ery4dV257IWXBWGa0-xFDMQdTTn2ScxWKsn86ROsLwQxqrVR5QM84Ij8TKFD2-cUZSm4O2LSt30kQcvwCgCmfZnAIAAA==).
Note that if you destructure a reactive value, the references are not reactive — as in normal JavaScript, they are evaluated at the point of destructuring: Note that if you destructure a reactive value, the references are not reactive — as in normal JavaScript, they are evaluated at the point of destructuring:

@ -1,5 +1,13 @@
# svelte # svelte
## 5.35.6
### Patch Changes
- chore: simplify reaction/source ownership tracking ([#16333](https://github.com/sveltejs/svelte/pull/16333))
- chore: simplify internal component `pop()` ([#16331](https://github.com/sveltejs/svelte/pull/16331))
## 5.35.5 ## 5.35.5
### 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.35.5", "version": "5.35.6",
"type": "module", "type": "module",
"types": "./types/index.d.ts", "types": "./types/index.d.ts",
"engines": { "engines": {

@ -6,7 +6,9 @@ import { roles as roles_map, aria, elementRoles } from 'aria-query';
import { AXObjects, AXObjectRoles, elementAXObjects } from 'axobject-query'; import { AXObjects, AXObjectRoles, elementAXObjects } from 'axobject-query';
import { import {
regex_heading_tags, regex_heading_tags,
regex_js_prefix,
regex_not_whitespace, regex_not_whitespace,
regex_redundant_img_alt,
regex_starts_with_vowel, regex_starts_with_vowel,
regex_whitespaces regex_whitespaces
} from '../../../patterns.js'; } from '../../../patterns.js';
@ -875,7 +877,7 @@ export function check_element(node, context) {
} }
// no-autofocus // no-autofocus
if (name === 'autofocus') { if (name === 'autofocus' && node.name !== 'dialog' && !is_parent(context.path, ['dialog'])) {
w.a11y_autofocus(attribute); w.a11y_autofocus(attribute);
} }
@ -1011,7 +1013,7 @@ export function check_element(node, context) {
if (href) { if (href) {
const href_value = get_static_text_value(href); const href_value = get_static_text_value(href);
if (href_value !== null) { if (href_value !== null) {
if (href_value === '' || href_value === '#' || /^\W*javascript:/i.test(href_value)) { if (href_value === '' || href_value === '#' || regex_js_prefix.test(href_value)) {
w.a11y_invalid_attribute(href, href_value, href.name); w.a11y_invalid_attribute(href, href_value, href.name);
} }
} }
@ -1061,7 +1063,7 @@ export function check_element(node, context) {
const alt_attribute = get_static_text_value(attribute_map.get('alt')); const alt_attribute = get_static_text_value(attribute_map.get('alt'));
const aria_hidden = get_static_value(attribute_map.get('aria-hidden')); const aria_hidden = get_static_value(attribute_map.get('aria-hidden'));
if (alt_attribute && !aria_hidden && !has_spread) { if (alt_attribute && !aria_hidden && !has_spread) {
if (/\b(image|picture|photo)\b/i.test(alt_attribute)) { if (regex_redundant_img_alt.test(alt_attribute)) {
w.a11y_img_redundant_alt(node); w.a11y_img_redundant_alt(node);
} }
} }

@ -23,3 +23,5 @@ export const regex_heading_tags = /^h[1-6]$/;
export const regex_illegal_attribute_character = /(^[0-9-.])|[\^$@%&#?!|()[\]{}^*+~;]/; export const regex_illegal_attribute_character = /(^[0-9-.])|[\^$@%&#?!|()[\]{}^*+~;]/;
export const regex_bidirectional_control_characters = export const regex_bidirectional_control_characters =
/[\u202a\u202b\u202c\u202d\u202e\u2066\u2067\u2068\u2069]+/g; /[\u202a\u202b\u202c\u202d\u202e\u2066\u2067\u2068\u2069]+/g;
export const regex_js_prefix = /^\W*javascript:/i;
export const regex_redundant_img_alt = /\b(image|picture|photo)\b/i;

@ -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.35.5'; export const VERSION = '5.35.6';
export const PUBLIC_VERSION = '5'; export const PUBLIC_VERSION = '5';

@ -1 +1,6 @@
<div autofocus></div> <div autofocus></div>
<dialog autofocus>
</dialog>
<dialog>
<input autofocus>
</dialog>

Loading…
Cancel
Save