Skip to content

Commit 839f8d3

Browse files
committed
Merge remote-tracking branch 'origin/main' into fix-dynamic-attribute-and-attribute-directive
2 parents a51cc25 + 4791832 commit 839f8d3

File tree

115 files changed

+1131
-163
lines changed

Some content is hidden

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

115 files changed

+1131
-163
lines changed

.changeset/chatty-snails-train.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 signal graph is consistent before triggering $inspect signals

.changeset/curvy-foxes-wink.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+
feat: better types for the `autocomplete` attribute

.changeset/eighty-dragons-search.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+
perf: inline module variables into template

.changeset/five-birds-check.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: widen ownership upon property access if necessary

.changeset/five-suns-roll.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: don't show `state_referenced_locally` warning on types

.changeset/flat-flies-know.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 custom element events on slot to bubble inside custom element

.changeset/fuzzy-tigers-swim.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 locally mutated bindable props persist with spreading props

.changeset/hot-peaches-clean.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 missing `autocomplete` attribute tokens

.changeset/late-geckos-draw.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: try catch `strict_equals` to avoid error accessing `STATE_SYMBOL`

.changeset/polite-pugs-attend.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 $inspect effects are fine-grain

.changeset/pre.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"blue-timers-film",
3939
"blue-waves-sneeze",
4040
"brave-carrots-draw",
41+
"brave-doors-compete",
4142
"brave-gorillas-end",
4243
"brave-gorillas-fold",
4344
"brave-pigs-obey",
@@ -71,6 +72,7 @@
7172
"chatty-cups-drop",
7273
"chatty-ghosts-unite",
7374
"chatty-sloths-allow",
75+
"chatty-snails-train",
7476
"chatty-taxis-juggle",
7577
"chilled-ladybugs-invite",
7678
"chilled-pumas-invite",
@@ -115,6 +117,7 @@
115117
"curvy-buses-laugh",
116118
"curvy-cups-cough",
117119
"curvy-flies-exercise",
120+
"curvy-foxes-wink",
118121
"curvy-papayas-pretend",
119122
"curvy-ties-shout",
120123
"cyan-colts-raise",
@@ -160,6 +163,7 @@
160163
"eighty-bugs-fetch",
161164
"eighty-days-cheat",
162165
"eighty-days-wave",
166+
"eighty-dragons-search",
163167
"eighty-lizards-notice",
164168
"eighty-mails-develop",
165169
"eleven-avocados-walk",
@@ -206,10 +210,13 @@
206210
"fifty-rice-wait",
207211
"fifty-steaks-float",
208212
"fifty-toys-invite",
213+
"five-birds-check",
209214
"five-maps-reflect",
210215
"five-shirts-run",
216+
"five-suns-roll",
211217
"five-tigers-search",
212218
"flat-feet-visit",
219+
"flat-flies-know",
213220
"flat-ghosts-fly",
214221
"flat-melons-protect",
215222
"flat-olives-live",
@@ -251,6 +258,7 @@
251258
"funny-wombats-argue",
252259
"fuzzy-bags-camp",
253260
"fuzzy-donuts-provide",
261+
"fuzzy-tigers-swim",
254262
"gentle-dolls-juggle",
255263
"gentle-eagles-walk",
256264
"gentle-needles-train",
@@ -330,6 +338,7 @@
330338
"hot-cooks-repair",
331339
"hot-jobs-tap",
332340
"hot-kangaroos-invite",
341+
"hot-peaches-clean",
333342
"hot-rivers-punch",
334343
"hot-sloths-clap",
335344
"hot-tips-appear",
@@ -374,6 +383,7 @@
374383
"large-waves-join",
375384
"late-bees-vanish",
376385
"late-crabs-lay",
386+
"late-geckos-draw",
377387
"late-grapes-judge",
378388
"late-peaches-mate",
379389
"late-zebras-argue",
@@ -429,6 +439,7 @@
429439
"mean-jokes-exist",
430440
"mean-numbers-cry",
431441
"mean-parents-film",
442+
"metal-cameras-jump",
432443
"metal-clouds-raise",
433444
"metal-lobsters-burn",
434445
"metal-pans-trade",
@@ -527,6 +538,7 @@
527538
"plenty-zoos-fix",
528539
"polite-dolphins-care",
529540
"polite-peas-mate",
541+
"polite-pugs-attend",
530542
"polite-pumpkins-guess",
531543
"polite-ravens-study",
532544
"polite-tomatoes-trade",
@@ -585,6 +597,7 @@
585597
"rich-tables-sing",
586598
"rich-taxis-hear",
587599
"rich-waves-mix",
600+
"rotten-actors-rush",
588601
"rotten-bags-type",
589602
"rotten-buckets-develop",
590603
"rotten-experts-relax",
@@ -596,6 +609,7 @@
596609
"selfish-socks-smile",
597610
"selfish-spies-help",
598611
"selfish-tools-hide",
612+
"selfish-trainers-kiss",
599613
"serious-bobcats-carry",
600614
"serious-crabs-punch",
601615
"serious-goats-tap",
@@ -729,6 +743,7 @@
729743
"strange-pears-perform",
730744
"strange-pillows-greet",
731745
"strange-roses-brake",
746+
"strange-trains-destroy",
732747
"strong-apricots-destroy",
733748
"strong-gifts-smoke",
734749
"strong-lemons-provide",
@@ -758,6 +773,7 @@
758773
"tame-cycles-kneel",
759774
"tame-dodos-float",
760775
"tame-dots-battle",
776+
"tame-frogs-shave",
761777
"tame-goats-bow",
762778
"tame-spies-drum",
763779
"tasty-cheetahs-appear",
@@ -769,6 +785,7 @@
769785
"ten-jokes-divide",
770786
"ten-peaches-sleep",
771787
"ten-singers-cough",
788+
"ten-singers-repair",
772789
"ten-teachers-travel",
773790
"ten-ties-repair",
774791
"ten-trainers-juggle",
@@ -814,6 +831,7 @@
814831
"tiny-taxis-whisper",
815832
"tough-buckets-thank",
816833
"tough-radios-punch",
834+
"tough-snails-chew",
817835
"tough-tomatoes-explain",
818836
"tricky-avocados-play",
819837
"tricky-balloons-care",
@@ -827,6 +845,7 @@
827845
"twelve-scissors-kneel",
828846
"twelve-worms-jog",
829847
"twenty-gifts-develop",
848+
"twenty-toes-attack",
830849
"two-brooms-fail",
831850
"two-candles-move",
832851
"two-cats-approve",
@@ -838,6 +857,7 @@
838857
"unlucky-points-clap",
839858
"unlucky-steaks-warn",
840859
"unlucky-trees-lick",
860+
"violet-bats-brake",
841861
"violet-mails-trade",
842862
"violet-mugs-behave",
843863
"violet-otters-carry",

