* 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
Get more validation tests passing:
- const tag cyclic validation (now runtime, based because of new reactivity system)
- illegal-variable-declaration
- illegal-attribute-character
- remove invalid-reactive-var validation as legacy reactive statements are transformed to functions under the hood, which never escape scope - arguably not completely correct, but will be what the user expects anyway
- invalid-rest-eachblock-binding
- remove edge-case redundant-event-modifier warning because event modifiers are deprecated anyway
- invalid-style-directive-modifier
- invalid-tag-property (now a different error)
- module-script-reactive-declaration
- take comment above script into account when silencing warnings
- invalid-css-declaration
- unused-export-let
- invalid-html-attribute
- illegal-store-subscription
- empty-block
- use interface instead of type (interface is less forgiving)
- rename SourceSignal to Source, etc
- make Derived extend Source, rather than deriveds sharing a type with effects, since they have much more in common with each other
- have a Value type which is a union of Source and Derived, and a Reaction type which is a union of Derived and Effect
- avoid using the Signal type (which is a union of all three) unless necessary
* move some code
* split computations.js into deriveds.js and effects.js
* move reactivity types into separate .d.ts file
* move some signal code
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
* fix: treat snippets like normal components when inferring namespace
* n
* simplify
* better desc
* slight adjustment
* feedback
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
* feedback
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
* skip html tag
* test
* changeset name
* cleanup
---------
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
Checking for expected or unexpected props in 2024 is the job TypeScript, and runtime validation has resulted in false positives previously - therefore leave this out in Svelte 5.
closes#10672
- explain when not to use `$effect`, closes#10193
- explain that only synchronous reads are tracked, closes#10475
- explain nuance around reruns and object reads, closes#10392
- widen ownership when getContext is called, part of #10649
- widen ownership when assigning one proxy to another
- skip first 4 stack trace entries and bail if first after that is not a module, hinting at a mutation encapsulated in a .svelte.js file; part of #10649