github-actions[bot]
efa5acf24e
Version Packages ( #14970 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
8 months ago
Paolo Ricciuti
8a1acac084
fix: never consider inert boundary effects ( #14999 )
...
* fix: never consider inert boundary effects
* chore: inline bitwise
8 months ago
Paolo Ricciuti
9b6e65fbeb
fix: correctly transform `pre` with no content ( #14973 )
...
Closes #14971
8 months ago
Paolo Ricciuti
41fb51349e
fix: store access on component destroy ( #14968 )
...
Co-authored-by: Oscar Dominguez <dominguez.celada@gmail.com>
8 months ago
Dominic Gannaway
dbe5818560
fix: wrap each block expression in derived to encapsulte effects ( #14967 )
...
* fix: wrap each block expression in derived to encapsulte effects
* add test
* Update .changeset/tender-apples-scream.md
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
8 months ago
github-actions[bot]
dc8ae825b8
Version Packages ( #14965 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
8 months ago
Dominic Gannaway
bdc02008e4
fix: reset dependency read versions after reaction execution ( #14964 )
...
* fix: reset dependency read versions after reaction execution
* fix: reset dependency read versions after reaction execution
* fix: reset dependency read versions after reaction execution
* fix: reset dependency read versions after reaction execution
* fix: reset dependency read versions after reaction execution
* chore: add test
* changeset
---------
Co-authored-by: paoloricciuti <ricciutipaolo@gmail.com>
Co-authored-by: Rich Harris <rich.harris@vercel.com>
8 months ago
github-actions[bot]
b7400ae93b
Version Packages ( #14959 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
8 months ago
Rich Harris
c0842d1459
fix: properly add owners to function bindings ( #14962 )
...
Closes #14956
8 months ago
Rich Harris
68cffa8489
fix: apply `overflow: hidden` style when transitioning elements, where necessary ( #14930 )
...
* fix: apply `overflow: hidden` style when transitioning elements, where necessary
* notes to self
8 months ago
Rich Harris
79a67c9561
fix: account for parent scale when animating elements ( #14957 )
...
* WIP fix flip
* fix: account for parent scale when animating elements
8 months ago
github-actions[bot]
80d9f9996f
Version Packages ( #14953 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
8 months ago
Simon H
9aae463ae1
fix: silence false-positive statel value warning ( #14958 )
...
fixes #14687
8 months ago
Simon H
a2565efa37
docs: tweak "invalid assignment" compiler error message ( #14955 )
...
* docs: tweak "invalid assignment" compiler error message
fixes #14702
* tweak wording
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
8 months ago
Rich Harris
ce4f9722da
fix: remove bindable prop validation ( #14946 )
8 months ago
github-actions[bot]
9b71eea35d
Version Packages ( #14943 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
8 months ago
Rich Harris
d41801c75f
feat: warn on using `slide` transition with invalid `display` styles ( #14936 )
...
* feat: warn on using `slide` transition with table elements
* more generic
* more generic
8 months ago
Rich Harris
4d2cb2734b
fix: prevent long delays causing erratic spring behaviour ( #14940 )
8 months ago
Rich Harris
d245bab63a
feat: allow non-numeric values to be tweened by snapping immediately to new value ( #14941 )
8 months ago
Rich Harris
adee13d98c
fix: account for min-width/height in `slide` transition ( #14942 )
8 months ago
Dominic Gannaway
9c20eb4815
chore: improve signal performance by reducing duplicate deps ( #14945 )
...
* chore: expand benchmark iterations
* chore: improve signal performance by reducing duplicate deps
* feedback
* oops
8 months ago
Caique Torres
48e3db21c1
fix: default values in object destructuring ( #14554 )
...
* fix: enhance string/expression length check and fix closing character issues
* docs: add documentation for unterminated_string_constant error
* test: add tests for object destructuring with default values in "each" blocks
* Update .changeset/clean-planets-rush.md
* refactor: clean up unnecessary comments and whitespace
* fix: resolve formatting issues
* simplify
* tweak
* regenerate
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
8 months ago
github-actions[bot]
4aadb34c02
Version Packages ( #14924 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
8 months ago
Simon H
08061c85da
fix: guard against `customElements` being unavailable in browser extension contexts ( #14933 )
...
fixes #14739
8 months ago
Simon H
8241096b06
fix: treat `inert` as a boolean attribute ( #14935 )
...
* fix: treat `inert` as a boolean attribute
fixes #14731
* remove solo: true
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
8 months ago
Matthijs
c8865bb4a7
fix: make Tween with duration 0 set current to target immediately ( #14937 )
...
* fix: Make Tween duration 0 set current to target immediately
* Run prettier on test file
* tweak
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
8 months ago
Rich Harris
77378688b9
fix: remove leading newline from `<pre>` contents ( #14922 )
...
... if it's not followed by another newline, according to the spec
Fixes #14767
---------
Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
8 months ago
github-actions[bot]
fb67bad5b0
Version Packages ( #14921 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
8 months ago
Paolo Ricciuti
72a6c7263c
fix: don't throw `bind_invalid_export` if there's also a bindable prop with the same name ( #14813 )
8 months ago
Dominic Gannaway
cd1adbc4e6
fix: ensure logic blocks keep consistent namespacing ( #14817 )
...
* fix: ensure logic blocks keep consitent namespacing
* lint
* add test
* handle `<title>` ambiguity the same as `<a>`
* update changeset
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
8 months ago
github-actions[bot]
f5c285080c
Version Packages ( #14918 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
8 months ago
Matthijs
a646780109
fix: Make Tween work with continuous target changes ( #14895 )
...
* Read previous_value at a later stage in Tween.set
* Add changeset
* tweak
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
8 months ago
Dominic Gannaway
dbdb8cd7fd
fix: use cached indexOf array prototype method internally ( #14912 )
8 months ago
github-actions[bot]
a8ca375c57
Version Packages ( #14908 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
8 months ago
Simon H
2e2b440954
fix: apply `clsx` logic to custom element `class` attributes ( #14907 )
...
Fixes #14902
8 months ago
Paolo Ricciuti
c4e9faad52
fix: correctly parse `each` with loose parser ( #14887 )
...
* fix: correctly parse `each` with loose parser
* chore: fix lint
* chore: remove unused imports
* Apply suggestions from code review
* chore: fix lint
---------
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
8 months ago
github-actions[bot]
ed26c3f658
Version Packages ( #14888 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
8 months ago
Dominic Gannaway
82db92f870
fix: ensure disconnected deriveds correctly connect again ( #14899 )
...
* fix: ensure disconnected deriveds correctly connect again
* fix: ensure disconnected deriveds correctly connect again
8 months ago
Paolo Ricciuti
a91308d9db
fix: correctly highlight sources reassigned inside `trace` ( #14811 )
...
* fix: correctly highlight sources reassigned inside `trace`
* chore: add missing effect logs
* fix: prevent `null` access on `tracing_expressions` for nested tracing
* chore: add test case for #14853
* fix: types for `$inpect.trace`
8 months ago
github-actions[bot]
f3a7ded734
Version Packages ( #14856 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
8 months ago
Dominic Gannaway
8148734812
fix: ensure unowned deriveds correctly get re-linked to the graph ( #14855 )
...
* fix: ensure unowned deriveds correctly get re-linked to the graph
* fix: ensure unowned deriveds correctly get re-linked to the graph
* fix: ensure unowned deriveds correctly get re-linked to the graph
* add test
* add test
* cleaner apporach
* cleaner apporach
* cleaner apporach
* cleaner apporach
8 months ago
Dominic Gannaway
32348a5387
fix: ensure $inspect.trace works correctly with null values ( #14853 )
...
* fix: ensure $inspect.trace works correctly with null values
* fix: ensure $inspect.trace works correctly with null values
8 months ago
github-actions[bot]
7f8acb8a37
Version Packages ( #14824 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
9 months ago
Simon H
015210a1a8
feat: allow objects/arrays for class attribute ( #14714 )
...
* WIP
* missed
* fix
* fix
* rename, smooth over incompatibilities
* spread support + test
* docs
* types
* implement CSS pruning for array/object expressions
* beefier static analysis
* lint
* rename doc
* move class after all directive docs
* tweak docs - clarify top-level falsy values, stagger examples, demonstrate composition, discourage class: more strongly
* changeset
* fix
* Update documentation/docs/03-template-syntax/18-class.md
Co-authored-by: Conduitry <git@chor.date>
* Apply suggestions from code review
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
Co-authored-by: Conduitry <git@chor.date>
9 months ago
Andrey Sitnik
38a3ae321f
fix: Allow to disable animation prefix ( #14822 )
...
* fix: Allow to disable animation prefix
* Apply suggestions from code review
---------
Co-authored-by: Paolo Ricciuti <ricciutipaolo@gmail.com>
9 months ago
github-actions[bot]
1d773ef3a4
Version Packages ( #14782 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
9 months ago
Bjorn Lu
72b7bc7af8
feat: add "worker" exports condition ( #14779 )
9 months ago
github-actions[bot]
2086c199be
Version Packages ( #14776 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
9 months ago
ottomated
999b92d134
fix: intellisense DX for $props, $inspect, $bindable, and $host ( #14777 )
...
* remove default function types for $props, $inspect, $bindable, and $host
* changeset
* regenerate types
* add helper message for type regeneration
* append a newline to generated types
* prettier
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
9 months ago
Dominic Gannaway
5bc4033421
fix: treeshake `$inspect.trace` code if unused in modules ( #14774 )
9 months ago
github-actions[bot]
69d198eb44
Version Packages ( #14764 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
9 months ago
Rich Harris
7c6379a260
fix: bump esrap dependency ( #14765 )
...
* fix: bump esrap
* changeset
* ugh
9 months ago
Dominic Gannaway
d0f156c0f9
fix: ensure $inspect.trace code is treeshaken out if unused ( #14770 )
...
* fix: ensure $inspect.trace code is treeshaken out if unused
* Update .changeset/tough-dingos-deliver.md
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
9 months ago
Dominic Gannaway
8705d44c64
fix: ensure svg namespace for `<a>` elements is correct ( #14756 )
...
* fix: ensure svg namespace persists from parent of if blocks
* better fix
* better fix
* address feedback
9 months ago
github-actions[bot]
2bfdd1b436
Version Packages ( #14745 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
9 months ago
Taku Fukada
c79b909458
fix: remove 'implements' from class declaration ( #14749 )
...
* fix: remove implements from class declaration
* add a smoke test
9 months ago
Rich Harris
e38975eac9
fix: remove unwanted properties from both replaced and unreplaced nodes ( #14744 )
9 months ago
github-actions[bot]
00ff60e8d5
Version Packages ( #14740 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
9 months ago
Rich Harris
c033dae049
fix: bump esrap, prevent malformed AST ( #14742 )
...
* bump esrap, start fixing stuff
* ignore type exports when looking for undefineds
* sanitize stuff
* changeset
* fix
* oops
* try this?
* prettier
9 months ago
Rich Harris
36a437c2f9
fix: compare array contents for equality mismatch detections, not the arrays themselves ( #14738 )
9 months ago
github-actions[bot]
5529ad241f
Version Packages ( #14735 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
9 months ago
Simon H
3146e93bbb
chore: loose parser improvements ( #14733 )
...
* handle invalid expression inside each key
* handle invalid expression inside each expression
* handle invalid expression inside await block
* handle "in the middle of typing" components with starting lowercase and dot at the end
* changeset
9 months ago
Paolo Ricciuti
36d73cad55
fix: correctly highlight first rerun of `$inspect.trace` ( #14734 )
9 months ago
github-actions[bot]
e0e999055d
Version Packages ( #14728 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
9 months ago
Dominic Gannaway
699dc6e4f7
fix: improve unowned derived performance ( #14724 )
...
* fix: improve unowned derived performance
* fix: improve unowned derived performance
* changeset
9 months ago
github-actions[bot]
bbf38291fc
Version Packages ( #14715 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
9 months ago
Dominic Gannaway
5483495c8d
feat: add $inspect.trace rune ( #14290 )
...
* feat: add $trace rune
WIP
WIP
WIP
WIP
WIP
WIP
WIP
WIP
WIP
WIP
WIP
WIP
WIP
WIP
WIP
WIP
WIP
WIP
WIP
WIP
* lint
* fix
* fix
* fix
* fix
* fix
* fix
* fix
* more tweaks
* lint
* improve label for derived cached
* improve label for derived cached
* lint
* better stacks
* complete redesign
* fixes
* dead code
* dead code
* improve change detection
* rename rune
* lint
* lint
* fix bug
* tweaks
* Update packages/svelte/src/internal/client/dev/tracing.js
Co-authored-by: Rich Harris <rich.harris@vercel.com>
* Update packages/svelte/src/internal/client/dev/tracing.js
Co-authored-by: Rich Harris <rich.harris@vercel.com>
* Update packages/svelte/src/internal/client/dev/tracing.js
Co-authored-by: Rich Harris <rich.harris@vercel.com>
* Update packages/svelte/src/internal/client/dev/tracing.js
Co-authored-by: Rich Harris <rich.harris@vercel.com>
* todos
* add test + some docs
* changeset
* update messages
* address feedback
* address feedback
* limit to first statement of function
* remove unreachable trace_rune_duplicate error
* tweak message
* remove the expression statement, not the expression
* revert
* make label optional
* relax restriction on label - no longer necessary with new design
* update errors
* newline
* tweak
* add some docs
* fix playground
* fix playground
* tweak message when function runs outside an effect
* unused
* tweak
* handle async functions
* fail on generators
* regenerate, update docs
* better labelling
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
9 months ago
github-actions[bot]
64a32cec38
Version Packages ( #14708 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
9 months ago
Rich Harris
ecd1b48095
bump changeset to minor ( #14710 )
9 months ago
Rich Harris
b0e3c5b438
feat: add outro option to unmount ( #14540 )
...
* feat: add outro option to unmount
* unused
* regenerate
* revert
* changeset
* create separate component_root effect
* docs
* return a promise
* remove from map immediately
9 months ago
Simon H
f0af633263
feat: loose parser mode ( #14691 )
...
* add loose option
* handle unclosed tags
* handle unclosed blocks
* handle unclosed opening tags
* handle invalid expressions
* handle invalid blocks
* oops
* more robust expression parsing
* changeset
* more unclosed tag handling
* types
* Update packages/svelte/src/compiler/phases/1-parse/state/element.js
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
9 months ago
github-actions[bot]
af9b071622
Version Packages ( #14698 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
9 months ago
Paolo Ricciuti
887ce6ab4b
fix: don't add parenthesis to media query if already present ( #14699 )
9 months ago
Mateusz Kadlubowski
61a0da8a5f
feat: Expose more AST types from `"svelte/compiler"` ( #14601 )
...
* add missing `SvelteBoundary` in `ElementLike`
* make union of AST types public and exportable with `AST` namespace
* apply AST types change to codebase
* changeset
* manually generate types
* Add `AttributeLike` type
* export namespace `Css` inside `AST`
* manually generate types again
* exported `Css` -> `CSS`
* `Css` -> `AST.CSS`
* fix Prettier issue
* Apply suggestions from code review
---------
Co-authored-by: Rich Harris <hello@rich-harris.dev>
9 months ago
Dominic Gannaway
2e0dcd7872
fix: ensure if block paths retain correct template namespacing ( #14685 )
...
* fix: ensure if block paths retain correct template namespacing
* add tests
* address feedback
* address feedback
* simplify
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
9 months ago
github-actions[bot]
780041a51e
Version Packages ( #14689 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
9 months ago
Yang Pan
88c2d6ea36
fix: Allow unquoted slash in attributes ( #14615 )
...
* test: add sample for unquoted attributes
* fix: handle unquoted slash in attributes
* docs: allow unquoted slash in attributes
* test: add additional sample for unquoted href attributes
* fix: improve handling of self-closing tags with unquoted attributes
* Update .changeset/long-boxes-flow.md
---------
Co-authored-by: Rich Harris <hello@rich-harris.dev>
9 months ago
Paolo Ricciuti
5e8d6edcf8
fix: make `defaultValue` work with spread ( #14640 )
...
* fix: make `defaultValue` work with spread
* chore: apply suggestions from review
* tweak
* only stash defaults when relevant
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
9 months ago
Rich Harris
ef8bd6adeb
fix: better handle hydration of script/style elements (alternative) ( #14683 )
...
* alternative approach to #14624
* changeset
* fix
* lint
9 months ago
Dominic Gannaway
8ba1b9ddd0
fix: avoid mutation validation for invalidate_inner_signals ( #14688 )
...
* fix: avoid mutation validation for invalidate_inner_signals
* add test
* Update packages/svelte/src/internal/client/runtime.js
---------
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
9 months ago
github-actions[bot]
7aa80fc2a7
Version Packages ( #14682 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
9 months ago
Paolo Ricciuti
edfc0a9c6a
fix: correctly handle ssr for `reactivity/window` ( #14681 )
9 months ago
github-actions[bot]
a5a4649743
Version Packages ( #14679 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
9 months ago
Simon H
68d266e0f8
fix: remove overzealous `reactive_declaration_non_reactive_property` warning ( #14663 )
...
fixes #14532
This removes the `reactive_declaration_non_reactive_property` warning altogether. The first version caused many false positives at compile time. The refined runtime version (introduced in #14192 ) was hoped to fix this, but it turns out we now get loads of false positives at runtime.
9 months ago
Paolo Ricciuti
ea6fd95332
fix: account for global block in `is_empty` ( #14677 )
...
Fixes #14675
9 months ago
github-actions[bot]
b0374f8863
Version Packages ( #14662 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
9 months ago
Rich Harris
d43a10ba7a
feat: add `svelte/reactivity/window` module ( #14660 )
...
* feat: add `svelte/reactivity/window` module
* lint
* fix
* hide private types
* online binding
* tweak docs
* tweak
* add @since tags
---------
Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
9 months ago
Simon H
a2539cfe1f
fix: correctly set custom element props ( #14508 )
...
fixes #14391
In #13337 the "when to set as a property" logic for custom elements was adjusted. A bug was introduced during this, and it consists of several parts, of which the latter I'm not sure what's the best solution, hence opening this to discuss.
The problem is that during set_custom_element_data, get_setters is the only check done to differentiate between setting the value as a prop (has a setter) or as an attribute (doesn't have a setter).
The solution is to take into account whether or not the custom element is already registered, and defer getting (and caching) its setters until then. Instead, fall back to a "an object is always set as a prop" heuristic.
9 months ago
github-actions[bot]
cb5734ae66
Version Packages ( #14652 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
9 months ago
grieben
a26b6d80ef
fix: overwrite #last_value when Spring is `.set()` with `{instant: true}` ( #14656 )
...
* fix: overwrite #last_value when Spring is with
* run npx changeset
9 months ago
Dominic Gannaway
fb879dd702
fix: ensure $state.snapshot clones holey arrays correctly ( #14657 )
...
* fix: ensure $state.snapshot clones holey arrays correctly
* fix: ensure $state.snapshot clones holey arrays correctly
* fix: ensure $state.snapshot clones holey arrays correctly
* fix: ensure $state.snapshot clones holey arrays correctly
9 months ago
Paolo Ricciuti
ab1f7f437e
fix: transform everything that is not a selector inside `:global` ( #14577 )
...
Fixes #14568
9 months ago
Simon H
88184cd769
fix: don't emit assignment warnings for bindings ( #14651 )
...
Also fixes the possibility of an infinite loop due to the property access during the dev time check
fixes #14643
9 months ago
Dominic Gannaway
66e30d3288
fix: ensure snippet hoisting works in the correct scope ( #14642 )
...
* fix: ensure snippet hoisting works in the correct scope
* fix bug
* revert
* revert
9 months ago
Dominic Gannaway
9cfd2e20ab
fix: restore input binding selection position ( #14649 )
9 months ago
github-actions[bot]
8bee23e387
Version Packages ( #14631 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
9 months ago
Rich Harris
a25a17373d
chore: upgrade last changeset to a minor ( #14636 )
9 months ago
Simon H
cfc1fb7de8
chore: provide links to documentation for errors/warnings ( #14629 )
...
* chore: provide links to documentation for errors/warnings
closes #11305
* changeset
* fix most of the tests
* fix mutations messing with nodes between runs
* more concise
* more test fixes
* last one
9 months ago
Paolo Ricciuti
11764632b9
fix: deconflict `get_name` for literal class properties ( #14607 )
9 months ago
Paolo Ricciuti
38171f60ea
fix: allow exports with source from script module even if no bind is present ( #14620 )
...
* fix: allow exports with source from script module even if no bind is present
* chore: move test to validator
9 months ago
github-actions[bot]
0a10c59517
Version Packages ( #14628 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
9 months ago
Paolo Ricciuti
c66bf178aa
fix: mark subtree dynamic for bind with sequence expressions ( #14626 )
9 months ago
github-actions[bot]
301744f1f7
Version Packages ( #14598 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
9 months ago
Rich Harris
57f8ca6e3c
oops
9 months ago
Dominic Gannaway
5771b455c0
feat: add support for bind getter/setters ( #14307 )
...
* feat: add support for bind getters/setters
* different direction
* oops
* oops
* build
* add changeset and tests
* move validation
* add comment
* build
* bind:group error
* simpler to just keep it as a SequenceExpression
* fix
* lint
* fix
* move validation to visitor
* fix
* no longer needed
* fix
* parser changes are no longer needed
* simplify
* simplify
* update messages
* docs
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
9 months ago
Rich Harris
1a0b822f48
fix: always run `if` block code the first time ( #14597 )
...
* fix: always run `if` block code the first time
* fix
9 months ago
github-actions[bot]
98286349b2
Version Packages ( #14593 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
9 months ago
Rich Harris
8433a7169b
fix: reinstate `prefersReducedMotion` ( #14586 )
...
* reinstate prefersReducedMotion
* changeset
9 months ago
github-actions[bot]
947d4adf3b
Version Packages ( #14583 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
9 months ago
Rich Harris
80ffcc3fe1
feat: add Spring and Tween classes ( #11519 )
...
* feat: add Spring class
* add some docs, Spring.of static method
* add Tween class
* lint
* preserveMomentum in milliseconds
* deprecate tweened
* changeset
* wrestle with types
* more consolidation
* flesh out the distinction a bit more, deprecate `subscribe`
---------
Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
9 months ago
github-actions[bot]
60c0dc7a2d
Version Packages ( #14576 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
9 months ago
Simon H
ca67aa1b34
fix: ensure bindings always take precedence over spreads ( #14575 )
9 months ago
github-actions[bot]
7f5172745d
Version Packages ( #14570 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
9 months ago
Simon H
0a9890bb1e
feat: provide `MediaQuery` / `prefersReducedMotion` ( #14422 )
...
* feat: provide `MediaQuery` / `prefersReducedMotion`
closes #5346
* matches -> current, server fallback
* createStartStopNotifier
* test polyfill
* more tests fixes
* feedback
* rename
* tweak, types
* hnnnggh
* mark as pure
* fix type check
* notify -> subscribe
* add links to inline docs
* better API, more docs
* add example to prefersReducedMotion
* add example for MediaQuery
* typo
* fix example
* tweak docs
* changesets
* note when APIs were added
* add note
* regenerate
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
9 months ago
Simon H
73b3cf72d0
fix: treat `undefined` and `null` the same for the initial input value ( #14562 )
...
* fix: treat `undefined` and `null` the same for the initial input value
Fixes #14558
* test
* same for checked
9 months ago
github-actions[bot]
85dec47a5e
Version Packages ( #14557 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
9 months ago
Dominic Gannaway
a220330011
chore: make if blocks tree-shakable ( #14549 )
...
* chore: make if blocks dead code eliminable
* chore: make if blocks dead code eliminable
* chore: make if blocks dead code eliminable
* address feedback
* address feedback
* prettier
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
9 months ago
github-actions[bot]
51c9eac577
Version Packages ( #14556 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
9 months ago
Simon H
a151ae1804
fix: handle static form values in combination with default values ( #14555 )
...
When the `value` or `checked` attribute of an input or the contents of a textarea were static, setting the `defaulValue/defaultChecked` property caused the latter to take precedence over the former. This is due to how we transform the code: If the value is static, we put it onto
9 months ago
github-actions[bot]
c0746e0e73
Version Packages ( #14552 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
9 months ago
Simon H
a57e747cbb
feat: default values for form elements ( #14289 )
...
* tests
* typings
* implement for defaultValue/defaultChecked on inputs
* docs (draft)
* selected
* fix test
* remove
* tweak
* changeset
* untrack reads, they could be inside an effect
* Apply suggestions from code review
Co-authored-by: Rich Harris <rich.harris@vercel.com>
* handle select reset case
* handle reset case specifically: use different props/queries in that case
* enhance test
* fix
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
9 months ago
github-actions[bot]
c55af4aa83
Version Packages ( #14548 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
9 months ago
Simon H
86ae349bcc
fix: better error messages for invalid HTML trees ( #14445 )
...
* fix: better error messages for invalid HTML trees
closes #13331
* fix test
* more concise
* tweak
* tweak messages
* adjust tests
* tweak message slightly, so it doesn't sound like the bad element is the one we're currently encountering
* put locations in generated message
* tidy up
* consistency
* fix
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
9 months ago
Rich Harris
4e77bdef74
fix: respect the unidirectional nature of time ( #14541 )
...
* fix: respect the unidirectional nature of time
* note to our future selves
9 months ago
Paolo Ricciuti
1f973b1770
fix: remove spreaded event handlers when they become nullish ( #14546 )
...
Fixes #14539
9 months ago
github-actions[bot]
3d9122fcc4
Version Packages ( #14537 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
9 months ago
Rich Harris
fe0bd299a5
fix: proxify values when assigning using `||=`, `&&=` and `??=` operators ( #14273 )
...
* add failing test for #14268
* simplify
* proxify values when using ||=, &&= and ??= assignment operators
* proxify values assigned to private state fields
* changeset
* fix
* fix
* add warning
* update test
9 months ago
Simon H
bbee1fc7e0
fix: don't try to add owners to non-`$state` class fields ( #14533 )
...
* fix: don't try to add owners to non-`$state` class fields
`$state.raw` and `$derived(.by)` will not have a state symbol on them, potentially causing a disastrous amount of traversal to potentially not find any state symbol. So it's better to not traverse them.
Potentially someone could create a `$state` while creating `$state.raw` or inside a `$derived.by`, but that feels so much of an edge case that it doesn't warrant a perf hit for the common case.
Fixes #14491
* for bind:, too
9 months ago
Dominic Gannaway
b5588523fc
fix: capture infinite_loop_guard in error boundary ( #14534 )
...
* fix: capture infinite_loop_guard in error boundary
* fix
9 months ago
github-actions[bot]
a65e68ca37
Version Packages ( #14530 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
9 months ago
github-actions[bot]
d595cc16fb
Version Packages ( #14529 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
9 months ago
Rich Harris
2f8eda94f3
fix: ensure SvelteDate cached methods have correct reactive context ( #14525 )
...
* fix: ensure SvelteDate cached methods have no reactive context
* fix: ensure SvelteDate cached methods have no reactive context
* fix
* lint
* use active reaction at time of instance creation
* tweak changeset
* Update packages/svelte/src/internal/client/dom/elements/bindings/shared.js
Co-authored-by: Paolo Ricciuti <ricciutipaolo@gmail.com>
---------
Co-authored-by: Dominic Gannaway <dg@domgan.com>
Co-authored-by: Paolo Ricciuti <ricciutipaolo@gmail.com>
9 months ago
Paolo Ricciuti
39275684e5
fix: don't throw with nullish actions ( #13559 )
...
Co-authored-by: Oscar Dominguez <dominguez.celada@gmail.com>
9 months ago
Rich Harris
a5de086f95
feat: turn `reactive_declaration_non_reactive_property` into a runtime warning ( #14192 )
...
* turn `reactive_declaration_non_reactive_property` into a runtime warning
* ignore warning
* Update packages/svelte/src/internal/client/reactivity/effects.js
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
* Update packages/svelte/src/internal/client/runtime.js
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
* fix
* test
* changeset
* Update .changeset/witty-turtles-bake.md
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
* add some details
* check
* regenerate
---------
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
9 months ago
Rich Harris
aac929d503
fix: leave update expressions untransformed unless a transformer is provided ( #14507 )
...
* fix: leave update expressions untransformed unless a transformer is provided
* fix more cases
9 months ago
github-actions[bot]
e722ef6b15
Version Packages ( #14510 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
9 months ago
Dominic Gannaway
4d2f2fb8e6
feat: allow snippets to be exported from module scripts ( #14315 )
...
* feat: allow snippets to be exported from module scripts
* tweak type
* fix issue + add test
* refactor
* refactor
* fix exports error
* fix lint
* fix lint
* error on undefined export
* hoisted snippets belong in transform state, not analysis
* put the code where it's used
* drop the local_. just binding. it's cleaner
* simplify
* simplify
* simplify
* simplify
* tidy up
* oops
* update message, add some details
* lint
* Apply suggestions from code review
* add some docs
* Update packages/svelte/src/compiler/phases/3-transform/utils.js
* Update .changeset/famous-parents-turn.md
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
9 months ago
Simon H
b72fd2b3cd
fix: ignore TypeScript generics on variables ( #14509 )
...
fixes #14505
9 months ago
github-actions[bot]
a091fb5ce6
Version Packages ( #14501 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
9 months ago
Simon H
a283083751
feat: each without as ( #14396 )
...
* feat: each without as
WIP
closes #8348
* properly
* docs
* changeset
* real world demo
* simplify
* typo
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
9 months ago
github-actions[bot]
a39605ec7a
Version Packages ( #14499 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
9 months ago
Rich Harris
ef640c3b46
fix: render attributes during SSR regardless of case ( #14492 )
...
fixes part of #14479
9 months ago
Rich Harris
1f25bd4f47
fix: correctly prune CSS for elements inside snippets ( #14494 )
...
fixes #14483
9 months ago
github-actions[bot]
99b4cfbb51
Version Packages ( #14489 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
9 months ago
ComputerGuy
945b625e95
fix: Prevent `$state` `bigint`s incrementing and decrementing from throwing ( #14485 )
...
* Fix `$.update` and `$.update_pre` for bigints
* resolve conflicts
* fix some things
* fix thing i definitely didn't just break
* hopefully this will fix it
* fix formatting
* simplify
* style consistency
* simplify
* changeset
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
9 months ago
Rich Harris
fe15ad4ae8
fix: treat spread elements the same as call expressions ( #14488 )
9 months ago
github-actions[bot]
f75a9a566e
Version Packages ( #14486 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
9 months ago
Dominic Gannaway
ed7ebcde1e
feat: add error boundaries ( #14211 )
...
* feat: add error boundary support
tweak
tweak again
retry -> reset
tweaks
add tests
tweaks
tweaks
tweaks
more tests
more tests and tweaks
comments
tweak
tweak
tweak
tweak
tweak
* tweak
tweak
tweak
tweak
more fixes
tweak
tweak
more fixes
changeset
* Update packages/svelte/elements.d.ts
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
* Update .changeset/polite-peaches-do.md
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
* fix issue with rethrowing
* handle fallback error
* handle fallback error
* add more test coverage
* more tests
* more bug fixes
* guard against non-errors
* add component_stack to error
* alternative approach
* remove spread support
* lint
* add to legacy ast
* add to svelte-html
* disallow anything but attributes on the boundary element
* fix error
* more validation
* only create block when necessary
* swap argument order - results in nicer-looking code in many cases
* Update .changeset/polite-peaches-do.md
* simplify a bit
* simplify
* move declaration closer to usage
* push once
* unused
* tweaks
* consistent naming
* simplify
* add a couple newlines
* tweak comments
* simplify
* newlines
* placeholder documentation
* add some docs
* Update packages/svelte/src/internal/client/dom/blocks/boundary.js
Co-authored-by: Rich Harris <rich.harris@vercel.com>
* Update packages/svelte/src/internal/client/dom/blocks/boundary.js
Co-authored-by: Rich Harris <rich.harris@vercel.com>
* Update packages/svelte/src/internal/client/dom/blocks/boundary.js
Co-authored-by: Rich Harris <rich.harris@vercel.com>
* fix type
* fix link
* explain what happens if onerror throws
---------
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
Co-authored-by: Rich Harris <rich.harris@vercel.com>
9 months ago
github-actions[bot]
6dd60b5685
Version Packages ( #14477 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
9 months ago
Ben McCann
4c88431228
fix: upgrade to esm-env 1.2.1 to fix issues with non-Vite setups ( #14470 )
...
* fix: upgrade to esm-env 1.2.1 to fix issues with non-Vite setups
* fix (albeit with annoying warnings)
* bundle with conditions to silence noise
* production is probably better
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
9 months ago
Rich Harris
00aaad16b2
fix: generate correct code when encountering object expression statement ( #14480 )
...
* bump esrap
* changeset
9 months ago
Rich Harris
a60e837e44
fix: prevent infinite loops when pruning CSS ( #14474 )
...
fixes #14472
---------
Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
9 months ago
github-actions[bot]
ca3690f7df
Version Packages ( #14464 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
9 months ago
Simon H
d62e7bdbe1
fix: ignore text and expressions outside the template when validating HTML ( #14468 )
...
fixes #14466
The logic introduced in #14395 was flawed - not every text or expression outside the template is the child of an attribute. This turns it around: We know that every child of a fragment is inside the template, so we ignore all text/expression tags that are not child of a fragment
9 months ago
Rich Harris
c4ac0e01e7
fix: better account for render tags when pruning CSS ( #14456 )
...
Fixes #14399
Add a mechanism to connect render tags to snippets to know where to walk when coming across render tags
---------
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
9 months ago
github-actions[bot]
dcef8ff45a
Version Packages ( #14451 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
9 months ago
Simon H
d6fc176fcb
fix: strip exported TypeScript function overloads ( #14458 )
...
fixes #14455
9 months ago
Ben McCann
41e47a4c00
chore: upgrade esm-env for Vite 6 support ( #14460 )
...
* chore: upgrade esm-env for Vite 6 support
* dedupe
---------
Co-authored-by: Conduitry <git@chor.date>
9 months ago
Paolo Ricciuti
19d80ad63c
fix: css pruning producing invalid css ( #14448 )
...
* fix: css pruning producing invalid css
* Update .changeset/big-hats-wonder.md
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
9 months ago
github-actions[bot]
3a6bf1041b
Version Packages ( #14444 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
9 months ago
Dominic Gannaway
45417a36ce
fix: addresses memory leak when creating deriveds inside untrack ( #14443 )
...
* fix: addresses memory leak when creating deriveds inside untrack
* fix: addresses memory leak when creating deriveds inside untrack
* changeset
* Update packages/svelte/src/internal/client/reactivity/deriveds.js
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
* fix
* fix
* fix
* comment
* Update packages/svelte/tests/signals/test.ts
* Update packages/svelte/src/internal/client/reactivity/deriveds.js
Co-authored-by: Rich Harris <rich.harris@vercel.com>
* Update .changeset/great-crabs-rhyme.md
Co-authored-by: Rich Harris <rich.harris@vercel.com>
---------
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
Co-authored-by: Rich Harris <rich.harris@vercel.com>
9 months ago
Rich Harris
a6ad5af0bb
fix: disregard TypeScript nodes when pruning CSS ( #14446 )
...
* make get_possible_element_siblings non-recursive
* treat slots as blocks
* simplify
* simplify
* add test
* changeset
9 months ago
Simon H
3fa08d565c
fix: show `:then` block for `null` value ( #14440 )
...
fixes #14439
This bug was introduced in #13642 because setting the input to null means the equality check ("is the input different") fails if you set the value to null
Also fixes #14441 - this bug was present for a long time, and the reason is the same as for the other bug: The equality check always returns "yes this is the same" if the value is undefined initially. The fix is similar; we need to initialize the input to something that can never be equal to whatever value is passed
9 months ago
Simon H
9e9fb2463c
fix: relax parent validation ( #14442 )
...
This reverts #13255 / #13158 , and helps with the validation error part of #14120
If you would have a component like this...
```svelte
<td>hi there</td>
```
...and then render it on the server via our `render` function like this:
```js
const result = render(Main);
```
...then right now you get an error saying that `td` is not valid at this position. But that doesn't seem right, because we should give people the benefit of the doubt: It may very well be that someone renders such a component and then correctly puts it into a `tr` tag themselves on the server (another example is rendering a full html document like in #14120 ).
All the other validation where there's a known parent (X not valid inside Y) is untouched by this.
Doing this as cleanup prior to tackling #13331
9 months ago
github-actions[bot]
2b5c0e791e
Version Packages ( #14383 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
9 months ago
Dominic Gannaway
63484aff9b
fix: ensure last empty text node correctly hydrates ( #14425 )
...
* fix: ensure last empty text node correctly hydrates
* fix: ensure last empty text node correctly hydrates
9 months ago
Rich Harris
37e6c7f26b
fix: correctly prune key/each blocks ( #14403 )
...
* fix: correctly prune key blocks
* fix pruning of each blocks
* simplify
* make more explicit
* changeset
* helperise/robustify
10 months ago
Theodor Steiner
e721d96d32
fix: export temporary LegacyComponentType ( #14256 ) ( #14257 )
...
closes #14256
helps TypeScript when generating dts files to not fail
10 months ago
Dominic Gannaway
dd9abea2a1
fix: ensure spread attribute events are attached synchronously ( #14387 )
...
* fix: ensure spread attribute events are attached synchronously
* fix: ensure spread attribute events are attached synchronously
* Update .changeset/rich-worms-burn.md
Co-authored-by: Rich Harris <rich.harris@vercel.com>
* simplify
---------
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
Co-authored-by: Rich Harris <rich.harris@vercel.com>
10 months ago
github-actions[bot]
6e391fce59
Version Packages ( #14380 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
10 months ago
Paolo Ricciuti
520055cf5c
fix: always use set for private identifiers ( #14378 )
...
* fix: always use set for private identifiers
* we can simplify this further - no need to check the value was transformed, since the outcome of not returning immediately is the same but with extra steps
* add explanatory note
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
10 months ago
github-actions[bot]
85ec6fa276
Version Packages ( #14377 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
10 months ago
Dominic Gannaway
9d12fd1a01
chore: remove template expression inlining ( #14374 )
...
* chore: remove template expression inlining
* missed some
* fix
* feedback
* feedback
* Update packages/svelte/src/compiler/phases/3-transform/client/utils.js
Co-authored-by: Rich Harris <rich.harris@vercel.com>
* Update packages/svelte/src/compiler/phases/3-transform/client/visitors/RegularElement.js
Co-authored-by: Rich Harris <rich.harris@vercel.com>
* Update packages/svelte/src/compiler/phases/3-transform/client/visitors/RegularElement.js
Co-authored-by: Rich Harris <rich.harris@vercel.com>
* Update packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/utils.js
Co-authored-by: Rich Harris <rich.harris@vercel.com>
* Update packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/utils.js
Co-authored-by: Rich Harris <rich.harris@vercel.com>
* Update packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/utils.js
Co-authored-by: Rich Harris <rich.harris@vercel.com>
* fix
* Update .changeset/calm-mice-perform.md
Co-authored-by: Rich Harris <rich.harris@vercel.com>
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
10 months ago
github-actions[bot]
f616c22053
Version Packages ( #14366 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
10 months ago
Dominic Gannaway
811c8d32eb
fix: correctly handle srcObject attribute on video elements ( #14369 )
...
* fix: correctly handle srcObject attribute on video elements
* remove side-effect
* side-effects agin
* side-effects agin
* better fix
10 months ago
Frédéric Crozatier
7bd1cdf427
feat: add content-visibility: auto state change event ( #14373 )
...
* add contentvisibilityautostatechange event
* changeset
* Update .changeset/kind-horses-lay.md
* Update .changeset/kind-horses-lay.md
---------
Co-authored-by: Rich Harris <hello@rich-harris.dev>
10 months ago
Simon H
4dfa0e31fe
fix: tighten up `export default` validation ( #14368 )
...
through #14363 I noticed our `export default` validation wasn't quite right:
- missed checking for derived/state exports
- the "cannot have a default export" error was only thrown if you did `export default` from the instance script, but it shouldn't matter from which component part you export it; it's never ok
10 months ago
Paolo Ricciuti
32a1453805
fix: include method definitions in class private fields ( #14365 )
...
* fix: include method definitions in class private fields
* Update packages/svelte/tests/runtime-runes/samples/class-disabinguate-private-method-definition/_config.js
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
10 months ago
github-actions[bot]
53cc60085e
Version Packages ( #14362 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
10 months ago
Dominic Gannaway
747d40833b
fix: ensure is_pure takes into account runes ( #14333 )
...
* fix: ensure is_pure takes into account runes
* feedback
10 months ago
Dominic Gannaway
741106879b
fix: ensure internal cloning can work circular values ( #14347 )
...
* fix: ensure internal cloning can work circular values
* better fixc
* 'original' feels slightly clearer than 'json_instance'
* use an optional parameter, so we can omit it in most cases
* Update packages/svelte/src/internal/shared/clone.js
Co-authored-by: Rich Harris <rich.harris@vercel.com>
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
10 months ago
Dominic Gannaway
6e8267f462
fix: correctly update dynamic member expressions ( #14359 )
...
* fix: output template effect for svg xlink attribute
* mark subtree dynamic in MemberExpression visitor
* don't treat attributes and text nodes differently
* Update .changeset/serious-spiders-bake.md
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
10 months ago
Santiago Cézar
012166ec3c
fix: convert input value to number on hydration ( #14349 )
...
* convert input value to number on hydration
* add test
* changeset
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
10 months ago
github-actions[bot]
b145035a00
Version Packages ( #14348 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
10 months ago
Dominic Gannaway
1c454c236e
fix: ensure dynamic call expressions correctly generate output ( #14345 )
10 months ago
github-actions[bot]
396ea2ef37
Version Packages ( #14328 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
10 months ago
Dominic Gannaway
3a69b4c415
fix: ensure inline object literals are correctly serialised ( #14325 )
...
* fix: ensure inline object literals are correctly serialised
* Apply suggestions from code review
* address feedback
* address feedback
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
10 months ago
github-actions[bot]
95ab85fad7
Version Packages ( #14304 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
10 months ago
Simon H
94471ca38e
fix: avoid relying on Node specifics within compiler ( #14314 )
...
fixes #14294
10 months ago
Paolo Ricciuti
1f0700f5c5
fix: mark subtree dynamic for img with loading attribute ( #14317 )
...
* fix: mark subtree dynamic for img with loading attribute
* chore: unify conditions
* chore: change conditions
10 months ago
Simon H
efc65d4e0c
fix: mark pseudo classes nested inside `:not` as used ( #14303 )
...
fixes the css bug part of #14299
10 months ago
Simon H
e379319626
fix: ensure props passed to components via mount are updateable ( #14210 )
...
The detection whether or not props are writable is buggy; it doesn't take into account the case when instantiating components via `mount` or legacy-`new`
Fixes #14161
This posed an interesting question: What to do about (non-)`bind:`able properties? The answer I arrived on was: Treat it as if everything that _can_ be bound _is_ treated as bound, and everything else as readonly. In other words, if you're reassigning a prop, it will diverge from the passed in props if it's not bindable or not set in the parent, otherwise it will mutate the passed in props. I think that makes the most sense, given that you can't control this behavior from the outside.
10 months ago
Dominic Gannaway
7fd3774015
fix: disallow invalid attributes for `<svelte:window>` and `<svelte:document>` ( #14228 )
10 months ago
github-actions[bot]
312dd51acc
Version Packages ( #14302 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
10 months ago
Paolo Ricciuti
8a8e6f70e8
fix: avoid marking subtree as dynamic for inlined attributes ( #14269 )
...
* fix: avoid marking subtree as dynamic for inlined attributes
* fix: i'm a silly goose 🪿
* chore: refactor `is_inlinable_expression` to accept the attribute
* feat: inline dom expression too
* fix: special case literals with `"` in it and fix standalone case
* chore: simpler check first
Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>
* typo
* add more stuff to snapshot test
* simplify/speedup by doing the work once, during analysis
* simplify
* simplify - no reason these cases should prevent inlining
* return template
* name is incorrect
* name is incorrect
* fix escaping
* no longer necessary
* remove obsolete description
* better concatenation
* fix test
* do the work at runtime
* fix another thing
* tidy
* tidy up
* simplify
* simplify
* fix
* note to self
* another
* simplify
* more accurate name
* simplify
* simplify
* explain what is happening
* tidy up
* simplify
* better inlining
* update test
* colocate some code
* better inlining
* use attribute metadata
* Update packages/svelte/src/compiler/phases/2-analyze/visitors/Identifier.js
Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>
* Apply suggestions from code review
---------
Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>
Co-authored-by: Rich Harris <rich.harris@vercel.com>
10 months ago
github-actions[bot]
6a7146bee7
Version Packages ( #14287 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
10 months ago
Simon H
320ebd24d8
fix: bump `is-reference` dependency to fix `import.meta` bug ( #14286 )
...
closes #14234
10 months ago
Simon H
45fa678242
fix: account for `:has(...)` as part of `:root` ( #14229 )
...
We previously marked all `:root` selectors as global-like, which excempted them from further analysis. This causes problems:
- things like `:not(...)` are never visited and therefore never marked as used -> we gotta do that directly when coming across this
- `:has(...)` was never visited, too. Just marking it as used is not enough though, because we might need to scope its contents
Therefore the logic is enhanced to account for these special cases. Fixes #14118
While fixing this I cleaned up some inconsistencies in what we mark as global. This simplified code and fixed some adjacent bugs, which conindicentally also fixes #14189
10 months ago
Rich Harris
ac9b7de058
fix: use strict equality for key block comparisons in runes mode ( #14285 )
...
fixes #14283
10 months ago
github-actions[bot]
f5a7d49216
Version Packages ( #14274 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
10 months ago
Torsten Dittmann
033061842d
fix: named slots with reserved keywords during migration ( #14278 )
...
Fixes named slots with a reserved keyword not working anymore after migration. Re-uses the @migration-task logic for invalid identifiers.
Fixes #14277
10 months ago
Simon H
36ece1c381
fix: don't wrap pseudo classes inside `:global(...)` with another `:global(...)` ( #14267 )
...
fixes #14088
10 months ago
github-actions[bot]
4a85c4157d
Version Packages ( #14262 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
10 months ago
Paolo Ricciuti
0fa43e216d
fix: consider static attributes that are inlined in the template ( #14249 )
...
* fix: consider static attributes that are inlined in the template
* fix: use `is_inlinable_expression`
* fix: move check for inlinable expression as last
* fix: simplify and correct
* chore: accept single node in `is_inlinable_expression`
* chore: update comment
* chore: add snapshots for non static nodes
10 months ago
github-actions[bot]
832499fee8
Version Packages ( #14251 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
10 months ago
Paolo Ricciuti
653f4accbd
fix: migration script messing with attributes ( #14260 )
10 months ago
Paolo Ricciuti
ae9f53a3bd
fix: account for mutations in script module in ownership check ( #14253 )
10 months ago
Paolo Ricciuti
7bc94b9984
fix: do not treat reassigned synthetic binds as state in runes mode ( #14236 )
...
* fix: do not treat reassigned synthetic binds as state in runes mode
* fix: avoid calling checks if we are in runes mode
10 months ago
Paolo Ricciuti
d207666ec3
fix: consider img with loading attribute not static ( #14237 )
...
* fix: consider img with loading attribute not static
* chore: add comment for `is_static_element`
* chore: better comment
Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>
---------
Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>
10 months ago
github-actions[bot]
4bcd01b994
Version Packages ( #14207 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
10 months ago
Paolo Ricciuti
1060bea6e1
fix: consider `valueOf` in the reactive methods of `SvelteDate` ( #14227 )
10 months ago
Paolo Ricciuti
f0c2d4c698
fix: account for shadowing children slot during migration ( #14224 )
...
Fixes #14171
10 months ago
Simon H
31e6bbb646
fix: add `lang="ts"` attribute during migration if needed ( #14222 )
...
* fix: add `lang="ts"` attribute during migration if needed
fixes #14219
* fix
10 months ago
Paolo Ricciuti
438de04fb2
fix: add migration task when there's a variable named that would conflict with a rune ( #14216 )
...
Closes #14215
10 months ago
Simon H
870745fc53
fix: handle sibling combinators within `:has` ( #14213 )
...
We didn't collect sibling elements of a given element to then check the `:has` selectors. This adds the logic for that. Fixes #14072
10 months ago
Paolo Ricciuti
53af138d58
fix: read index as a source in legacy keyed each block ( #14208 )
...
Fixes #14203
10 months ago
Paolo Ricciuti
ea0d80e195
fix: consider variables with synthetic store sub as state ( #14195 )
...
Fixes #14183
10 months ago
Simon H
1eed645919
fix: ensure explicit nesting selector is always applied ( #14193 )
...
Previously, we were applying an explicit nesting selector to the start of a relative selector chain only when starting the traversal. Prepending the selector is important because it ensures we traverse upwards to the parent rule when the current selectors all matched and there's still more to do. But we forgot to do the prepend for parent rules, which meant that if we were nested two levels deep, we would stop too early. This fix ensures we prepend in that case, too.
Fixes #14178
10 months ago
github-actions[bot]
d7caf0833c
Version Packages ( #14184 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
10 months ago
Paolo Ricciuti
44a833fafe
fix: restore active reaction if then block throws ( #14191 )
10 months ago
Dominic Gannaway
f1aeaf19e5
feat: adds legacy mode flag ( #14180 )
...
* feat: adds legacy mode flag
* feedback
* feedback and tweaks
* feedback and tweaks
* tweaks
* tweaks
* tweaks
* tweaks
10 months ago
Simon H
9b2a8f15fb
fix: ignore `as` type expressions on property definitions ( #14181 )
...
fixes #14179
10 months ago
github-actions[bot]
c49949621b
Version Packages ( #14167 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
10 months ago
Simon H
aa23415179
fix: remove scoping for most `:not` selectors ( #14177 )
...
fixes #14168
This reverts the whole "selectors inside `:not` are scoped" logic. Scoping is done so that styles don't bleed. But within `:not`,everything is reversed, which means scoping the selectors now means they are more likely to bleed. That is the opposite of what we want to achieve, therefore we should just leave those selectors alone.
The exception are `:not` selectors with descendant selectors, as that means "look up the tree" and we need to scope all ancestor elements in that case.
10 months ago
Caique Torres
5077061695
fix: issue with implicit public modifier causing undefined properties ( #14153 )
...
closes #14152
10 months ago
github-actions[bot]
ecc9b97a5b
Version Packages ( #14097 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
10 months ago
Rich Harris
927319c139
fix: update links in JSDoc ( #14165 )
10 months ago
Gonzalo Ruiz
e6dd871819
fix: ensure migrate keeps inline/trailing comments in $props type definition and produces non-broken code ( #14143 )
...
* feat[sv migrate]: keep inline/trailing comments when migrating export let types to type definition
* test: add tests for inline comment migration
* chore: add changeset
* fix: migrate trailing multiline comment parsing no longer results in broken code, FIXES PR #14143#issuecomment-2455702689
* test: add migrate test with same-line trailing multiline comments and same-line leading multiline comments
* chore: add changeset
* fix: lint
---------
Co-authored-by: Gonzalo Ruiz <rgon@rgon.es>
Co-authored-by: paoloricciuti <ricciutipaolo@gmail.com>
10 months ago
Simon H
7dbe812fc9
fix: ensure non-matching elements are scoped for `:not(...)` selector ( #13999 )
...
If the contents of a `:not` selector don't match, then it's actually a match for `:not` because it's inverted. Therefore, we need to scope such elements. We're also making sure that contents of `:not` that never match actually count as a used (because the result is negated), and as such the contents of `:not` that always match are actually marked as unused.
Fixes #13974
10 months ago
wackbyte
57e27ae90e
fix: only output the key for each_key_duplicate ( #14147 )
...
Fixes #14146
10 months ago
Simon H
551284ca22
fix: correctly infer `<a>` tag namespace ( #14134 )
...
`<a>` tags are valid in both the SVG and HTML namespace. If there's no parent, we therefore have to look downwards to see if it's the parent of a SVG or HTML element.
fixes #7807
fixes #13793
10 months ago
Paolo Ricciuti
8de5605b6a
fix: prevent migrated snippet from shadow snippet prop ( #14127 )
10 months ago
Paolo Ricciuti
74a2c6b580
fix: migrate multiple declarations with only some exported correctly ( #14126 )
10 months ago
Simon H
4ec9986cba
fix: check options namespace for top level `svelte:element`s ( #14101 )
...
We were checking it for nested elements, but not root elements
fixes #13875
10 months ago
Dominic Gannaway
9883e7078c
fix: ensure SvelteMap and SvelteSet work with generators in dev ( #14103 )
...
* fix: ensure SvelteMap and SvelteSet work with generators in dev
* add test
* better fix
* better fix
* better fix
* better fix
10 months ago
Simon H
e7d68d8c10
fix: pass along `anchor` in legacy class wrappers ( #14100 )
...
fixes #13832
10 months ago
Dominic Gannaway
a315a14939
fix: ensure video elements autoplay in safari ( #14095 )
10 months ago
Simon H
7d11fa8da2
fix: recognize all custom element prop definitions ( #14084 )
...
We didn't account for the `$props` rune being writtin in a way that makes some props unknown, and they would only be visible through the `customElement.props` definition. This changes the iteration to account for that and also adds a note to the documentation that you need to list out the properties explicitly.
fixes #13785
10 months ago
github-actions[bot]
cf25930512
Version Packages ( #14081 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
10 months ago
Dominic Gannaway
58b1540ddc
fix: ensure transitions are applied to nested elements ( #14080 )
10 months ago
github-actions[bot]
b0d255aefe
Version Packages ( #14075 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
10 months ago
Dominic Gannaway
2bdc3d401f
fix: ensure compiler statements are correctly included ( #14074 )
...
Fixes #14068 and fixes #14071
10 months ago
github-actions[bot]
3b38bc2a77
Version Packages ( #14052 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
10 months ago
Rich Harris
37049b4171
Revert "feat: migrate `Component` to `ComponentExports<typeof Component>` in …" ( #14070 )
...
This reverts commit 4715dfaad2
.
10 months ago
Rich Harris
2784fb19f3
Revert "feat: add `ComponentExports` utility type ( #13441 )" ( #14069 )
...
This reverts commit d93ad3ba1e
.
10 months ago
Simon H
4f80ab6da6
fix: allow `warningFilter` option for `compileModule` ( #14066 )
...
fixes #14012
10 months ago
Paolo Ricciuti
4715dfaad2
feat: migrate `Component` to `ComponentExports<typeof Component>` in TS ( #13656 )
...
Closes #13491
---------
Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
10 months ago
FoHoOV
d93ad3ba1e
feat: add `ComponentExports` utility type ( #13441 )
...
Safer/clearer/backwards/forward-compatibale way to reference them
---------
Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
10 months ago
Dominic Gannaway
3999fed4ca
fix: ensure each block inert items are disposed of if the each block is also inert ( #13930 )
...
Fixes #13926
10 months ago
Paolo Ricciuti
e47ee22628
fix: wrap `:id`, `:where``:not` and `:has` with `:global` during migration ( #13850 )
...
Closes #13765
10 months ago
Dominic Gannaway
4a5a0b15d9
fix: ensure onMount correctly fires when new expressions are used ( #14049 )
...
* fix: ensure onMount correctly fires when used externally
* fix root context
* fix root context
* revert
* alternative fix
10 months ago
Dominic Gannaway
cdec39afac
fix: ensure custom element attribute/prop changes are in their own context ( #14016 )
...
Fixes #13848 .
When we set custom element attributes/props, we should be doing so without the current effect/reaction active. Otherwise, the custom element lifecycle might attach effects/dependencies to the wrong reaction and all manner of things can incorrectly occur
---------
Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
10 months ago
github-actions[bot]
e78ea1d555
Version Packages ( #14047 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
10 months ago
Dominic Gannaway
bce1c4898c
fix: ensure child effects are destroyed before their deriveds ( #14043 )
...
* fix: ensure legacy props cache last value when destroyed
* fix runes
* better approach
* better approach
* kill code
* lint
10 months ago
github-actions[bot]
f519b3d7b7
Version Packages ( #14031 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
10 months ago
Rich Harris
4157db94c4
fix: correct typo in compiler error messages ( #14044 )
10 months ago
Ahmad S.
224fcde821
fix: preserve the separator between selectors when an unused selector is in between ( #13954 )
...
fixes #13945
10 months ago
Dominic Gannaway
253d01ec29
fix: ensure element effects are executed in the correct order ( #14038 )
10 months ago
Ben McCann
217e40998a
chore: add changeset and comment ( #14040 )
...
for #14026
10 months ago
Simon H
8a2c97a7b8
fix: extend derived/state validation error to indirect exports ( #14039 )
...
Closes #14029
10 months ago
Simon H
1434f48f7c
fix: make compiler error extend from `Error` ( #14036 )
...
We originally didn't extend from `Error` anymore because its fields are of no real value to us, and has problems with serialization in a worker context.
Turns out this was a mistake, because various build tools rely on errors being thrown as something that extends Error, else they try to wrap it in their own error.
We therefore revert that change while still trying to preserve most of the advantages of not extending `Error`, namely nuking the useless stack trace and making sure the message is enumerable.
10 months ago
Dominic Gannaway
435a9c1cd0
fix: ensure toStore subscription correctly syncs latest value ( #14015 )
...
* fix: ensure toStore subscription correctly syncs latest value
* Update packages/svelte/src/store/index-client.js
---------
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
10 months ago
Simon H
0106204982
fix: minify inject CSS in prod mode ( #14006 )
...
When CSS is externalized we rightfully rely on the following tooling chain to properly minify CSS. When we inject the CSS however, that tooling won't be able to do that, so we gotta do it ourselves.
This PR brings back most of that logic that existed in Svelte 4. Fixes #13716
10 months ago
Simon H
2e9dab6a21
fix: more robust re-subscribe detection for `fromStore` ( #13995 )
...
Only count down after timeout, else we would reach 0 before our own render effect reruns, but reach 1 again when the tick callback of the prior teardown runs. That would mean we re-subcribe unnecessarily and create a memory leak because the old subscription is never cleaned up.
10 months ago
Simon H
cbc2ca36ce
fix: allow to pass in TS preference to migration ( #13929 )
...
First half of https://github.com/sveltejs/kit/issues/12880 - the idea is for the migration script to check for a tsconfig.json and then set it to `true` if one is found
10 months ago
github-actions[bot]
4441952028
Version Packages ( #13949 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
10 months ago
Ben McCann
07219f1cbd
chore: update links that previously pointed to preview site ( #14001 )
10 months ago
Ben McCann
c93a645b68
docs: fix broken links ( #13944 )
10 months ago
Paolo Ricciuti
b6fccdb4f7
fix: properly migrate imports types prefixed with $ ( #14007 )
10 months ago
Dominic Gannaway
3876b302f3
fix: ensure effect_tracking correctly handles tracking reactions ( #14005 )
...
* fix: ensure effect_tracking correctly handles tracking reactions
* fix: ensure effect_tracking correctly handles tracking reactions
10 months ago
Paolo Ricciuti
67cf3871b4
fix: more exhaustive check during `SvelteMap.set` in deriveds ( #13951 )
...
* fix: more exhaustive check during `SvelteMap.set` in deriveds
* chore: use set for version reactions
* chore: cleanup
10 months ago
Paolo Ricciuti
12fcc7a35a
fix: trim whitespace while migrating blocks ( #13941 )
...
Co-authored-by: Oscar Dominguez <dominguez.celada@gmail.com>
10 months ago
Paolo Ricciuti
7be3afb3a6
fix: add empty stack to `CompileDiagnostic` to show error on build ( #13942 )
...
* fix: add empty stack to `CompileDiagnostic` to show error on build
* chore: generate types
* chore: make stack optional to make TS happy
* chore: generate types -.-"
* chore: add comment
11 months ago
github-actions[bot]
da1fefcd45
Version Packages ( #13920 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
11 months ago
Dominic Gannaway
83a5eaac8e
fix: skip comment nodes in snippet validation logic ( #13936 )
11 months ago
Dominic Gannaway
37fa34c4ad
fix: ensure value is correctly set to zero on the progress element ( #13924 )
...
* fix: ensure value is correctly set to zero on the progress element
* fix: ensure value is correctly set to zero on the progress element
* fix: ensure value is correctly set to zero on the progress element
11 months ago
Dominic Gannaway
1e6cf1bb40
fix: ensure bind:group works as intended with proxied state objects ( #13939 )
11 months ago
Dominic Gannaway
7bbaedd6c7
fix: rethrow errors from await block if no catch block exists ( #13819 )
...
* chore: highlight swallowed errors from await blocks in DEV
* chore: highlight swallowed errors from await blocks in DEV
* chore: highlight swallowed errors from await blocks in DEV
* lint
* feedback
* feedback
* add test
* Update packages/svelte/tests/runtime-runes/samples/await-no-catch-error/main.svelte
---------
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
11 months ago
Simon H
81f9bdd376
fix: remove metadata from legacy AST ( #13927 )
...
Besides being private API that shouldn't be exposed, they caused our AST explorer on the Svelte site to traverse endlessly
fixes https://github.com/sveltejs/svelte.dev/issues/480
11 months ago
Dominic Gannaway
441124c5c7
fix: ensure SVG element attributes have case preserved ( #13935 )
...
* fix: ensure SVG element attributes have case preserved
* fix: ensure SVG element attributes have case preserved
* fix: ensure SVG element attributes have case preserved
11 months ago
Matthew Carroll
1a6a3e7ebd
fix: typo in `Action` types ( #13874 )
...
* typo: HTMLDiveElement
* regenerate types
* add changeset
---------
Co-authored-by: Conduitry <git@chor.date>
11 months ago
github-actions[bot]
1ee2ac4d05
Version Packages ( #13888 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
11 months ago
Paolo Ricciuti
b63fde3b75
fix: prevent migration script from adding `props.` to the `export let` identifier ( #13899 )
11 months ago
Paolo Ricciuti
3147287813
fix: prevent var name clashing for delegated events without params ( #13896 )
11 months ago
Dominic Gannaway
dee8db53df
chore: add missing changeset ( #13895 )
...
Adds a changeset for #13884
11 months ago
Dominic Gannaway
42ccdc1023
fix: ensure snippets after empty text correctly hydrate ( #13870 )
11 months ago
Dominic Gannaway
771b1e8905
fix: enable bound store props in runes mode components ( #13887 )
...
* fix: enable bound store props in runes mode components
* add some JSDoc, since it could be a headscratcher for future us
* make it clear that this is specifically about bindings
* skip intermediate value
* tweak other names too
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
11 months ago
Dominic Gannaway
4cf2d4a904
fix: ensure each block references to imports are handled correctly ( #13892 )
11 months ago
Dominic Gannaway
5a54ad9cc7
fix: ensure SvelteMap reactivity persists through deriveds ( #13877 )
...
* fix: ensure SvelteMap reactivity persists through deriveds
* fix: ensure SvelteMap reactivity persists through deriveds
* fix: ensure SvelteMap reactivity persists through deriveds
11 months ago
github-actions[bot]
041e563466
Version Packages ( #13863 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
11 months ago
Simon H
b979c291e2
fix: properly traverse children when checking matches for `:has` ( #13866 )
...
The previous algorithm didn't take control flow blocks etc into account, this fixes that. Fixes #13860
11 months ago
Paolo Ricciuti
04c38b089f
fix: allow binding to const with spread in legacy mode ( #13849 )
11 months ago
Dominic Gannaway
4fbd2a6f10
fix: ensure props internally untracks current_value on sets ( #13859 )
...
* fix: ensure props internally untracks current_value on sets
* Update packages/svelte/src/internal/client/reactivity/props.js
---------
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
11 months ago
Dominic Gannaway
60dcffb856
fix: internally wrap store subscribe in untrack ( #13858 )
...
* fix: internally wrap store subscribe in untrack
* lint
* Update packages/svelte/src/store/utils.js
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
---------
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
11 months ago
github-actions[bot]
af4d105cd3
Version Packages ( #13757 )
...
* Version Packages
* Update packages/svelte/CHANGELOG.md
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
11 months ago
Dominic Gannaway
d621f59642
feat: allow usage of getContext() within $derived runes ( #13830 )
...
Closes #13493 .
This PR allows the usage of getContext() inside $derived runes. Previously, you could use it, but only on init and not updates – and this inconsistency was unnecessary. We can make it work just like we do in other places.
11 months ago
Simon H
5669b31fe6
fix: ensure `:has` selectors followed by other selectors match ( #13824 )
...
I resisted this previously because it felt a bit wasteful, but I now think that there's really no way around this: Instead of only going upwards the tree while matching, for `:has` we go _down_ the tree to see what matches. More specifically, we're collecting the children of the current element and then check if one of those does match the selectors inside `:has`.
This makes the way the code works easier to reason about and also removes some boolean tracking we had to add for the previous approach.
Fixes #13779
11 months ago
Ben McCann
2d69a64e4e
chore: one of these is not like the others ( #13834 )
11 months ago
Dominic Gannaway
17cb462ca4
fix: ensure muted DOM property works correctly in FF ( #13751 )
...
Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
11 months ago
Francesco Zanini
185e112377
fix: property name conversion in custom transitions ( #13820 )
11 months ago
José Pablo Ramírez Vargas
95980d1f08
feat: Define the MountOptions type ( #13674 )
...
* feat: Define the MountOptions type
* Revert "feat: Define the MountOptions type"
This reverts commit bd3596fcba
.
* feat: Define the MountOptions type
* chore: Add changeset
* lint
* lint
---------
Co-authored-by: Dominic Gannaway <dg@domgan.com>
11 months ago
Paolo Ricciuti
b6a67e85b4
fix: prevent spread attribute from overriding class directive ( #13763 )
11 months ago
Dominic Gannaway
de609ec34c
fix: ensure $effect.tracking returns false inside transition functions ( #13775 )
11 months ago
Paolo Ricciuti
8ff2af52d3
fix: show filename information in `legacy_recursive_reactive_block` ( #13764 )
11 months ago
Paolo Ricciuti
41d61c7a37
fix: properly migrate ts with inferred type comments ( #13761 )
...
Closes #13747
11 months ago
Paolo Ricciuti
9832c639e5
fix: migrate default slots to children snippet ( #13760 )
...
Closes #13758
11 months ago
Paolo Ricciuti
d1cac703c0
fix: don't print errors on migration errors ( #13754 )
...
makes it look like the migration script failed when in reality you need to update some of your files by hand
11 months ago
github-actions[bot]
ae8f50fd6a
Version Packages ( #13742 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
11 months ago
Simon H
a6e416da8c
fix: mark `:has` selectors with multiple preceding selectors as used ( #13750 )
...
Fixes #13717
There are two parts to this:
1. the parent selectors weren't passed along for the check inside `:has`, which in case of a leading combinator would mean it would always count as unused
2. In case if a selector like `x > y:has(z)`, the prior logic would correctly determine that for element `z` there's a match for the `:has` selector, by first checking its contents and then walking up the tree. But after it did that, it would try to walk up the tree once more, which is a) wasteful b) buggy because the tree walking mechanism would no longer be adjusted for the `:has` special case, resulting in false negatives. To fix that, the `:has` will return a new value from the function, signaling that it already fully checked the upper selectors, and so the function calling it will skip doing that.
11 months ago
adiGuba
ad578a5da5
fix: @debug does not work with proxied-state ( #13690 )
...
* fix: @debug must use $state.snapshot() on value
* changeset
* add test
---------
Co-authored-by: Dominic Gannaway <dg@domgan.com>
11 months ago
Simon H
28c8d2b95d
fix: do not comment out unused selectors that are inside an unused selector ( #13746 )
...
fixes #13680
11 months ago
Simon H
2efae794b8
fix: add more robust check for `Element` prototype ( #13744 )
...
fixes #13691
fixes #13414
fixes #13726
11 months ago
Simon H
a08f063b37
fix: more accurately detect `$derived` migration use cases ( #13740 )
...
- detect store mutations and not use `$derived` in that case, fixes #13723
- better detect `let x` that can be folded into `$derived`, fixes #13727
---------
Co-authored-by: ComputerGuy <63362464+Ocean-OS@users.noreply.github.com>
11 months ago
Simon H
8a06d051e8
fix: do not add jsdoc if no types found ( #13738 )
...
fixes #13417
fixes #13724
11 months ago
Dominic Gannaway
be02b7e54c
event_context ( #13737 )
11 months ago
github-actions[bot]
fb052be96e
Version Packages ( #13736 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
11 months ago
Simon H
8251bae8db
fix: better children snippet / default slot interop ( #13734 )
...
- correctly assign children snippet to default slot, fixes #13067
- allow `svelte:fragment` without `let:` directives to be rendered by `@render children()`, fixes #13066
11 months ago
Florent BENOIT
d0bfd22bef
fix: webview can contain any string for preload ( #13733 )
...
fixes #13661
11 months ago
github-actions[bot]
41b5cd6f5d
Version Packages ( #13720 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
11 months ago
Dominic Gannaway
ed6d7eeb48
wrap-transition-events ( #13719 )
11 months ago
github-actions[bot]
0581e334a0
Version Packages ( #13704 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
11 months ago
Paolo Ricciuti
e43176906f
fix: don't blank css on migration error ( #13703 )
11 months ago
github-actions[bot]
c73c683ecd
Version Packages ( #13702 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
11 months ago
Paolo Ricciuti
6ad017ffc5
fix: use typedef for JSDoc props and maintain comments ( #13698 )
...
* fix: use typedef for JSDoc props and maintain comments
* chore: add comments
* chore: add extra spaces and delete commented line
11 months ago
pngwn
7691521dc1
major bump - svelte 5 ( #13701 )
11 months ago
github-actions[bot]
0fdfd9c50c
Version Packages (next) ( #13696 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
11 months ago
Dominic Gannaway
2ca9a81679
fix: ensure user effects are correctly executed on initialisation ( #13697 )
11 months ago
Dominic Gannaway
ae10f4d37c
breaking: state mutations inside the template are no longer allowed ( #13660 )
...
* breaking: state mutations inside the template are no longer allowed
* fix test
* fix test
* lint
* update error message
* fix test
11 months ago
github-actions[bot]
966a6bda05
Version Packages (next) ( #13695 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
11 months ago
Dominic Gannaway
bb491f1229
fix: avoid chromium issue with dispatching blur on element removal ( #13694 )
...
* fix: avoid chromium issue with dispatching blur on element removal
* fix: avoid chromium issue with dispatching blur on element removal
* fix: avoid chromium issue with dispatching blur on element removal
* active effect too
* try/finally
11 months ago
github-actions[bot]
793a8de06e
Version Packages (next) ( #13650 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
11 months ago
Paolo Ricciuti
18c5a5ba2d
fix: bail out if slot name changes and $$slots assigned to variable ( #13678 )
11 months ago
Paolo Ricciuti
ab9eeb46fe
fix: migrated snippet shadowing prop and let directive removal ( #13679 )
11 months ago
Dominic Gannaway
894b1c37ad
chore: CompileDiagnostic no longer extends Error ( #13651 )
11 months ago
Dominic Gannaway
61391c8704
fix: ensure migrate correctly handles named slots ( #13676 )
...
* fix: ensure migrate correctly handles named slots
* tweak
* fix
11 months ago
Dominic Gannaway
c9d85c2d52
fix: migrate reactive statements with inner blocks ( #13675 )
11 months ago
Dominic Gannaway
f398929fdd
fix: correct migration of uninitialised state ( #13673 )
...
* fix: correct migration of uninitialised state
* better fix
11 months ago
Paolo Ricciuti
0598f2bbe1
fix: reset `reset_element` in `render` to prevent runtime error ( #13669 )
11 months ago
Paolo Ricciuti
9f930f4e9b
feat: tell users of `@migration-task` ( #13668 )
11 months ago
Paolo Ricciuti
969e6aa750
feat: add `migration-task` for impossible to migrate slots ( #13658 )
...
* feat: add `migration-task` for impossible to migrate slots
* Update packages/svelte/src/compiler/migrate/index.js
Co-authored-by: Paolo Ricciuti <ricciutipaolo@gmail.com>
* Update packages/svelte/tests/migrate/samples/slot-non-identifier/output.svelte
Co-authored-by: Paolo Ricciuti <ricciutipaolo@gmail.com>
* Update packages/svelte/tests/migrate/samples/slot-non-identifier/output.svelte
Co-authored-by: Paolo Ricciuti <ricciutipaolo@gmail.com>
* Update packages/svelte/tests/migrate/samples/slot-non-identifier/output.svelte
Co-authored-by: Paolo Ricciuti <ricciutipaolo@gmail.com>
* Update packages/svelte/tests/migrate/samples/slot-non-identifier/output.svelte
Co-authored-by: Paolo Ricciuti <ricciutipaolo@gmail.com>
---------
Co-authored-by: Dominic Gannaway <trueadm@users.noreply.github.com>
11 months ago
Paolo Ricciuti
0dcd4f6c6e
feat: add `migration-task` comment after errors ( #13659 )
11 months ago
Paolo Ricciuti
b352f08e9d
fix: migrating rest props type includes props types ( #13632 )
...
* fix: rest props type includes props types
* chore: remove extra line
* Update .changeset/spotty-kings-hug.md
11 months ago
github-actions[bot]
d7cf76bbb6
Version Packages (next) ( #13640 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
11 months ago
Dominic Gannaway
193cc37f7a
fix: correctly applies autofocus to static elements ( #13648 )
...
* fix: correctly applies autofocus to static elements
* lint
* fix other case
11 months ago
Dominic Gannaway
e21e624fff
chore: avoid reporting inspections when an exception occurs ( #13601 )
...
* chore: avoid reporting inspections when an exception occurs
* add test
* revise
11 months ago
adiGuba
bb245445fc
fix : $.component() break transition ( #13646 )
...
* $.component() must use EFFECT_TRANSPARENT
* changeset
* Update .changeset/eight-pans-worry.md
---------
Co-authored-by: Dominic Gannaway <trueadm@users.noreply.github.com>
11 months ago
Dominic Gannaway
139114bdcb
fix: ensure legacy run utility does not cause cycles ( #13643 )
...
* fix: ensure legacy run utility does not cause cycles
* add warning
* add warning
* lint
* feedback
* lint
* lint
11 months ago
Frédéric Crozatier
ffa2af7549
fix: `method` is case insensitive ( #13639 )
...
* fix method
* changeset
11 months ago
Paolo Ricciuti
372884cf99
fix: use `internal_set` in `await` block ( #13642 )
11 months ago
Paolo Ricciuti
440017d442
fix: better migration for leading and trailing comments ( #13630 )
11 months ago