Skip to content

Commit 01428b3

Browse files
committed
Merge branch 'main' into gh-9556
2 parents 90a7aec + 6e863e6 commit 01428b3

File tree

139 files changed

+1860
-555
lines changed

Some content is hidden

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

139 files changed

+1860
-555
lines changed

.changeset/chilled-pumas-invite.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: apply keyed validation only for keyed each

.changeset/cold-birds-own.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: add inline new class warning

.changeset/dirty-garlics-design.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 type of `$effect.active`

.changeset/dirty-tips-add.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: correct bind this multiple bindings

.changeset/fair-crabs-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: prevent false positives when detecting runes mode

.changeset/few-mugs-fail.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: reuse common templates

.changeset/forty-comics-invent.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 undefined bubble events

.changeset/friendly-lies-camp.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: warn on references to mutated non-state in template

.changeset/green-eggs-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: adjust mount and createRoot types

.changeset/green-hounds-play.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: deconflict generated names against globals

.changeset/light-pens-watch.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: prevent reactive snippet from reinitializing unnecessarily

.changeset/lovely-items-turn.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: dont error on stores looking like runes when runes explicitly turned off

.changeset/lovely-rules-eat.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: omit this bind this arg if we know it's not a signal

.changeset/moody-frogs-exist.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 member expression mutation logic

.changeset/new-boats-wait.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 esrap

.changeset/odd-schools-wait.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: untrack keyed validation logic

.changeset/polite-pumpkins-guess.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: take event attributes into account when checking a11y

.changeset/popular-mangos-rest.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 $effect.active rune

.changeset/pre.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,41 +12,65 @@
1212
"afraid-moose-matter",
1313
"brave-walls-destroy",
1414
"brown-spoons-boil",
15+
"chilled-pumas-invite",
1516
"chilly-dolphins-lick",
1617
"clean-eels-beg",
18+
"cold-birds-own",
1719
"cuddly-pianos-drop",
1820
"curly-lizards-dream",
21+
"dirty-garlics-design",
22+
"dirty-tips-add",
1923
"early-ads-tie",
2024
"eight-steaks-shout",
2125
"eighty-bikes-camp",
26+
"fair-crabs-check",
27+
"few-mugs-fail",
2228
"fifty-steaks-float",
29+
"forty-comics-invent",
2330
"fresh-weeks-trade",
2431
"funny-wombats-argue",
2532
"good-pianos-jump",
33+
"green-eggs-approve",
34+
"green-hounds-play",
2635
"honest-icons-change",
2736
"hungry-dots-fry",
2837
"itchy-lions-wash",
2938
"khaki-mails-draw",
3039
"kind-deers-lay",
3140
"lazy-spiders-think",
3241
"long-crews-return",
42+
"lovely-items-turn",
43+
"lovely-rules-eat",
3344
"lucky-schools-hang",
45+
"moody-frogs-exist",
3446
"moody-owls-cry",
47+
"new-boats-wait",
3548
"odd-needles-joke",
49+
"odd-schools-wait",
3650
"poor-eggs-enjoy",
51+
"popular-mangos-rest",
3752
"quiet-camels-mate",
3853
"rich-sheep-burn",
3954
"rotten-buckets-develop",
55+
"serious-zebras-scream",
56+
"seven-deers-jam",
4057
"sharp-gorillas-impress",
58+
"shiny-baboons-play",
4159
"shiny-shrimps-march",
4260
"small-papayas-laugh",
4361
"soft-geese-learn",
4462
"sour-rules-march",
4563
"strong-lemons-provide",
4664
"tall-shrimps-worry",
65+
"ten-worms-reflect",
4766
"thirty-flowers-sit",
4867
"thirty-ghosts-fix",
68+
"thirty-impalas-repair",
69+
"thirty-wombats-relax",
4970
"tiny-kings-whisper",
71+
"two-falcons-buy",
72+
"wet-games-fly",
73+
"wicked-clouds-exercise",
5074
"wicked-doors-train"
5175
]
5276
}

.changeset/serious-zebras-scream.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 snippets have correct scope

.changeset/seven-deers-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: better attribute casing logic

.changeset/seven-ravens-check.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'svelte': minor
3+
---
4+
5+
feat: support type definition in {@const}

.changeset/shiny-baboons-play.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 Snippet type

.changeset/slimy-clouds-talk.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: ignore href attributes when hydrating

.changeset/stale-comics-look.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 esrap

.changeset/ten-worms-reflect.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: remove constructor overload

.changeset/thirty-impalas-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: adjust event delegation heuristics

.changeset/thirty-wombats-relax.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 each block index handling

.changeset/two-falcons-buy.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: remove unused code

.changeset/wet-games-fly.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: type-level back-compat for default slot and children prop

