The `update` function could cause a read, which would end up being tracked in the effect, and said effect would then run multiple times when it should only run once
fixes#11934fixes#12028
* fix: ensure input value is correctly set during hydration
* fix: ensure input value is correctly set during hydration
* address feedback
* fix typos
* early return, var
* fix test
* Update packages/svelte/src/internal/client/dom/elements/attributes.js
Co-authored-by: Rich Harris <rich.harris@vercel.com>
* update changeset
* tweak names
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
prevent misidentification of bindings as delegatable event handlers if used outside event attribute
Fixes#12074
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
add them so that the TypeScript parser doesn't put the following content under the `@deprecated` tag, which messes with the JSON-type-generation script.
When the TypeScript plugin we provide isn't enabled, imports to `.svelte`-files fall back to an ambient module declaration. Said declaration was still only providing the deprecated class. This PR widens the type so that you can also invoke it like a function. After the transition period (Svelte 6 or 7) only the new type should be provided from the module declaration.
* chore: get rid of current_untracking
* simplify
* remove incorrect comment
* only apply unowned check to user effects - less work that way
* tweak
---------
Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
The `is` attribute is special and always needs to be part of the static template string, or else it wouldn't be taken into account on initialization
fixes#12052
- give autocompletion for types and more precise event types for html elements
- allow to pass other kinds of event target nodes, like window
closes#12027fixes#12045
* fix: increment derived versions when updating
* we only need to increment version when setting sources and updating deriveds
* no tests fail if we remove this code
* codegolf
---------
Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
We need to ensure that if derived a depends on derived b, and a is reconnecting to the dependency graph, that if b was updated more recently than a, a also updates.
Fixes#11988Fixes#12044
follow up to #12014, which wasn't quite the right fix. It would mean that delegated listeners between two manual listeners wouldn't be called at the correct time.
It was wrongfully cut down in #11834 - sadly we need to duplicate the config because of a prettier VS Code bug which does not pick up the nearest prettier config. This change results in the proper files getting ignored when touching them with the editor
* import Component as Type
interfaces can only be used as a Type, that way it should be imported as type
* fix import type
* regenerate types
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
* fix: ensure bound input content is resumed on hydration
* fix: ensure bound input content is resumed on hydration
* Update packages/svelte/src/internal/client/dom/elements/bindings/input.js
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
* fix: ensure bound input content is resumed on hydration
* fix: ensure bound input content is resumed on hydration
* Update packages/svelte/src/internal/client/dom/elements/bindings/input.js
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
* add test
* add test
* add test
* add test
* Update packages/svelte/src/internal/client/dom/elements/bindings/input.js
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
* add test
* add test
* newlines between multi-line blocks, let the code breathe
---------
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
Co-authored-by: Rich Harris <rich.harris@vercel.com>
* chore: simplify SSR escaping
* treat solo expressions the same as sequence expressions
* reduce some indirection
* more
* tidy
* tidy
* remove unused types
* more
* this doesnt do anything
* more
* Anchor is unused
* simplify
* simplify
* move special case handling
* more
* simplify
* simplify
* simplify
* more
* unnecessary
* simplify
* remove unused arg
* more
* more
* unnecessary
* more
* more
* dedupe