* 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
* Docs: Change all initizlisation to initialisation
* Reverted to "initialization" when asserting errors with specific message
* Reverted to "initialization" where related to specific error message
- run reactive statements only once per tick, even when they have indirect cyclic dependencies. Made possible by adding an array to the component context, which is filled with identifiers of the reactive statements, and which is cleared after all have run. Reactive statements rerunning before that will bail early if they detect they're still in the list
- part of the solution is to run all reactive statements, and then all render effects, which also fixes#10597
* fix: improve bind:this support around proxyied state
* fix: improve bind:this support around proxyied state
* fix: improve bind:this support around proxyied state
A handful of minor cleanups:
- there were two different "do this" / "don't do this" formats. Standardize on the one that's much easier to read
- clarify that callback props are being used (component events no longer exist in Svelte 5)
- rename variable from `proxy` to `facade` since it's not a proxy