Relax the runtime error to only throw when you're passing a binding with an undefined value. This makes it possible to provide components in a way that can be used more flexibly while keeping the error to guard against the case that we want to avoid: a default value propagation up.
* fix: handle sole empty expression tags
When there's only a single expression tag and its value evaluates to the empty string, special handling is needed to create and insert a text node
fixes#10426
* fix
* need this, too
* Update packages/svelte/src/internal/client/operations.js
---------
Co-authored-by: Rich Harris <richard.a.harris@gmail.com>
Closes#9420.
This PR creates an $effect.pre (before beforeUpdate and an $effect (for afterUpdate) and, inside those, listen for all locally declared signals plus reactive props. This does mean that we need to link the locally declared signals to the component context (the reverse of the current behaviour, wherein we link the component context to locally declared signals).
fixes#10296
Also make sure to use the server export conditions when resolving Svelte imports from inside the server compiler output
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
- Previously, any each block parents where used as keys for the sub group. That's wrong, it should only be using each blocks whos declarations contribute to the `bind:group` expression. Fixes#10345
- Only the left-most identifier of the expression was used to determine the binding group. This is wrong, all identifiers within the expression need to be taken into account. Fixes#9947
* fix: don't reuse proxies when state symbol refers to stale value
When somebody copies over the state symbol property onto a new object (you can retrieve the symbol by using `Reflect.ownKeys(...)`), it was wrongfully assumed that it always relates to the current value. This PR adds an additional check that this is actually the case.
This also adds a dev time warning when an object is frozen but contains a state property, which hints at a bug in user land.
fixes#10316
* lint
* rename
* remove warning
* update test
* changeset
---------
Co-authored-by: Rich Harris <rich.harris@vercel.com>
Co-authored-by: Rich Harris <richard.a.harris@gmail.com>
* strip typescript assertions before analysis
* add test
* changeset
* move ts handling from transform to before analysis
* format
* types
* remove unwrap_ts_expression
---------
Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>