Simon H
13c6c273c6
fix: prevent false positives when detecting runes mode ( #9599 )
...
Move references from module scope to instance scope if we determined that these references are store subscriptions
fixes #9580
12 months ago
Rich Harris
1f4ae5ef45
chore: remove some unused code ( #9593 )
...
Co-authored-by: Rich Harris <rich.harris@vercel.com>
12 months ago
Dominic Gannaway
cf9130613d
feat: add $effect.active rune ( #9591 )
...
* chore: add $effect.active rune
* chore: add $effect.active rune
12 months ago
Rich Harris
fe9c0bc19d
chore: bump esrap ( #9590 )
12 months ago
Dominic Gannaway
eb0b4dc6e5
chore: add inline new class warning ( #9583 )
...
* chore: add inline new class warning
* Address feedback
* address feedback
* more tests
12 months ago
Simon H
1003acccc4
feat: add Snippet type ( #9584 )
...
* feat: add Snippet type
related to #9447
* one more test
1 year ago
Dominic Gannaway
da15806136
fix: adjust event delegation heuristics ( #9581 )
...
Fixes #9561
1 year ago
Rich Harris
1bc89b5eb6
fix: deconflict generated names against globals ( #9570 )
...
fixes #9559
1 year ago
Simon H
617df1f3c3
fix: adjust regex ( #9572 )
...
would error on non-quoted attributes with more than one character
1 year ago
github-actions[bot]
b9664700b7
Version Packages (next) ( #9542 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Rich Harris
459e4ff006
feat: native TypeScript support ( #9482 )
...
* add typescript support to parser
* fix
* unnecessary
* various
* transform assertions
* tweak
* prettier
* robustify
* fix
* see if this fixes the prettier stuff
* only parse ts in ts mode
* fixes
* fix
* fix
* fix
* fix
* more
* check
* changeset
* allow type annotations on all contexts
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
1 year ago
Dominic Gannaway
bd2a586fea
chore: more transition code-golfing ( #9536 )
1 year ago
github-actions[bot]
699c337908
Version Packages (next) ( #9535 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Dominic Gannaway
5809ac6758
chore: rename internal object properties ( #9532 )
...
* chore: rename internal object properties
chore: rename internal object properties
order properties and add comments
add missing remove_in_transitions
* jsdoc
1 year ago
github-actions[bot]
5458ea7735
Version Packages (next) ( #9530 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Dominic Gannaway
b0588d7888
fix: address intro transition bugs ( #9528 )
...
* fix: address intro transition bugs
* fix: address intro transition bugs
1 year ago
Dominic Gannaway
298da65ed6
chore: more signal fine-tuning ( #9531 )
...
* chore: opt for two signal data-structures to reduce memory usage
1 year ago
Dominic Gannaway
bbd1a6c05a
chore: tune signals for better runtime perf ( #9529 )
1 year ago
github-actions[bot]
a36dba7df0
Version Packages (next) ( #9519 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Dominic Gannaway
f886bc133e
fix: handle intro global transition propagation correctly ( #9515 )
...
* fix: stop propagating global intros
* fix: stop propagating global intros
* add test
1 year ago
github-actions[bot]
e0271f0fc7
Version Packages (next) ( #9492 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Dominic Gannaway
3b2e6eac9a
fix: address unowned propagation signal issue ( #9510 )
...
* fix: address unowned propagation signal issue
* Add comments
1 year ago
Dominic Gannaway
378093941d
fix: ensure we visit assignments during compilation ( #9511 )
...
* fix: add missing visit for expressions
* fix: add missing visit for expressions
* Add test
1 year ago
Simon H
4418ba6535
fix: add top level snippets to instance scope ( #9467 )
...
fixes #9460
1 year ago
Simon H
1beb5e8dc9
fix: tweak script/style tag parsing/preprocessing logic ( #9502 )
...
Related to sveltejs/language-tools#2204 / sveltejs/language-tools#2039
The Svelte 5 version of #9486 and #9498
---------
Co-authored-by: Rich Harris <richard.a.harris@gmail.com>
Co-authored-by: Rich Harris <rich.harris@vercel.com>
1 year ago
Rich Harris
c827b0c772
fix: only treat instance context exports as accessors ( #9500 )
...
* failing test for #9499
* limit export handling to instance context
* changeset
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
1 year ago
Rich Harris
ede1edd314
fix: emit useful error on invalid binding to derived state ( #9497 )
...
closes #9495
1 year ago
Tee Ming
37f249350c
allow setting files ( #9463 )
1 year ago
github-actions[bot]
c823dd2efa
Version Packages (next) ( #9481 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Dominic Gannaway
60c273eb76
Revert "fix: address bug in before/after update" ( #9480 )
...
* Revert "fix: address bug in before/after update (#9448 )"
This reverts commit 9eb969ddd4
.
* add changeset
1 year ago
github-actions[bot]
7e94dee955
Version Packages (next) ( #9431 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Simon H
c1f6ee096d
fix: handle dynamic selects with falsy select values ( #9471 )
...
when options are added later, we need to ensure the select value still stays in sync
fixes #9412
1 year ago
Yuichiro Yamashita
19f84ca730
fix: Added missing context of `svelte.js` for validation ( #9394 )
...
* fix
* add changeset
* Update .changeset/eighty-bikes-camp.md
Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>
* Update .changeset/eighty-bikes-camp.md
---------
Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>
Co-authored-by: Rich Harris <hello@rich-harris.dev>
1 year ago
Dominic Gannaway
455fa8950e
Code golf each transitions ( #9476 )
...
* chore: improve code size of transitions
* Add changeset
1 year ago
Rich Harris
e3e1fef238
fix: stringify attribute values before comparison ( #9475 )
...
* fix: stringify attribute values before comparison
* simplify
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
1 year ago
Dominic Gannaway
73e8820fe7
chore: make DOM operations lazily init ( #9468 )
...
* chore: make DOM operations lazyily init
* cleanup types
* cleanup types
* cleanup types
* Update packages/svelte/src/internal/client/operations.js
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
* single line annotations
* remove unnecessary coercion
* group statements by type
---------
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
Co-authored-by: Rich Harris <rich.harris@vercel.com>
1 year ago
Simon H
9ef3424732
fix: support class exports ( #9465 )
1 year ago
Paolo Ricciuti
6f3dc04c82
fix: allow member access on directives ( #9462 )
...
fixes #9445
1 year ago
Dominic Gannaway
9eb969ddd4
fix: address bug in before/after update ( #9448 )
...
* fix: address bug in before/after update
fix: address bug in before/after update
* Add changeset
* use every instead of filter - more explicit and enables early-exit from the loop
* Update logic and comment
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
1 year ago
Rich Harris
f5101c0d8c
treat `slot` the same as other props - closes #9455 ( #9457 )
...
Co-authored-by: Rich Harris <rich.harris@vercel.com>
1 year ago
Rich Harris
6f6c3a0787
fix: only escape attribute values for elements, not components ( #9456 )
...
* only escape attribute values for elements, not components - closes #9454
* changeset
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
1 year ago
Paolo Ricciuti
e90ded677e
fix: allow svelte:self in snippets ( #9439 )
...
* fix: allow svelte:self in snippets
* Create funny-wombats-argue.md
1 year ago
Dominic Gannaway
73ae5ef5bc
fix: tighten up event attributes and hoisting logic ( #9433 )
...
- add event delegation to spread_attributes
- add event attributes to spread
- don't delegate when bindings/actions on the same element in order to preserve backwards compatibility of ordering
- don't hoist identifiers when one of them is used in an event that is not delegateable
---------
Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
1 year ago
Dominic Gannaway
cf63220a0e
fix: ensure keyed fallback to indexed ( #9441 )
...
Fixes #9408 . Ensures that if we have a key that matches the index, that we fallback to using an indexed each block.
1 year ago
Dominic Gannaway
da37c928ef
fix: support dynamic attributes containing call expressions ( #9443 )
...
Fixes #9403 . We weren't taking into account the containment of call expressions logic before.
1 year ago
Rich Harris
66661eff04
chore: use internal `get_descriptors` helper ( #9389 )
...
* chore: use internal get_descriptors helper
* tweak changeset
* fix bad merge
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
1 year ago
Simon H
7ab03ae36c
fix: add missing files binding ( #9415 )
...
no two-way binding because setting it involves a `DataTransfer` workaround, so it's not really officially supported that way - if you need that, you shouldn't use that binding probably. This matches the behavior in Svelte 4.
Co-authored-by: Rich Harris <rich.harris@vercel.com>
1 year ago
Simon H
9aa06bdf9e
fix: check that snippet is not rendered as a component ( #9423 )
...
Co-authored-by: Rich Harris <rich.harris@vercel.com>
1 year ago
github-actions[bot]
1fd77d7494
Version Packages (next) ( #9386 )
...
* Version Packages (next)
* Update packages/svelte/CHANGELOG.md
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Rich Harris <richard.a.harris@gmail.com>
1 year ago
Dominic Gannaway
5768df1300
chore: remove selector api ( #9426 )
...
* chore: remove selector api
1 year ago
Dominic Gannaway
17e6c4f834
fix: address runtime effect issues ( #9417 )
...
* Fix runtime effect issues
* Prettier
* Add changeset
* Fix operations
* Update .changeset/khaki-mails-draw.md
* more tweaks
* more tweaks
---------
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
1 year ago
Dominic Gannaway
8798f3b1e7
chore: split $.each into $.each_keyed/$.each_indexed ( #9422 )
...
* Split $.each into $.each_keyed/$.each_indexed
* Add changeset
* Update .changeset/quiet-camels-mate.md
* Fix typo
---------
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
1 year ago
Dominic Gannaway
5a6afe5463
fix: correct each block update index type ( #9425 )
...
* fix: correctly handle index within each block updates
* changeset
1 year ago
Simon H
9a99554379
breaking: remove Component type, keep using SvelteComponent instead ( #9413 )
...
I came to the conclusion that when we're making up arbitrary types, we might as well keep the old class. That way:
- one less thing to worry about (language tools and other tooling basically can continue to spit out SvelteComponent )
- we can more clearly mark $set , the constructor etc as being deprecated and no longer functioning unless you use that legacy compatibility mode
- much more ergonomic to type for the user:
- const someInstance: SvelteComponent<..> instead of const someInstance: ReturnType<typeof Component<..>>
- If you're using generics, you can do export class MyComponent<T> extends SvelteComponent<{ prop: T }> {} instead of having to type out the whole function in a way that I'm not even sure how to do with generics
1 year ago
gtmnayan
7a84e78b4d
fix: add snippet symbol to children prop ( #9395 )
...
* add snippet symbol to children prop
* fix error message for snippet validation
* changeset
1 year ago
Rich Harris
2aacfad9ae
fix: exclude internal props from spread attributes ( #9384 )
...
* exclude internal props from spread attributes
* changeset
* tighten up
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
1 year ago
github-actions[bot]
28b560392b
Version Packages (next) ( #9382 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Simon H
c6c934afb2
chore: cleanup ( #9381 )
...
* lets see if this works
* fix versions
* sigh
* debugging ci is sooo fun
* oh wow
* fix stuff, changelog, add back readme
* appease prettier
* format stuff
1 year ago
Simon Holthausen
b8ea454372
chore: enter changeset prerelease mode
1 year ago
Simon Holthausen
fe8a9ce31d
breaking: init Svelte 5
...
Co-authored-by: Rich Harris <rich.harris@vercel.com>
Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
Co-authored-by: Dominic Gannaway <dg@domgan.com>
1 year ago
github-actions[bot]
1369aa5cec
Version Packages ( #9380 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Simon H
2a2a773174
chore: rewire some master occurences ( #9379 )
...
(main for a few in contributing; doesn't exist yet but will, soon)
1 year ago
Kelvin Soh
00700621bb
fix: html tag hydration: regard empty claimed_nodes array as content mismatch ( #9184 )
...
fixes #6832
1 year ago
Ben McCann
895612514c
fix: improve a11y-click-events-have-key-events message ( #9358 )
1 year ago
github-actions[bot]
590503044f
Version Packages ( #9293 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Sina Salahshour
6b9b8af050
fix: ignore comments while comparing nodes in node_match ( #9197 )
...
related to issue #9088
it doesn't solve the main problem of dependencies getting invalidated whenever value of a variable gets changed.
but it fixes the behavior difference between the code with and without comments
1 year ago
vhladko
ab80d9d214
fix: add missing plaintext-only value to contenteditable type ( #9242 )
...
fixes #9181
1 year ago
Simon H
9900c85acf
fix: support camelCase properties on custom elements ( #9328 )
...
while attributes are case insensitive, properties are not. to not introduce a breaking change, the lowercased variant is checked first.
fixes #9325
1 year ago
Ben McCann
052d38158f
chore: upgrade magic-string ( #9292 )
1 year ago
github-actions[bot]
bd5e5eef9b
Version Packages ( #9121 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
gtmnayan
26eb2a2f89
fix: false reactive component warning ( #9094 )
...
fixes #9082
1 year ago
Teo
93b17c85f7
fix: spreading attributes on option value attribute get's replaced by option's inner text ( #9125 )
...
fixes #9107
Apart from the problem with the option the same happens with the textarea.
1 year ago
Teo
228dd4d9d7
fix: svelte:element with dynamic this and spread attributes throws error ( #9112 )
...
fixes #9092
---------
Co-authored-by: gtmnayan <50981692+gtm-nayan@users.noreply.github.com>
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
1 year ago
paulreece
6fe17eabf2
fix: This makes the indeterminate HTML attribute available for use. Fixes #9176 . ( #9180 )
...
Fixes #9176 . This adds indeterminate to the list of HTMLAttributes so that one can use it without receiving an error.
1 year ago
Kelvin Soh
d5a1822428
fix: style directive not updating when style attribute is present and style directive is updated via an object prop. fixes #9185 ( #9187 )
...
fixes #9185 .
I narrowed down the issue to the bug surfacing when we use object properties to update style attributes and directives. This fix removes the size check (because a single object will be of size 1 but can affect n attributes/directives via its properties).
In addition, the order of the OR is switched as the earlier condition has some reactive assignments which are not run in the current order when style_changed_var is truthy.
1 year ago
gtmnayan
115ea1ff4a
fix: do not add module declared variables as dependencies ( #9122 )
...
closes #5943
1 year ago
gtmnayan
d5839ef194
fix: head duplication when binding is present ( #9124 )
...
fixes #7879
fixes #4982
1 year ago
Teo
bd64f07e98
fix: take custom attribute name into account when reflecting property ( #9140 )
...
fixes #9134
1 year ago
gtmnayan
ba1e67844e
fix: css sourcemap generation with unicode filenames ( #9120 )
...
* fix: css sourcemap generation with unicode filenames
* format
1 year ago
github-actions[bot]
50c270a54d
Version Packages ( #9096 )
...
---------
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
1 year ago
Lyu, Wei-Da
05f99d20f9
feat: move svelteHTML to load the correct svelte/element ( #9070 )
...
Make IntrinsicElements extends SvelteHTMLElements
so it can be extend with declare module
converting to module so it can extend without needing another type alias
---------
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
1 year ago
github-actions[bot]
a08ae0f555
Version Packages ( #9037 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
hackape
99a3cc93b6
fix: allow child element with slot attribute within svelte:element ( #9038 )
...
fix #9018
1 year ago
Paolo Ricciuti
a71f3595a3
fix: Add data-* to svg attributes ( #9036 )
...
* Add data-* to svg attributes
* Create twelve-suits-drive.md
1 year ago
github-actions[bot]
6827709373
Version Packages ( #9008 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
hackape
a2b6401c43
fix: `svelte:component` spread props change not picked up ( #9006 )
...
fix #9003 , amend #8946 (comment)
1 year ago
github-actions[bot]
5d66f96d01
Version Packages ( #8928 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Nguyen Tran
f8283fbc77
fix: remove let variable from select binding dependencies ( #8969 )
...
Fixes #2943
The issue linked above invalidates a variable that is not defined in <script> but instead is defined as a let: variable, which does not make sense to invalidate, therefore, this PR exists.
1 year ago
Simon H
cb1358cc41
fix: don't add accessor twice ( #8996 )
...
In dev mode, Svelte creates a setter to throw an error noting that you can't set that readonly prop, which resulted in the accessor getting applied twice to the custom element wrapper, causing an error
fixes #8971
1 year ago
Simon H
657f11376c
feat: add ability to extend custom element class ( #8991 )
...
This should help everyone who has special needs and use cases around custom elements. Since Svelte components are wrapped and only run on connectedCallback, it makes sense to expose the custom element class for modification before that.
- fixes #8954 / closes #8955 - use extend to attach the function manually and save possible values to a prop
- closes #8473 / closes #4168 - use extend to set the proper static attribute and then call attachInternals in the constructor
- closes #8472 - use extend to attach anything custom you need
- closes #3091 - pass `this` to a prop of your choice and use it inside your component
- add some doc for #8987
1 year ago
Ben McCann
4bbb5454e2
perf: optimize imports that are not mutated or reassigned ( #8948 )
...
this means such imports are seen as static and subsequently Svelte needs to generate way less code
1 year ago
gtmnayan
20dac2ae12
fix: handle patterns in destructured literals ( #8871 )
...
fixes #8863
---------
Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>
1 year ago
Nguyen Tran
66593c62f4
fix: svelte:component evaluates props once ( #8946 )
...
Fixes #6634
1 year ago
github-actions[bot]
3ff0084dc3
Version Packages ( #8925 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Lyu, Wei-Da
0a2732a2b0
fix: generate type definition with nullable types ( #8924 )
...
This results in `undefined` and `null` being added explicitly in places which is crucial in some situations
1 year ago
github-actions[bot]
a12643cbb8
Version Packages ( #8911 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Simon H
136aebd8eb
fix: repair invalid raw html content during hydration ( #8912 )
...
When the HTML that is coming from raw html is invalid, the browser reshuffles things. Bail in that case to try to repair more often. Should help with https://github.com/withastro/astro/issues/7557
1 year ago
Simon H
35221c8811
fix: claim svg tags in raw mustache tags correctly ( #8910 )
...
fixes #8904
1 year ago
github-actions[bot]
800f6c076b
Version Packages ( #8902 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Simon H
8de9dc6144
fix: handle falsy srcset values ( #8901 )
...
fixes #8899
1 year ago