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
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>
1 year 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>
1 year ago
github-actions[bot]
d85d5a060b
Version Packages (next) ( #11035 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Dominic Gannaway
c50883e496
fix: ensure transition errors are not swallowed ( #11039 )
...
* fix: ensure transition errors are not swallowed
* feedback
1 year ago
Rich Harris
92909834f0
breaking: prevent unparenthesized sequence expressions in attributes ( #11032 )
1 year ago
github-actions[bot]
2a1d3c6e73
Version Packages (next) ( #11034 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Rich Harris
3254d2e22f
fix: add missing package.json in package ( #11033 )
1 year ago
github-actions[bot]
6bb825b1b1
Version Packages (next) ( #11018 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Dominic Gannaway
1d52c1323b
fix: improve unowned derived signal heuristics ( #11029 )
...
* fix: improve unowned derived signal heuristics
* spelling
1 year 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
1 year ago
Rich Harris
3c155e3f3e
fix: ensure effect cleanup functions are called with null `this` ( #11024 )
1 year ago
Rich Harris
ad11c5087f
fix: ensure correct context for action update/destroy functions ( #11023 )
1 year ago
Rich Harris
0a162924fb
feat: more efficient hydration markers ( #11019 )
...
* remove <!--ssr:if:true--> comments
* remove <!--ssr:each_else--> comments
* changeset
* tidy up
1 year ago
Rich Harris
4f3fae7c6d
chore: compiler subpackage ( #10988 )
...
* move compiler.cjs to compiler/index.js
* changeset
* prettier
* ugh
1 year ago
Frédéric Crozatier
1c75b9ac4d
fix: add `name` to HTMLDetailsAttributes ( #11013 )
...
* add name attribute to HTMLDetailsAttributes
* changeset
1 year ago
github-actions[bot]
57813124d8
Version Packages (next) ( #10995 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year 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
1 year ago
Rich Harris
4a6316818c
feat: faster HTML tags ( #10986 )
...
* feat: faster HTML tags
* move code to where it is used
1 year ago
github-actions[bot]
442f2d7c39
Version Packages (next) ( #10983 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year 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
1 year ago
Rich Harris
5b2d5212d2
feat: expose `'svelte/internal'` ( #10987 )
...
* feat: expose svelte/internal
* fix
1 year ago
Dominic Gannaway
696b6922e8
fix: revert shorthand ssr comments ( #10980 )
...
* fix: revert shorthand ssr comments
* tests
* add changeset
1 year ago
github-actions[bot]
ef0191a6ae
Version Packages (next) ( #10977 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year 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
1 year 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>
1 year ago
github-actions[bot]
de6a802435
Version Packages (next) ( #10966 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Dominic Gannaway
ea6fd72e79
fix: apply animate on prefix/suffix each block mutations ( #10965 )
1 year ago
github-actions[bot]
1c645c3c07
Version Packages (next) ( #10963 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year 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>
1 year 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>
1 year ago
github-actions[bot]
b6598a3cc5
Version Packages (next) ( #10934 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Dominic Gannaway
afe589e219
fix: improve order of pre-effect execution ( #10942 )
...
* chore: refactor local effect flushing to use new topological approach
1 year 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
1 year ago
Rich Harris
808cc6fca6
feat: shorter each blocks ( #10937 )
1 year ago
Rich Harris
8cfea9f36c
breaking: always run pre effects synchronously ( #10928 )
1 year ago
github-actions[bot]
b44311acc1
Version Packages (next) ( #10920 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
miunau
bbd44e9e47
fix: Add `elementtiming` HTMLAttribute, remove `crossorigin` from HTMLInputAttributes ( #10921 )
...
* Removed `crossorigin` from HTMLInputAttributes
* Added `elementtiming` attribute to HTMLAttributes
* changeset
---------
Co-authored-by: Rich Harris <hello@rich-harris.dev>
1 year ago
Rich Harris
59ff650ccb
remove if blocks around attribute updates ( #10917 )
1 year ago
github-actions[bot]
1e0054e915
Version Packages (next) ( #10889 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
miunau
0c05733d31
fix: Add `dirname` to HTMLInputAttributes ( #10908 )
...
* Add `dirname` to HTMLInputAttributes
* changeset
---------
Co-authored-by: Rich Harris <hello@rich-harris.dev>
1 year ago
Rich Harris
f1d9afe32f
changeset ( #10906 )
1 year ago
Rich Harris
8214075285
fix: update type of `options.target` ( #10892 )
1 year ago
Rich Harris
7f10642add
chore: improve hydration tests ( #10887 )
...
* use server-rendered HTML as hydration test starting point
* update tests
* remove _before.html files
* remove _before_head.html files
* override output with _expected.html
* expected output for binding-input case
* remove unused files
* fix
* changeset
1 year ago
github-actions[bot]
c47c5713e2
Version Packages (next) ( #10869 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Dominic Gannaway
83f30bf0e8
fix: allow runes for variable declarations in the template ( #10879 )
1 year ago
Simon H
b468978e4d
fix: handle multiple snippet parameters with one or more being optional ( #10833 )
...
fixes #10825
Co-authored-by: Dominic Gannaway <dg@domgan.com>
1 year ago
Simon H
3eef1cb8cf
feat: take form resets into account for two way bindings ( #10617 )
...
* feat: take form resets into account for two way bindings
When resetting a form, the value of the inputs within it get out of sync with the bound value of those inputs. This PR introduces a reset listener on the parent form to reset the value in that case
closes #2659
* slightly different approach
* tweaks, test
* this is a breaking change, strictly speaking
* bind:files
* use capture phase
* tweak wording
* use promise, explain
1 year ago
Simon H
a339c28bb7
breaking: apply fallback value every time in runes mode ( #10797 )
...
* breaking: apply fallback value every time in runes mode
closes #9948
* apply fallback value in setter
* encapsulate fallback logic
* we should keep this logic out of b.set, since it's very specific to accessors
* oops
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
1 year ago
github-actions[bot]
c60f2e38a3
Version Packages (next) ( #10832 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 year ago
Dominic Gannaway
8c2f6039c6
fix: improve element class attribute behaviour ( #10856 )
...
* fix: improve element class attribute behaviour
* Update packages/svelte/src/internal/client/dom/elements/class.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
Dominic Gannaway
efe85fcce0
fix: more robust select element logic ( #10848 )
...
* follow up to 10846
* lint
* simplify
* don't update value
* rework logic, rely more on mutation observer, fix bug related to select multiple
* fix lazy select options bug
---------
Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
Co-authored-by: brunnerh <brunnerh@users.noreply.github.com>
1 year ago
Dominic Gannaway
f5f9465edc
feat: add support for webkitdirectory DOM boolean attribute ( #10847 )
...
* feat: add support for webkitdirectory DOM boolean attribute
* add to types
---------
Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
1 year ago
Dominic Gannaway
c564c77199
fix: ensure select value is updated upon select element removal ( #10846 )
...
* fix: ensure select value is updated upon select element removal
* lint
* lol
1 year ago
Simon H
682f4a6513
fix: adjust scope parent for named slots ( #10843 )
...
fixes #10802
1 year ago
Dominic Gannaway
117082b039
fix: improve handling of unowned derived signals ( #10842 )
1 year ago
Simon H
1fc41730a1
fix: don't override instance methods during legacy class creation ( #10834 )
...
fixes #10805
1 year ago
Simon H
f8c85d525d
fix: ensure capture events don't call delegated events ( #10831 )
...
fixes #10821
1 year ago
github-actions[bot]
1bfafe935b
Version Packages (next) ( #10814 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2 years ago
Rich Harris
d921fb97bd
fix: add types for svelte/reactivity ( #10817 )
...
* fix: add types for svelte/reactivity - closes #10816
* simplify
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
2 years ago
Dominic Gannaway
474fc7ebe0
fix: ensure arguments are supported on all reactive Date methods ( #10813 )
2 years ago
github-actions[bot]
afc2eea382
Version Packages (next) ( #10806 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2 years ago
Dominic Gannaway
fe3b3b463c
feat: adds reactive Map class to svelte/reactivity ( #10803 )
...
* feat: adds reactive Map class to svelte/reactivity
* add docs
* add docs
* add test case
* types
* make reactive set better
* address feedback
* fix typo
* more efficient initialisation
* this is incorrect, it would fail if given a map for example
* increase consistency (with e.g. proxy.js)
* tidy up
* Revert "more efficient initialisation"
This reverts commit 29d4a8078b
.
* efficient initialization, without bugs this time
* convention
* delete make_iterable
* update changeset
* efficient initialization
* avoid generator functions
* Update sites/svelte-5-preview/src/routes/docs/content/01-api/02-runes.md
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
Co-authored-by: Rich Harris <richard.a.harris@gmail.com>
2 years ago
github-actions[bot]
924f0611f7
Version Packages (next) ( #10792 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2 years ago
Rich Harris
1e653ef4d8
fix: make `set.has(...)` granular for existing properties ( #10793 )
...
* fix: make set.has(...) granular
* changeset
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
2 years ago
Simon H
fbbd89a917
fix: invalidate store when mutated inside each block ( #10785 )
...
* fix: invalidate store when mutated inside each block
fixes #10771
* Update packages/svelte/src/compiler/phases/3-transform/client/visitors/template.js
2 years ago
github-actions[bot]
2701c0ad64
Version Packages (next) ( #10782 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2 years ago
Simon H
339782f3e0
fix: handle component binding mutation ( #10786 )
...
* fix: handle component binding mutation
https://github.com/sveltejs/svelte/issues/10359#issuecomment-1991885046
* alternative approach to mutating props (#10788 )
Co-authored-by: Rich Harris <rich.harris@vercel.com>
---------
Co-authored-by: Rich Harris <richard.a.harris@gmail.com>
Co-authored-by: Rich Harris <rich.harris@vercel.com>
2 years ago
Dominic Gannaway
2cb78ac253
fix: adjust render effect ordering ( #10783 )
...
We can simplify pre effects by not doing the flush logic at all now. Instead we can move the flushing logic to the only place its needed – for beforeUpdate
2 years ago
github-actions[bot]
0c1026f166
Version Packages (next) ( #10770 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2 years ago
Dominic Gannaway
3f7fcf9aec
feat: add reactive Set class to svelte/reactivity ( #10781 )
...
* feat: add reactive Set class to svelte/reactivity
* add some type safety
* simplify, read entries lazily
* failing unit test
* fix deletions
* minor tweaks
* work around effect ordering bug
* simplify, make entries lazy
* small tweak
* use var, minor tweaks
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
2 years ago
Rich Harris
77f39ea988
breaking: make `$props()` rune non-generic ( #10694 )
...
* breaking: make `$props()` rune non-generic
* explain why type argument was removed
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
2 years ago
Dominic Gannaway
468ecda6ea
fix: improve internal render effect sequencing ( #10769 )
...
We need to additionally check the levels to not accidentally insert a higher level before a lower level
fixes #10741
2 years ago
github-actions[bot]
3bdef5486f
Version Packages (next) ( #10758 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2 years ago
Dominic Gannaway
ef206fe1b5
fix: improve derived output for ssr ( #10757 )
...
* fix: improve derived output for ssr
* ts
* Update .changeset/rotten-rules-invite.md
---------
Co-authored-by: Rich Harris <richard.a.harris@gmail.com>
2 years ago
github-actions[bot]
8dc7cd2151
Version Packages (next) ( #10742 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2 years ago
Mostafa Kheibary
e16591abe8
docs: Change all the word "initialization" to "initialisation" ( #10708 )
...
* Docs: Change all initizlisation to initialisation
* Reverted to "initialization" when asserting errors with specific message
* Reverted to "initialization" where related to specific error message
2 years ago
Simon H
74474fe085
fix: prevent reactive statement reruns ( #10736 )
...
- run reactive statements only once per tick, even when they have indirect cyclic dependencies. Made possible by adding an array to the component context, which is filled with identifiers of the reactive statements, and which is cleared after all have run. Reactive statements rerunning before that will bail early if they detect they're still in the list
- part of the solution is to run all reactive statements, and then all render effects, which also fixes #10597
2 years ago
github-actions[bot]
f3bfb938ee
Version Packages (next) ( #10716 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2 years ago
Dominic Gannaway
7c00f1dacb
fix: improve bind:this support around proxyied state ( #10732 )
...
* fix: improve bind:this support around proxyied state
* fix: improve bind:this support around proxyied state
* fix: improve bind:this support around proxyied state
2 years ago
Simon H
304db0d5b2
fix: bump specificity on all members of a selector list ( #10730 )
...
Previously, only `div span` in `div span, div div { .. }` would've gotten the specificity bump
2 years ago
Simon H
b1267b03b6
fix: error when exporting reassigned state from module context ( #10728 )
...
fixes #10380
2 years ago
Simon H
ae4af6841a
fix: eagerly unsubscribe when store is changed ( #10727 )
...
fixes #9346
2 years ago
Simon H
3fd02f1c49
breaking: preserve slots inside templates with a shadowrootmode attribute ( #10721 )
...
closes #10641
2 years ago
Simon H
fff3320517
chore: custom elements validation ( #10720 )
...
- add "missing customElement option" warning
- add backwards compat support for customElement={null}
2 years ago
Dominic Gannaway
622195cc21
fix: ensure performance.now() and requestAnimationFrame() are polyfilled in ssr ( #10715 )
2 years ago
github-actions[bot]
b3d0a0695a
Version Packages (next) ( #10701 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2 years ago
Dominic Gannaway
d9d1022895
fix: improve indexed each equality ( #10702 )
2 years ago
Simon H
4285e6d814
fix: prevent snippet children conflict ( #10700 )
...
closes #10385
2 years ago