Skip to content

Commit caf62ee

Browse files
authored
fix: allow $.state and $.derived to be treeshaken (#15702)
1 parent 6a668c4 commit caf62ee

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

.changeset/clever-news-enjoy.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'svelte': patch
3+
---
4+
5+
fix: allow `$.state` and `$.derived` to be treeshaken

packages/svelte/src/internal/client/reactivity/deriveds.js

+1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ export function derived(fn) {
6767
* @param {() => V} fn
6868
* @returns {Derived<V>}
6969
*/
70+
/*#__NO_SIDE_EFFECTS__*/
7071
export function user_derived(fn) {
7172
const d = derived(fn);
7273

packages/svelte/src/internal/client/reactivity/sources.js

+1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ export function source(v, stack) {
7878
* @param {V} v
7979
* @param {Error | null} [stack]
8080
*/
81+
/*#__NO_SIDE_EFFECTS__*/
8182
export function state(v, stack) {
8283
const s = source(v, stack);
8384

0 commit comments

Comments
 (0)