Skip to content

Commit 643e4eb

Browse files
authored
Merge branch 'main' into remove-readonly-check
2 parents f0d3740 + 89123a8 commit 643e4eb

File tree

179 files changed

+2130
-958
lines changed

Some content is hidden

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

179 files changed

+2130
-958
lines changed

.changeset/afraid-dogs-matter.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: align `beforeUpdate`/`afterUpdate` behavior better with that in Svelte 4

.changeset/famous-pants-pay.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+
chore: bump zimmerframe to fix bugs introduced in previous version

.changeset/forty-suns-smile.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: properly analyze group expressions

.changeset/friendly-candles-relate.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: allow `let:` directives on slot elements

.changeset/long-lobsters-mate.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: use hybrid scoping strategy for consistent specificity increase

.changeset/loud-ravens-drop.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: handle nested script tags

.changeset/mighty-files-hammer.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: throw validation error when binding to each argument in runes mode

.changeset/odd-taxis-retire.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 exporting props, derived and reassigned state from within components

.changeset/olive-seals-sell.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+
chore: bump zimmerframe to resolve AST-traversal-related bugs

.changeset/olive-socks-kick.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: repair each block length mismatches during hydration

.changeset/pink-mayflies-tie.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: make CSS animation declaration transformation more robust

.changeset/pre.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"svelte.dev": "1.0.0"
1010
},
1111
"changesets": [
12+
"afraid-dogs-matter",
1213
"afraid-moose-matter",
1314
"angry-books-jam",
1415
"angry-plums-punch",
@@ -56,6 +57,7 @@
5657
"fair-pianos-talk",
5758
"famous-falcons-melt",
5859
"famous-knives-sneeze",
60+
"famous-pants-pay",
5961
"fast-weeks-clean",
6062
"few-mugs-fail",
6163
"fifty-rice-wait",
@@ -65,8 +67,10 @@
6567
"forty-comics-invent",
6668
"forty-dolls-wave",
6769
"forty-peaches-unite",
70+
"forty-suns-smile",
6871
"four-flies-hammer",
6972
"fresh-weeks-trade",
73+
"friendly-candles-relate",
7074
"friendly-lies-camp",
7175
"funny-wombats-argue",
7276
"gentle-sheep-hug",
@@ -112,13 +116,16 @@
112116
"light-pens-watch",
113117
"long-buckets-lay",
114118
"long-crews-return",
119+
"long-lobsters-mate",
115120
"loud-cheetahs-flow",
121+
"loud-ravens-drop",
116122
"lovely-carpets-lick",
117123
"lovely-items-turn",
118124
"lovely-rules-eat",
119125
"lucky-schools-hang",
120126
"lucky-toes-begin",
121127
"many-trees-fix",
128+
"mighty-files-hammer",
122129
"moody-frogs-exist",
123130
"moody-owls-cry",
124131
"nasty-lions-double",
@@ -131,13 +138,17 @@
131138
"odd-needles-joke",
132139
"odd-schools-wait",
133140
"odd-shoes-cheat",
141+
"odd-taxis-retire",
134142
"old-flies-jog",
135143
"old-houses-drum",
136144
"old-mails-sneeze",
137145
"old-oranges-compete",
138146
"olive-kangaroos-brake",
147+
"olive-seals-sell",
139148
"olive-shirts-complain",
149+
"olive-socks-kick",
140150
"orange-dingos-poke",
151+
"pink-mayflies-tie",
141152
"polite-dolphins-care",
142153
"polite-pumpkins-guess",
143154
"polite-ravens-study",
@@ -150,6 +161,7 @@
150161
"quiet-crabs-nail",
151162
"quiet-timers-speak",
152163
"rare-pears-whisper",
164+
"rare-worms-hunt",
153165
"real-guests-do",
154166
"real-items-suffer",
155167
"red-doors-own",
@@ -174,6 +186,8 @@
174186
"shiny-baboons-play",
175187
"shiny-shrimps-march",
176188
"short-buses-camp",
189+
"silent-apes-report",
190+
"silver-points-approve",
177191
"sixty-items-crash",
178192
"slimy-clouds-talk",
179193
"slimy-laws-explode",
@@ -196,13 +210,15 @@
196210
"spotty-spiders-compare",
197211
"stale-books-perform",
198212
"stale-comics-look",
213+
"strange-apricots-happen",
199214
"strong-gifts-smoke",
200215
"strong-lemons-provide",
201216
"strong-pans-doubt",
202217
"sweet-mangos-beg",
203218
"sweet-pens-sniff",
204219
"swift-donkeys-perform",
205220
"swift-fans-stare",
221+
"swift-feet-juggle",
206222
"swift-ravens-hunt",
207223
"swift-seahorses-deliver",
208224
"tall-books-grin",
@@ -226,6 +242,7 @@
226242
"thirty-pears-hug",
227243
"thirty-wombats-relax",
228244
"three-camels-sell",
245+
"three-icons-trade",
229246
"three-suits-grin",
230247
"tidy-buses-whisper",
231248
"tidy-starfishes-allow",
@@ -236,6 +253,7 @@
236253
"two-falcons-buy",
237254
"unlucky-boxes-obey",
238255
"unlucky-trees-lick",
256+
"violet-pigs-jam",
239257
"wet-games-fly",
240258
"wicked-clouds-exercise",
241259
"wicked-doors-train",

.changeset/rare-worms-hunt.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: only update lazy properties that have actually changed

.changeset/silent-apes-report.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: handle sole empty expression tags

.changeset/silver-points-approve.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: improve indexed each array reconcilation

.changeset/strange-apricots-happen.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: set `open` binding value in `<details>`

.changeset/swift-feet-juggle.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: correctly determine binding scope of `let:` directives

.changeset/three-icons-trade.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: run `onDestroy` callbacks during SSR

.changeset/violet-pigs-jam.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: add compiler error for each block mutations in runes mode

documentation/blog/2023-09-20-runes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,4 +220,4 @@ This is just the beginning though. We have a long list of ideas for subsequent r
220220

221221
You can't use Svelte 5 in production yet. We're in the thick of it at the moment and can't tell you when it'll be ready to use in your apps.
222222

223-
But we didn't want to leave you hanging. We've created a [preview site](https://svelte-5-preview.vercel.app) with detailed explanations of the new features and an interactive playground. You can also visit the `#svelte-5-runes` channel of the [Svelte Discord](/chat) to learn more. We'd love to have your feedback!
223+
But we didn't want to leave you hanging. We've created a [preview site](https://svelte-5-preview.vercel.app) with detailed explanations of the new features and an interactive playground. You can also visit the `#svelte-5-alpha` channel of the [Svelte Discord](/chat) to learn more. We'd love to have your feedback!

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.0.0-next.52
4+
5+
### Patch Changes
6+
7+
- fix: use hybrid scoping strategy for consistent specificity increase ([#10443](https://github.com/sveltejs/svelte/pull/10443))
8+
9+
- fix: throw validation error when binding to each argument in runes mode ([#10441](https://github.com/sveltejs/svelte/pull/10441))
10+
11+
- fix: make CSS animation declaration transformation more robust ([#10432](https://github.com/sveltejs/svelte/pull/10432))
12+
13+
- fix: handle sole empty expression tags ([#10433](https://github.com/sveltejs/svelte/pull/10433))
14+
15+
## 5.0.0-next.51
16+
17+
### Patch Changes
18+
19+
- fix: align `beforeUpdate`/`afterUpdate` behavior better with that in Svelte 4 ([#10408](https://github.com/sveltejs/svelte/pull/10408))
20+
21+
- fix: disallow exporting props, derived and reassigned state from within components ([#10430](https://github.com/sveltejs/svelte/pull/10430))
22+
23+
- fix: improve indexed each array reconcilation ([#10422](https://github.com/sveltejs/svelte/pull/10422))
24+
25+
- fix: add compiler error for each block mutations in runes mode ([#10428](https://github.com/sveltejs/svelte/pull/10428))
26+
27+
## 5.0.0-next.50
28+
29+
### Patch Changes
30+
31+
- fix: set `open` binding value in `<details>` ([#10413](https://github.com/sveltejs/svelte/pull/10413))
32+
33+
## 5.0.0-next.49
34+
35+
### Patch Changes
36+
37+
- fix: properly analyze group expressions ([#10410](https://github.com/sveltejs/svelte/pull/10410))
38+
39+
- fix: handle nested script tags ([#10416](https://github.com/sveltejs/svelte/pull/10416))
40+
41+
- fix: only update lazy properties that have actually changed ([#10415](https://github.com/sveltejs/svelte/pull/10415))
42+
43+
- fix: correctly determine binding scope of `let:` directives ([#10395](https://github.com/sveltejs/svelte/pull/10395))
44+
45+
- fix: run `onDestroy` callbacks during SSR ([#10297](https://github.com/sveltejs/svelte/pull/10297))
46+
47+
## 5.0.0-next.48
48+
49+
### Patch Changes
50+
51+
- chore: bump zimmerframe to fix bugs introduced in previous version ([#10405](https://github.com/sveltejs/svelte/pull/10405))
52+
53+
## 5.0.0-next.47
54+
55+
### Patch Changes
56+
57+
- chore: bump zimmerframe to resolve AST-traversal-related bugs ([`b63ab91c7b92ecec6e7e939d6d509fc3008cf048`](https://github.com/sveltejs/svelte/commit/b63ab91c7b92ecec6e7e939d6d509fc3008cf048))
58+
59+
## 5.0.0-next.46
60+
61+
### Patch Changes
62+
63+
- fix: allow `let:` directives on slot elements ([#10391](https://github.com/sveltejs/svelte/pull/10391))
64+
65+
- fix: repair each block length mismatches during hydration ([#10398](https://github.com/sveltejs/svelte/pull/10398))
66+
367
## 5.0.0-next.45
468

569
### Patch Changes

packages/svelte/elements.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -978,6 +978,7 @@ export interface HTMLImgAttributes extends HTMLAttributes<HTMLImageElement> {
978978
alt?: string | undefined | null;
979979
crossorigin?: 'anonymous' | 'use-credentials' | '' | undefined | null;
980980
decoding?: 'async' | 'auto' | 'sync' | undefined | null;
981+
fetchpriority?: 'auto' | 'high' | 'low' | undefined | null;
981982
height?: number | string | undefined | null;
982983
ismap?: boolean | undefined | null;
983984
loading?: 'eager' | 'lazy' | undefined | null;
@@ -1098,6 +1099,7 @@ export interface HTMLLinkAttributes extends HTMLAttributes<HTMLLinkElement> {
10981099
sizes?: string | undefined | null;
10991100
type?: string | undefined | null;
11001101
charset?: string | undefined | null;
1102+
fetchpriority?: 'auto' | 'high' | 'low' | undefined | null;
11011103
}
11021104

11031105
export interface HTMLMapAttributes extends HTMLAttributes<HTMLMapElement> {
@@ -1232,6 +1234,7 @@ export interface HTMLScriptAttributes extends HTMLAttributes<HTMLScriptElement>
12321234
charset?: string | undefined | null;
12331235
crossorigin?: string | undefined | null;
12341236
defer?: boolean | undefined | null;
1237+
fetchpriority?: 'auto' | 'high' | 'low' | undefined | null;
12351238
integrity?: string | undefined | null;
12361239
nomodule?: boolean | undefined | null;
12371240
nonce?: string | undefined | null;

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.0.0-next.45",
5+
"version": "5.0.0-next.52",
66
"type": "module",
77
"types": "./types/index.d.ts",
88
"engines": {
@@ -128,7 +128,7 @@
128128
"is-reference": "^3.0.2",
129129
"locate-character": "^3.0.0",
130130
"magic-string": "^0.30.5",
131-
"zimmerframe": "^1.1.0"
131+
"zimmerframe": "^1.1.2"
132132
},
133133
"knip": {
134134
"entry": [

packages/svelte/src/compiler/errors.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,12 @@ const runes = {
169169
'invalid-legacy-export': () => `Cannot use \`export let\` in runes mode — use $props instead`,
170170
/** @param {string} rune */
171171
'invalid-rune-usage': (rune) => `Cannot use ${rune} rune in non-runes mode`,
172-
'invalid-state-export': () => `Cannot export state if it is reassigned`,
173-
'invalid-derived-export': () => `Cannot export derived state`,
172+
'invalid-state-export': () =>
173+
`Cannot export state if it is reassigned. Either export a function returning the state value or only mutate the state value's properties`,
174+
'invalid-derived-export': () =>
175+
`Cannot export derived state. To expose the current derived value, export a function returning its value`,
176+
'invalid-prop-export': () =>
177+
`Cannot export properties. To expose the current value of a property, export a function returning its value`,
174178
'invalid-props-id': () => `$props() can only be used with an object destructuring pattern`,
175179
'invalid-props-pattern': () =>
176180
`$props() assignment must not contain nested properties or computed keys`,
@@ -200,7 +204,11 @@ const runes = {
200204
`${rune} can only be called with ${list(args, 'or')} ${
201205
args.length === 1 && args[0] === 1 ? 'argument' : 'arguments'
202206
}`,
203-
'duplicate-props-rune': () => `Cannot use $props() more than once`
207+
/** @param {string} name */
208+
'invalid-runes-mode-import': (name) => `${name} cannot be used in runes mode`,
209+
'duplicate-props-rune': () => `Cannot use $props() more than once`,
210+
'invalid-each-assignment': () =>
211+
`Cannot reassign or bind to each block argument in runes mode. Use the array and index variables instead (e.g. 'array[i] = value' instead of 'entry = value')`
204212
};
205213

206214
/** @satisfies {Errors} */
@@ -273,7 +281,8 @@ const attributes = {
273281

274282
/** @satisfies {Errors} */
275283
const slots = {
276-
'invalid-slot-element-attribute': () => `<slot> can only receive attributes, not directives`,
284+
'invalid-slot-element-attribute': () =>
285+
`<slot> can only receive attributes and (optionally) let directives`,
277286
'invalid-slot-attribute': () => `slot attribute must be a static value`,
278287
/** @param {boolean} is_default */
279288
'invalid-slot-name': (is_default) =>

packages/svelte/src/compiler/phases/1-parse/read/context.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ import { error } from '../../../errors.js';
1313

1414
/**
1515
* @param {import('../index.js').Parser} parser
16-
* @returns {any}
16+
* @returns {import('estree').Pattern}
1717
*/
18-
export default function read_context(parser) {
18+
export default function read_pattern(parser) {
1919
const start = parser.index;
2020
let i = parser.index;
2121

packages/svelte/src/compiler/phases/1-parse/state/element.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ export default function tag(parser) {
6565
const data = parser.read_until(regex_closing_comment);
6666
parser.eat('-->', true);
6767

68+
/** @type {ReturnType<typeof parser.append<import('#compiler').Comment>>} */
6869
parser.append({
6970
type: 'Comment',
7071
start,

0 commit comments

Comments
 (0)