sveltejs

svelte

web development for the rest of us

by sveltejs

JavaScript

JavaScript70.6%
Svelte22.4%
TypeScript5%
CSS1.1%
HTML0.8%

Commit activity

Last 12 weeks · 172 commits

Full graph →

Community health

6 of 6 standards met

Community profile →
87
✓README✓License✓Contributing✓Code of Conduct✓Issue Template✓PR Template

Recent PRs & issues

Active · Last activity 10m ago
See all on GitHub →
dummdidumm

When you remove an if block, we want the value in teardown read to be reflecting what was there before the block became falsy. E.g. in this example, the effect teardown print . But if we put a transition on the outroing block, it's no longer doing that. Bug or not? I lean towards bug.

dummdidumm · 23m ago
Rich-Harris

Alternative to #19240. Not quite ready yet — two tests are still failing, and I think there are further opportunities for simplification — but I think the overall idea makes sense. Essentially, any time a branch has expressions, we wrap the contents in a synthetic block, where means 'all the async dependencies have a value'. The problem this solves is most easily illustrated with this example: If and are written, and then is written while we're waiting for the initial , and the second batch resolves before the first, at present we will render before the expression is ready. With this change, we render initially, then update it to when the first batch resolves.

Rich-Harris · 1h ago
xyrolle

Describe the bug With , while one change is waiting on an and another change is processed, so is set, a dirty executes again on every read instead of once. A derived read N times runs N times, and one read inside another derived multiplies. In the reproduction below, runs 2,000 times for one click while the DOM ends up correct. teemingc's comment below shows that through a chain of deriveds the re-runs compound and can freeze the tab. The mechanism has come up before. This comment on #18624 describes it with SvelteKit's as the trigger, and #18355 is about the same retained dirtiness during overlapping batches, there as an infinite loop. Two things here are new: the trigger is plain Svelte (one pending plus an unrelated state change), and the amplification grew sharply in 5.46.3. Up to 5.46.1, didn't re-evaluate a derived when . Some redundant work already existed: runs 11 times in the reproduction, once per read plus one. #17362 (5.46.3) removed that condition. Now runs and then (runtime.js#L683-L692) before it consults (#L700). While , caches the value in but deliberately leaves the derived's status dirty (deriveds.js#L428-L436), so every read executes it again. A chain does the same: calls (runtime.js#L167-L169) and doesn't reset the status while time-travelling (#L176-L183). Restoring only the condition brings back to 1 but still runs 11 times, as in 5.46.1. #18988 fixed both paths when tested at 8a1046e. It was merged into , not , and that branch into #18880's, which is still open; the table below has and #18880's head. Reproduction Project setup (Vite 8.3.4, @sveltejs/vite-plugin-svelte 7.3.1, experimental.async) , where every promise is resolved by hand: Each step has to run in its own task: on one line becomes a single update. Paste one of these into the console after a fresh load: / (Chromium, dev server): In A, doesn't depend on , so it needn't run, and should run once. In B, the resolved change moves , so each runs once. Logs System Info Severity annoyance

xyrolle · 2h ago
abd1rahmane

links the license badge to . GitHub resolves that relative to , so the badge opens , which does not exist. The license file is at the repository root. The link now points at the root with an absolute URL so it also works when the README is read from the npm package. Before submitting the PR, please make sure you do the following [ ] It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs [x] Prefix your PR title with , , , or . [x] This message body should clearly illustrate what problems it solves. [ ] Ideally, include a test that fails without this PR but passes with it. [ ] If this PR changes code within , add a changeset (). Tests and linting [ ] Run the tests with and lint the project with

abd1rahmane · 13m ago
Structured data for AI agents

Repository: sveltejs/svelte. Description: web development for the rest of us Stars: 88725, Forks: 6063. Primary language: JavaScript. Languages: JavaScript (70.6%), Svelte (22.4%), TypeScript (5%), CSS (1.1%), HTML (0.8%). License: MIT. Homepage: https://svelte.dev Topics: compiler, template, ui. Latest release: svelte@5.57.3 (2w ago). Open PRs: 100, open issues: 1192. Last activity: 10m ago. Community health: 87%. Top contributors: Rich-Harris, dummdidumm, Conduitry, github-actions[bot], trueadm, tanhauhau, paoloricciuti, benmccann, PuruVJ, baseballyama and others.