Simon H
c2f75dc7ba
fix: use coarse-grained updates for derived expressions in legacy mode ( #11652 )
...
fixes #11648
Also deduplicates the code a bit
6 months ago
Dominic Gannaway
54083fb9cc
fix: replay load and error events on load during hydration ( #11642 )
...
* fix: replay load and error events on load during hydration
* oops
* fix replacement logic
* make less evasive
* address feedback
* address feedback
* address feedback
* Update packages/svelte/src/internal/client/dom/elements/events.js
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
* address feedback
* Update packages/svelte/src/internal/client/dom/elements/attributes.js
Co-authored-by: Rich Harris <rich.harris@vercel.com>
* Update packages/svelte/src/internal/client/dom/elements/attributes.js
Co-authored-by: Rich Harris <rich.harris@vercel.com>
* address more feedback
* address more feedback
---------
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
Co-authored-by: Rich Harris <rich.harris@vercel.com>
6 months ago
Rich Harris
7b9fad4b0e
chore: remove `handle_compile_error` ( #11639 )
...
We don't need the awkward handle_compile_error stuff any more, because the relevant information now lives in state.js
6 months ago
Rich Harris
2ebb277be7
feat: more information when hydration fails ( #11649 )
...
In the case of an invalid child element, we already get information about the parent and the child, but in other cases where a mismatch could occur you're pretty much on your own.
This adds a bit more context to hydration_mismatch warnings — 'The error occurred near ...'
6 months ago
github-actions[bot]
019b26b775
Version Packages (next) ( #11645 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
6 months ago
Dominik G
dc9b0d08c1
feat: add rootDir option and set __svelte_meta.file like in svelte4 ( #11627 )
...
* feat: add rootDir option and set __svelte_meta.file like in svelte4
* Update packages/svelte/src/compiler/validate-options.js
* update tests
* centralise logic
* fix
* note to self
* Apply suggestions from code review
* lint
* one dollar towards the windows backslash bugfix foundation please
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
6 months ago
Rich Harris
2e7e399160
chore: use indirect eval, avoid exposing stuff to the global scope ( #11646 )
...
* chore: use indirect eval, avoid exposing stuff to the global scope
* prettier
6 months ago
Dominic Gannaway
c131e6f494
Revert "chore: ensure we use event system code paths throughout" ( #11644 )
...
* Revert "chore: ensure we use event system code paths throughout (#11640 )"
This reverts commit c00d8245ee
.
* Update packages/svelte/src/internal/client/dom/elements/attributes.js
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
6 months ago
Rich Harris
3bf68b4765
fix: make messages more consistent ( #11643 )
6 months ago
Dominic Gannaway
053159bf0b
fix: avoid state_referenced_locally warning within type annotations ( #11638 )
...
* fix: avoid state_referenced_locally warning within type annotations
* better fix
* prettier
* better fix
* fix
* fix
* fix
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
6 months ago
Dominic Gannaway
c00d8245ee
chore: ensure we use event system code paths throughout ( #11640 )
6 months ago
Rich Harris
a7b61c0f30
docs: use a canvas demo for `$effect` ( #10745 )
...
* use a canvas demo for effect docs
* use js block
* update text
* fix
6 months ago
github-actions[bot]
ec25208ba4
Version Packages (next) ( #11617 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
6 months ago
Simon H
4365562228
fix: deduplicate children prop from default slot ( #10800 )
...
* feat: provide isSnippet type, deduplicate children prop from default slot
fixes #10790
part of #9774
* fix ce bug
* remove isSnippet type, adjust test
* fix types
* revert unrelated changes
* remove changeset
* enhance test
* fix
* fix
* fix
* fix, different approach without needing symbol
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
6 months ago
Mathias
cac8630de6
chore: use CustomEvent constructor instead of deprecated createEvent method ( #11629 )
...
* chore: use CustomEvent constructor instead of deprecated createEvent method
* while we're here...
* changeset
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
6 months ago
Simon H
4bedd0e4fb
feat: error on imports to `svelte/internal/*` ( #11632 )
...
* feat: error on imports to `svelte/internal/*`
closes #11622
* regenerate
* also error on svelte/internal
6 months ago
Simon H
13ce43a0a8
docs: document more breaking changes ( #11636 )
...
* docs: document more breaking changes
Related to #11400
closes #11590
* Update sites/svelte-5-preview/src/routes/docs/content/03-appendix/02-breaking-changes.md
Co-authored-by: Rich Harris <rich.harris@vercel.com>
* Update sites/svelte-5-preview/src/routes/docs/content/03-appendix/02-breaking-changes.md
Co-authored-by: Rich Harris <rich.harris@vercel.com>
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
6 months ago
Dominic Gannaway
4f8bba2f80
fix: cleanup array prototype monkeypatching ( #11634 )
...
* fix: cleanup array prototype monkeypatching
* Update packages/svelte/src/internal/client/dev/equality.js
---------
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
6 months ago
Dominic Gannaway
e5e7ec2404
fix: better handle img loading attribute ( #11635 )
...
* fix: better handle img loading attribute
* better fix
* switch to symbol
6 months ago
adiGuba
6f28e41b6d
chore: tidy up scrolling code logic ( #11630 )
...
---------
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
6 months ago
Paolo Ricciuti
87a420f64d
feat: error when snippet shadows a prop ( #11631 )
...
Closes #11603
6 months ago
Simon H
573b9f1d74
fix: adjust unknown code warning offset ( #11621 )
...
They were the wrong way around
fixes #11612
6 months ago
Dominic Gannaway
7ef686f8ee
feat: provide $state warnings for accidental equality ( #11610 )
...
* feat: provide $state warnings for accidental equality
* tune
* tune
* tune
* adjust test
* fix treeshaking
* fix bugs
* fix bugs
* refactor
* revert test changes
* tune
* tune
* tune
* tune
* fix up
* fix
* remove if(DEV) stuff
* use console.trace, like we do for ownership warnings
* tweak
* tweak message, simplify logic
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
6 months ago
Dominic Gannaway
f488a6e84a
feat: add $state.is rune ( #11613 )
...
* feat: add $state.is rune
* fix type
* tweak docs
* may as well update the test case to match the docs
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
6 months ago
Dominic Gannaway
1087e6fb54
chore: improve SSR invalid element error message ( #11585 )
...
* chore: improve SSR invalid element error message
* move push_element and pop_element into new dev.js file
* pass location info, remove unnecessary if (DEV) block
* use full filename, basename is not very helpful. also, current_component is guaranteed to not be null
* current_element is guaranteed to not be null in pop_element
* tweaks
* remove message prefix - redundant when filenames are included
* add line/column
* make message more concise
* reduce indirection
* only print message once
* update test
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
6 months ago
github-actions[bot]
e97bc79f02
Version Packages (next) ( #11608 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
6 months ago
Dominic Gannaway
a8a5bb668f
fix: improve REPL stringify logic ( #11609 )
...
* fix: improve REPL stringify logic
* fix: improve REPL stringify logic
* Update sites/svelte-5-preview/src/lib/Output/srcdoc/index.html
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
---------
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
6 months ago
Mateusz Kadlubowski
fd437024f5
fix: add missing `modernAst` in `validate_component_options` ( #11542 )
6 months ago
Simon H
faced066bd
feat: migrate warnings ( #11607 )
...
Also contains a changeset for the previous work because we forgot that. Also added more code mappings.
6 months ago
Simon H
2bc39b1de2
chore: better ignore code handling ( #11606 )
...
Instead of hacking an ignores array onto each node (and possibly degrading perf a bit because the object shape is mutated) we keep track of ignores in a stack. The new approach also avoids the indirection the old one had to do because the new approach looks upwards (checking if parent is a fragment) instead of iterating the children (checking for comments in them).
As a bonus unknown code warnings are now in order (line-column-wise) with the other warnings. Also fixes #11482 because text nodes of all shapes are ok
6 months ago
Rich Harris
ac7709f65c
chore: dedupe `getLocator` calls ( #11600 )
...
...by introducing global compiler state that is reset between iterations
6 months ago
Rich Harris
5cb432b7bd
feat: warn on unknown warning codes in runes mode ( #11549 )
...
Related to #11414
---------
Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
6 months ago
Dominic Gannaway
f6b800414d
chore: update run.js to include dev mode on compileModule ( #11601 )
6 months ago
Rich Harris
50a9020d00
reorder eslint ignores
6 months ago
github-actions[bot]
5e9428a65d
Version Packages (next) ( #11580 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
6 months ago
Dominic Gannaway
b964a4ce1d
fix: improve ff handling of lazy images ( #11593 )
...
* fix: improve ff handling of lazy images
* tune
* tune
* tune
* tune
* tune
6 months ago
Rich Harris
b212b17385
fix: skip deriveds for props with known safe calls ( #11595 )
6 months ago
Rich Harris
faa2e937ab
chore: exclude local playground from eslint ( #11596 )
6 months ago
Simon H
d408d20cdd
fix: replicate Svelte 4 props update detection in legacy mode ( #11577 )
...
* fix: replicate Svelte 4 props update detection in legacy mode
fixes #11448 by wrapping props in deriveds
* fix test
* Update packages/svelte/src/compiler/phases/3-transform/client/utils.js
Co-authored-by: Rich Harris <rich.harris@vercel.com>
* dedicated flag
* prettier
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
6 months ago
Simon H
a0bdac8cd7
fix: correctly handle falsy values of style directives in SSR mode ( #11583 )
...
fixes #11044
6 months ago
Matei Trandafir
a2bc0f5f7d
Add documentation for svelte/elements ( #11587 )
...
closes #11451
6 months ago
Dominic Gannaway
dc16668773
chore: improve runtime overhead of creating comment templates ( #11591 )
...
* chore: improve runtime overhead of creating comment templates
* Update packages/svelte/src/internal/client/dom/template.js
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
* changeset
---------
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
Co-authored-by: Rich Harris <rich.harris@vercel.com>
6 months ago
이요
965afc5ccc
docs: correct variable references ( #11582 )
6 months ago
Rich Harris
61bf97210b
chore: improve local playground ( #11575 )
6 months ago
Paolo Ricciuti
81517a506c
fix: allow for non optional chain call expression in render ( #11578 )
6 months ago
github-actions[bot]
61238d0fd3
Version Packages (next) ( #11564 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
6 months ago
Rich Harris
9c680f1030
chore: optimise effects ( #11569 )
...
* optimise effects
* tweak
* don't allocate array unnecessarily
* filter_flags appears to be unnecessary?
* lint
* tweak
* simplify (#11570 )
* changeset
6 months ago
Dominic Gannaway
5497b3d0bc
fix: ensure all effect cleanup functions are untracked ( #11567 )
...
* fix: ensure all effect cleanup functions are untracked
* add test
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
6 months ago
Dominic Gannaway
f6e87772cb
Revert "fix: ensure Svelte action destroy effects are untracked ( #11562 )" ( #11568 )
...
This reverts commit e49f1f7f11
.
6 months ago
Dominic Gannaway
e49f1f7f11
fix: ensure Svelte action destroy effects are untracked ( #11562 )
...
* fix: unesure Svelte action destroy effects are untracked
* fix: unesure Svelte action destroy effects are untracked
6 months ago