Skip to content

Commit 5516a2f

Browse files
committed
Merge branch 'main' into fix-15337
2 parents 5545894 + 0cbb5be commit 5516a2f

File tree

461 files changed

+13003
-3247
lines changed

Some content is hidden

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

461 files changed

+13003
-3247
lines changed

.changeset/clever-dodos-jam.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,23 @@ jobs:
4343
- run: pnpm test
4444
env:
4545
CI: true
46+
TestNoAsync:
47+
permissions: {}
48+
runs-on: ubuntu-latest
49+
timeout-minutes: 10
50+
steps:
51+
- uses: actions/checkout@v4
52+
- uses: pnpm/action-setup@v4
53+
- uses: actions/setup-node@v4
54+
with:
55+
node-version: 22
56+
cache: pnpm
57+
- run: pnpm install --frozen-lockfile
58+
- run: pnpm playwright install chromium
59+
- run: pnpm test runtime-runes
60+
env:
61+
CI: true
62+
SVELTE_NO_ASYNC: true
4663
Lint:
4764
permissions: {}
4865
runs-on: ubuntu-latest

.github/workflows/ecosystem-ci-trigger.yml

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,17 @@ jobs:
88
trigger:
99
runs-on: ubuntu-latest
1010
if: github.repository == 'sveltejs/svelte' && github.event.issue.pull_request && startsWith(github.event.comment.body, '/ecosystem-ci run')
11+
permissions:
12+
issues: write # to add / delete reactions
13+
pull-requests: write # to read PR data, and to add labels
14+
actions: read # to check workflow status
15+
contents: read # to clone the repo
1116
steps:
12-
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
13-
- uses: actions/github-script@v6
17+
- name: monitor action permissions
18+
uses: GitHubSecurityLab/actions-permissions/monitor@v1
19+
- name: check user authorization # user needs triage permission
20+
uses: actions/github-script@v7
21+
id: check-permissions
1422
with:
1523
script: |
1624
const user = context.payload.sender.login
@@ -29,24 +37,26 @@ jobs:
2937
}
3038
3139
if (hasTriagePermission) {
32-
console.log('Allowed')
40+
console.log('User is allowed. Adding +1 reaction.')
3341
await github.rest.reactions.createForIssueComment({
3442
owner: context.repo.owner,
3543
repo: context.repo.repo,
3644
comment_id: context.payload.comment.id,
3745
content: '+1',
3846
})
3947
} else {
40-
console.log('Not allowed')
48+
console.log('User is not allowed. Adding -1 reaction.')
4149
await github.rest.reactions.createForIssueComment({
4250
owner: context.repo.owner,
4351
repo: context.repo.repo,
4452
comment_id: context.payload.comment.id,
4553
content: '-1',
4654
})
47-
throw new Error('not allowed')
55+
throw new Error('User does not have the necessary permissions.')
4856
}
49-
- uses: actions/github-script@v6
57+
58+
- name: Get PR Data
59+
uses: actions/github-script@v7
5060
id: get-pr-data
5161
with:
5262
script: |
@@ -59,21 +69,27 @@ jobs:
5969
return {
6070
num: context.issue.number,
6171
branchName: pr.head.ref,
72+
commit: pr.head.sha,
6273
repo: pr.head.repo.full_name
6374
}
64-
- id: generate-token
65-
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92 #keep pinned for security reasons, currently 1.8.0
75+
76+
- name: Generate Token
77+
id: generate-token
78+
uses: actions/create-github-app-token@v2
6679
with:
67-
app_id: ${{ secrets.ECOSYSTEM_CI_GITHUB_APP_ID }}
68-
private_key: ${{ secrets.ECOSYSTEM_CI_GITHUB_APP_PRIVATE_KEY }}
69-
repository: '${{ github.repository_owner }}/svelte-ecosystem-ci'
70-
- uses: actions/github-script@v6
80+
app-id: ${{ secrets.ECOSYSTEM_CI_GITHUB_APP_ID }}
81+
private-key: ${{ secrets.ECOSYSTEM_CI_GITHUB_APP_PRIVATE_KEY }}
82+
repositories: |
83+
svelte
84+
svelte-ecosystem-ci
85+
86+
- name: Trigger Downstream Workflow
87+
uses: actions/github-script@v7
7188
id: trigger
7289
env:
7390
COMMENT: ${{ github.event.comment.body }}
7491
with:
7592
github-token: ${{ steps.generate-token.outputs.token }}
76-
result-encoding: string
7793
script: |
7894
const comment = process.env.COMMENT.trim()
7995
const prData = ${{ steps.get-pr-data.outputs.result }}
@@ -89,6 +105,7 @@ jobs:
89105
prNumber: '' + prData.num,
90106
branchName: prData.branchName,
91107
repo: prData.repo,
108+
commit: prData.commit,
92109
suite: suite === '' ? '-' : suite
93110
}
94111
})

