Last 12 weeks · 135 commits
6 of 6 standards met
Describe the bug Hello, I'm working on a Vite plugin (wuchale) and use to transform Svelte code and generate the source map. Sometimes, the source maps that the browser sees are sometimes wrong, and I used to check the output of wuchale and it seems correct, but then Svelte's compiler messes it up after that. Reproduction Since the reproduction can't work in the REPL, and since it is fairly small, I'll provide the files here. Start from the template in , and edit only these two files: Then run it, go to devtools, and look at the location of the message, it will be at the beginning of the script block, not at the actual location. Logs System Info Severity annoyance
Describe the bug Using can, in at least some cases, result in being exposed as a _function_ that returns the appropriate value, rather than as the value itself. Client-side rendering seems to be fine, and using in the `function`. For comparison, SSR-compiles into Logs System Info Severity annoyance
Describe the bug A $derived declared as a class field is "owned" by whatever effect happens to be active when the instance is constructed (derived.parent = active_effect). If that instance outlives the effect, e.g. a long-lived model object that was new'd inside a component which later unmounts, the derived is frozen to its last value and never recomputes again, even though its $state dependencies keep changing. This is a regression introduced in 5.55.3 by #17921; pinning to 5.55.2 restores correct behavior. The trap is that the owning effect is non-deterministic and semantically meaningless for an object whose lifetime isn't tied to any component, it's just whichever effect was on the stack at new-time. Reproduction https://svelte.dev/playground/86e9f769bb1d4021af59f2d289b73448?version=5.56.4 Click the button twice. Expected: after step 2, box.value === 'C' so box.doubled === 'CC'. Actual (5.55.3+): box.doubled === 'BB', frozen at the value from before the child unmounted. Reading it inside a reactive context (template/$effect) instead reconnects and unfreezes it, which makes the staleness order-dependent and hard to spot. Logs System Info Severity blocking an upgrade
Fixes #18385 ## Problem infers BigInt properties as because is missing from the type definition. BigInt is a valid JavaScript primitive and is supported by . ## Solution Added to the type in both and . ## Before ```ts const object = $state({ number: 1n }); const snapshot = $state.snapshot(object); // snapshot.number is inferred as never ❌ After const object = $state({ number: 1n }); const snapshot = $state.snapshot(object); // snapshot.number is correctly inferred as bigint ✅ Tests and linting [x] This is a type-only change, no runtime behavior affected
Summary Adds a note explaining the behavior of fallback values when the property is bound. The note clarifies that fallback values only apply when the property is not bound, and that binding a value of will result in a runtime error. Why This makes the documentation easier to understand by explicitly highlighting a behavior that readers might otherwise overlook.
Repository: sveltejs/svelte. Description: web development for the rest of us Stars: 87366, Forks: 4959. Primary language: JavaScript. Languages: JavaScript (71.3%), Svelte (22.3%), TypeScript (4.8%), CSS (1.1%), HTML (0.5%). License: MIT. Homepage: https://svelte.dev Topics: compiler, template, ui. Latest release: svelte@5.56.4 (1w ago). Open PRs: 100, open issues: 960. Last activity: 1d ago. Community health: 87%. Top contributors: Rich-Harris, Conduitry, dummdidumm, github-actions[bot], trueadm, tanhauhau, benmccann, paoloricciuti, PuruVJ, baseballyama and others.