github-actions[bot]
6e8131d826
Version Packages (next) ( #11767 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
5 months ago
Simon H
7a1326be06
fix: handle `this` parameter in TypeScript-annotated functions ( #11795 )
...
fixes #11731
5 months ago
Rich Harris
5fb017df92
fix: allow classes to be reassigned ( #11794 )
5 months ago
FoHoOV
4fef0eb08f
fix: capture the correct event names when spreading attributes ( #11783 )
...
fixes #11777
We need to scope the `key` variable because it may be captured in a closure
5 months ago
Paolo Ricciuti
ee9d5ef850
fix: allow global next to `&` for nesting ( #11784 )
...
Fixes #11782
5 months ago
FoHoOV
b963e53fc9
fix: parse ongotpointercapture and onlostpointercapture events correctly ( #11790 )
...
Fixes #11789
5 months ago
Rich Harris
d1f5d5d33d
fix: only inject push/pop/$$props in SSR components when necessary ( #11771 )
5 months ago
Paolo Ricciuti
9084f1796b
fix: allow runelike writable as prop ( #11768 )
...
Fixes #11742
5 months ago
Paolo Ricciuti
d856c50092
fix: `array.lastIndexOf` without second argument ( #11766 )
...
Fixes #11756
lastIndexOf seems to be using arguments internally so passing undefined is different from not passing it
5 months ago
github-actions[bot]
3dfa343ea2
Version Packages (next) ( #11753 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
5 months ago
Paolo Ricciuti
7dacf2c4d4
fix: use svg methods for updating svg attributes too ( #11755 )
...
Closes #11746
we were using the svg methods for every child of svg but not for svg itself
5 months ago
Paolo Ricciuti
5765752d78
fix: throw on invalid attribute expressions ( #11736 )
...
In runes mode only to prevent a breaking change solely from upgrading to Svelte 5
Closes #11734
5 months ago
Rich Harris
ba429fd2f1
fix: don't use console.trace inside dev warnings ( #11744 )
...
Chrome does include a trace for warnings, Firefox does not, but the vast majority of devs uses Chromium-based browsers for dev, so this reduces noise
5 months ago
Paolo Ricciuti
e73b133b66
fix: don't warn on link without href if aria-disabled ( #11737 )
...
Also don't warn on a tag without a href attribute and link role
fixes #11733
5 months ago
github-actions[bot]
152961a649
Version Packages (next) ( #11745 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
5 months ago
Dominic Gannaway
fe51cde1fa
breaking: event handlers + bindings now yield effect updates ( #11706 )
...
* breaking: delegated event handlers now yield effect updates
* tweak
* refactor
* refactor
* yield binding change events
* handle input event bindings
* more bindings
* more bindings
* more tests
* more tests
* address feedback
* address feedback
5 months ago
github-actions[bot]
3498df842b
Version Packages (next) ( #11743 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
5 months ago
Dominic Gannaway
a074734ba7
fix: ensure we clear down each block opening anchors from document ( #11740 )
...
* fix: ensure we clear down each block opening anchors from document
* fix: ensure we clear down each block opening anchors from document
5 months ago
github-actions[bot]
c3489eb5de
Version Packages (next) ( #11714 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
5 months ago
Paolo Ricciuti
77f91459b6
fix: update value like attributes in a separate template_effect ( #11720 )
...
* fix: update value like attributes in a separate template_effect
* chore: remove unnecessary commented code
* chore: add test for spread values
5 months ago
Simon H
c21f019a4b
chore: speedup hydration around input and select values ( #11717 )
...
* chore: speedup hydration around input and select values
* use idle tasks to do the work
---------
Co-authored-by: Dominic Gannaway <dg@domgan.com>
5 months ago
Paolo Ricciuti
6d2f1a48b4
fix: allow comments after last selector in css ( #11723 )
...
Fixes #11721
5 months ago
Rich Harris
0128df33da
fix: don't add scoping modifier to nesting selectors ( #11713 )
5 months ago
Dominic Gannaway
09addad9ae
fix: improve handling of unowned derived signal ( #11712 )
5 months ago
github-actions[bot]
fba6b5676b
Version Packages (next) ( #11663 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
5 months ago
Paolo Ricciuti
f48001ac63
fix: check for invalid bindings on window and document ( #11676 )
...
Fixes #11673
5 months ago
Paolo Ricciuti
b788b72862
fix: migrate derivations without semicolons ( #11704 )
...
Closes #11689
5 months ago
Dominic Gannaway
a5fd28a14b
fix: inline pointer events now correctly work in Chrome ( #11695 )
...
* fix: inline pointer events now correctly work in Chrome
* fix more
5 months ago
Simon H
1784026843
fix: don't require commas between warnings in legacy mode ( #11669 )
...
also add commas in migration
closes #11666
6 months ago
Rich Harris
c70533a5a7
fix: more efficient spread attributes in SSR output ( #11660 )
...
* fix: more efficient spread attributes in SSR output
* more tweaks
6 months ago
github-actions[bot]
62e2647c8a
Version Packages (next) ( #11656 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
6 months ago
Rich Harris
c29b74669d
feat: migrate `<svelte:element this="div">` ( #11659 )
6 months ago
Simon H
110a5a852f
fix: robustify `bind:scrollX/Y` binding ( #11655 )
...
- we were scrolling to the given value, which we shouldn't for accessibility reasons (Svelte 4 didn't do it either)
- we need to notify of the value 0 if there's no scroll (https://github.com/sveltejs/svelte/issues/11623#issuecomment-2113495573 )
6 months ago
Rich Harris
d288735fa8
breaking: disallow string literal values in `<svelte:element this="...">` ( #11454 )
...
* breaking: disallow string literal values in `<svelte:element this="...">`
* note breaking change
* Update sites/svelte-5-preview/src/routes/docs/content/03-appendix/02-breaking-changes.md
Co-authored-by: Jeremiasz Major <jrh.mjr@gmail.com>
* prettier
* make invalid `<svelte:element this>` a warning instead of an error (#11641 )
* make it a warning instead of an error
* format
---------
Co-authored-by: Jeremiasz Major <jrh.mjr@gmail.com>
6 months ago
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
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
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
Dominic Gannaway
e5e7ec2404
fix: better handle img loading attribute ( #11635 )
...
* fix: better handle img loading attribute
* better fix
* switch to symbol
6 months ago
Paolo Ricciuti
87a420f64d
feat: error when snippet shadows a prop ( #11631 )
...
Closes #11603
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
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
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
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
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
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
github-actions[bot]
816335f906
Version Packages (next) ( #11561 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
6 months ago
Dominic Gannaway
643bbf2be2
Better process effects ( #11560 )
...
* fix: improve internal mechanism for handling process_effects
6 months ago
github-actions[bot]
4cadd07676
Version Packages (next) ( #11559 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
6 months ago
Dominic Gannaway
a3702e8171
fix: adjust heuristics for effect_update_depth_exceeded ( #11558 )
...
* fix: adjust heuristics for effect_update_depth_exceeded
* fix: adjust heuristics for effect_update_depth_exceeded
* fix: further adjust heuristics for effect_update_depth_exceeded
6 months ago
github-actions[bot]
18f61a575f
Version Packages (next) ( #11554 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
6 months ago
Dominic Gannaway
43ad72b1ce
fix: adjust heuristics for effect_update_depth_exceeded ( #11557 )
...
* fix: adjust heuristics for effect_update_depth_exceeded
* fix: adjust heuristics for effect_update_depth_exceeded
6 months ago
Dominic Gannaway
597715ff98
fix: improved $inspect handling of reactive Map/Set/Date ( #11553 )
6 months ago
github-actions[bot]
7e9b109de6
Version Packages (next) ( #11541 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
6 months ago
Dominic Gannaway
c450cdb7a7
fix: better support for lazy img elements ( #11545 )
...
* fix: better support for lazy img elements
* tune
* fix
6 months ago
Dominic Gannaway
fcc72ae2f3
feat: provide better error messages in DEV ( #11526 )
...
* feat: provide better error messages in DEV
* fix stuff
* fix stuff
* fix tests
* fix
* assert.include results in better errors on mismatches
* remove indentation
* tweak
* rename
* fix issues
* more fixes
* more fixes
* neaten up stack trace
* Update packages/svelte/src/internal/client/reactivity/effects.js
Co-authored-by: Rich Harris <rich.harris@vercel.com>
* Update packages/svelte/src/internal/client/runtime.js
Co-authored-by: Rich Harris <rich.harris@vercel.com>
* address feedback
* lint
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
6 months ago
Simon H
641e411cf1
fix: ensure spread events are always added ( #11535 )
...
In edge cases it may happen that set_attributes is re-run before the effect is executed. In that case the render effect which initiates this re-run will destroy the inner effect and it will never run. But because next and prev may have the same keys, the event would not get added again and it would get lost. We prevent this by using a root effect.
The added test case doesn't fail for some reason without this fix, but it does fail when you test it out manually, so I still added it.
Found through https://github.com/sveltejs/svelte/issues/10359#issuecomment-2101167524
6 months ago
Simon H
31f8fea22d
fix: don't warn on writes to `$state` ( #11540 )
...
fixes #10905
6 months ago
Simon H
65223363e9
fix: handle falsy prop aliases correctly ( #11539 )
...
fixes #10854
6 months ago
github-actions[bot]
59f4feb4d8
Version Packages (next) ( #11518 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
6 months ago
Rich Harris
8742823e39
fix: make `$effect.active()` true when updating deriveds ( #11500 )
...
* fix: make `$effect.active()` true when updating deriveds
* WIP
* this seems to work?
* prevent effects being created in unowned deriveds
* update test
* fix issue
---------
Co-authored-by: Dominic Gannaway <dg@domgan.com>
6 months ago
Dominic Gannaway
30caaef2e5
fix: improve behaviour of unowned derived signals ( #11521 )
6 months ago
Paolo Ricciuti
70419daf5f
fix: use snippet as parent element of snippets childrens in validator ( #11463 )
...
* fix: use snippet as parent element of snippets childrens in validator
* Update packages/svelte/src/compiler/phases/2-analyze/validation.js
* Update .changeset/wet-pears-remain.md
---------
Co-authored-by: Rich Harris <hello@rich-harris.dev>
6 months ago
github-actions[bot]
4fb4365567
Version Packages (next) ( #11503 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
6 months ago
Rich Harris
b1b2dddc3b
feat: add support for svelte inspector (alternative approach) ( #11514 )
...
* mostly working
* fix
* fix
* handle dynamic elements too
* add __svelte_meta to prototype
* changeset
* cheeky fix
6 months ago
Dominic Gannaway
f543856cc3
fix: skip AST analysis of TypeScript AST nodes ( #11513 )
...
* fix: skip AST analysis of TypeScript AST nodes
* fix: skip AST analysis of TypeScript AST nodes
* lint
6 months ago
Dominik G
28f3755e40
fix: use acceptExports to support partial hmr ( #11453 )
...
* fix: use acceptExports to support partial hmr
* fix: add condition to only use acceptExports when it is available
* fix: update test snapshot
* fix: format
6 months ago
Paolo Ricciuti
0cf6d56ffe
fix: increment and decrement edge case ( #11506 )
...
* fix: increment and decrement edge case
* fix/simplify test
* simplify
* Apply suggestions from code review
* golf
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
Co-authored-by: Rich Harris <hello@rich-harris.dev>
6 months ago
github-actions[bot]
8318b3d142
Version Packages (next) ( #11474 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
6 months ago
Rich Harris
dca8861c5a
feat: better error for `bind:this` legacy API usage ( #11498 )
6 months ago
Vladislav Logvin
85d680582b
Fix: bind:scroll resets scroll state ( #11469 )
...
* Fixed: bind:scroll resets scroll state
* failing test
* bail if value is undefined
* changeset
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
6 months ago
Simon H
6bd6f0971b
fix: ensure derived is detected as dirty correctly ( #11496 )
...
Deriveds where under certain conditions not detected as dirty correctly. The reason is that a transitive check_dirtiness call could update the flag of a derived, even if the condition doesn't ulimately result to true. That's why the check for "is now dirty" needs to be moved out of the inner if block.
Fixes #11481
This may also fix a yet undetected overfiring bug in the "is unowned" case because the previous inner "is now dirty?" check didn't take unowned into account.
6 months ago
Simon H
d86b05279f
fix: prevent false positive ownership warning ( #11490 )
...
fixes #11483
We need to keep track of the component function similar to how we keep track of the component context, so that effects etc have the correct one associated
6 months ago
Philipp Pracht
3e1f82b8c4
fix: additional check for component on destroy ( #11488 )
...
fixes #10454
6 months ago
Paolo Ricciuti
fa3e98e8c6
fix: allow to access private fields after `this` reassignment ( #11487 )
...
Fixes #11480
Fixes #11476
6 months ago
Paolo Ricciuti
34079a0ec5
fix: restore value after attribute removal during hydration ( #11465 )
...
Fix #11457
6 months ago
github-actions[bot]
272ffc5520
Version Packages (next) ( #11440 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
6 months ago
github-actions[bot]
c0e91a7490
Version Packages (next) ( #11433 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
6 months ago
Simon H
9c1a5063b9
fix: adjust order of `derived` function definition overloads ( #11426 )
...
Turns out the order is crucial for not getting a type error
fixes #11415
6 months ago
Simon H
9c5a9d8e20
fix: mark function properties on runes as deprecated for better intellisense ( #11439 )
...
Ensures that IDEs will order the to the bottom so that the rune variants are on top, better visible
closes #11437
6 months ago
Simon H
6e5ab2e678
fix: prevent ownership validation from infering with component context ( #11438 )
...
Ownership validation had a false positive when rendering a component as slotted content of another component. To fix this, #11401 did set the current component context to the context the snippet was declared in, not to the context it is rendered in. This was flawed because it means that component context was altered in a way that setContext/getContext failed because the parent chain was incorrect. This fixes that by introducing a separate global (dev time only) which tracks the component function the ownership needs.
fixes #11429
6 months ago