.changeset/wicked-clouds-exercise.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: adjust regex

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ jobs:
2525
os: ubuntu-latest
2626
- node-version: 20
2727
os: ubuntu-latest
28+
- node-version: 21
29+
os: ubuntu-latest
30+
2831
steps:
2932
- uses: actions/checkout@v3
3033
- uses: pnpm/[email protected]

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,7 @@ sites/svelte.dev/src/lib/generated
3737
.changeset
3838
pnpm-lock.yaml
3939
pnpm-workspace.yaml
40+
41+
# Temporarily ignore this file to avoid merge conflicts.
42+
# see: https://github.com/sveltejs/svelte/pull/9609
43+
documentation/docs/05-misc/03-typescript.md

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.13
4+
5+
### Patch Changes
6+
7+
- fix: apply keyed validation only for keyed each ([#9641](https://github.com/sveltejs/svelte/pull/9641))
8+
9+
- fix: omit this bind this arg if we know it's not a signal ([#9635](https://github.com/sveltejs/svelte/pull/9635))
10+
11+
- fix: improve each block index handling ([#9644](https://github.com/sveltejs/svelte/pull/9644))
12+
13+
## 5.0.0-next.12
14+
15+
### Patch Changes
16+
17+
- fix: adjust mount and createRoot types ([`63e583184`](https://github.com/sveltejs/svelte/commit/63e58318460dbb3485df93d15beb2779a86d2c9a))
18+
19+
- fix: remove constructor overload ([`cb4b1f0a1`](https://github.com/sveltejs/svelte/commit/cb4b1f0a189803bed04adcb90fbd4334782e8469))
20+
21+
- fix: type-level back-compat for default slot and children prop ([`a3bc7d569`](https://github.com/sveltejs/svelte/commit/a3bc7d5698425ec9dde86eb302f2fd56d9da8f96))
22+
23+
## 5.0.0-next.11
24+
25+
### Patch Changes
26+
27+
- feat: add type of `$effect.active` ([#9624](https://github.com/sveltejs/svelte/pull/9624))
28+
29+
- fix: correct bind this multiple bindings ([#9617](https://github.com/sveltejs/svelte/pull/9617))
30+
31+
- chore: reuse common templates ([#9601](https://github.com/sveltejs/svelte/pull/9601))
32+
33+
- fix: handle undefined bubble events ([#9614](https://github.com/sveltejs/svelte/pull/9614))
34+
35+
- fix: dont error on stores looking like runes when runes explicitly turned off ([#9615](https://github.com/sveltejs/svelte/pull/9615))
36+
37+
- fix: improve member expression mutation logic ([#9625](https://github.com/sveltejs/svelte/pull/9625))
38+
39+
- chore: untrack keyed validation logic ([#9618](https://github.com/sveltejs/svelte/pull/9618))
40+
41+
- fix: ensure snippets have correct scope ([#9623](https://github.com/sveltejs/svelte/pull/9623))
42+
43+
- fix: better attribute casing logic ([#9626](https://github.com/sveltejs/svelte/pull/9626))
44+
45+
## 5.0.0-next.10
46+
47+
### Patch Changes
48+
49+
- chore: add inline new class warning ([#9583](https://github.com/sveltejs/svelte/pull/9583))
50+
51+
- fix: prevent false positives when detecting runes mode ([#9599](https://github.com/sveltejs/svelte/pull/9599))
52+
53+
- fix: deconflict generated names against globals ([#9570](https://github.com/sveltejs/svelte/pull/9570))
54+
55+
- chore: bump esrap ([#9590](https://github.com/sveltejs/svelte/pull/9590))
56+
57+
- feat: add $effect.active rune ([#9591](https://github.com/sveltejs/svelte/pull/9591))
58+
59+
- feat: add Snippet type ([#9584](https://github.com/sveltejs/svelte/pull/9584))
60+
61+
- fix: adjust event delegation heuristics ([#9581](https://github.com/sveltejs/svelte/pull/9581))
62+
63+
- chore: remove unused code ([#9593](https://github.com/sveltejs/svelte/pull/9593))
64+
65+
- fix: adjust regex ([#9572](https://github.com/sveltejs/svelte/pull/9572))
66+
367
## 5.0.0-next.9
468

569
### Patch Changes

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.9",
5+
"version": "5.0.0-next.13",
66
"type": "module",
77
"types": "./types/index.d.ts",
88
"engines": {
@@ -120,7 +120,7 @@
120120
"aria-query": "^5.3.0",
121121
"axobject-query": "^4.0.0",
122122
"esm-env": "^1.0.0",
123-
"esrap": "^1.1.1",
123+
"esrap": "^1.2.1",
124124
"is-reference": "^3.0.1",
125125
"locate-character": "^3.0.0",
126126
"magic-string": "^0.30.4",

packages/svelte/src/compiler/legacy.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,33 @@ export function convert(source, ast) {
209209
};
210210
},
211211
// @ts-ignore
212+
ConstTag(node) {
213+
if (
214+
/** @type {import('./types/legacy-nodes.js').LegacyConstTag} */ (node).expression !==
215+
undefined
216+
) {
217+
return node;
218+
}
219+
220+
const modern_node = /** @type {import('#compiler').ConstTag} */ (node);
221+
const { id: left } = { ...modern_node.declaration.declarations[0] };
222+
// @ts-ignore
223+
delete left.typeAnnotation;
224+
return {
225+
type: 'ConstTag',
226+
start: modern_node.start,
227+
end: node.end,
228+
expression: {
229+
type: 'AssignmentExpression',
230+
start: (modern_node.declaration.start ?? 0) + 'const '.length,
231+
end: modern_node.declaration.end ?? 0,
232+
operator: '=',
233+
left,
234+
right: modern_node.declaration.declarations[0].init
235+
}
236+
};
237+
},
238+
// @ts-ignore
212239
KeyBlock(node, { visit }) {
213240
remove_surrounding_whitespace_nodes(node.fragment.nodes);
214241
return {

0 commit comments

Comments
 (0)