Simon H
7a1326be06
fix: handle `this` parameter in TypeScript-annotated functions ( #11795 )
...
fixes #11731
1 year ago
Rich Harris
5fb017df92
fix: allow classes to be reassigned ( #11794 )
1 year ago
FoHoOV
4fef0eb08f
fix: capture the correct event names when spreading attributes ( #11783 )
...
fixes #11777
We need to scope the `key` variable because it may be captured in a closure
1 year ago
Paolo Ricciuti
ee9d5ef850
fix: allow global next to `&` for nesting ( #11784 )
...
Fixes #11782
1 year ago
FoHoOV
b963e53fc9
fix: parse ongotpointercapture and onlostpointercapture events correctly ( #11790 )
...
Fixes #11789
1 year ago
Rich Harris
d1f5d5d33d
fix: only inject push/pop/$$props in SSR components when necessary ( #11771 )
1 year ago
Paolo Ricciuti
9084f1796b
fix: allow runelike writable as prop ( #11768 )
...
Fixes #11742
1 year ago
Paolo Ricciuti
d856c50092
fix: `array.lastIndexOf` without second argument ( #11766 )
...
Fixes #11756
lastIndexOf seems to be using arguments internally so passing undefined is different from not passing it
1 year ago
Rich Harris
d946066c08
chore: yet another hydration tweak ( #11763 )
1 year ago
Rich Harris
caab8dad05
chore: remove unused code ( #11762 )
...
* chore: remove unused code
* remove text_prototype
* more
1 year ago
Rich Harris
fec57e298e
chore: tweak add_locations ( #11761 )
1 year ago
Rich Harris
4a708dd005
chore: always return hydrate_start from template functions ( #11760 )
1 year ago
Rich Harris
c239cdf3af
remove some unnecessary code ( #11759 )
1 year ago
Rich Harris
a2260940e7
chore: replace `hydrate_nodes[0]` with `hydrate_start` where possible ( #11758 )
...
* manipulate effect.dom rather than hydrate_nodes
* use hydrate_start instead of hydrate_nodes where possible
* tidy up
1 year ago
Rich Harris
196d7e41b1
chore: simplify add_locations ( #11757 )
...
* chore: simplify add_locations
* tiny tweak
1 year ago
github-actions[bot]
3dfa343ea2
Version Packages (next) ( #11753 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Paolo Ricciuti
7dacf2c4d4
fix: use svg methods for updating svg attributes too ( #11755 )
...
Closes #11746
we were using the svg methods for every child of svg but not for svg itself
1 year ago
Rich Harris
d15fd9556f
chore: better invalid attribute message ( #11754 )
...
* simplify code
* replace error code and message
* update message, update tests
1 year ago
Rich Harris
8459098c05
chore: simplify effect.dom stuff ( #11752 )
1 year ago
Paolo Ricciuti
5765752d78
fix: throw on invalid attribute expressions ( #11736 )
...
In runes mode only to prevent a breaking change solely from upgrading to Svelte 5
Closes #11734
1 year ago
Rich Harris
ba429fd2f1
fix: don't use console.trace inside dev warnings ( #11744 )
...
Chrome does include a trace for warnings, Firefox does not, but the vast majority of devs uses Chromium-based browsers for dev, so this reduces noise
1 year ago
Paolo Ricciuti
e73b133b66
fix: don't warn on link without href if aria-disabled ( #11737 )
...
Also don't warn on a tag without a href attribute and link role
fixes #11733
1 year ago
Rich Harris
50cc8a4848
chore: more non-essential changes from #11690 ( #11750 )
1 year ago
Rich Harris
329c10eb6c
chore: update noscript test ( #11749 )
1 year ago
Rich Harris
b87fd61729
chore: DRY out namespace template code ( #11748 )
...
* chore: DRY out namespace template code
* Update packages/svelte/src/internal/client/dom/template.js
1 year ago
github-actions[bot]
152961a649
Version Packages (next) ( #11745 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Dominic Gannaway
fe51cde1fa
breaking: event handlers + bindings now yield effect updates ( #11706 )
...
* breaking: delegated event handlers now yield effect updates
* tweak
* refactor
* refactor
* yield binding change events
* handle input event bindings
* more bindings
* more bindings
* more tests
* more tests
* address feedback
* address feedback
1 year ago
github-actions[bot]
3498df842b
Version Packages (next) ( #11743 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Dominic Gannaway
a074734ba7
fix: ensure we clear down each block opening anchors from document ( #11740 )
...
* fix: ensure we clear down each block opening anchors from document
* fix: ensure we clear down each block opening anchors from document
1 year ago
Dominic Gannaway
401c8b23be
chore: simplify internal DOM operations ( #11741 )
...
* chore: simplify internal DOM operations
* chore: simplify internal DOM operations
* chore: simplify internal DOM operations
1 year ago
Dominic Gannaway
44115840bd
chore: cleanup more tests ( #11738 )
...
remove awaits in favor of flushSync
1 year ago
Simon H
4f9096a5a8
chore: delegate input event ( #11732 )
...
We didn't delegate the input event back when we were also delegating `on:x` events, because it messes up the event/bindings/actions order. Since we're only doing that for `onx` event attributes now that reason is obsolete and we can start delegating it.
1 year ago
github-actions[bot]
c3489eb5de
Version Packages (next) ( #11714 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Dominic Gannaway
4a3f7ac257
fix: improved checked/value handling ( #11726 )
...
* fix: improved checked/value handling
* tweak
1 year ago
Paolo Ricciuti
77f91459b6
fix: update value like attributes in a separate template_effect ( #11720 )
...
* fix: update value like attributes in a separate template_effect
* chore: remove unnecessary commented code
* chore: add test for spread values
1 year ago
Simon H
c21f019a4b
chore: speedup hydration around input and select values ( #11717 )
...
* chore: speedup hydration around input and select values
* use idle tasks to do the work
---------
Co-authored-by: Dominic Gannaway <dg@domgan.com>
1 year ago
Simon H
d590cd8bea
fix: ignore value attribute on select during SSR ( #11724 )
...
The value attribute on select elements does nothing - it does not influence the initial value (in SSR that's the job of the `selected` attribute on an option element), updating it does not influence the current value either. Instead of rendering it out and then removing it on hydration (which is costly because the mutation causes work) we just don't render it in SSR.
No test/changeset because no change in behavior.
1 year ago
Paolo Ricciuti
6d2f1a48b4
fix: allow comments after last selector in css ( #11723 )
...
Fixes #11721
1 year ago
Rich Harris
0128df33da
fix: don't add scoping modifier to nesting selectors ( #11713 )
1 year ago
Dominic Gannaway
09addad9ae
fix: improve handling of unowned derived signal ( #11712 )
1 year ago
github-actions[bot]
fba6b5676b
Version Packages (next) ( #11663 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Paolo Ricciuti
f48001ac63
fix: check for invalid bindings on window and document ( #11676 )
...
Fixes #11673
1 year ago
Paolo Ricciuti
b788b72862
fix: migrate derivations without semicolons ( #11704 )
...
Closes #11689
1 year ago
Rich Harris
02520aea48
better tooltips in playground ( #11705 )
...
* better tooltips in playground
* update some tests that a drive-by fix broke
1 year ago
Dominic Gannaway
a5fd28a14b
fix: inline pointer events now correctly work in Chrome ( #11695 )
...
* fix: inline pointer events now correctly work in Chrome
* fix more
1 year ago
Dominic Gannaway
e6f8e95199
chore: tidy up tests to use flushSync ( #11703 )
1 year ago
Rich Harris
43d2f750b6
Revert "chore: consistent nextSibling usage ( #11694 )" ( #11696 )
...
This reverts commit f3dbfc91d6
.
1 year ago
Dominic Gannaway
f3dbfc91d6
chore: consistent nextSibling usage ( #11694 )
...
* chore: consistent nextSibling usage
* cleanup
1 year ago
Simon H
1784026843
fix: don't require commas between warnings in legacy mode ( #11669 )
...
also add commas in migration
closes #11666
1 year ago
Rich Harris
c70533a5a7
fix: more efficient spread attributes in SSR output ( #11660 )
...
* fix: more efficient spread attributes in SSR output
* more tweaks
1 year ago
github-actions[bot]
62e2647c8a
Version Packages (next) ( #11656 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Rich Harris
c29b74669d
feat: migrate `<svelte:element this="div">` ( #11659 )
1 year ago
Simon H
110a5a852f
fix: robustify `bind:scrollX/Y` binding ( #11655 )
...
- we were scrolling to the given value, which we shouldn't for accessibility reasons (Svelte 4 didn't do it either)
- we need to notify of the value 0 if there's no scroll (https://github.com/sveltejs/svelte/issues/11623#issuecomment-2113495573 )
1 year ago
Rich Harris
d288735fa8
breaking: disallow string literal values in `<svelte:element this="...">` ( #11454 )
...
* breaking: disallow string literal values in `<svelte:element this="...">`
* note breaking change
* Update sites/svelte-5-preview/src/routes/docs/content/03-appendix/02-breaking-changes.md
Co-authored-by: Jeremiasz Major <jrh.mjr@gmail.com>
* prettier
* make invalid `<svelte:element this>` a warning instead of an error (#11641 )
* make it a warning instead of an error
* format
---------
Co-authored-by: Jeremiasz Major <jrh.mjr@gmail.com>
1 year ago
Simon H
ade6b6e480
chore: add css regression test ( #11658 )
...
closes #9207
1 year ago
Simon H
c2f75dc7ba
fix: use coarse-grained updates for derived expressions in legacy mode ( #11652 )
...
fixes #11648
Also deduplicates the code a bit
1 year ago
Dominic Gannaway
54083fb9cc
fix: replay load and error events on load during hydration ( #11642 )
...
* fix: replay load and error events on load during hydration
* oops
* fix replacement logic
* make less evasive
* address feedback
* address feedback
* address feedback
* Update packages/svelte/src/internal/client/dom/elements/events.js
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
* address feedback
* Update packages/svelte/src/internal/client/dom/elements/attributes.js
Co-authored-by: Rich Harris <rich.harris@vercel.com>
* Update packages/svelte/src/internal/client/dom/elements/attributes.js
Co-authored-by: Rich Harris <rich.harris@vercel.com>
* address more feedback
* address more feedback
---------
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
Co-authored-by: Rich Harris <rich.harris@vercel.com>
1 year ago
Rich Harris
7b9fad4b0e
chore: remove `handle_compile_error` ( #11639 )
...
We don't need the awkward handle_compile_error stuff any more, because the relevant information now lives in state.js
1 year ago
Rich Harris
2ebb277be7
feat: more information when hydration fails ( #11649 )
...
In the case of an invalid child element, we already get information about the parent and the child, but in other cases where a mismatch could occur you're pretty much on your own.
This adds a bit more context to hydration_mismatch warnings — 'The error occurred near ...'
1 year ago
github-actions[bot]
019b26b775
Version Packages (next) ( #11645 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Dominik G
dc9b0d08c1
feat: add rootDir option and set __svelte_meta.file like in svelte4 ( #11627 )
...
* feat: add rootDir option and set __svelte_meta.file like in svelte4
* Update packages/svelte/src/compiler/validate-options.js
* update tests
* centralise logic
* fix
* note to self
* Apply suggestions from code review
* lint
* one dollar towards the windows backslash bugfix foundation please
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
1 year ago
Dominic Gannaway
c131e6f494
Revert "chore: ensure we use event system code paths throughout" ( #11644 )
...
* Revert "chore: ensure we use event system code paths throughout (#11640 )"
This reverts commit c00d8245ee
.
* Update packages/svelte/src/internal/client/dom/elements/attributes.js
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
1 year ago
Rich Harris
3bf68b4765
fix: make messages more consistent ( #11643 )
1 year ago
Dominic Gannaway
053159bf0b
fix: avoid state_referenced_locally warning within type annotations ( #11638 )
...
* fix: avoid state_referenced_locally warning within type annotations
* better fix
* prettier
* better fix
* fix
* fix
* fix
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
1 year ago
Dominic Gannaway
c00d8245ee
chore: ensure we use event system code paths throughout ( #11640 )
1 year ago
github-actions[bot]
ec25208ba4
Version Packages (next) ( #11617 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Simon H
4365562228
fix: deduplicate children prop from default slot ( #10800 )
...
* feat: provide isSnippet type, deduplicate children prop from default slot
fixes #10790
part of #9774
* fix ce bug
* remove isSnippet type, adjust test
* fix types
* revert unrelated changes
* remove changeset
* enhance test
* fix
* fix
* fix
* fix, different approach without needing symbol
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
1 year ago
Mathias
cac8630de6
chore: use CustomEvent constructor instead of deprecated createEvent method ( #11629 )
...
* chore: use CustomEvent constructor instead of deprecated createEvent method
* while we're here...
* changeset
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
1 year ago
Simon H
4bedd0e4fb
feat: error on imports to `svelte/internal/*` ( #11632 )
...
* feat: error on imports to `svelte/internal/*`
closes #11622
* regenerate
* also error on svelte/internal
1 year ago
Dominic Gannaway
4f8bba2f80
fix: cleanup array prototype monkeypatching ( #11634 )
...
* fix: cleanup array prototype monkeypatching
* Update packages/svelte/src/internal/client/dev/equality.js
---------
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
1 year ago
Dominic Gannaway
e5e7ec2404
fix: better handle img loading attribute ( #11635 )
...
* fix: better handle img loading attribute
* better fix
* switch to symbol
1 year ago
adiGuba
6f28e41b6d
chore: tidy up scrolling code logic ( #11630 )
...
---------
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
1 year ago
Paolo Ricciuti
87a420f64d
feat: error when snippet shadows a prop ( #11631 )
...
Closes #11603
1 year ago
Simon H
573b9f1d74
fix: adjust unknown code warning offset ( #11621 )
...
They were the wrong way around
fixes #11612
1 year ago
Dominic Gannaway
7ef686f8ee
feat: provide $state warnings for accidental equality ( #11610 )
...
* feat: provide $state warnings for accidental equality
* tune
* tune
* tune
* adjust test
* fix treeshaking
* fix bugs
* fix bugs
* refactor
* revert test changes
* tune
* tune
* tune
* tune
* fix up
* fix
* remove if(DEV) stuff
* use console.trace, like we do for ownership warnings
* tweak
* tweak message, simplify logic
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
1 year ago
Dominic Gannaway
f488a6e84a
feat: add $state.is rune ( #11613 )
...
* feat: add $state.is rune
* fix type
* tweak docs
* may as well update the test case to match the docs
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
1 year ago
Dominic Gannaway
1087e6fb54
chore: improve SSR invalid element error message ( #11585 )
...
* chore: improve SSR invalid element error message
* move push_element and pop_element into new dev.js file
* pass location info, remove unnecessary if (DEV) block
* use full filename, basename is not very helpful. also, current_component is guaranteed to not be null
* current_element is guaranteed to not be null in pop_element
* tweaks
* remove message prefix - redundant when filenames are included
* add line/column
* make message more concise
* reduce indirection
* only print message once
* update test
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
1 year ago
github-actions[bot]
e97bc79f02
Version Packages (next) ( #11608 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Mateusz Kadlubowski
fd437024f5
fix: add missing `modernAst` in `validate_component_options` ( #11542 )
1 year ago
Simon H
faced066bd
feat: migrate warnings ( #11607 )
...
Also contains a changeset for the previous work because we forgot that. Also added more code mappings.
1 year ago
Simon H
2bc39b1de2
chore: better ignore code handling ( #11606 )
...
Instead of hacking an ignores array onto each node (and possibly degrading perf a bit because the object shape is mutated) we keep track of ignores in a stack. The new approach also avoids the indirection the old one had to do because the new approach looks upwards (checking if parent is a fragment) instead of iterating the children (checking for comments in them).
As a bonus unknown code warnings are now in order (line-column-wise) with the other warnings. Also fixes #11482 because text nodes of all shapes are ok
1 year ago
Rich Harris
ac7709f65c
chore: dedupe `getLocator` calls ( #11600 )
...
...by introducing global compiler state that is reset between iterations
1 year ago
Rich Harris
5cb432b7bd
feat: warn on unknown warning codes in runes mode ( #11549 )
...
Related to #11414
---------
Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
1 year ago
github-actions[bot]
5e9428a65d
Version Packages (next) ( #11580 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Dominic Gannaway
b964a4ce1d
fix: improve ff handling of lazy images ( #11593 )
...
* fix: improve ff handling of lazy images
* tune
* tune
* tune
* tune
* tune
1 year ago
Rich Harris
b212b17385
fix: skip deriveds for props with known safe calls ( #11595 )
1 year ago
Simon H
d408d20cdd
fix: replicate Svelte 4 props update detection in legacy mode ( #11577 )
...
* fix: replicate Svelte 4 props update detection in legacy mode
fixes #11448 by wrapping props in deriveds
* fix test
* Update packages/svelte/src/compiler/phases/3-transform/client/utils.js
Co-authored-by: Rich Harris <rich.harris@vercel.com>
* dedicated flag
* prettier
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
1 year ago
Simon H
a0bdac8cd7
fix: correctly handle falsy values of style directives in SSR mode ( #11583 )
...
fixes #11044
1 year ago
Dominic Gannaway
dc16668773
chore: improve runtime overhead of creating comment templates ( #11591 )
...
* chore: improve runtime overhead of creating comment templates
* Update packages/svelte/src/internal/client/dom/template.js
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
* changeset
---------
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
Co-authored-by: Rich Harris <rich.harris@vercel.com>
1 year ago
Paolo Ricciuti
81517a506c
fix: allow for non optional chain call expression in render ( #11578 )
1 year ago
github-actions[bot]
61238d0fd3
Version Packages (next) ( #11564 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Rich Harris
9c680f1030
chore: optimise effects ( #11569 )
...
* optimise effects
* tweak
* don't allocate array unnecessarily
* filter_flags appears to be unnecessary?
* lint
* tweak
* simplify (#11570 )
* changeset
1 year ago
Dominic Gannaway
5497b3d0bc
fix: ensure all effect cleanup functions are untracked ( #11567 )
...
* fix: ensure all effect cleanup functions are untracked
* add test
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
1 year ago
Dominic Gannaway
f6e87772cb
Revert "fix: ensure Svelte action destroy effects are untracked ( #11562 )" ( #11568 )
...
This reverts commit e49f1f7f11
.
1 year ago
Dominic Gannaway
e49f1f7f11
fix: ensure Svelte action destroy effects are untracked ( #11562 )
...
* fix: unesure Svelte action destroy effects are untracked
* fix: unesure Svelte action destroy effects are untracked
1 year ago
github-actions[bot]
816335f906
Version Packages (next) ( #11561 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Dominic Gannaway
643bbf2be2
Better process effects ( #11560 )
...
* fix: improve internal mechanism for handling process_effects
1 year ago
github-actions[bot]
4cadd07676
Version Packages (next) ( #11559 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Dominic Gannaway
a3702e8171
fix: adjust heuristics for effect_update_depth_exceeded ( #11558 )
...
* fix: adjust heuristics for effect_update_depth_exceeded
* fix: adjust heuristics for effect_update_depth_exceeded
* fix: further adjust heuristics for effect_update_depth_exceeded
1 year ago
github-actions[bot]
18f61a575f
Version Packages (next) ( #11554 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Dominic Gannaway
43ad72b1ce
fix: adjust heuristics for effect_update_depth_exceeded ( #11557 )
...
* fix: adjust heuristics for effect_update_depth_exceeded
* fix: adjust heuristics for effect_update_depth_exceeded
1 year ago
Dominic Gannaway
597715ff98
fix: improved $inspect handling of reactive Map/Set/Date ( #11553 )
1 year ago
github-actions[bot]
7e9b109de6
Version Packages (next) ( #11541 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Dominic Gannaway
c450cdb7a7
fix: better support for lazy img elements ( #11545 )
...
* fix: better support for lazy img elements
* tune
* fix
1 year ago
Dominic Gannaway
fcc72ae2f3
feat: provide better error messages in DEV ( #11526 )
...
* feat: provide better error messages in DEV
* fix stuff
* fix stuff
* fix tests
* fix
* assert.include results in better errors on mismatches
* remove indentation
* tweak
* rename
* fix issues
* more fixes
* more fixes
* neaten up stack trace
* Update packages/svelte/src/internal/client/reactivity/effects.js
Co-authored-by: Rich Harris <rich.harris@vercel.com>
* Update packages/svelte/src/internal/client/runtime.js
Co-authored-by: Rich Harris <rich.harris@vercel.com>
* address feedback
* lint
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
1 year ago
Simon H
641e411cf1
fix: ensure spread events are always added ( #11535 )
...
In edge cases it may happen that set_attributes is re-run before the effect is executed. In that case the render effect which initiates this re-run will destroy the inner effect and it will never run. But because next and prev may have the same keys, the event would not get added again and it would get lost. We prevent this by using a root effect.
The added test case doesn't fail for some reason without this fix, but it does fail when you test it out manually, so I still added it.
Found through https://github.com/sveltejs/svelte/issues/10359#issuecomment-2101167524
1 year ago
Simon H
31f8fea22d
fix: don't warn on writes to `$state` ( #11540 )
...
fixes #10905
1 year ago
Simon H
65223363e9
fix: handle falsy prop aliases correctly ( #11539 )
...
fixes #10854
1 year ago
Dominic Gannaway
4ea8a5e36b
chore: add derived effect ownership tests ( #11538 )
...
* chore: add derived effect ownership tests
* chore: add derived effect ownership tests
1 year ago
Fabio Rotondo
f219c795f4
fix: check for falsy values in spread ( #11388 )
...
---------
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
1 year ago
Simon H
f70c0370be
chore: deduplicate code ( #11534 )
1 year ago
github-actions[bot]
59f4feb4d8
Version Packages (next) ( #11518 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Rich Harris
8742823e39
fix: make `$effect.active()` true when updating deriveds ( #11500 )
...
* fix: make `$effect.active()` true when updating deriveds
* WIP
* this seems to work?
* prevent effects being created in unowned deriveds
* update test
* fix issue
---------
Co-authored-by: Dominic Gannaway <dg@domgan.com>
1 year ago
Dominic Gannaway
30caaef2e5
fix: improve behaviour of unowned derived signals ( #11521 )
1 year ago
Paolo Ricciuti
70419daf5f
fix: use snippet as parent element of snippets childrens in validator ( #11463 )
...
* fix: use snippet as parent element of snippets childrens in validator
* Update packages/svelte/src/compiler/phases/2-analyze/validation.js
* Update .changeset/wet-pears-remain.md
---------
Co-authored-by: Rich Harris <hello@rich-harris.dev>
1 year ago
github-actions[bot]
4fb4365567
Version Packages (next) ( #11503 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Rich Harris
b1b2dddc3b
feat: add support for svelte inspector (alternative approach) ( #11514 )
...
* mostly working
* fix
* fix
* handle dynamic elements too
* add __svelte_meta to prototype
* changeset
* cheeky fix
1 year ago
Dominic Gannaway
3c756cf14c
chore: use clear_text_content in more areas ( #11512 )
1 year ago
Dominic Gannaway
f543856cc3
fix: skip AST analysis of TypeScript AST nodes ( #11513 )
...
* fix: skip AST analysis of TypeScript AST nodes
* fix: skip AST analysis of TypeScript AST nodes
* lint
1 year ago
Dominik G
28f3755e40
fix: use acceptExports to support partial hmr ( #11453 )
...
* fix: use acceptExports to support partial hmr
* fix: add condition to only use acceptExports when it is available
* fix: update test snapshot
* fix: format
1 year ago
Paolo Ricciuti
0cf6d56ffe
fix: increment and decrement edge case ( #11506 )
...
* fix: increment and decrement edge case
* fix/simplify test
* simplify
* Apply suggestions from code review
* golf
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
Co-authored-by: Rich Harris <hello@rich-harris.dev>
1 year ago
github-actions[bot]
8318b3d142
Version Packages (next) ( #11474 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Rich Harris
dca8861c5a
feat: better error for `bind:this` legacy API usage ( #11498 )
1 year ago
Vladislav Logvin
85d680582b
Fix: bind:scroll resets scroll state ( #11469 )
...
* Fixed: bind:scroll resets scroll state
* failing test
* bail if value is undefined
* changeset
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
1 year ago
Simon H
6bd6f0971b
fix: ensure derived is detected as dirty correctly ( #11496 )
...
Deriveds where under certain conditions not detected as dirty correctly. The reason is that a transitive check_dirtiness call could update the flag of a derived, even if the condition doesn't ulimately result to true. That's why the check for "is now dirty" needs to be moved out of the inner if block.
Fixes #11481
This may also fix a yet undetected overfiring bug in the "is unowned" case because the previous inner "is now dirty?" check didn't take unowned into account.
1 year ago
Simon H
d86b05279f
fix: prevent false positive ownership warning ( #11490 )
...
fixes #11483
We need to keep track of the component function similar to how we keep track of the component context, so that effects etc have the correct one associated
1 year ago
Philipp Pracht
3e1f82b8c4
fix: additional check for component on destroy ( #11488 )
...
fixes #10454
1 year ago
Paolo Ricciuti
fa3e98e8c6
fix: allow to access private fields after `this` reassignment ( #11487 )
...
Fixes #11480
Fixes #11476
1 year ago
Rich Harris
0d5a32d5f7
typo
1 year ago
Paolo Ricciuti
34079a0ec5
fix: restore value after attribute removal during hydration ( #11465 )
...
Fix #11457
1 year ago
github-actions[bot]
272ffc5520
Version Packages (next) ( #11440 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
github-actions[bot]
c0e91a7490
Version Packages (next) ( #11433 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Simon H
9c1a5063b9
fix: adjust order of `derived` function definition overloads ( #11426 )
...
Turns out the order is crucial for not getting a type error
fixes #11415
1 year ago
Simon H
9c5a9d8e20
fix: mark function properties on runes as deprecated for better intellisense ( #11439 )
...
Ensures that IDEs will order the to the bottom so that the rune variants are on top, better visible
closes #11437
1 year ago
Simon H
6e5ab2e678
fix: prevent ownership validation from infering with component context ( #11438 )
...
Ownership validation had a false positive when rendering a component as slotted content of another component. To fix this, #11401 did set the current component context to the context the snippet was declared in, not to the context it is rendered in. This was flawed because it means that component context was altered in a way that setContext/getContext failed because the parent chain was incorrect. This fixes that by introducing a separate global (dev time only) which tracks the component function the ownership needs.
fixes #11429
1 year ago
Simon H
dfb30aaddd
fix: only warn about non-reactive state in runes mode ( #11434 )
...
Fixes #11269
1 year ago
Dominic Gannaway
1f9ad03287
fix: ensure $inspect untracks inspected object ( #11432 )
1 year ago
github-actions[bot]
fcdad4c166
Version Packages (next) ( #11410 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Dominic Gannaway
b4968584df
fix: improve html escaping of element attributes ( #11411 )
...
escape `<` because there's an edge case scenario where a script inside an attribute of a noscript is parsed differently
1 year ago
Simon H
a038d49f78
fix: rework bindable types strategy ( #11420 )
...
Instead of using types that declare whether or not a type is bindable directly as part of the property, we're introducing a new for-types-only field to `SvelteComponent`: `$$bindings`, which is typed as the keys of the properties that are bindable (string by default, i.e. everything's bindable; for backwards compat). language-tools can then produce code that assigns to this property which results in an error we can display if the binding is invalid
closes #11356
1 year ago
Hunter Johnston
17b2f6215d
fix: `event.currentTarget` always being equal to `event.target` ( #11419 )
...
fixes #11328
1 year ago
Rich Harris
edefc846c3
fix: set correct component context when rendering snippets ( #11401 )
...
fixes #11399
1 year ago
Paolo Ricciuti
f64d16931d
fix: detect style shorthands as stateful variables in legacy mode ( #11421 )
...
Fixes #11417
1 year ago
Dominic Gannaway
0f4f3d7df0
fix: improve unowned derived signal behaviour ( #11408 )
1 year ago
Rich Harris
4d051962f3
chore: tidy up ( #11404 )
1 year ago
github-actions[bot]
9e1e1b45e8
Version Packages (next) ( #11396 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Luke Warlow
8be6fdde54
feat: MathML support ( #11387 )
...
* feat: MathML support
- Add support for MathML namespace
- Auto-infer MathML namespace
* tweak
* DRY out
* note to self
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
1 year ago
github-actions[bot]
fe56c7fd2e
Version Packages (next) ( #11393 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Rich Harris
7a66927ca8
fix: bump esrap ( #11392 )
1 year ago
github-actions[bot]
e7d1e4a8bc
Version Packages (next) ( #11384 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Dominic Gannaway
e01776401d
fix: ensure no data loss occurs when using reactive Set methods ( #11385 )
1 year ago
Simon H
2754e4eb39
fix: handle reassignment of `$$props` and `$$restProps` ( #11348 )
...
* fix: handle reassignment of `$$props` and `$$restProps`
Some libraries assign to properties of `$$props` and `$$restProps`. These were previously resulting in an error but are now handled properly
https://github.com/sveltejs/svelte/issues/10359#issuecomment-2080067464
* $$props is coarse grained on updates, so we can simplify this
* fix
* fix comment
1 year ago
Simon H
5e0845fe3e
fix: disallow sequence expressions in `@const` tags ( #11357 )
...
* fix: disallow sequence expressions in `@const` tags
closes #11349
* allow parenthesized sequence expression
1 year ago
github-actions[bot]
b3c2d979c6
Version Packages (next) ( #11381 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Jeremiasz Major
0397fcb614
fix: require whitespace after `@const` tag ( #11379 )
1 year ago
Simon H
eb7e32c168
fix: collect all necessary setters of html elements ( #11371 )
...
When spreading attributes, the setters of the element are checked. If they contain the key in question, it's set via that setter. For certain setters on certain elements this didn't work because the element prototype was not HTMLElement, rather a descendant of that (for example HTMLDivElement), which meant that only the setters of the descendant, not the superclass were taken into account. This fixes that by walking up the prototype chain until we find the Element prototype.
fixes #11179
1 year ago
Simon H
cd2506535f
feat: leave view transition pseudo selectors untouched ( #11375 )
...
* feat: leave view transition pseudo selectors untouched
view transition pseude selectors are global-like, i.e. they shouldn't be scoped or treated as unused.
In the process of adding support for this, is_root and is_host were consolidated into is_global_like because their usage locations didn't need any differentiation between them (same for the new view transition treatment)
closes #9127
* regenerate types
1 year ago
Simon H
de315d84eb
fix: ensure reactions are kept dirty when marking them again ( #11364 )
...
previously a reaction could be marked as DIRTY and subsequently as MAYBE_DIRTY before running, resulting in false negatives. Ensure that DIRTY flag can never be lowered to MAYBE_DIRTY
fixes #11363
1 year ago
github-actions[bot]
7a3ee6d059
Version Packages (next) ( #11335 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Simon H
4479b8c6f3
fix: allow `bind:this` on `<select>` with dynamic `multiple` attribute ( #11378 )
...
fixes #11377
1 year ago
Simon H
500b2065e0
fix: apply modifiers to bubbled events ( #11369 )
...
fixes #11365
1 year ago
Simon H
8b1a26904a
chore: add css regression test ( #11373 )
...
at rules are now left alone and you can have nested css in them which is scoped correctly. This just adds a test so we don't regress in the future
closes #9267
1 year ago
Paolo Ricciuti
2d2508a2cd
feat: allow for literal property definition with state on classes ( #11326 )
...
closes #11316
---------
Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
1 year ago
Paolo Ricciuti
c7bdef595b
fix: store from props hoist wrong param ( #11367 )
...
Fixes #11355
---------
Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
1 year ago
Caique Torres
68071f7c06
fix: disallow mixing event-handling syntaxes ( #11295 )
...
Closes #11262
---------
Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
1 year ago
Simon H
7d19e5b1a4
fix: disallow mounting a snippet ( #11347 )
...
fixes #11264
1 year ago
Paolo Ricciuti
d3949a6e71
fix: hr, script and template as valid select children ( #11344 )
...
Closes #11342
---------
Co-authored-by: Jeremiasz Major <jrh.mjr@gmail.com>
1 year ago
Simon H
cd798077b4
feat: provide migration function ( #11334 )
...
Provides a migration function, exported as `migrate` from `svelte/compiler`, which tries its best to automatically migrate towards runes, render tags (instead of slots) and event attributes (instead of event handlers)
The preview REPL was updated with a migrate button so people can try it out in the playground.
closes #9239
1 year ago
Rich Harris
f1986da755
feat: only inject push/init/pop when necessary ( #11319 )
...
* feat: only inject push/init/pop when necessary - closes #11297
* regenerate
* differentiate between safe/unsafe
* only inject $$props when necessary
* more
* fix
* simplify
* handle store subscriptions
1 year ago
Rich Harris
8e43e9aae0
fix: correctly interpret empty aria- attribute ( #11325 )
...
* fix: correctly interpret empty aria- attribute
* changeset
* huh
* only suggest default value for boolean/tristate attributes
* adjust messages, disallow empty strings
* gah
1 year ago
Rich Harris
9a887f8dab
chore: directly export function in non-HMR mode ( #11333 )
...
* chore: directly export function in non-HMR mode
* remove some more noise
* update snapshots
* Update sites/svelte-5-preview/src/lib/workers/compiler/index.js
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
---------
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
1 year ago
Rich Harris
8e17428316
chore: tidy up messages ( #11327 )
...
* start reorganising messages
* tidy up
* more
* more
* more
* alphabetise
* consolidate
* more
* more
* more
* more
* more
* more
* alphabetise
* more
* this is no longer needed
* no longer necessary
* more
* more
* fix
* regenerate messages
* more
* more
* tighten up rune validation
* more
* fix
* more
* tweak a11y messages
* add server errors
* overhaul runtime errors
* regenerate messages
* unused
* lint
* more
* more
* Update packages/svelte/messages/compile-errors/script.md
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
* Update packages/svelte/messages/client-warnings/warnings.md
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
* fix
---------
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
1 year ago
Rich Harris
6ad5cd4461
feat: implement message overloads ( #11318 )
1 year ago
github-actions[bot]
4be593472d
Version Packages (next) ( #11315 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Rich Harris
6eb70f88bb
fix: remove `bind_prop` in runes mode ( #11321 )
1 year ago
Rich Harris
476f2172b6
fix: mark `accessors` and `immutable` as deprecated ( #11277 )
...
* fix: mark `accessors` and `immutable` as deprecated
* add warnings for deprecated <svelte:options> attributes
* disable accessors in runes mode
* update tests
* tidy up
* the hell?
* regenerate types
* if I would get a dollar for every windows bug I fix I would be a millionaire by now
* return instance _and_ props in runes mode, move flushSync into shared code, don't set accessors in runes mode
* goddammit
* note breaking change
* fix
* regenerate messages
* Revert "return instance _and_ props in runes mode, move flushSync into shared code, don't set accessors in runes mode"
This reverts commit a47827e57d
.
* pass instance to tests
---------
Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
1 year ago
Rich Harris
22b2c15280
put messages in blockquotes ( #11311 )
1 year ago
Rich Harris
f906aa207b
chore: fix playground ( #11310 )
1 year ago
Rich Harris
94b4268ce3
chore: markdown runtime errors/warnings ( #11304 )
...
* chore: markdown runtime warnings
* on second thoughts
* start adding errors too
* lint
* centralise
1 year ago
github-actions[bot]
880886061d
Version Packages (next) ( #11307 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Rich Harris
eea5c8ff95
chore: handle option warnings the same as others ( #11303 )
1 year ago
Simon H
f6dfac985c
feat: `Bindable` types ( #11225 )
...
This is a typings PR and the companion PR to sveltejs/language-tools#2336
It introduces two new types:
- Binding: Marks a property as being bound (i.e. you must do bind:x)
- Bindable: Marks a property as being able to be bound (i.e. you can do bind:x)
Language tools then uses this generate code accordingly which then generates type errors.
All the other type gymnastics are there to ensure that you don't interact with these bindable types when using mount or hydrate or ComponentProps<MyComponent>, i.e. these two types should be mostly opaque for day-to-day users.
For backwards-compatibility, all properties are automatically wrapped with Bindable, which means existing type definition files will continue to work from a types perspective. Language tools opts into strict bindability by providing its own constructor definition for all generated classes in runes mode which omits the "wrap everything with bindable" behavior.
1 year ago
Rich Harris
1f04045052
chore: move legacy context stuff into its own object ( #11298 )
1 year ago
Rich Harris
7b55bd4d89
chore: markdown warnings ( #11302 )
...
* rename warnings.js to warnings-tmp.js
* start porting warnings
* centralise stuff
* finish porting warnings
* tidy up
* get messages into JSDoc annotations
* prettier
* lint
1 year ago
Rich Harris
5405ec6c91
chore: refactor logic for ignoring warnings ( #11300 )
...
* reimplement svelte-ignore logic
* simplify
* remove unused code
* remove ignores array from comment node
* unused
* regenerate types
* types
* oops, again
1 year ago
Rich Harris
73490bbb8e
chore: markdown errors ( #11294 )
...
* rename errors.js to errors-tmp.js
* start porting errors
* generate markdown files for more errors
* convert parse errors
* convert css errors
* convert special_element errors
* convert runes errors
* convert element errors
* more
* more
* more
* more
* more
* more
* fix some tests
* fix some tests
* more tests
* remove unused error
* prettierignore
* weird
* ugh
* lint
1 year ago
github-actions[bot]
3866887f37
Version Packages (next) ( #11296 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Simon H
2d378bb762
breaking: disallow binding to component exports in runes mode ( #11238 )
...
* breaking: disallow binding to component exports in runes mode
Svelte 4 allowed you to have `export const foo = ..` in component A and then do `<A bind:foo />`. This is confusing because it's not clear whether the binding is for a property or an export, and we have to sanitize rest props from the export bindings.
This PR therefore introduces a breaking change in runes mode: You cannot bind to these exports anymore. Instead use `<A bind:this={a} />` and then do `a.foo` - makes things easier to reason about.
* Update sites/svelte-5-preview/src/routes/docs/content/03-appendix/02-breaking-changes.md
Co-authored-by: Rich Harris <rich.harris@vercel.com>
* tweak messages
* fix tests
* use component.name
* oops
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
1 year ago
github-actions[bot]
e3c8589737
Version Packages (next) ( #11292 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Craig Jennings
fe6e4e2b05
fix: avoid hoisting error by using 'let' instead of 'var' ( #11291 )
...
Fixes #11284
1 year ago
github-actions[bot]
05ac8f4322
Version Packages (next) ( #11260 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Yuichiro Yamashita
0bb49b12d2
fix: resolve type definition error in `svelte/compiler` ( #11283 )
...
* fix generated type
* add changeset
1 year ago
Rich Harris
dcfa503617
fix: use type arguments when extending Map/Set ( #10820 )
...
* use type arguments when extending Map/Set
* changeset
1 year ago
Rich Harris
fd5f5bb85d
monkey-patch console.log and console.warn for all tests ( #11265 )
...
* monkey-patch console.log and console.warn for all tests
* update legacy tests
* various
* tests passing
* tidy up
* tidy up
* tidier output
1 year ago
Rich Harris
47ba488cf2
fix: only destroy snippets when they have changed ( #11267 )
...
* fix: only destroy snippets when they have changed
* tidy up
* changeset
* oops
* tidy up
1 year ago
Rich Harris
5ef1fdf7cc
fix: run render functions for dynamic void elements ( #11258 )
...
* fix: run render functions for dynamic void elements
* Update packages/svelte/src/internal/client/dom/blocks/svelte-element.js
1 year ago
Rich Harris
521d124267
fix: allow events to continue propagating following an error ( #11263 )
...
* fix: allow events to continue propagating following an error
* test
* appease eslint
1 year ago
Rich Harris
9721d5641b
feat: implement `:global {...}` CSS blocks ( #11276 )
...
* feat: implement `:global {...}` CSS blocks
* tests for compiler errors
* regenerate types
* lint
1 year ago
Vaibhav Rai
11c7cd5495
Feat: Add read-only binding focused ( #11271 )
...
* Feat: Add readonly binding focused
* prettier
* simplify test
* revert
* simplify implementation
* changeset
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
Co-authored-by: Rich Harris <hello@rich-harris.dev>
1 year ago
Jeremiasz Major
b91a67ba68
feat: include `script` and `svelte:options` attributes in ast ( #11241 )
...
* include attributes of script tags in ast
* include attributes of svelte:options tag in ast
* add changeset
* improve types
* improve test
1 year ago
Rich Harris
7785d58365
chore: use #client instead of ./types.js ( #11259 )
1 year ago
github-actions[bot]
1b688eac8f
Version Packages (next) ( #11255 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Simon H
7edba25581
fix: run event attributes after binding event listeners ( #11230 )
...
* fix: run event attributes after binding event listeners
By running the event listener logic inside an effect on the first run we guarantee that they're attached after binding listeners. Fixes #11138 .
* give arrow functions stable id, better code gen
* optimise normal function expressions too (rare but valid!)
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
1 year ago
github-actions[bot]
68a12f0a09
Version Packages (next) ( #11236 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Rich Harris
6bff8c0e93
fix: ensure that CSS is generated for the final frame of a transition ( #11251 )
...
* fix: ensure that CSS is generated for the final frame of a transition
* well that makes a lot more sense
1 year ago
Rich Harris
0ad0f04b0b
fix: more robust moving of each item nodes ( #11254 )
...
* move then link
* fix: more robust moving of each item nodes
* test
1 year ago
Rich Harris
a8ca2a4904
tweak types ( #11252 )
1 year ago
Jeremiasz Major
a764f4e88e
don't allow children in svelte:options ( #11250 )
1 year ago
Caique Torres
f632b2a944
feat: checking for runes when generating js code for object mutations ( #11243 )
1 year ago
Simon H
669d2d7a1e
fix: preserve getters/setters in HMR mode ( #11231 )
...
fixes #11228
1 year ago
Rich Harris
516cd22686
fix: more accurate error message when creating orphan effects ( #11227 )
1 year ago
Paolo Ricciuti
eac4218402
fix: possible name clash in hoisted functions ( #11237 )
...
* fix: possible name clash in hoisted functions
* chore: add test
1 year ago
Simon H
cca67bba51
fix: support `$state.snapshot` as part of variable declarations ( #11235 )
...
fixes #11234
1 year ago
Rich Harris
307f15d5f7
chore: refactor `$inspect` ( #11226 )
...
* chore: move inspect logic into its own module
* better error
* remove unused imports
1 year ago
github-actions[bot]
5fce00f06e
Version Packages (next) ( #11205 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Rich Harris
de2d8a0bee
Revert "feat: allow $inspect reactivity map, set, date ( #11164 )" ( #11223 )
...
This reverts commit 43d13e92a0
.
1 year ago
Rich Harris
42ce8d74e1
breaking: warn on self-closing non-void HTML tags ( #11114 )
...
* warn on self-closing non-void HTML tags
* fix tests
* changeset
* account for foreign namespace
1 year ago
Rich Harris
56654986a6
fix: measure elements before taking siblings out of the flow ( #11216 )
...
* Revert "fix: take outroing elements out of the flow when animating siblings (#11208 )"
This reverts commit c44234dc2f
.
* fix: measure elements before taking siblings out of the flow
* lint
* add changeset back
* changeset
1 year ago
Simon H
27eb91bbce
fix: dynamic namespace fixes and enhancements ( #11219 )
...
* fix: fall back to component namespace when not statically determinable
In #10006 we added more elaborate mechanisms to determine which namespace a given element is in. For `<svelte:element>` we added a "can't know at compile time" case and introduced a limited heuristic into the runtime.
This doesn't work for a few reasons:
- we're checking the parent's namespace to determine the current namespace, but the element itself could be the one that _changes_ the namespace
- as mentioned in the previous comment already, on the first render we can't do any parent analysis
- it does not take into account the static component namespace
The last point is the crucial one: In Svelte 4, we're falling back to the component namespace if we can't know statically - e.g. if someone added `<svelte:options namespace="svg">` then `<svelte:element>` should fall back to that namespace instead.
We were not doing that up until now, which introduced a regression. Fixing this also means getting rid of the (flawed) "can't know statically" heuristic.
Fixes #10858 , though for a complete solution we likely need some way to tell `<svelte:element>` the namespace at runtime through a special attribute. Maybe we can use `xmlns` for that like we do in the static case
* support dynamic svelte:element namespace through xmlns attribute
* fix
1 year ago
Tan Li Hau
43d13e92a0
feat: allow $inspect reactivity map, set, date ( #11164 )
...
* feat: allow $inspect reactivity map, set, date
* feat: inspect map without adding new data source
* feat: add inspect
* feat: define inspect on dev mode only
* fix: lint error
1 year ago
Rich Harris
70b47de124
chore: follow-up to #11197 ( #11213 )
...
* simplify
* make each item first nodes explicit
* remove a couple of var declarations
1 year ago
Simon H
4b59ef3c41
fix: widen ownership when sub state is assigned to new state ( #11217 )
...
Ownership was not widened when assigning a sub state to a different top level state. The set of owners for the state was zero because the owner was on the original parent, but that one was reset to null because it's now the top level of a different state. That meant that there was no owner but also no parent to check for the owner, which is an invalid combination resulting in a nullpointer (and also potentially false positive warnings in other situations).
fixes #11204
1 year ago
Rich Harris
c44234dc2f
fix: take outroing elements out of the flow when animating siblings ( #11208 )
...
* fix: take outroing elements out of the flow when animating siblings
* changeset
1 year ago
Tan Li Hau
27d48c601f
fix: catch clause scope ( #11209 )
1 year ago
Simon H
d51075c154
breaking: warn/error on old syntax in runes mode ( #11203 )
...
* breaking: warn/error on old syntax in runes mode
- warn on slots and event handlers in runes mode
- error on `<slot>` + `{@render ...}` tag usage in same component
closes #9416
* render tag + slot could occur in legacy mode as well, error there, too
1 year ago
github-actions[bot]
4ef64541dd
Version Packages (next) ( #11201 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Tan Li Hau
3d49731b1b
fix: refine css `:global()` selector checks in a compound selector ( #11142 )
1 year ago
Azarattum
e7301af1e5
fix: no data duplication in reactive Set/Map ( #11200 )
...
* fix: get rid of data duplication in reactive map
* fix: get rid of data duplication in reactive set
1 year ago
Tan Li Hau
1510c13113
feat: add warning when using $bindable runes without calling it ( #11181 )
...
* feat: add warning when using `$bindable` rune without calling it
* --amend
1 year ago
Dominic Gannaway
777527b5a3
fix: remove memory leak from retaining old DOM elements ( #11197 )
...
* fix: remove memory leak from retaining old DOM elements
* missing logic
* fix dynamic html bug
1 year ago
Dominic Gannaway
63456f1df9
fix: remove memory leak from bind:this ( #11194 )
...
* fix: remove memory leak from bind:this
* alternative approach
* add error
* tidy
* tidy
* add TODO
* add TODO
* alternative approach
1 year ago
github-actions[bot]
9aebae83a5
Version Packages (next) ( #11192 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Simon H
1cc6a32069
fix: ConstTag AST tweak ( #11196 )
...
VariableDeclaration should start at `const`, not at `@const`
As a side-effect, this will create less diff noise for language tools tests
1 year ago
Rich Harris
1c33ff0107
fix: make snippet effects transparent for transitions ( #11195 )
1 year ago
Rich Harris
8fef412dbb
feat: use state proxy ancestry for ownership validation ( #11184 )
...
* rename metadata.o to metadata.owners, tweak check_ownership implementation
* track parent relationships
* update
* changeset
* adjust test to reflect new semantics
* prevent component using bind: with object it does not own
* failing test
* fix #11060
* add explanatory comment
* don't accidentally narrow global ownership, fix has_owner method
* widen ownership if assigning different state proxies to one another
* don't set owners to null when parent exists
* fix
* only recurse into POJOs
* handle cycles on context
---------
Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
Co-authored-by: Dominic Gannaway <dg@domgan.com>
1 year ago
Dominic Gannaway
77ed790fb3
fix: ensure bind:this unmount behavior for members is conditional ( #11193 )
...
* fix: ensure bind:this unmount behavior for members is conditional
* revise
1 year ago
Simon H
e7869faf4d
fix: return ast from `compile` ( #11191 )
...
Svelte 4 does it and language tools assumes it's there
This also uncovered another case of how ridicoulus the old AST was
1 year ago
Simon H
7363f873df
chore: remove unused code ( #11190 )
...
leftover from earlier iterations of #11183
1 year ago
github-actions[bot]
30fa876a79
Version Packages (next) ( #11186 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Dominic Gannaway
18097478fc
breaking: remove unstate(), replace with $state.snapshot rune ( #11180 )
...
* breaking: remove untrack(), replace with $state.clean rune
* lol
* update types
* update types
* undo
* undo
* rename to raw
* rename to snapshot
* fix
* tweak docs, to make it explicitly that we're converting to and from proxies
* remove vestiges
* validation
* tweak
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
1 year ago
Simon H
cd7c3fea16
fix: more accurate default value handling ( #11183 )
...
- don't call fallback values eagerly, only when it's actually needed. Avoids potential unwanted side effects
- use derived_safe_equals to memoize results of destructured snippet/each context values with default values to ensure they're only recalculated when their dependencies change. Avoids unstable default values getting called multiple times yielding different results. Use derived_safe_equals to ensure new values are always set, even when mutated. fixes #11143
1 year ago
github-actions[bot]
ae7d73453c
Version Packages (next) ( #11176 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Dominic Gannaway
2fa095b61e
fix: improve spreading of attributes ( #11177 )
...
* fix: improve spreading of attributes
* twak
1 year ago
Daniel
d061f2f137
fix: ssr comments in head elements that require raw content ( #10936 )
...
* added raw elements set
* added test
* added changeset
* moved raw text elements to constands and made array
* moved to correct constants
* fix test
* fix constants formatting
1 year ago
github-actions[bot]
322737ac01
Version Packages (next) ( #11162 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Tan Li Hau
8caaa375cf
feat: add reactive URL object to svelte/reactivity ( #11157 )
...
* feat: reactive url
* fix
* simplify
* tidy
* simplify, make ReactiveURLSearchParams signature match URLSearchParams
* Update .changeset/tidy-chefs-taste.md
* fix
* fix
* regenerate types
* improve minifiability
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
Co-authored-by: Rich Harris <hello@rich-harris.dev>
1 year ago
Rich Harris
2cefd785a4
fix: make ownership validation work with HMR ( #11171 )
...
* fix: make ownership validation work with HMR
* bump vite-plugin-svelte in playground
* missed a spot
1 year ago
Tan Li Hau
a092899843
feat: update error message for snippet binding and assignments ( #11168 )
...
* feat: update error message for snippet binding and assignments
* make invalid-snippet-assignment apply in non-runes mode too
* update tests
* update types
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
1 year ago
Tan Li Hau
d1976c07ff
fix: fix string name of reactive map and set iterator ( #11169 )
...
* fix: fix string name of reactive map and set iterator
* remove solo: true
* lint
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
1 year ago
Tan Li Hau
dd9a8a2578
feat: remove todo ( #11167 )
1 year ago
Tan Li Hau
9b67ee18eb
fix: throw error when auto-subscribed store variable shadow by local variable ( #11170 )
1 year ago
Rich Harris
dc6a8398d1
Revert "fix: ensure deep mutation ownership widening" ( #11155 )
...
* Revert "fix: ensure deep mutation ownership widening (#11094 )"
This reverts commit 8578857332
.
* don't delete the changeset, it's already merged
1 year ago
github-actions[bot]
be842425f5
Version Packages (next) ( #11154 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Rich Harris
c1a549e801
check generated types ( #11068 )
...
* check generated types
* bump dts-buddy
1 year ago
github-actions[bot]
70ddaf4048
Version Packages (next) ( #11133 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Dominic Gannaway
19144b000f
fix: add validation around disallowed sequence expressions to element attributes ( #11149 )
1 year ago
Tan Li Hau
15eb5b5864
fix: missing classes after dynamic expressions in class attributes ( #11134 )
1 year ago
Rich Harris
d5776c3ec3
feat: simplify HMR implementation ( #11132 )
...
* chore: simplify HMR implementation
* changeset
* unused
* prettier
1 year ago
github-actions[bot]
a740b7bb43
Version Packages (next) ( #11130 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Dominic Gannaway
0896543e67
fix: further improvements to hmr component key generation ( #11129 )
1 year ago
github-actions[bot]
3f9f28604e
Version Packages (next) ( #11126 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Dominic Gannaway
53e6a99458
fix: use correct meta property for hmr key ( #11125 )
1 year ago
github-actions[bot]
37b689b320
Version Packages (next) ( #11121 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Dominic Gannaway
b01af747e8
fix: use keys for hmr modules ( #11123 )
...
* fix: use keys for hmr modules
* simplify
* lint
* ts
1 year ago
Dominic Gannaway
1183984f68
fix: addresses reactive Set bug in certain engines ( #11120 )
1 year ago
Jeremiasz Major
0cf2e98322
chore: upgrade eslint to v9 ( #11108 )
1 year ago
github-actions[bot]
710c8f4924
Version Packages (next) ( #11111 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Dominic Gannaway
afe1d11a5b
feat: hot module reloading support for Svelte 5 ( #11106 )
...
* feat: hot module reloading support for Svelte 5
* fix lockfile
* tweaks
* types
* lint
* lint
* tweaks
* add hmr flag
* tweak
* tweaks
* move HMR logic into its own module
* simplify
* tidy up types
* fix test
* lint
* need some indirection here or references break
* prevent transitions during HMR update
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
1 year ago
Dominic Gannaway
e1b2d29eda
chore: add hmr compiler flag ( #11112 )
...
* chore: add hmr compiler flag
* lint
1 year ago
Dominic Gannaway
3bb231197e
fix: loosen proxy signal creation heuristics ( #11109 )
...
* fix: loosen proxy signal creation heuristics
* tighten up test
* update comment
* no need to create a source outside an effect here, because it can't result in a reference
* preserve reference to props.$$events
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
1 year ago
Simon H
27891cb2dd
fix: ensure top level snippets are defined when binding to component prop ( #11104 )
...
...by hoisting top level snippets out of the binding loop in ssr mode
fixes #11086
1 year ago
Rich Harris
4d0b743918
feat: use linked lists for each blocks ( #11107 )
...
* unify indexed/keyed each blocks
* WIP
* comment out console temporarily
* WIP
* animations
* fix animations
* mostly working
* working
* revert unnecessary test changes
* remove unused code
* noop when item matches
* add test
* DRY
* simplify
* mostly working
* fix
* fix
* uncomment
* remove unnecessary test
* unused
* appease eslint etc
* avoid mutating lookup
* reuse lookup
* perf tweaks
* microoptimisations
* more efficient linking
* optimise
1 year ago
Dominic Gannaway
ce348f0d69
chore: add test to show usage of context in component template ( #11061 )
...
* chore: prevent usage of getContext during component template
* repurpose test to be just a test to capture context in template
1 year ago
github-actions[bot]
e8f7437cf6
Version Packages (next) ( #11093 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Simon H
5a1c756a4e
fix: execute sole static script tag ( #11095 )
...
- take into account that template could consist of a single script tag, for which querySelectorAll('script') would yield false negatives
- add test to ensure that we don't execute script tags inside `@html` tags next to static script tags
fixes #11082
1 year ago
Dominic Gannaway
3c2f4d2d55
fix: improve hydration of svelte head blocks ( #11099 )
...
* fix: improve hydration of svelte head blocks
* revert sandbox
* simplify
1 year ago
Dominic Gannaway
48549f7d00
fix: improve internal proxied state signal heuristic ( #11102 )
...
Fixes #11069
1 year ago
Simon H
d2b6159d2e
chore: css unused selector warnings ( #11098 )
...
The character adjustments in the existing warnings are because we remove some tabs from empty lines when initializing the Svelte 5 repo; the warnings were just not checked at that time yet.
1 year ago
Simon H
ed9bab9200
fix: better sibling selector handling ( #11096 )
...
Keep sibling selectors when dealing with slots/render tags/`svelte:element` tags
fixes #9274
1 year ago
Dominic Gannaway
3462c54fd2
fix: improve compiled output of multiple call expression in single text node ( #11097 )
...
* fix: improve compiled output of multiple call expression in single text node
* fix
1 year ago
Simon H
22494be9ec
feat: introduce `$host` rune, deprecate `createEventDispatcher` ( #11059 )
...
closes #11022
1 year ago
Simon H
8578857332
fix: ensure deep mutation ownership widening ( #11094 )
...
Previously, ownership widening/removal was only done if the immediate object that was encountered was state. This isn't always the case. It also didn't take into account classes with state on it (which turn into getters). This change takes both these cases into account and now always traverses the given object deeply.
fixes #11060
1 year ago
Simon H
b1a8038f8b
fix: make static `element` property available ( #11079 )
...
for the SvelteComponent type
closes #8936
1 year ago
github-actions[bot]
dfc55c18f0
Version Packages (next) ( #11072 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Simon H
a9e15bdf2d
breaking: robustify interop of exports and props ( #11064 )
...
- don't throw a dev time error when binding to an export (fixes #11008 )
- remove bindings that are for component exports
- throw an error when using a component export with the same name as a property
1 year ago
Dominic Gannaway
452749494e
Fix unowned bug 2 ( #11077 )
...
* fix: improve handled of unowned derived signals
* fix: improve handled of unowned derived signals
* lint
1 year ago
Rich Harris
8cbe8c1197
fix: bundle CSS types ( #11067 )
...
* make Css a proper namespace
* changeset
1 year ago
github-actions[bot]
ae3d472cbc
Version Packages (next) ( #11057 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2 years ago
Dominic Gannaway
b87d57dc6e
fix: add `anchor` support to mount() API ( #11050 )
...
* fix: add `anchor` support to mount() API
* use ??
* fix inconsistent formatting
* required options before optional ones
* regenerate types
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
2 years ago
Dominic Gannaway
02441c6a19
chore: apply each block controlled teardown optimization, again ( #11051 )
2 years ago
Rich Harris
f7c8fd569b
Revert "chore: apply each block controlled teardown optimization ( #11045 )" ( #11049 )
...
This reverts commit 1afec80261
.
2 years ago
Rich Harris
bb1d229e26
fix docs ( #11048 )
2 years ago
Dominic Gannaway
1afec80261
chore: apply each block controlled teardown optimization ( #11045 )
...
* chore: apply each block controlled teardown optimization
remove deopt
remove deopt
* remove deopt
* give a more descriptive name if we're running it across modules
* shorter comment
* rename each_element -> parent_node
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
2 years ago
Dominic Gannaway
17281c3df1
Revert "chore: remove deopts and refactor code for controlled optimizations (…" ( #11043 )
...
This reverts commit 3ece9cd051
.
2 years ago
Dominic Gannaway
3ece9cd051
chore: remove deopts and refactor code for controlled optimizations ( #11040 )
...
* chore: remove deopts and refactor code for controlled optimizations
* remove comment
* tune
* tweak
* tweak
* typo
* get rid of single-use variable
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
2 years ago
github-actions[bot]
d85d5a060b
Version Packages (next) ( #11035 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2 years ago
Dominic Gannaway
c50883e496
fix: ensure transition errors are not swallowed ( #11039 )
...
* fix: ensure transition errors are not swallowed
* feedback
2 years ago
Dominic Gannaway
b210fe3c9d
chore: remove parent DOM before children DOM ( #11038 )
2 years ago
Rich Harris
92909834f0
breaking: prevent unparenthesized sequence expressions in attributes ( #11032 )
2 years ago
github-actions[bot]
2a1d3c6e73
Version Packages (next) ( #11034 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2 years ago
Rich Harris
3254d2e22f
fix: add missing package.json in package ( #11033 )
2 years ago
github-actions[bot]
6bb825b1b1
Version Packages (next) ( #11018 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2 years ago
Dominic Gannaway
1d52c1323b
fix: improve unowned derived signal heuristics ( #11029 )
...
* fix: improve unowned derived signal heuristics
* spelling
2 years ago
Dominic Gannaway
2a784fce16
fix: correctly handle closure passed to $derived.by when destructuring ( #11028 )
...
* fix: correctly handle closure passed to $derived.by when destructuring
* oops
2 years ago
Rich Harris
3c155e3f3e
fix: ensure effect cleanup functions are called with null `this` ( #11024 )
2 years ago
Rich Harris
ad11c5087f
fix: ensure correct context for action update/destroy functions ( #11023 )
2 years ago
Rich Harris
34748ba015
chore: verify that `$effect.root(...)` does not re-run ( #11020 )
2 years ago
Rich Harris
0a162924fb
feat: more efficient hydration markers ( #11019 )
...
* remove <!--ssr:if:true--> comments
* remove <!--ssr:each_else--> comments
* changeset
* tidy up
2 years ago
Rich Harris
4f3fae7c6d
chore: compiler subpackage ( #10988 )
...
* move compiler.cjs to compiler/index.js
* changeset
* prettier
* ugh
2 years ago
Frédéric Crozatier
1c75b9ac4d
fix: add `name` to HTMLDetailsAttributes ( #11013 )
...
* add name attribute to HTMLDetailsAttributes
* changeset
2 years ago
Dominic Gannaway
8c4769db37
chore: improve internal performance of effect runtime ( #10999 )
...
* chore: improve internal performance of effect runtime
* add TODOs
* add TODOs
2 years ago
github-actions[bot]
57813124d8
Version Packages (next) ( #10995 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2 years ago
Rich Harris
7bd853b1a8
fix: hydrate HTML with surrounding whitespace ( #10996 )
...
* fix: hydrate HTML with surrounding whitespace
* add test
* fix a few more short comments
* tidy up
* avoid magic strings
* avoid magic strings
* fix
* oops
2 years ago
Dominic Gannaway
3f6eff55a4
chore: use internal doubly linked listed for effect tree ( #10994 )
...
* chore: use internal doubly linked listed for effect tree
* cleanup
* todo
2 years ago
Rich Harris
4a6316818c
feat: faster HTML tags ( #10986 )
...
* feat: faster HTML tags
* move code to where it is used
2 years ago
Rich Harris
cd90a5d946
chore: rename css.ts to css.d.ts ( #10991 )
2 years ago
github-actions[bot]
442f2d7c39
Version Packages (next) ( #10983 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2 years ago
Dominic Gannaway
b119600966
fix: ensure child effects are removed from parent branches ( #10985 )
...
* fix: ensure child effects are removed from parent branches
* fix: child effects are removed from parent branches
* oops
2 years ago
Rich Harris
5b2d5212d2
feat: expose `'svelte/internal'` ( #10987 )
...
* feat: expose svelte/internal
* fix
2 years ago
Dominic Gannaway
a1d74bd56d
chore: remove signal field from effects ( #10984 )
2 years ago
Dominic Gannaway
696b6922e8
fix: revert shorthand ssr comments ( #10980 )
...
* fix: revert shorthand ssr comments
* tests
* add changeset
2 years ago
github-actions[bot]
ef0191a6ae
Version Packages (next) ( #10977 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2 years ago
Rich Harris
227945d242
feat: re-export built-ins from `svelte/reactivity` on the server ( #10973 )
...
* chore: re-export builtins from svelte/reactivity on the server
* changeset
* fix
2 years ago
Dominic Gannaway
8971910940
fix: further improvements to effect scheduling and flushing ( #10971 )
...
* fix: improve effect scheduling
* fix: further improvements to effect scheduling and flushin
* add test
* simplify
* simplify
* lint
* fix e2e tests
* fix e2e tests
* simplify
* Update packages/svelte/src/internal/client/runtime.js
* Update packages/svelte/src/internal/client/runtime.js
Co-authored-by: Rich Harris <rich.harris@vercel.com>
* Update packages/svelte/src/internal/client/runtime.js
Co-authored-by: Rich Harris <rich.harris@vercel.com>
* Update packages/svelte/src/internal/client/runtime.js
Co-authored-by: Rich Harris <rich.harris@vercel.com>
* style tweak
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
2 years ago
Rich Harris
293f905a53
chore: use #client alias ( #10974 )
2 years ago
Rich Harris
f303d82043
chore: tidy up server exports ( #10972 )
...
* tidy up server exports
* tidy up server exports
* docs are unnecessary here
* eliminate client dependencies from server code
* lint
2 years ago
Rich Harris
d49e2aeb15
chore: explicit reexports ( #10970 )
...
* explicit re-exports
* explicit re-exports
* regenerate types
2 years ago
Rich Harris
8a758d86ee
move some code ( #10969 )
2 years ago
Rich Harris
cebbccbcba
chore: move svelte/internal to svelte/internal/client ( #10968 )
2 years ago
Rich Harris
eaa243d2da
chore: reshuffle some code ( #10967 )
...
* remove superfluous .d.ts file
* remove main/main-client.js to index-client.js
* move main/main-server.js to index-server.js
* move main/public.d.ts to index.d.ts
* move ambient.d.ts
* fix
* fix
2 years ago
github-actions[bot]
de6a802435
Version Packages (next) ( #10966 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2 years ago
Dominic Gannaway
ea6fd72e79
fix: apply animate on prefix/suffix each block mutations ( #10965 )
2 years ago
github-actions[bot]
1c645c3c07
Version Packages (next) ( #10963 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2 years ago
Dominic Gannaway
f118f8ea27
fix: improve action support for nested $effect ( #10962 )
...
* fix: improve action support for nested $effect
* tweaks
* simplify
* comment
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
2 years ago
Dominic Gannaway
d50b7661e5
fix: improve effect sequencing and execution order ( #10949 )
...
* WIP
* WIP
* address bad merge conflict
* add test
* fix issues
* remove debugger
* increase count
* increase count
* something different
* change
* change
* try it
* better comment
* remove deadcode
* move to continue
* fix tests
* add optimization
* unksip test
* Update packages/svelte/src/internal/client/dom/elements/bindings/this.js
Co-authored-by: Rich Harris <rich.harris@vercel.com>
* Update packages/svelte/src/internal/client/dom/elements/bindings/this.js
Co-authored-by: Rich Harris <rich.harris@vercel.com>
* Update packages/svelte/src/internal/client/dom/elements/bindings/this.js
Co-authored-by: Rich Harris <rich.harris@vercel.com>
* remove import
* add changeset
* tweaks
* code golf
* remove pre effects
* more effect ordering stuff (#10958 )
* WIP
* i guess this change makes sense?
* simplify
* delete unused code
* delete pre_effect
* note to self
* tidy up
* typos
* style tweaks
* style tweaks
* improve reactive statement handling
* no return needed
* let prettier put everything on a single line
* style tweaks
* var
* failing test
* fix test
* fix ordering
* simplify
* ondestroy
* working
* note breaking change
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
2 years ago
Rich Harris
2079e675ea
replace skip_if_ssr and skip_if_hydrate with modes ( #10956 )
2 years ago
Rich Harris
326e2b4840
chore: simplify templates ( #10954 )
...
* WIP
* WIP
* fix
* simplify
* rename close to append
* appease typescript
* simplify
* simplify
* frag -> root
* move logic to where it's used
2 years ago
Dominic Gannaway
cb18f8fbbe
chore: root effects should not have parents ( #10950 )
...
* chore: root effects should not have parents
* tune
* oops
* Update packages/svelte/src/internal/client/runtime.js
Co-authored-by: Rich Harris <rich.harris@vercel.com>
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
2 years ago
Rich Harris
9a4cd7e8d8
chore: refactor effects a bit ( #10948 )
...
* WIP
* formalise branch effects
* WIP
* rename MANAGED to BRANCH_EFFECT
* remove ondestroy functions
* tidy up
* simplify
* lint
* tidy up
* tidy up
* tidy up
* tidy up
* remove ondestroy
* tidy up
* tidy up
* remove TODO comment
* update comment
2 years ago
github-actions[bot]
b6598a3cc5
Version Packages (next) ( #10934 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2 years ago
Rich Harris
c683484f5f
chore: tidy up some hydration code ( #10944 )
...
* tidy up
* tidy up
2 years ago
Rich Harris
f8fcbf0b0b
chore: tidy up some outdated code ( #10947 )
2 years ago
Rich Harris
66e0378155
chore: remove `$.space` ( #10945 )
...
* chore: remove $.space
* simplify space_frag
* rename $.space_frag to $.text
2 years ago
Rich Harris
4fcedb2fb1
chore: simplify hydration ( #10943 )
...
* WIP
* unused
* unused
* fix head hydration
* working
* simplify
* tighten up
* css props
* fix treeshaking
* add a comment
2 years ago
Dominic Gannaway
afe589e219
fix: improve order of pre-effect execution ( #10942 )
...
* chore: refactor local effect flushing to use new topological approach
2 years ago
Rich Harris
3ce74e47a9
chore: update sequencing inside blocks ( #10939 )
...
* WIP
* fix timing issue
* compromise
* fix
* add missing before_init
* lint
---------
Co-authored-by: Dominic Gannaway <dg@domgan.com>
2 years ago
Rich Harris
9bbc3328ee
chore: tidy up effect init ( #10931 )
...
* move signal init logic into create_effect
* tidy up
* call set_signal_status inside execute_effect
* tidy up
* unused import
2 years ago
Rich Harris
7adc14e24c
chore: unify pre effects ( #10933 )
...
* breaking: always run pre effects synchronously
* unify pre effects
2 years ago
Rich Harris
f2cca537a3
feat: use implicit return for each block keys ( #10938 )
...
* feat: use implicit return for each block keys
* swap args
* update test
2 years ago
Rich Harris
808cc6fca6
feat: shorter each blocks ( #10937 )
2 years ago