* WIP towards single-pass hydration
* fix
* fixes
* fix
* fix
* fixes
* fix
* fixes
* fix
* fix, tidy up
* update script (it currently fails)
* fix
* fix
* hmm
* fix
* fix
* fix
* fix
* all hydration tests passing
* drive-by fix
* fix
* update snapshot tests
* fix
* recover: false
* fix invalid HTML message
* note to self
* fix
* fix
* update snapshot tests
* fix
* fix
* fix
* update test
* fix
* fix
* fix
* ALL TESTS PASSING THIS IS NOT A DRILL
* optimise each blocks
* changeset
* type stuff
* fix comment
* tidy up
* tidy up
* tidy up
* tidy up
* tidy up
* remove comment, turns out we do need it
* revert
* reinstate standalone optimisation
* improve <svelte:element> SSR
* reset more conservatively
* tweak
* DRY/fix
* revert
* simplify
* add comment
* tweak
* simplify
* simplify
* answer: yes, at least for now, because otherwise empty components are a nuisance
* tweak
* unused
* comment is answered by https://github.com/sveltejs/svelte/pull/12356
* tweak
* handle `<template>` edge case at compile time
* this is no longer a possibility, because of is_text_first
* unused
* tweak
* fix
* move annotations to properties
* Update packages/svelte/src/constants.js
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
* Update packages/svelte/src/compiler/phases/3-transform/client/visitors/template.js
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
* Update packages/svelte/src/internal/client/dom/blocks/each.js
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
* Update packages/svelte/src/internal/client/dom/hydration.js
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
* Update playgrounds/demo/vite.config.js
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
* add a comment
* prettier
* tweak
* tighten up hydration tests, add test for standalone component
* test for standalone snippet
* fix
* add some comments
* tidy up
* avoid mutating `arguments`
---------
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
assign_nodes inside the branch sets the nodes property, and there's a dependency on the `this` value, which both (on its own) already prevent the effect from being pruned.
Setting the `value` attribute of an `<option>` element to a falsy value should result in the empty string. This wasn't happening in all situations previously.
Fixes#11616
* breaking: play transitions on `mount` by default
closes#11280
* only prevent transitions when the component is invalidated
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
This aligns warning and error objects to contain the same properties and have their toString methods return the same shape. It's implemented by warnings becoming class objects, too, and sharing the same base class with errors. It also adds back the `frame` property that got lost in the Svelte 4->5 transition. The only difference to Svelte 4 now is a slightly adjusted toString property (which is consistent between warnings and errors now) and a `position` property that contains a tuple of start/end offsets instead of a `pos` property only containing the start offset
closes#12151
The modern AST is an opportunity to tweak things. In the old AST, the start of else (if) branches was the content, now it's the opening bracket, which makes more sense.
- check that the runtime doesn't use methods that are too new
- add linting rule to prevent references to the compiler in the runtime (this is important for the first check, else the ambient node typings would be included, which includes a definition for `at()`, which means we no longer would get errors when violating the "don't use new methods" rule in the runtime)
- fix code as a result of these new checks
closes#10438
Closes#12287
---------
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
If an even handler is hoisted and said event handler access rest props, we can't be sure whether or not it will access it via `$$props` (optimized) or via `rest()` - therefore we add both as params in this edge case
fixes#12279
* fix: improve ReactiveDate class
* improved test
* added changeset
* improved performance by using less signals
* using the same signal for getX and getUTCX
* fixed types
* combined setX with setUTCX tests together
* simplified fine-grainability by using deriveds
* reused the calculated new_time
* removed logic that reduced number of signals, cuz its use-cases are rare
* inference is fine
* tidy up
* tweaks
* more efficient iteration
* tweak
* more descriptive changeset
* this makes all tests but one pass
* fix
* adjust test to be robust across timezones
* tweak more tests
* Update .changeset/sleepy-dogs-sit.md
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
Co-authored-by: Rich Harris <hello@rich-harris.dev>
* use existing teardown function
* set up stores and unsubscriptions in one go
* we never set last_value, this is gibberish
* simplify
* tidy up
* inline
* more
* only call mark_reactions when updating a source
* move mark_reactions to where it belongs, remove force_schedule stuff
* tweak
* move inspect_effects to where it is used
* this is wrong
* remove obsolete comment
* tweak
* reconnect on get
* try marking unowneds as clean
* tidy up
* tidy up
* simplify
* typo
* don't bother caching length
* fix lint
---------
Co-authored-by: Dominic Gannaway <dg@domgan.com>
* add some explanatory comments
* rename variables
* var
* this appears to be unnecessary?
* more renaming
* surely we only care about array.length?
* no need to cache this, it isnt faster AFAICT
* comment
* remove unnecessary casting
* again
* fix: further avoid duplicate signal dependencies
visitor
another approach
tune
tune
* add test
* clean up test
* early return to reduce indentation, use var over let/const
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>