pre effects, which also contain `$:` statements, are more controlled in legacy mode and should only run once per tick, in their defined order. Flushing them out of order can result in bugs. Related to #10795 and #10787
* fix: improve element class attribute behaviour
* Update packages/svelte/src/internal/client/dom/elements/class.js
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
---------
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
The await block scope analysis was flawed because it did not set the scope for the value/error field before visiting those nodes, resulting in the wrong scopes getting references
As a byproduct, this fixes#8141
* follow up to 10846
* lint
* simplify
* don't update value
* rework logic, rely more on mutation observer, fix bug related to select multiple
* fix lazy select options bug
---------
Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
Co-authored-by: brunnerh <brunnerh@users.noreply.github.com>
* feat: add support for webkitdirectory DOM boolean attribute
* add to types
---------
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
* feat: adds reactive Map class to svelte/reactivity
* add docs
* add docs
* add test case
* types
* make reactive set better
* address feedback
* fix typo
* more efficient initialisation
* this is incorrect, it would fail if given a map for example
* increase consistency (with e.g. proxy.js)
* tidy up
* Revert "more efficient initialisation"
This reverts commit 29d4a8078b.
* efficient initialization, without bugs this time
* convention
* delete make_iterable
* update changeset
* efficient initialization
* avoid generator functions
* Update sites/svelte-5-preview/src/routes/docs/content/01-api/02-runes.md
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
Co-authored-by: Rich Harris <richard.a.harris@gmail.com>
- the `component` parameter expects a component constructor type, not an instance type
- use `import('svelte')` instead of relative paths to not inline all types that are already present in the sibiling module declaration
* null out teardown function
* add managed effects to effect tree
* let the code breathe a bit
* bit more
* man, that's better
* create correct parent-child relationship between if block and its branches
* remove unnecessary arg
* each blocks already have the correct parent-child relationship so i guess we can get rid of this
* simplify
* unused import
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
* fix: invalidate store when mutated inside each block
fixes#10771
* Update packages/svelte/src/compiler/phases/3-transform/client/visitors/template.js
We can simplify pre effects by not doing the flush logic at all now. Instead we can move the flushing logic to the only place its needed – for beforeUpdate
* feat: add reactive Set class to svelte/reactivity
* add some type safety
* simplify, read entries lazily
* failing unit test
* fix deletions
* minor tweaks
* work around effect ordering bug
* simplify, make entries lazy
* small tweak
* use var, minor tweaks
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
* move bindings to separate file
* tidy up
* errrr this code is confusing as hell but it works and the tests pass. fix it another day
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
* split destroy_signal into destroy_effect and destroy_derived
* remove unused code
* remove derived.y
* remove unused code
* lint
* use alias
* simplify
* remove unused code
* remove unused code
* rename value.c to value.reactions, remove from effect type
* rename consumer to reaction, for greater consistency
* remove push_destroy_fn, we don't need it
* more clarity
* this is just incorrect
* align with 10594
* rename signal.i to signal.fn
* rename signal.d to signal.deps
* remove some unnecessary ceremony
* remove unnecessary code
* believe it or not this is faster. it also looks cooler
* tidy up
* remove derived.x
* tighten up mark_subtree_insert
* remove derived.b
* tidy up
* tidy up
* effect.x -> effect.ctx
* signal.b -> signal.block
* tighten up
* tidy up
* separate reaction.r into reaction.effects and reaction.deriveds
* make Derived and Effect inherit from Reaction, rather than Reaction being a union of Derived and Effect
* remove unused stuff
* tidy up
* rename effect.v to effect.teardown
* rename effect.y to effect.ondestroy
* tidy up
* inline doc
* rename
* simplify
* tidy up
* tweak
* remove unnecessary if check
* fix effect teardown bug
* test
* stfu eslint
* remove unused is_runes call
* remove unused argument
* this code doesnt do anything
* typos
* unused import
* source needs no flags
* tidy up
* tidy up
* move some code
* tidy up
* set current signal status, not dependency status
* simplify
* remove unused code
* tidy up
* rename — is_signal_dirty sounds like a pure function but it isnt
* rename value.w to value.version
* rename
* simplify
* MaybeSignal -> MaybeSource
* unused argument
* use default parameters
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
* chore: use Svelte 5 for preview site
* use server route to load Svelte compiler, enables this to work on windows locally, and avoids loading all our test files
* cache for 10 seconds
* make it thirty
* prerender