paoloricciuti
00f710d06a
chore: add test
1 month ago
paoloricciuti
10dfa18d55
fix: missing space when importing run as in migration
1 month ago
Rich Harris
bc2d30c558
chore: refactor `set_attributes` code generation ( #13353 )
...
* chore: refactor `set_attributes` code generation
* simplify
* simplify
2 months ago
Rich Harris
13cb3855da
chore: refactor `RegularElement` visitor ( #13350 )
...
* WIP
* tidy
* simplify
* simplify
* more
* more
* use a switch
* alphabetize
* simplify
* group stuff
* rename
* simplify
* shuffle
* shuffle
* doh
2 months ago
Rich Harris
9e511b141c
fix: make each items reassignable ( #12257 )
...
* chore: make each items reassignable
* add failing test
* update test
* transform reassigned getters inside each block
* Update .changeset/thirty-guests-flow.md
* comment
* add note
* tidy up
* Update packages/svelte/src/compiler/phases/3-transform/client/visitors/EachBlock.js
2 months ago
Rich Harris
f81f4feab8
chore: simplify attributes ( #13337 )
...
* chore: simplify attributes
* fix/optimise
* unused
2 months ago
Conduitry
1a5cf6fef4
perf: improve get_setters cache ( #13343 )
2 months ago
github-actions[bot]
de157ee1dc
Version Packages (next) ( #13342 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2 months ago
Rich Harris
3aa2ec0813
fix: only set attribute as property if element has setter ( #13341 )
2 months ago
github-actions[bot]
78b134dec1
Version Packages (next) ( #13336 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2 months ago
Rich Harris
b3f3915180
fix: set strings as attributes, non-strings as properties if property exists ( #13327 )
...
* fix: set strings as attributes, non-strings as properties if property exists
* simplify
* remove draggable from list, no longer needed
* in fact we dont need the lookup at all
* lint
* beef up test
* correctly SSR translate attribute
2 months ago
Rich Harris
2553932c2c
fix: only warn on context="module" in runes mode ( #13332 )
...
* fix: only warn on context="module" in runes mode
* wow
2 months ago
Rich Harris
d6ab12ae76
feat: deprecate `<svelte:self>` in runes mode ( #13333 )
...
* feat: deprecate `<svelte:self>` in runes mode
* fix
2 months ago
github-actions[bot]
313bcea6cc
Version Packages (next) ( #13330 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2 months ago
Simon H
c636fc67bc
fix: silence snapshot warnings inside `$inspect` ( #13334 )
...
It's not really actionable and also confusing because the user doesn't see `$state.snapshot` anywhere in their code
2 months ago
Simon H
e4926d7507
docs: note html structure breaking change ( #12991 )
2 months ago
Dominic Gannaway
db6545d173
fix: keep bound inputs in sync in runes mode ( #13328 )
...
* fix: keep bound inputs in sync in runes mode
* small tweak, add more detailed explanatory comment
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
2 months ago
github-actions[bot]
00cc3640b1
Version Packages (next) ( #13329 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2 months ago
Rich Harris
321e3eafa7
feat: better `flip` animations ( #13317 )
...
* fix: flip not accounting for scaled lengths
* zoom is uniform, one calculation will do
* stash width/height multipliers
* use var
* scale-first appears to work better?
* more robust zoom calculation
* changeset
---------
Co-authored-by: Etai Nadler <75544136+etainad008@users.noreply.github.com>
2 months ago
github-actions[bot]
d65304007d
Version Packages (next) ( #13319 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2 months ago
Simon H
5dbe763792
fix: don't make wheel events passive by default ( #13322 )
...
This was done previously to align with browser behavior, but the browser behavior actually only makes them passive on window/document/body. Since wheel events are not delegated, we can revert their passive-by-default setting. Closes #13318
For touchstart/touchmove we're not changing it because these events are delegated, which means they happen a lot more often on a target higher up the tree, which may cause jank.
2 months ago
Rich Harris
0ef14b5128
chore: more `process_effect` tweaks ( #13315 )
...
* consolidate more stuff
* simpler
* simplify
* comment is unnecessary, this is the first time we read current_effect.first
2 months ago
Rich Harris
5d56c592ff
fix: delete transformers shadowed by unreassigned state ( #13316 )
...
fixes #13314
2 months ago
github-actions[bot]
b3842d7982
Version Packages (next) ( #13311 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2 months ago
Rich Harris
19179822c3
create effect root for custom element ( #13312 )
2 months ago
Rich Harris
1d1e4aeeb1
fix: attach effects-inside-deriveds to the parent of the derived ( #13309 )
...
* WIP
* fix types
* ensure effects with deriveds are added to the tree
* test
* changeset
* oops
2 months ago
Dominic Gannaway
c4d8d405c9
fix: ensure component effects have the correct reaction owner ( #13308 )
...
* fix: ensure component effects have the correct reaction owner
* fix: ensure component effects have the correct reaction owner
* lint
2 months ago
Simon H
b23516121b
fix: handle `$$Props` interface during migration ( #13305 )
...
fixes #13178
2 months ago
Simon H
d338e8083f
fix: simplify and robustify appending styles ( #13303 )
...
#13225 did not fully fix the described issue: As soon as you have a child component, that child component's anchor will not be in the right ownerDocument yet, and so the logic falls down.
To fix that, we would need to move the ownerDocument check into the microtask - and that map check was mainly done to avoid just that. So instead I opted to simplify the code and just remove the map checks. According to my benchmarking (https://jsbench.me/3hm17l0bxl/1 ) this has no impact on performance assuming that you'll have cache hits roughly half the time - and even if you'd have much more cache hits, the performance loss is microscopic. Given that the default mode is to not inject styles, this will not be common anyway, so I favor removing that map.
2 months ago
github-actions[bot]
f852a6890b
Version Packages (next) ( #13304 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2 months ago
Rich Harris
b4417383d6
chore: improve performance of scheduling effects (but without creating additional branches) ( #13300 )
...
* fix: improve performance of scheduling effects
* alternative fix
* add comment
* use same codepath
* use same codepath
* address feedback
* tweak
* more tweaks
* more tweaks
* address feedback
* remove EFFECT_HAS_DIRTY_CHILDREN
* revert
* mark effect root as queued instead of adding a branch effect
* revert
* revert
* unused
* revert
---------
Co-authored-by: Dominic Gannaway <dg@domgan.com>
2 months ago
github-actions[bot]
dbc5793533
Version Packages (next) ( #13293 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2 months ago
Paolo Ricciuti
e3c56fab4f
fix: correctly migrate sequence expressions ( #13291 )
...
* fix: correctly migrate sequence expressions
* remove unwanted parens
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
2 months ago
Dominic Gannaway
09527fd190
fix: avoid disconnecting deriveds that are still active ( #13292 )
...
* fix: ensure the if block condition is wrapped in a derived
* add test
* tidy
* fix key block
* fix key block test
* alternative approach
* changeset
* Update packages/svelte/src/internal/client/runtime.js
Co-authored-by: Rich Harris <rich.harris@vercel.com>
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
2 months ago
Rich Harris
9d1394fb9d
chore: remove unused DESTROYED check ( #13294 )
2 months ago
James Glenn
c229e0f80b
feat: a11y warning for `<button>` / `<a>` without aria-label and content ( #13130 )
...
* Introduce button a11y warnings
* Log changeset
* Don't check for label if aria-hidden
* State based flag to avoid multiple warnings firing
* Update existing validators to include aria labels
* false positives are okay, false negatives aren't
* prefer text over aria-label in tests
* remove unnecessary aria-labels
* tweak message
* update test
* fix
* simplify
* various
* DRY out
* Apply suggestions from code review
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
Co-authored-by: Rich Harris <hello@rich-harris.dev>
2 months ago
github-actions[bot]
758fb2aa0f
Version Packages (next) ( #13290 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2 months ago
Maxime LUCE
5210ae2610
fix: allow component to be mounted in iframe ( #13225 )
...
* fix: allow component to be mounted in iframe
* prettier
* prettier
* fix: allow HMR cleanup styles in iframe and custom elements
* add test
* avoid creating unnecessary microtasks
* simplify
* rename stuff
* typo
* lint
* changeset
* changeset
---------
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
Co-authored-by: Rich Harris <rich.harris@vercel.com>
Co-authored-by: Rich Harris <hello@rich-harris.dev>
2 months ago
Ben McCann
a680e6f2e7
chore: bump @sveltejs/eslint-config ( #13288 )
2 months ago
Simon H
36168286ba
fix: ensure snapshot logs don't affect dependency graph ( #13286 )
...
* fix: ensure snapshot logs don't affect dependency graph
untrack the whole function
See https://github.com/sveltejs/svelte/pull/13142#issuecomment-2354116248
* try-catch
* appease eslint
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
2 months ago
github-actions[bot]
e7f51e4982
Version Packages (next) ( #13272 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2 months ago
Rich Harris
a88e2dc6fe
chore: tweak template generation logic ( #13283 )
...
* chore: tweak template generation logic
* collapse
* simplify
2 months ago
Rich Harris
2a1d1c1282
bump vite ( #13281 )
...
* bump vite
* dedupe
* bump vite in svelte-5-playground as well
---------
Co-authored-by: Conduitry <git@chor.date>
2 months ago
Dominic Gannaway
b624380c45
fix: ensure correct parent effect is associated with render effects ( #13274 )
...
* fix: ensure correct parent effect is associated with render effects
* fix
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
2 months ago
Dominic Gannaway
eba64f7cb3
chore: improve runtime variable naming ( #13275 )
2 months ago
Simon H
ed7611b163
feat: provide guidance in browser console when logging `$state` objects ( #13142 )
...
* feat: provide guidance in browser console when logging `$state` objects
Wrap console.log/warn/error statements in DEV mode with a check whether or not they contain state objects. Closes #13123
This is an alternative or enhancement to #13070 . Alternative if we deem it the better solution. Enhancement because it's not as robust as a custom formatter: We only check the top level of each entry (though we could maybe traverse a few levels), and if you're logging class instances, snapshot currently stops at the boundaries there and so you don't get snapshotted values for these (arguably this is a more general problem of $inspect and $state.snapshot), whereas with custom formatter it doesn't matter at which level you come across it.
* lint
* use normal warning mechanism, so we can link to docs etc
* add a few more methods
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
2 months ago
Rich Harris
836bc605f4
feat: omit unnecessary setters from bindings ( #13269 )
...
* remove unnecessary closure
* lint
* reuse logic
* feat: omit unnecessary setters in bindings
* changeset
---------
Co-authored-by: adiguba <frederic.martini@gmail.com>
2 months ago
github-actions[bot]
c1d8eb375d
Version Packages (next) ( #13257 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2 months ago
Paolo Ricciuti
3864229418
fix: separate `template_effect` for dynamic class/style directive with dynamic attributes ( #13171 )
...
* fix: separate `template_effect` for dynamic class/style directive with dynamic attributes
* fix: only move to `init` if it `has_call`
* fix: initialize spread `needs_isolation` based on if there are directives with `has_call`
* fix: revert splitting templates and generate deriveds instead
* small tweaks
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
2 months ago
Ben McCann
6b69de79fa
fix: import process for improved Deno compatibility ( #13204 )
2 months ago