Skip to content

Commit 63718a1

Browse files
committed
add warning
1 parent 8fbbd55 commit 63718a1

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### legacy_reactive_block_mutation
1+
### legacy_recursive_reactive_block
22

33
```
44
Detected a migrated `$:` reactive block that both accesses and updates the same reactive value. This may cause recursive updates when converted to an `$effect`.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
## legacy_reactive_block_mutation
1+
## legacy_recursive_reactive_block
22

33
> Detected a migrated `$:` reactive block that both accesses and updates the same reactive value. This may cause recursive updates when converted to an `$effect`.

packages/svelte/src/legacy/legacy-client.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ export function run(fn) {
182182
var effect = /** @type {import('#client').Effect} */ (active_effect);
183183
// If the effect is immediately made dirty again, mark it as maybe dirty to emulate legacy behaviour
184184
if ((effect.f & DIRTY) !== 0) {
185-
w.legacy_reactive_block_mutation();
185+
w.legacy_recursive_reactive_block();
186186
set_signal_status(effect, MAYBE_DIRTY);
187187
}
188188
});

packages/svelte/src/legacy/warnings.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ var normal = 'font-weight: normal';
88
/**
99
* Detected a migrated `$:` reactive block that both accesses and updates the same reactive value. This may cause recursive updates when converted to an `$effect`.
1010
*/
11-
export function legacy_reactive_block_mutation() {
11+
export function legacy_recursive_reactive_block() {
1212
if (DEV) {
13-
console.warn(`%c[svelte] legacy_reactive_block_mutation\n%cDetected a migrated \`$:\` reactive block that both accesses and updates the same reactive value. This may cause recursive updates when converted to an \`$effect\`.`, bold, normal);
13+
console.warn(`%c[svelte] legacy_recursive_reactive_block\n%cDetected a migrated \`$:\` reactive block that both accesses and updates the same reactive value. This may cause recursive updates when converted to an \`$effect\`.`, bold, normal);
1414
} else {
1515
// TODO print a link to the documentation
16-
console.warn("legacy_reactive_block_mutation");
16+
console.warn("legacy_recursive_reactive_block");
1717
}
1818
}

0 commit comments

Comments
 (0)