* 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>
#12202 revealed that TypeScript has a harder time tracing imports when they are indirectly exposed, e.g. `function foo(): void; ... export { foo }` instead of `export function foo(): void;`, which can lead to bugs down the line (such as in that issue). A new `dts-buddy` version fixes this, which in turn fixes#12202
This also adjustes the `Snippet` type and turns it into an interface, which makes for better intellisense: The type will be unpacked in less situations, resulting a more readable and named type.