.prettierignore

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ packages/**/config/*.js
77

88
# packages/svelte
99
packages/svelte/messages/**/*.md
10+
packages/svelte/scripts/_bundle.js
1011
packages/svelte/src/compiler/errors.js
1112
packages/svelte/src/compiler/warnings.js
1213
packages/svelte/src/internal/client/errors.js
@@ -25,17 +26,7 @@ packages/svelte/tests/hydration/samples/*/_expected.html
2526
packages/svelte/tests/hydration/samples/*/_override.html
2627
packages/svelte/types
2728
packages/svelte/compiler/index.js
28-
playgrounds/sandbox/input/**.svelte
29-
playgrounds/sandbox/output
30-
31-
# sites/svelte.dev
32-
sites/svelte.dev/static/svelte-app.json
33-
sites/svelte.dev/scripts/svelte-app/
34-
sites/svelte.dev/src/routes/_components/Supporters/contributors.jpg
35-
sites/svelte.dev/src/routes/_components/Supporters/contributors.js
36-
sites/svelte.dev/src/routes/_components/Supporters/donors.jpg
37-
sites/svelte.dev/src/routes/_components/Supporters/donors.js
38-
sites/svelte.dev/src/lib/generated
29+
playgrounds/sandbox/src/*
3930

4031
**/node_modules
4132
**/.svelte-kit

.prettierrc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@
1717
"useTabs": false,
1818
"tabWidth": 2
1919
}
20-
},
21-
{
22-
"files": ["sites/svelte-5-preview/src/routes/docs/content/**/*.md"],
23-
"options": {
24-
"printWidth": 60
25-
}
2620
}
2721
]
2822
}

.vscode/settings.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
{
2-
"search.exclude": {
3-
"sites/svelte-5-preview/static/*": true
4-
},
52
"typescript.tsdk": "node_modules/typescript/lib"
63
}

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,14 @@ Test samples are kept in `/test/xxx/samples` folder.
101101
1. To run test, run `pnpm test`.
102102
1. To run a particular test suite, use `pnpm test <suite-name>`, for example:
103103

104-
```bash
104+
```sh
105105
pnpm test validator
106106
```
107107

108-
1. To filter tests _within_ a test suite, use `pnpm test <suite-name> -- -t <test-name>`, for example:
108+
1. To filter tests _within_ a test suite, use `pnpm test <suite-name> -t <test-name>`, for example:
109109

110-
```bash
111-
pnpm test validator -- -t a11y-alt-text
110+
```sh
111+
pnpm test validator -t a11y-alt-text
112112
```
113113

114114
(You can also do `FILTER=<test-name> pnpm test <suite-name>` which removes other tests rather than simply skipping them — this will result in faster and more compact test results, but it's non-idiomatic. Choose your fighter.)

documentation/docs/01-introduction/02-getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Getting started
44

55
We recommend using [SvelteKit](../kit), which lets you [build almost anything](../kit/project-types). It's the official application framework from the Svelte team and powered by [Vite](https://vite.dev/). Create a new project with:
66

7-
```bash
7+
```sh
88
npx sv create myapp
99
cd myapp
1010
npm install

documentation/docs/02-runes/02-$state.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ todos.push({
5050
});
5151
```
5252

53-
> [!NOTE] When you update properties of proxies, the original object is _not_ mutated.
53+
> [!NOTE] When you update properties of proxies, the original object is _not_ mutated. If you need 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==).
5454
5555
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:
5656

@@ -119,7 +119,9 @@ class Todo {
119119
}
120120
```
121121

122-
> Svelte provides reactive implementations of built-in classes like `Set` and `Map` that can be imported from [`svelte/reactivity`](svelte-reactivity).
122+
### Built-in classes
123+
124+
Svelte provides reactive implementations of built-in classes like `Set`, `Map`, `Date` and `URL` that can be imported from [`svelte/reactivity`](svelte-reactivity).
123125

124126
## `$state.raw`
125127

documentation/docs/02-runes/03-$derived.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,27 @@ let selected = $derived(items[index]);
9494

9595
...you can change (or `bind:` to) properties of `selected` and it will affect the underlying `items` array. If `items` was _not_ deeply reactive, mutating `selected` would have no effect.
9696

97+
## Destructuring
98+
99+
If you use destructuring with a `$derived` declaration, the resulting variables will all be reactive — this...
100+
101+
```js
102+
function stuff() { return { a: 1, b: 2, c: 3 } }
103+
// ---cut---
104+
let { a, b, c } = $derived(stuff());
105+
```
106+
107+
...is roughly equivalent to this:
108+
109+
```js
110+
function stuff() { return { a: 1, b: 2, c: 3 } }
111+
// ---cut---
112+
let _stuff = $derived(stuff());
113+
let a = $derived(_stuff.a);
114+
let b = $derived(_stuff.b);
115+
let c = $derived(_stuff.c);
116+
```
117+
97118
## Update propagation
98119

99120
Svelte uses something called _push-pull reactivity_ — when state is updated, everything that depends on the state (whether directly or indirectly) is immediately notified of the change (the 'push'), but derived values are not re-evaluated until they are actually read (the 'pull').

0 commit comments

Comments
 (0)