Rich Harris
2d3818463a
chore: check namespace inside set attributes ( #15443 )
...
* set_attributes for <svelte:element>
* changeset
* Update .changeset/wise-hats-wonder.md
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
* add changeset
* remove `chore` changeset — no need for non-user-facing changes to appear in changelog
* Update packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/element.js
* determine element traits inside set_attributes
* unused
* stash lookup
---------
Co-authored-by: adiguba <frederic.martini@gmail.com>
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
6 months ago
github-actions[bot]
43ff3047ac
Version Packages ( #15452 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
6 months ago
Rich Harris
76f5ecfdab
fix: never deduplicate expressions in templates ( #15451 )
6 months ago
github-actions[bot]
0abd7f2a7f
Version Packages ( #15447 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
6 months ago
Rich Harris
3fc2007836
fix: run effect roots in tree order ( #15446 )
...
* process effect roots in tree order
* bring test over
* add test
* changeset
* tidy
6 months ago
github-actions[bot]
3b465a7172
Version Packages ( #15444 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
6 months ago
Paolo Ricciuti
181fb2ad49
fix: correctly set `is_updating` before flushing root effects ( #15442 )
...
* fix: correctly set `is_updating` before flushing root effects
* rename for consistency with update_effect
* use var
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
6 months ago
github-actions[bot]
cd56c1d60e
Version Packages ( #15433 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
6 months ago
Simon H
ef7fd96ccf
fix: switch to our fork acorn typescript plugin ( #15393 )
...
* fix: switch to our fork acorn typescript plugin
* changeset
* bump
* bump
* bump
* adjust snapshots
* this should be obsolete now
* bump
* bump
6 months ago
github-actions[bot]
0f2633736d
Version Packages ( #15431 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
6 months ago
Tom Adler
e3dc396e01
fix: make dialog element and role interactive ( #15429 )
...
Fixes #8283
Also see https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/issues/932
6 months ago
Rich Harris
b82692af2f
feat: add `idPrefix` to `render` ( #15428 )
...
This ensures someone like Astro can render multiple islands and the unique ids produced in them are able to be deduplicated
---------
Co-authored-by: Hugos68 <hugokorteapple@gmail.com>
Co-authored-by: paoloricciuti <ricciutipaolo@gmail.com>
Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
6 months ago
github-actions[bot]
7ce2dfc622
Version Packages ( #15402 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
6 months ago
adiGuba
2032049e47
chore: Reduce hydration comment for {:else if} ( #15250 )
...
* rewrite else/if hydration
* fix: bad index
* reduce args on if_block()
* restore the block
* don't use isNan()
* changeset
6 months ago
Paolo Ricciuti
474c588067
fix: disallow `bind:group` to snippet parameters ( #15401 )
6 months ago
github-actions[bot]
e4987d2a9f
Version Packages ( #15383 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
6 months ago
adiGuba
fe343e9c50
fix: catch error on @const tag in svelte:boundary in DEV mode ( #15369 )
...
* fix: catch error on @const tag in svelte:boundary
* changeset
* edit changeset
* test
* fix
* rollback
* simpler way to do that
* rollback
* roolback again
---------
Co-authored-by: paoloricciuti <ricciutipaolo@gmail.com>
6 months ago
adiGuba
8fb2fb70e1
fix : bug "$0 is not defined" with svelte:element and a single class with a function call ( #15396 )
...
* add spread to test
* fix #15386
* fix #15392
* test
* changeset
* use is_text_attribute
6 months ago
adiGuba
cf56973bf0
fix: class:directive not working with $$restProps ( #15389 )
...
* add spread to test
* fix #15386
* do no set cssHash on non-scoped element
* changeset
6 months ago
Paolo Ricciuti
3d59e84a65
fix: allow double hyphen css selector names ( #15384 )
6 months ago
Paolo Ricciuti
c2ec0d9ac2
fix: allow for duplicate `var` declarations ( #15382 )
6 months ago
github-actions[bot]
bbeeed421b
Version Packages ( #15380 )
...
* Version Packages
* this changeset was unnecessary
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Rich Harris <rich.harris@vercel.com>
6 months ago
Rich Harris
51337f22bd
chore: simplify flushing ( #15348 )
...
* this appears to be unnecessary
* DRY out
* this doesnt appear to do anything useful
* simplify
* remove unused if block
* simplify, make non-recursive
* unused
* DRY
* simplify
* tidy up
* simplify
* changeset
* unused
* Revert "changeset"
This reverts commit 946e00dcf7
.
* make flush_sync non-recursive
* fix flushSync types
* fix
* unused
* simplify
* tidy up
* tidy up
* present unnecessary microtasks, avoid flushing if no function provided
* simplify
6 months ago
Rich Harris
7958eb74df
chore: remove unnecessary `binding.is_called` property ( #15361 )
6 months ago
github-actions[bot]
220c2418d1
Version Packages ( #15358 )
...
* Version Packages
* tweak
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Rich Harris <rich.harris@vercel.com>
6 months ago
adiGuba
d4360af751
chore: rewrite set_class() to handle directives ( #15352 )
...
* set_class with class: directives
* update expected result (remove leading space)
* fix
* optimize literals
* add test
* add test for mutations on hydration
* clean observer
* Update packages/svelte/src/compiler/phases/3-transform/client/visitors/RegularElement.js
unused
Co-authored-by: Rich Harris <hello@rich-harris.dev>
* Update packages/svelte/src/compiler/phases/3-transform/client/visitors/RegularElement.js
unused for now
Co-authored-by: Rich Harris <hello@rich-harris.dev>
* Update packages/svelte/src/compiler/phases/3-transform/client/visitors/shared/element.js
unused for now
Co-authored-by: Rich Harris <hello@rich-harris.dev>
* Update packages/svelte/src/compiler/phases/3-transform/server/visitors/shared/element.js
nit
Co-authored-by: Rich Harris <hello@rich-harris.dev>
* Update packages/svelte/src/internal/client/dom/elements/attributes.js
nit
Co-authored-by: Rich Harris <hello@rich-harris.dev>
* Update packages/svelte/src/internal/shared/attributes.js
rename clazz to value :D
Co-authored-by: Rich Harris <hello@rich-harris.dev>
* remove unused + fix JSDoc
* drive-by fix
* minor style tweaks
* tweak test
* this is faster
* tweak
* tweak
* this is faster
* typo
* tweak
* changeset
---------
Co-authored-by: Rich Harris <hello@rich-harris.dev>
Co-authored-by: Rich Harris <rich.harris@vercel.com>
6 months ago
Alexis
5a946e7905
fix: Allow @const inside #key ( #15377 )
6 months ago
adiGuba
1e1aea4063
chore: remove unnecessary `?? ''` on some expressions ( #15287 )
...
* no `?? ''` on some expressions
* changeset
* delete operator returns boolean
* inverted conditions are a lil confusing
* no need for else after return
* simplify condition
* may as well add special handling for undefined while we're here
* use normal string literal when there are no values
* omit assignment when there is no text content
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
7 months ago
github-actions[bot]
9873443337
Version Packages ( #15304 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
7 months ago
Paolo Ricciuti
d8e78f7f57
fix: `muted` reactive without `bind` and select/autofocus attributes … ( #15326 )
...
* fix: `muted` reactive without `bind` and select/autofocus attributes working with function calls
Co-authored-by: Joel Howse <joel@helicalco.com>
* chore: add comments
---------
Co-authored-by: Joel Howse <joel@helicalco.com>
7 months ago
Simon H
9091e7e930
fix: fire delegated events on target even it was disabled in the meantime ( #15319 )
...
They DOM could've been updated already by the time the event bubbling logic is reached, so the target element itself could not be notified of the event because it is marked as disabled. But the target could not have been disabled because it emits the event in the first place, so we emit regardless.
No test because not reproducible in jsdom environment.
Fixes #15256
7 months ago
Ranjan Purbey
575900de88
fix: Add more checks to determine if element is non-static ( #15259 )
...
Fixes #15241
7 months ago
tomoam
073f4d8911
fix: prevent writable store value from becoming a proxy when reassigning using $-prefix ( #15283 )
...
fixes #15281
7 months ago
Paolo Ricciuti
dde8603872
fix: do not warn for `binding_property_non_reactive` if binding is a store in an each ( #15318 )
...
Fixes #15315
7 months ago
adiGuba
c40392c1e8
chore: remove options.uid in render() ( #15302 )
...
* remove options.uid in render()
* changeset
* chore: update changeset
---------
Co-authored-by: Paolo Ricciuti <ricciutipaolo@gmail.com>
7 months ago
github-actions[bot]
32b78c9954
Version Packages ( #15279 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
7 months ago
Simon H
7e3253745e
fix: ensure AST analysis on `svelte.js` modules succeeds ( #15297 )
...
This was the result of a `@ts-expect-error` silencing other type errors, which lead to this creeping in. This changes it so that the object is fully set, so we'll get type errors when new properties need to be added
fixes #15284
7 months ago
Paolo Ricciuti
b6bf735a23
fix: correctly ssr component in `svelte:head` with `$props.id()` or `css='injected'` ( #15291 )
7 months ago
Caique Torres
21dadfc997
fix: ignore typescript abstract methods during code transformation ( #15267 )
7 months ago
github-actions[bot]
23ecc364da
Version Packages ( #15271 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
7 months ago
Dominic Gannaway
f747c412f4
chore: tweak effect self invalidation logic ( #15275 )
...
Also make sure events dispatched via transition/animation logic runs outside event context
Related to #15262
7 months ago
Paolo Ricciuti
5e52825d60
fix: take private and public into account for `constant_assignment` of derived state ( #15276 )
...
Fixes #15273
7 months ago
Paolo Ricciuti
18481386f3
fix: use `importNode` to clone templates for Firefox ( #15272 )
...
* fix: use `importNode` to clone templates for Firefox
* fix: move `is_firefox` check to line 28
* fix: revert using `is_firefox` too soon
7 months ago
Simon H
a3e49b6110
fix: recurse into `$derived` for ownership validation ( #15166 )
...
- `$derived` can contain `$state` declarations so we cannot ignore them, so this reverts #14533
- instead, we add equality checks to not do this expensive work unnecessarily
- this also adds a render effect similar to the class ownership addition when it detects a getter on a POJO during ownership addition
fixes #15164
7 months ago
adiGuba
afae274587
fix: value/checked not correctly set using spread ( #15239 )
...
* set value/checked by JS
* test
* changeset
* fix test form-default-value-spread
7 months ago
adiGuba
85f83ec435
feat: $props.id(), a SSR-safe ID generation ( #15185 )
...
* first impl of $$uid
* fix
* $props.id()
* fix errors
* rename $.create_uid() into $.props_id()
* fix message
* relax const requirement, validate assignments instead
* oops
* simplify
* non-constants should be lowercased
* ditto
* start at 1
* add docs
* changeset
* add test
* add docs
* doc : add code example
* fix type reported by bennymi
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
7 months ago
github-actions[bot]
280d8c74cc
Version Packages ( #15263 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
7 months ago
Dominic Gannaway
b602c59a22
fix: when re-connecting unowned deriveds, remove their unowned flag ( #15255 )
...
* fix: when an unowned derived is tracked again, remove unowned flag
* fix: when an unowned derived is tracked again, remove unowned flag
* test case
* test case
* cleanup unused logic
* simplify
* simplify
* simplify
* simplify
* add test
* fix other issue
* back to original plan
* Apply suggestions from code review
---------
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
7 months ago
Paolo Ricciuti
02788f8e62
fix: allow mutation of private derived state ( #15228 )
...
Also disallow reassignment of private derived state
Fixes #15227
7 months ago
github-actions[bot]
c4d4349d0a
Version Packages ( #15234 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
7 months ago
Simon H
4883fd2c83
fix: hydrate `href` that is part of spread attributes ( #15226 )
...
We had some duplicated and buggy code, removing it fixes #15120
7 months ago
Dominic Gannaway
f2c83e5db7
fix: ensure unowned derived dependencies are not duplicated when reac… ( #15232 )
...
* fix: ensure unowned derived dependencies are not duplicated when reactions are skipped
* added test case
* added test case
* add comment
7 months ago
github-actions[bot]
b0c4fa5246
Version Packages ( #15216 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
7 months ago
Simon H
3b7066f5c6
fix: ensure custom element updates don't run in hydration mode ( #15217 )
...
* fix: ensure custom element updates don't run in hydration mode
When a custom element is created before Svelte hydration kicks in, it will scaffold itself, using the properties given via attributes.
Now when a custom element property is set during Svelte's hydration, the Svelte custom element component could run logic like updating an each block. Without turning off hydration mode during that time, the update would try to pick up existing element nodes (because it thinks they must be there because of hydration mode), and crash.
No test because it would require a setup where we can ensure the element is scaffolded before hydration runs.
Fixes #15213
* changeset
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
7 months ago
Simon H
6f392d679b
fix: properly set `value` property of custom elements ( #15206 )
...
Avoid going through the `element.value = element.__value = newValue` condition because `__value` is actually how Lit stores the current value on the element, and messing with that would break things: Lit would think the value hasn't changed (because `__value` is already set to the new value by us) and doesn't fire an update.
fixes #15194
7 months ago
Dominic Gannaway
d39d8c0675
fix: ensure tracking returns true, even if in unowned ( #15214 )
...
* fix: ensure tracking returns true, even if in unowned
* fix: ensure tracking returns true, even if in unowned
* Update packages/svelte/tests/runtime-runes/samples/effect-tracking-unowned/main.svelte
---------
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
7 months ago
github-actions[bot]
64f86ee9d4
Version Packages ( #15190 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
7 months ago
Dominic Gannaway
e0b3dc020c
chore: remove unused code from signal logic ( #15195 )
7 months ago
7nik
5b30fbfb0b
fix: encounter svelte:element in blocks as sibling during pruning css ( #15165 )
...
Fixes #14890
7 months ago
github-actions[bot]
04addca428
Version Packages ( #15156 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
7 months ago
Dominic Gannaway
7bef5963bd
fix: ensure reactions are correctly attached for unowned deriveds ( #15158 )
...
* fix: ensure reactions are correctly attached for unowned deriveds
* tune
7 months ago
Simon H
970aa7cfaa
fix: prevent false-positive ownership validations due to hot reload ( #15154 )
...
The component identity could change due to HMR, so we fall back to checking the filenames as well
fixes #14746
7 months ago
Simon H
83f00ebbd6
fix: don't error on slot prop inside block inside other component ( #15148 )
...
`slot` is treated as a regular prop if it is not used directly inside another component, but we were running validations on such regular props that should only be run on real slots.
Fixes #15125
7 months ago
Simon H
b8607f8765
fix: silence a11y attribute warnings when spread attributes present ( #15150 )
...
Fixes #15067
7 months ago
Simon H
f5406c952e
fix: widen ownership when calling setContext ( #15153 )
...
Instead of doing ownership addition at each `getContext` call site, we do it once as the `setContext` call site and make the state basically global.
- avoids potential false positives in edge cases
- makes the whole thing more performant, especially around things like calling `getContext` inside a list item component
- false negatives are unlikely from this
fixes #15072
7 months ago
7nik
522557559f
fix: do not prune selectors like `:global(.foo):has(.scoped)` ( #15140 )
...
Fixes #14910
The issue occurs only when :has() targets at a component's root element and because include_self is false.
I came to the conclusion that this is the same case as :root:has(.scoped).
7 months ago
github-actions[bot]
c8bbb15693
Version Packages ( #15139 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
7 months ago
Dominic Gannaway
13a6d555c0
fix: improve derived connection to ownership graph ( #15137 )
...
* fix: improve derived connection to ownership graph
* revised
* revised
* revised
* revised
* feedback
* feedback
* invasive change
* fix bugs
* fix other bug
7 months ago
7nik
9410ad0318
fix: correctly look for sibling elements inside blocks and components ( #15106 )
...
Fixes #15027 and fixes #14995
When the target element is inside a block or component, get_following_sibling_elements was looking only for sibling elements after the block/component. This PR fixes it by starting the search from the begging of the block/component and skipping nodes that go before the target element.
7 months ago
github-actions[bot]
b2c8224a73
Version Packages ( #15118 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
7 months ago
Dominic Gannaway
fc4dd2dec4
fix: lazily connect derievds (in deriveds) to their parent ( #15129 )
7 months ago
Elliott Johnson
3f8ce21f47
fix: Add `bind:focused` to `HTMLAttributes` ( #15122 )
...
* Revert "fix: ensure untrack correctly retains the active reaction (#15065 )"
This reverts commit 2ad519542d
.
* feat: Add `bind:focused` to `HTMLAttributes`
* Revert "Revert "fix: ensure untrack correctly retains the active reaction (#15065 )""
This reverts commit f4e98bf89f
.
* changeset
* tests
7 months ago
Rich Harris
0e0f01ee1c
fix: disallow $state/$derived in const tags ( #15115 )
7 months ago
github-actions[bot]
357e1a74b4
Version Packages ( #15088 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
7 months ago
Trevor N. Suarez
d47f4f5908
fix: expand boolean attribute support ( #15095 )
...
* Adding test for expected boolean attribute support
* Improving support for more boolean attributes:
Added:
- `defer`
- `disablepictureinpicture`
- `disableremoteplayback`
Improved:
- `allowfullscreen`
- `novalidate`
* Skipping JSDOM version of boolean attribute test
JSDOM lacks support for some attributes, so we'll skip it for now.
See:
- `async`: https://github.com/jsdom/jsdom/issues/1564
- `nomodule`: https://github.com/jsdom/jsdom/issues/2475
- `autofocus`: https://github.com/jsdom/jsdom/issues/3041
- `inert`: https://github.com/jsdom/jsdom/issues/3605
- etc...: https://github.com/jestjs/jest/issues/139#issuecomment-592673550
* Adding changeset
8 months ago
Edoardo Cavazza
d17f5c748d
fix: add check for is attribute ( #15086 )
...
Fixes #15085
Add a check for is attribute in is_custom_element_node function.
8 months ago
Rich Harris
7740d4576b
fix: optimise || expressions in template ( #15092 )
8 months ago
Theodore Brown
c2e805f05c
fix: consistently set value to blank string when value attribute is undefined ( #15057 )
...
Fixes #4467
8 months ago
Rich Harris
8bba70b8e3
fix: avoid double deriveds in component props ( #15089 )
...
* fix: prevent double deriveds in component props
* unused
* reuse mechanism
* move code to where it is used
* changeset
8 months ago
Trevor N. Suarez
eee808fb79
fix: correctly handle `novalidate` attribute casing ( #15083 )
...
This PR fixes #15082 by correctly handling the HTML element novalidate attribute casing through noValidate DOM property mapping.
8 months ago
Paolo Ricciuti
7da86ef80c
fix: don't throw for `undefined` non delegated event handlers ( #15087 )
...
* fix: don't throw for `undefined` non delegated event handlers
* chore: update typings
8 months ago
github-actions[bot]
ee024ffd0e
Version Packages ( #15080 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
8 months ago
Dominic Gannaway
09510c8c5c
fix: address regression with untrack ( #15079 )
...
* fix: address regression with untrack
* add test
8 months ago
github-actions[bot]
c75f1f5f2f
Version Packages ( #15052 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
8 months ago
Paolo Ricciuti
5ad6a0cdc3
fix: initialize `files` bind on hydration ( #15059 )
8 months ago
Dominic Gannaway
2ad519542d
fix: ensure untrack correctly retains the active reaction ( #15065 )
...
* fix: ensure untrack correctly retains the active reaction
* fix: ensure untrack correctly retains the active reaction
8 months ago
ComputerGuy
5f6525f416
fix: omit unnecessary nullish coallescing in template expressions ( #15056 )
...
* omit unnecessary nullish coallescing in template expressions
* add tests
8 months ago
Rich Harris
700029bd4d
fix: more efficient template effect grouping ( #15050 )
...
* WIP
* drive-by
* group attribute updates
* fix
* more
* unused
* more
* WIP
* unused
* simplify
* simplify
* simplify
* more
* unused
* unused
* more
* tweak
* update how class/style directives are handled
* more
* more
* simplify
* changeset
8 months ago
github-actions[bot]
a9d1f46dbb
Version Packages ( #15021 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
8 months ago
Rich Harris
509ba568f3
fix: create fewer deriveds for concatenated strings ( #15041 )
...
* fix: create fewer deriveds for concatenated strings
* stringified_text -> expression
8 months ago
Puru Vijay
2aefc5430d
feat(elements): Expose ClassValue ( #15035 )
...
* Push
* Cleanup
* Add changeset
* Remove redundant string
* Update documentation/docs/03-template-syntax/18-class.md
Co-authored-by: Paolo Ricciuti <ricciutipaolo@gmail.com>
* Update documentation/docs/03-template-syntax/18-class.md
---------
Co-authored-by: Paolo Ricciuti <ricciutipaolo@gmail.com>
8 months ago
Paolo Ricciuti
973b51d168
fix: correctly parse leading comments in function binding ( #15020 )
...
* fix: correctly parse leading comments in function binding
* chore: fix lint
8 months ago
github-actions[bot]
1d3c4397b2
Version Packages ( #15010 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
8 months ago
Rich Harris
ff79704ab8
fix: bump esrap ( #15015 )
...
* chore: bump esrap
* changeset
8 months ago
Dominic Gannaway
5419610833
fix: ensure resume effects are scheduled in topological order ( #15012 )
...
* fix: ensure resume effects are scheduled in topological order
* fix: ensure resume effects are scheduled in topological order
8 months ago
Paolo Ricciuti
360ee70dcb
fix: remove listener on `bind_current_time` teardown ( #15013 )
...
Fixes #15008
8 months ago
Paolo Ricciuti
dfa97a5e64
feat: allow every children in `template` tags ( #15007 )
...
* feat: allow every children in `template` tags
* Update .changeset/dry-mails-return.md
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
8 months ago
github-actions[bot]
a1698c63ec
Version Packages ( #15001 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
8 months ago
Dominic Gannaway
dae4c5f5e1
fix: ensure signal write invalidation within effects is consistent ( #14989 )
...
* fix: ensure signal write invalidation within effects is persistent
* fix: ensure signal write invalidation within effects is persistent
* fix: ensure signal write invalidation within effects is persistent
* address feedback
8 months ago
Paolo Ricciuti
a129592e5b
feat: allow const tag inside `svelte:boundary` ( #14993 )
...
* feat: allow const tag inside `svelte:boundary`
* chore: add better test
* docs: update docs for `@const`
8 months ago
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