Skip to content

Commit aa224ce

Browse files
committed
merge main
2 parents 4b22a09 + 707682e commit aa224ce

File tree

636 files changed

+11263
-5573
lines changed

Some content is hidden

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

636 files changed

+11263
-5573
lines changed

.changeset/hot-kings-shout.md

-5
This file was deleted.

.changeset/spicy-insects-check.md

-5
This file was deleted.

.changeset/tender-apples-scream.md

-5
This file was deleted.

.github/workflows/ci.yml

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ env:
1212

1313
jobs:
1414
Tests:
15+
permissions: {}
1516
runs-on: ${{ matrix.os }}
1617
timeout-minutes: 15
1718
strategy:
@@ -41,6 +42,7 @@ jobs:
4142
env:
4243
CI: true
4344
Lint:
45+
permissions: {}
4446
runs-on: ubuntu-latest
4547
timeout-minutes: 5
4648
steps:
@@ -61,6 +63,7 @@ jobs:
6163
if: (${{ success() }} || ${{ failure() }}) # ensures this step runs even if previous steps fail
6264
run: pnpm build && { [ "`git status --porcelain=v1`" == "" ] || (echo "Generated types have changed — please regenerate types locally with `cd packages/svelte && pnpm generate:types` and commit the changes after you have reviewed them"; git diff; exit 1); }
6365
Benchmarks:
66+
permissions: {}
6467
runs-on: ubuntu-latest
6568
timeout-minutes: 15
6669
steps:

.github/workflows/docs-preview-create-request.yml

-26
This file was deleted.

.github/workflows/docs-preview-delete-request.yml

-27
This file was deleted.

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

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
if: github.repository == 'sveltejs/svelte' && github.event.issue.pull_request && startsWith(github.event.comment.body, '/ecosystem-ci run')
1111
steps:
12+
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
1213
- uses: actions/github-script@v6
1314
with:
1415
script: |

.github/workflows/pkg.pr.new-comment.yml

+4
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@ on:
66
types:
77
- completed
88

9+
permissions:
10+
pull-requests: write
11+
912
jobs:
1013
build:
1114
name: 'Update comment'
1215
runs-on: ubuntu-latest
1316
steps:
17+
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
1418
- name: Download artifact
1519
uses: actions/download-artifact@v4
1620
with:

.github/workflows/pkg.pr.new.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ on: [push, pull_request]
33

44
jobs:
55
build:
6+
permissions: {}
7+
68
runs-on: ubuntu-latest
79

810
steps:
9-
- name: Checkout code
10-
uses: actions/checkout@v4
11-
12-
- run: corepack enable
11+
- uses: actions/checkout@v4
12+
- uses: pnpm/action-setup@v4
1313
- uses: actions/setup-node@v4
1414
with:
15-
node-version: 18.x
15+
node-version: 22.x
1616
cache: pnpm
1717

1818
- name: Install dependencies

.github/workflows/release.yml

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
name: Release
1818
runs-on: ubuntu-latest
1919
steps:
20+
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
2021
- name: Checkout Repo
2122
uses: actions/checkout@v4
2223
with:

.github/workflows/sync-request.yml

-22
This file was deleted.

