Skip to content

Commit 2207b7d

Browse files
committed
regenerate
1 parent 2627c3c commit 2207b7d

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

documentation/docs/98-reference/.generated/client-warnings.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,34 @@ Mutating a value outside the component that created it is strongly discouraged.
9292
A `$:` statement (%location%) read reactive state that was not visible to the compiler. Updates to this state will not cause the statement to re-run. The behaviour of this code will change if you migrate it to runes mode
9393
```
9494

95+
In legacy mode, a `$:` [reactive statement](https://svelte.dev/docs/svelte/legacy-reactive-assignments) re-runs when the state it _references_ changes. This is determined at compile time, by analysing the code.
96+
97+
In runes mode, effects and deriveds re-run when there are changes to the values that are read during the function's _execution_.
98+
99+
Often, the result is the same — for example these can be considered equivalent:
100+
101+
```js
102+
$: sum = a + b;
103+
```
104+
105+
```js
106+
const sum = $derived(a + b);
107+
```
108+
109+
In some cases — such as the one that triggered the above warning — they are _not_ the same:
110+
111+
```js
112+
const add = () => a + b;
113+
114+
// the compiler can't 'see' that `sum` depends on `a` and `b`, but
115+
// they _would_ be read while executing the `$derived` version
116+
$: sum = add();
117+
```
118+
119+
Similarly, reactive properties of [deep state](https://svelte.dev/docs/svelte/$state#Deep-state) are not visible to the compiler. As such, changes to these properties will cause effects and deriveds to re-run but will _not_ cause `$:` statements to re-run.
120+
121+
When you [migrate this component](https://svelte.dev/docs/svelte/v5-migration-guide) to runes mode, the behaviour will change accordingly.
122+
95123
### state_proxy_equality_mismatch
96124

97125
```

packages/svelte/messages/client-warnings/warnings.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ Similarly, reactive properties of [deep state](https://svelte.dev/docs/svelte/$s
8686

8787
When you [migrate this component](https://svelte.dev/docs/svelte/v5-migration-guide) to runes mode, the behaviour will change accordingly.
8888

89-
9089
## state_proxy_equality_mismatch
9190

9291
> Reactive `$state(...)` proxies and the values they proxy have different identities. Because of this, comparisons with `%operator%` will produce unexpected results

0 commit comments

Comments
 (0)