.changeset/rotten-actors-rush.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 unowned derived signals correctly re-connect to graph

.changeset/ten-singers-repair.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 more characters in the unicode range as component identifiers

.changeset/tough-snails-chew.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 for nesting selector in pseudoclasses

.changeset/twenty-toes-attack.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 StyleDirective and ClassDirective are marked as dynamic

.changeset/violet-bats-brake.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+
feat: add infinite loop effect callstack

documentation/docs/02-template-syntax/06-transitions-and-animations.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ The `t` argument passed to `css` is a value between `0` and `1` after the `easin
102102
The function is called repeatedly _before_ the transition begins, with different `t` and `u` arguments.
103103

104104
```svelte
105+
<!--- file: App.svelte --->
105106
<script>
106107
import { elasticOut } from 'svelte/easing';
107108
@@ -345,6 +346,7 @@ The function is called repeatedly _before_ the animation begins, with different
345346
<!-- TODO: Types -->
346347

347348
```svelte
349+
<!--- file: App.svelte --->
348350
<script>
349351
import { cubicOut } from 'svelte/easing';
350352
@@ -378,6 +380,7 @@ A custom animation function can also return a `tick` function, which is called _
378380
> If it's possible to use `css` instead of `tick`, do so — CSS animations can run off the main thread, preventing jank on slower devices.
379381
380382
```svelte
383+
<!--- file: App.svelte --->
381384
<script>
382385
import { cubicOut } from 'svelte/easing';
383386