CONTRIBUTING.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ We use [GitHub issues](https://github.com/sveltejs/svelte/issues) for our public
5151

5252
If you have questions about using Svelte, contact us on Discord at [svelte.dev/chat](https://svelte.dev/chat), and we will do our best to answer your questions.
5353

54-
If you see anything you'd like to be implemented, create a [feature request issue](https://github.com/sveltejs/svelte/issues/new?template=feature_request.yml)
54+
If you see anything you'd like to be implemented, create a [feature request issue](https://github.com/sveltejs/svelte/issues/new?template=feature_request.yml).
5555

5656
### Reporting new issues
5757

@@ -62,8 +62,6 @@ When [opening a new issue](https://github.com/sveltejs/svelte/issues/new/choose)
6262

6363
## Pull requests
6464

65-
> HEADS UP: Svelte 5 will likely change a lot on the compiler. For that reason, please don't open PRs that are large in scope, touch more than a couple of files etc. In other words, bug fixes are fine, but big feature PRs will likely not be merged.
66-
6765
### Proposing a change
6866

6967
If you would like to request a new feature or enhancement but are not yet thinking about opening a pull request, you can also file an issue with [feature template](https://github.com/sveltejs/svelte/issues/new?template=feature_request.yml).

LICENSE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2016-2025 [these people](https://github.com/sveltejs/svelte/graphs/contributors)
1+
Copyright (c) 2016-2025 [Svelte Contributors](https://github.com/sveltejs/svelte/graphs/contributors)
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
44

README.md

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
[![Cybernetically enhanced web apps: Svelte](https://sveltejs.github.io/assets/banner.png)](https://svelte.dev)
2-
3-
[![license](https://img.shields.io/npm/l/svelte.svg)](LICENSE.md) [![Chat](https://img.shields.io/discord/457912077277855764?label=chat&logo=discord)](https://svelte.dev/chat)
1+
<a href="https://svelte.dev">
2+
<picture>
3+
<source media="(prefers-color-scheme: dark)" srcset="assets/banner_dark.png">
4+
<img src="assets/banner.png" alt="Svelte - web development for the rest of us" />
5+
</picture>
6+
</a>
7+
8+
[![License](https://img.shields.io/npm/l/svelte.svg)](LICENSE.md) [![Chat](https://img.shields.io/discord/457912077277855764?label=chat&logo=discord)](https://svelte.dev/chat)
49

510
## What is Svelte?
611

assets/banner.png

97.4 KB
Loading

assets/banner_dark.png

103 KB
Loading

benchmarking/benchmarks/reactivity/kairo/kairo_avoidable.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ function setup() {
2020
return {
2121
destroy,
2222
run() {
23-
$.flush_sync(() => {
23+
$.flush(() => {
2424
$.set(head, 1);
2525
});
2626
assert($.get(computed5) === 6);
2727
for (let i = 0; i < 1000; i++) {
28-
$.flush_sync(() => {
28+
$.flush(() => {
2929
$.set(head, i);
3030
});
3131
assert($.get(computed5) === 6);

benchmarking/benchmarks/reactivity/kairo/kairo_broad.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ function setup() {
2525
return {
2626
destroy,
2727
run() {
28-
$.flush_sync(() => {
28+
$.flush(() => {
2929
$.set(head, 1);
3030
});
3131
counter = 0;
3232
for (let i = 0; i < 50; i++) {
33-
$.flush_sync(() => {
33+
$.flush(() => {
3434
$.set(head, i);
3535
});
3636
assert($.get(last) === i + 50);

benchmarking/benchmarks/reactivity/kairo/kairo_deep.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ function setup() {
2525
return {
2626
destroy,
2727
run() {
28-
$.flush_sync(() => {
28+
$.flush(() => {
2929
$.set(head, 1);
3030
});
3131
counter = 0;
3232
for (let i = 0; i < iter; i++) {
33-
$.flush_sync(() => {
33+
$.flush(() => {
3434
$.set(head, i);
3535
});
3636
assert($.get(current) === len + i);

benchmarking/benchmarks/reactivity/kairo/kairo_diamond.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ function setup() {
2828
return {
2929
destroy,
3030
run() {
31-
$.flush_sync(() => {
31+
$.flush(() => {
3232
$.set(head, 1);
3333
});
3434
assert($.get(sum) === 2 * width);
3535
counter = 0;
3636
for (let i = 0; i < 500; i++) {
37-
$.flush_sync(() => {
37+
$.flush(() => {
3838
$.set(head, i);
3939
});
4040
assert($.get(sum) === (i + 1) * width);

benchmarking/benchmarks/reactivity/kairo/kairo_mux.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ function setup() {
2222
destroy,
2323
run() {
2424
for (let i = 0; i < 10; i++) {
25-
$.flush_sync(() => {
25+
$.flush(() => {
2626
$.set(heads[i], i);
2727
});
2828
assert($.get(splited[i]) === i + 1);
2929
}
3030
for (let i = 0; i < 10; i++) {
31-
$.flush_sync(() => {
31+
$.flush(() => {
3232
$.set(heads[i], i * 2);
3333
});
3434
assert($.get(splited[i]) === i * 2 + 1);

benchmarking/benchmarks/reactivity/kairo/kairo_repeated.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ function setup() {
2525
return {
2626
destroy,
2727
run() {
28-
$.flush_sync(() => {
28+
$.flush(() => {
2929
$.set(head, 1);
3030
});
3131
assert($.get(current) === size);
3232
counter = 0;
3333
for (let i = 0; i < 100; i++) {
34-
$.flush_sync(() => {
34+
$.flush(() => {
3535
$.set(head, i);
3636
});
3737
assert($.get(current) === i * size);

benchmarking/benchmarks/reactivity/kairo/kairo_triangle.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ function setup() {
3838
destroy,
3939
run() {
4040
const constant = count(width);
41-
$.flush_sync(() => {
41+
$.flush(() => {
4242
$.set(head, 1);
4343
});
4444
assert($.get(sum) === constant);
4545
counter = 0;
4646
for (let i = 0; i < 100; i++) {
47-
$.flush_sync(() => {
47+
$.flush(() => {
4848
$.set(head, i);
4949
});
5050
assert($.get(sum) === constant - width + i * width);

benchmarking/benchmarks/reactivity/kairo/kairo_unstable.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ function setup() {
2525
return {
2626
destroy,
2727
run() {
28-
$.flush_sync(() => {
28+
$.flush(() => {
2929
$.set(head, 1);
3030
});
3131
assert($.get(current) === 40);
3232
counter = 0;
3333
for (let i = 0; i < 100; i++) {
34-
$.flush_sync(() => {
34+
$.flush(() => {
3535
$.set(head, i);
3636
});
3737
}

benchmarking/benchmarks/reactivity/mol_bench.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ function setup() {
5151
*/
5252
run(i) {
5353
res.length = 0;
54-
$.flush_sync(() => {
54+
$.flush(() => {
5555
$.set(B, 1);
5656
$.set(A, 1 + i * 2);
5757
});
58-
$.flush_sync(() => {
58+
$.flush(() => {
5959
$.set(A, 2 + i * 2);
6060
$.set(B, 2);
6161
});

benchmarking/compare/index.js

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import fs from 'node:fs';
22
import path from 'node:path';
33
import { execSync, fork } from 'node:child_process';
44
import { fileURLToPath } from 'node:url';
5-
import { benchmarks } from '../benchmarks.js';
65

76
// if (execSync('git status --porcelain').toString().trim()) {
87
// console.error('Working directory is not clean');

benchmarking/compare/runner.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { benchmarks } from '../benchmarks.js';
1+
import { reactivity_benchmarks } from '../benchmarks/reactivity/index.js';
22

33
const results = [];
4-
for (const benchmark of benchmarks) {
4+
for (const benchmark of reactivity_benchmarks) {
55
const result = await benchmark();
66
console.error(result.benchmark);
77
results.push(result);

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

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Getting started
33
---
44

5-
We recommend using [SvelteKit](../kit), the official application framework from the Svelte team powered by [Vite](https://vite.dev/):
5+
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

77
```bash
88
npx sv create myapp
@@ -15,7 +15,9 @@ Don't worry if you don't know Svelte yet! You can ignore all the nice features S
1515

1616
## Alternatives to SvelteKit
1717

18-
You can also use Svelte directly with Vite by running `npm create vite@latest` and selecting the `svelte` option. With this, `npm run build` will generate HTML, JS and CSS files inside the `dist` directory using [vite-plugin-svelte](https://github.com/sveltejs/vite-plugin-svelte). In most cases, you will probably need to [choose a routing library](faq#Is-there-a-router) as well.
18+
You can also use Svelte directly with Vite by running `npm create vite@latest` and selecting the `svelte` option. With this, `npm run build` will generate HTML, JS, and CSS files inside the `dist` directory using [vite-plugin-svelte](https://github.com/sveltejs/vite-plugin-svelte). In most cases, you will probably need to [choose a routing library](faq#Is-there-a-router) as well.
19+
20+
>[!NOTE] Vite is often used in standalone mode to build [single page apps (SPAs)](../kit/glossary#SPA), which you can also [build with SvelteKit](../kit/single-page-apps).
1921
2022
There are also plugins for [Rollup](https://github.com/sveltejs/rollup-plugin-svelte), [Webpack](https://github.com/sveltejs/svelte-loader) [and a few others](https://sveltesociety.dev/packages?category=build-plugins), but we recommend Vite.
2123

documentation/docs/01-introduction/04-svelte-js-files.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: .svelte.js and .svelte.ts files
44

55
Besides `.svelte` files, Svelte also operates on `.svelte.js` and `.svelte.ts` files.
66

7-
These behave like any other `.js` or `.ts` module, except that you can use runes. This is useful for creating reusable reactive logic, or sharing reactive state across your app.
7+
These behave like any other `.js` or `.ts` module, except that you can use runes. This is useful for creating reusable reactive logic, or sharing reactive state across your app (though note that you [cannot export reassigned state]($state#Passing-state-across-modules)).
88

99
> [!LEGACY]
1010
> This is a concept that didn't exist prior to Svelte 5

0 commit comments

Comments
 (0)