Skip to content

Commit 3ae0c80

Browse files
committed
Merge branch 'main' into error-boundaries
2 parents c468c6d + e379319 commit 3ae0c80

File tree

144 files changed

+2045
-457
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

144 files changed

+2045
-457
lines changed

.changeset/fast-ligers-repeat.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'svelte': patch
3+
---
4+
5+
fix: disallow invalid attributes for `<svelte:window>` and `<svelte:document>`

.changeset/fresh-pigs-divide.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'svelte': patch
3+
---
4+
5+
fix: ensure props passed to components via mount are updateable

documentation/docs/03-template-syntax/06-snippet.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ Any content inside the component tags that is _not_ a snippet declaration implic
169169

170170
```svelte
171171
<!--- file: App.svelte --->
172-
<Button>click me<Button>
172+
<Button>click me</Button>
173173
```
174174

175175
```svelte

documentation/docs/07-misc/02-testing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ When writing component tests that involve two-way bindings, context or snippet p
197197

198198
E2E (short for 'end to end') tests allow you to test your full application through the eyes of the user. This section uses [Playwright](https://playwright.dev/) as an example, but you can also use other solutions like [Cypress](https://www.cypress.io/) or [NightwatchJS](https://nightwatchjs.org/).
199199

200-
To get start with Playwright, either let you guide by [their VS Code extension](https://playwright.dev/docs/getting-started-vscode), or install it from the command line using `npm init playwright`. It is also part of the setup CLI when you run `npx sv create`.
200+
To get started with Playwright, either install it via [the VS Code extension](https://playwright.dev/docs/getting-started-vscode), or install it from the command line using `npm init playwright`. It is also part of the setup CLI when you run `npx sv create`.
201201

202202
After you've done that, you should have a `tests` folder and a Playwright config. You may need to adjust that config to tell Playwright what to do before running the tests - mainly starting your application at a certain port:
203203

documentation/docs/98-reference/.generated/compile-errors.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,12 @@ Expected whitespace
412412
`$host()` can only be used inside custom element component instances
413413
```
414414

415+
### illegal_element_attribute
416+
417+
```
418+
`<%name%>` does not support non-event attributes or spread attributes
419+
```
420+
415421
### import_svelte_internal_forbidden
416422

417423
```

packages/svelte/CHANGELOG.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,69 @@
11
# svelte
22

3+
## 5.2.0
4+
5+
### Minor Changes
6+
7+
- feat: better inlining of static attributes ([#14269](https://github.com/sveltejs/svelte/pull/14269))
8+
9+
## 5.1.17
10+
11+
### Patch Changes
12+
13+
- fix: account for `:has(...)` as part of `:root` ([#14229](https://github.com/sveltejs/svelte/pull/14229))
14+
15+
- fix: prevent nested pseudo class from being marked as unused ([#14229](https://github.com/sveltejs/svelte/pull/14229))
16+
17+
- fix: use strict equality for key block comparisons in runes mode ([#14285](https://github.com/sveltejs/svelte/pull/14285))
18+
19+
- fix: bump `is-reference` dependency to fix `import.meta` bug ([#14286](https://github.com/sveltejs/svelte/pull/14286))
20+
21+
## 5.1.16
22+
23+
### Patch Changes
24+
25+
- fix: don't wrap pseudo classes inside `:global(...)` with another `:global(...)` during migration ([#14267](https://github.com/sveltejs/svelte/pull/14267))
26+
27+
- fix: bail on named slots with that have reserved keywords during migration ([#14278](https://github.com/sveltejs/svelte/pull/14278))
28+
29+
## 5.1.15
30+
31+
### Patch Changes
32+
33+
- fix: consider static attributes that are inlined in the template ([#14249](https://github.com/sveltejs/svelte/pull/14249))
34+
35+
## 5.1.14
36+
37+
### Patch Changes
38+
39+
- fix: migration script messing with attributes ([#14260](https://github.com/sveltejs/svelte/pull/14260))
40+
41+
- fix: do not treat reassigned synthetic binds as state in runes mode ([#14236](https://github.com/sveltejs/svelte/pull/14236))
42+
43+
- fix: account for mutations in script module in ownership check ([#14253](https://github.com/sveltejs/svelte/pull/14253))
44+
45+
- fix: consider img with loading attribute not static ([#14237](https://github.com/sveltejs/svelte/pull/14237))
46+
47+
## 5.1.13
48+
49+
### Patch Changes
50+
51+
- fix: add migration task when there's a variable named that would conflict with a rune ([#14216](https://github.com/sveltejs/svelte/pull/14216))
52+
53+
- fix: consider `valueOf` in the reactive methods of `SvelteDate` ([#14227](https://github.com/sveltejs/svelte/pull/14227))
54+
55+
- fix: handle sibling combinators within `:has` ([#14213](https://github.com/sveltejs/svelte/pull/14213))
56+
57+
- fix: consider variables with synthetic store sub as state ([#14195](https://github.com/sveltejs/svelte/pull/14195))
58+
59+
- fix: read index as a source in legacy keyed each block ([#14208](https://github.com/sveltejs/svelte/pull/14208))
60+
61+
- fix: account for shadowing children slot during migration ([#14224](https://github.com/sveltejs/svelte/pull/14224))
62+
63+
- fix: ensure explicit nesting selector is always applied ([#14193](https://github.com/sveltejs/svelte/pull/14193))
64+
65+
- fix: add `lang="ts"` attribute during migration if needed ([#14222](https://github.com/sveltejs/svelte/pull/14222))
66+
367
## 5.1.12
468

569
### Patch Changes

packages/svelte/messages/compile-errors/template.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@
172172

173173
> Expected whitespace
174174
175+
## illegal_element_attribute
176+
177+
> `<%name%>` does not support non-event attributes or spread attributes
178+
175179
## js_parse_error
176180

177181
> %message%

packages/svelte/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "svelte",
33
"description": "Cybernetically enhanced web apps",
44
"license": "MIT",
5-
"version": "5.1.12",
5+
"version": "5.2.0",
66
"type": "module",
77
"types": "./types/index.d.ts",
88
"engines": {
@@ -144,7 +144,7 @@
144144
"axobject-query": "^4.1.0",
145145
"esm-env": "^1.0.0",
146146
"esrap": "^1.2.2",
147-
"is-reference": "^3.0.2",
147+
"is-reference": "^3.0.3",
148148
"locate-character": "^3.0.0",
149149
"magic-string": "^0.30.11",
150150
"zimmerframe": "^1.1.2"

packages/svelte/src/compiler/errors.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -984,6 +984,16 @@ export function expected_whitespace(node) {
984984
e(node, "expected_whitespace", "Expected whitespace");
985985
}
986986

987+
/**
988+
* `<%name%>` does not support non-event attributes or spread attributes
989+
* @param {null | number | NodeLike} node
990+
* @param {string} name
991+
* @returns {never}
992+
*/
993+
export function illegal_element_attribute(node, name) {
994+
e(node, "illegal_element_attribute", `\`<${name}>\` does not support non-event attributes or spread attributes`);
995+
}
996+
987997
/**
988998
* %message%
989999
* @param {null | number | NodeLike} node

0 commit comments

Comments
 (0)