Paolo Ricciuti
32c4e47060
fix: always set draggable through `setAttribute` to avoid weird behavior ( #12649 )
...
Closes #12643
Very weird behaviour from the draggable setter...if you set element.draggable="false" it will actually set draggable to true (the boolean).
2 months ago
Dominic Gannaway
e417d3a2d2
fix: remove implicit passive behavior from OnDirective events ( #12645 )
...
Fixes #12639
2 months ago
github-actions[bot]
5817767a87
Version Packages (next) ( #12641 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2 months ago
Rich Harris
5d82cf1f03
feat: remove `$.unwrap` calls from `bind:group` ( #12642 )
...
* add each.metadata.keyed
* simplify
* feat: remove `$.unwrap` from `bind:group` code
* changeset
* regenerate types
2 months ago
Rich Harris
219ba6a71b
fix: error on `bind:this` to each block parameter ( #12638 )
...
* chore: remove outdated comment
* fix: error on `bind:this` to each block parameter
2 months ago
Rich Harris
7af0e604d8
feat: remove `$.unwrap` calls from each block indexes ( #12640 )
...
* remove $.unwrap from key functions
* feat: remove `$.unwrap` calls from each block indexes
* tweak
2 months ago
github-actions[bot]
1d17677131
Version Packages (next) ( #12613 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2 months ago
Simon H
32af9434bc
fix: never set custom element props as attributes ( #12622 )
...
* fix: never set custom element props as attributes
* changeset
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
2 months ago
Rich Harris
97d5cf178f
chore: simplify assignments in server code ( #12614 )
...
Also fixes an uncovered bug where store `+=/-=` etc assignments were not serialized correctly on the server
2 months ago
Rich Harris
c66d2cfcc1
feat: better code generation for `let:` directives in SSR mode ( #12611 )
...
* better code generation for slot props in SSR
* simplify
* remove getters mechanism from server compiler
* changeset
* no need to use getters in SSR mode
* fix comment
2 months ago
github-actions[bot]
beea5c3772
Version Packages (next) ( #12609 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Rich Harris <rich.harris@vercel.com>
2 months ago
github-actions[bot]
ff27753742
Version Packages (next) ( #12583 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2 months ago
Simon H
13d86e9019
feat: allow `:global` in more places (alternative) ( #12560 )
...
* `div { :global { &.x { ... } } }` is equivalent to `div:global.x { ... }`, so the latter should be allowed, too
* finalize
* replace obsolete breaking change (which turned out to be a wrong change and was since reverted), add new breaking change note
* changeset
* regenerate types
* Update sites/svelte-5-preview/src/routes/docs/content/03-appendix/02-breaking-changes.md
Co-authored-by: Rich Harris <rich.harris@vercel.com>
* always remove descendant selector before global
* error on lone `:global` with nested `&`, revert "remove spaces" rule
* regenerate types
* documentation
* oops
* switch to removing descendant combinator
* fix
* revert combinator validation relaxation
* error on first global being modified
* tweak docs
* tweak error messages
* Update documentation/docs/02-template-syntax/05-styles-and-classes.md
Co-authored-by: Rich Harris <rich.harris@vercel.com>
* clarify
* tweak messages
* update tests
* tweak docs
* tweak `:global(...)` docs
* tweak docs
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
2 months ago
Dominic Gannaway
5a07219836
fix: add missing hydration mismatch call-site ( #12604 )
...
* fix: add missing hydration mismatch call-site
* add changeset
* Update playgrounds/demo/index.html
Co-authored-by: Conduitry <git@chor.date>
---------
Co-authored-by: Conduitry <git@chor.date>
2 months ago
Dominic Gannaway
afa3128d2f
breaking: avoid flushing queued updates on mount/hydrate ( #12602 )
...
* Revert "Revert "breaking: avoid flushing queued updates on mount/hydrate" (#1…"
This reverts commit 8d139210b7
.
* fix legacy wrapper
* lint
* docs
* duplicate
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
2 months ago
Dominic Gannaway
7a8cf3a9a1
fix: ensure directives run in sequential order ( #12591 )
...
Co-authored-by: Rich Harris <rich.harris@vercel.com>
2 months ago
Rich Harris
8d139210b7
Revert "breaking: avoid flushing queued updates on mount/hydrate" ( #12593 )
...
* Revert "breaking: avoid flushing queued updates on mount/hydrate (#12587 )"
This reverts commit 20b879717a
.
* Update packages/svelte/src/internal/client/render.js
2 months ago
Dominic Gannaway
20b879717a
breaking: avoid flushing queued updates on mount/hydrate ( #12587 )
...
* breaking: avoid flushing queued updates on mount/hydrat
* Fix tests
* Update packages/svelte/src/internal/client/render.js
Co-authored-by: Rich Harris <rich.harris@vercel.com>
* tweak
* tweak
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
2 months ago
Dominic Gannaway
abaa4413df
fix: tweak element_invalid_self_closing_tag to exclude namespace ( #12585 )
2 months ago
Dominic Gannaway
37f58cf318
fix: apply dynamic event fixes to OnDirective ( #12582 )
...
* fix: apply dynamic event fixes to OnDirective
* build
2 months ago
github-actions[bot]
c18221dcc3
Version Packages (next) ( #12579 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2 months ago
Simon H
c0832fd85d
fix: exclude `bind:this` from reactive state validation ( #12566 )
2 months ago
Rich Harris
cf8df0bacc
chore: remove `binding.expression` ( #12530 )
...
* add state.getters as alternative to binding.expression
* on second thoughts
* fix
* first of many
* couple more
* regenerate types
* more
* another
* more
* another
* another
* another
* remove binding.expression from client-side code
* tweak
* last one
* comment
* regenerate types
* add a changeset
* small tidy up
* simplify
* simplify
* simplify and fix
* simplify
2 months ago
github-actions[bot]
9b512ca91d
Version Packages (next) ( #12576 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2 months ago
Rich Harris
9f3ed8968f
fix: correctly set anchor inside HMR block ( #12575 )
2 months ago
github-actions[bot]
5669c7de4f
Version Packages (next) ( #12552 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2 months ago
Dominic Gannaway
d17755a8b5
fix: ensure dynamic event handlers are wrapped in a derived ( #12563 )
...
* fix: ensure dynamic event handlers are wrapped in a derived
* fix test
* feedback
* more feedback
* address feedback
* we have .svelte.js files
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
2 months ago
Dominic Gannaway
d73c5b8434
fix: ensure $state.snapshot correctly clones Date objects ( #12564 )
2 months ago
Rich Harris
7b2279d84c
chore: tidy up dynamic event handler generated code ( #12553 )
...
* chore: tidy up dynamic event handler generated code
* actually we need a proper function
2 months ago
Simon H
e2b75d1a6e
fix: properly update store values ( #12562 )
...
We need to extend the "don't use `set` on first run" logic to the falsy branch aswell
Fixes #12558
2 months ago
Rich Harris
72f5539f51
fix: remove runtime validation of components/snippets, rely on types instead ( #12507 )
...
closes #12446
2 months ago
Dominic Gannaway
90d6f573e3
fix: dynamic event delegation for stateful call expressions ( #12549 )
2 months ago
github-actions[bot]
55400fd16c
Version Packages (next) ( #12548 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2 months ago
Rich Harris
6fdfc537e4
fix: update original source in HMR update ( #12547 )
...
* fix: update original source in HMR update
* tidy up
* comments
* oops
2 months ago
github-actions[bot]
53d32d4dfe
Version Packages (next) ( #12536 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2 months ago
Rich Harris
73ac4fe456
fix: only emit binding_property_non_reactive warning in runes mode ( #12544 )
2 months ago
Rich Harris
fd5cfd77d8
fix: correctly set filename on HMR wrappers ( #12543 )
...
* fix: correctly set filename on HMR wrappers
* changeset
2 months ago
Dominic Gannaway
346cf96599
fix: bail-out of hydrating head if no anchor is found ( #12541 )
...
* fix: bail-out of hydrating head if no anchor is found
* add failing test
* fix
* fix comment
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
2 months ago
Dominic Gannaway
518d9854f5
chore: add warning for invalid render function of createRawSnippet ( #12535 )
...
* chore: add warning for invalid render function of createRawSnippet
* add test
* warnings
* Update packages/svelte/messages/client-warnings/warnings.md
Co-authored-by: Rich Harris <rich.harris@vercel.com>
* build
* build
* build
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
2 months ago
github-actions[bot]
ca2f02c23e
Version Packages (next) ( #12515 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2 months ago
Rich Harris
ff080cbbdc
fix: improve validation error that occurs when using `{@render ...}` to render default slotted content ( #12521 )
...
* add invalid_default_snippet error message
* fix: improve validation error that occurs when using `{@render ...}` to render default slotted content
* cheeky hack to keep treeshakeability until we can nuke this validation altogether
2 months ago
Rich Harris
f402d01454
fix: reset hydrate_node after `hydrate(...)` ( #12512 )
2 months ago
github-actions[bot]
30b143cef0
Version Packages (next) ( #12504 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2 months ago
Simon H
e02c90209b
fix: make animations more robust to quick shuffling ( #12496 )
...
Previously, if transitions/animations were playing in quick succession, overlapping each other, it could have disastrous outcomes, leading to elements jumping all over the place.
This PR gets that into much better state (not completely fixed, but close) by applying a few fixes:
- destructure style object from `getComputedStyles`, because it's a live object with getters and we're interested in the fixed values at the beginning
- `unfix` for animations didn't reset the transition styles
- don't apply `fix` when we detect already-running animations on the element. That means it's already away from its original position, and doesn't need fixing. Worse, applying an absolute position can lead to the element jumping to the top left if the running animation also applies a transition style - those take precedence over the one we would apply
fixes #10252
2 months ago
Dominic Gannaway
20e6508c47
fix: ensure $state proxy invokes set accessor if present ( #12503 )
2 months ago
Rich Harris
2ce2b7d98b
feat: warn if binding to a non-reactive property ( #12500 )
...
* feat: warn if binding to a non-reactive property
* tweak
2 months ago
github-actions[bot]
919e7adaa8
Version Packages (next) ( #12487 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2 months ago
Simon H
5d82573dcd
fix: properly assign trailing comments ( #12471 )
...
* fix: properly assign trailing comments
Trailing comments were added even if they started before the node end, which violates the definition of trailing comments.
This fixes that, with the consequence that some comments no longer show up in the AST at all. Previously they were stuffed _somewhere_, but arguably at the wrong positions. For example the last comment in a function body got assigned as a trailing comma for the body, which is wrong, because the body ends _after_ the comma.
The special case is comments at the end of an expression tag - they are added even if there are multiple, and they are added regardless of whether they are separated by newlines or not. This ensures the expression tag end is calculated correctly.
Fixes #12466
* support multiple trailing comments after last statement in a body
* simplify, handle object and array expressions
2 months ago
Simon H
48c5503b53
fix: set volume through DOM property ( #12485 )
...
Already works when using spread attributes, but not when setting it on its own
fixes #12029
2 months ago
Simon H
35ab21df93
fix: don't add imports to hoisted event parameters ( #12493 )
...
fixes #12489
2 months ago