documentation/docs/02-template-syntax/08-bindings.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,25 +42,30 @@ Numeric input values are coerced; even though `input.value` is a string as far a
4242
<input type="range" bind:value={num} />
4343
```
4444

45-
On `<input>` elements with `type="file"`, you can use `bind:files` to get the [`FileList` of selected files](https://developer.mozilla.org/en-US/docs/Web/API/FileList). It is readonly.
45+
On `<input>` elements with `type="file"`, you can use `bind:files` to get the [`FileList` of selected files](https://developer.mozilla.org/en-US/docs/Web/API/FileList). When you want to update the files programmatically, you always need to use a `FileList` object.
4646

4747
```svelte
48+
<script>
49+
let files = $state();
50+
51+
function clear() {
52+
files = new FileList(); // null or undefined doesn't work
53+
}
54+
</script>
55+
4856
<label for="avatar">Upload a picture:</label>
4957
<input accept="image/png, image/jpeg" bind:files id="avatar" name="avatar" type="file" />
58+
<button onclick={clear}>clear</button>
5059
```
5160

52-
If you're using `bind:` directives together with `on:` directives, the order that they're defined in affects the value of the bound variable when the event handler is called.
61+
If you're using `bind:` directives together with `on` event attributes, the binding will always fire before the event attribute.
5362

5463
```svelte
5564
<script>
5665
let value = 'Hello World';
5766
</script>
5867
59-
<input
60-
on:input={() => console.log('Old value:', value)}
61-
bind:value
62-
on:input={() => console.log('New value:', value)}
63-
/>
68+
<input oninput={() => console.log('New value:', value)} bind:value />
6469
```
6570

6671
Here we were binding to the value of a text input, which uses the `input` event. Bindings on other elements may use different events such as `change`.

documentation/docs/02-template-syntax/09-special-elements.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ It cannot appear at the top level of your markup; it must be inside an if or eac
1414

1515
```svelte
1616
<script>
17-
/** @type {number} */
18-
export let count;
17+
let { count } = $props();
1918
</script>
2019
2120
{#if count > 0}
@@ -56,12 +55,12 @@ If `this` is the name of a [void element](https://developer.mozilla.org/en-US/do
5655

5756
```svelte
5857
<script>
59-
let tag = 'div';
58+
let { handler } = $props();
6059
61-
export let handler;
60+
let tag = $state('div');
6261
</script>
6362
64-
<svelte:element this={tag} on:click={handler}>Foo</svelte:element>
63+
<svelte:element this={tag} onclick={handler}>Foo</svelte:element>
6564
```
6665

6766
Svelte tries its best to infer the correct namespace from the element's surroundings, but it's not always possible. You can make it explicit with an `xmlns` attribute:
@@ -73,7 +72,7 @@ Svelte tries its best to infer the correct namespace from the element's surround
7372
## `<svelte:window>`
7473

7574
```svelte
76-
<svelte:window on:event={handler} />
75+
<svelte:window onevent={handler} />
7776
```
7877

7978
```svelte
@@ -86,13 +85,12 @@ Unlike `<svelte:self>`, this element may only appear at the top level of your co
8685

8786
```svelte
8887
<script>
89-
/** @param {KeyboardEvent} event */
9088
function handleKeydown(event) {
9189
alert(`pressed the ${event.key} key`);
9290
}
9391
</script>
9492
95-
<svelte:window on:keydown={handleKeydown} />
93+
<svelte:window onkeydown={handleKeydown} />
9694
```
9795

9896
You can also bind to the following properties:
@@ -117,7 +115,7 @@ All except `scrollX` and `scrollY` are readonly.
117115
## `<svelte:document>`
118116

119117
```svelte
120-
<svelte:document on:event={handler} />
118+
<svelte:document onevent={handler} />
121119
```
122120

123121
```svelte
@@ -129,7 +127,7 @@ Similarly to `<svelte:window>`, this element allows you to add listeners to even
129127
As with `<svelte:window>`, this element may only appear the top level of your component and must never be inside a block or element.
130128

131129
```svelte
132-
<svelte:document on:visibilitychange={handleVisibilityChange} use:someAction />
130+
<svelte:document onvisibilitychange={handleVisibilityChange} use:someAction />
133131
```
134132

135133
You can also bind to the following properties:
@@ -144,15 +142,15 @@ All are readonly.
144142
## `<svelte:body>`
145143

146144
```svelte
147-
<svelte:body on:event={handler} />
145+
<svelte:body onevent={handler} />
148146
```
149147

150148
Similarly to `<svelte:window>`, this element allows you to add listeners to events on `document.body`, such as `mouseenter` and `mouseleave`, which don't fire on `window`. It also lets you use [actions](/docs/element-directives#use-action) on the `<body>` element.
151149

152150
As with `<svelte:window>` and `<svelte:document>`, this element may only appear the top level of your component and must never be inside a block or element.
153151

154152
```svelte
155-
<svelte:body on:mouseenter={handleMouseenter} on:mouseleave={handleMouseleave} use:someAction />
153+
<svelte:body onmouseenter={handleMouseenter} onmouseleave={handleMouseleave} use:someAction />
156154
```
157155

158156
## `<svelte:head>`

0 commit comments

Comments
 (0)