Skip to content

Commit 985c43b

Browse files
committed
feedback
1 parent 5f713ac commit 985c43b

File tree

8 files changed

+23
-27
lines changed

8 files changed

+23
-27
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ Hydration failed because the initial UI does not match what was rendered on the
5656
The `render` function passed to `createRawSnippet` should return HTML for a single element
5757
```
5858

59+
### legacy_recursive_reactive_block
60+
61+
```
62+
Detected a migrated `$:` reactive block that both accesses and updates the same reactive value. This may cause recursive updates when converted to an `$effect`.
63+
```
64+
5965
### lifecycle_double_unmount
6066

6167
```

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

Lines changed: 0 additions & 5 deletions
This file was deleted.

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ The easiest way to log a value as it changes over time is to use the [`$inspect`
3636

3737
> The `render` function passed to `createRawSnippet` should return HTML for a single element
3838
39+
## legacy_recursive_reactive_block
40+
41+
> Detected a migrated `$:` reactive block that both accesses and updates the same reactive value. This may cause recursive updates when converted to an `$effect`.
42+
3943
## lifecycle_double_unmount
4044

4145
> Tried to unmount a component that was not mounted

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

Lines changed: 0 additions & 3 deletions
This file was deleted.

packages/svelte/scripts/process-messages/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,4 +404,3 @@ transform('client-errors', 'src/internal/client/errors.js');
404404
transform('server-errors', 'src/internal/server/errors.js');
405405
transform('shared-errors', 'src/internal/shared/errors.js');
406406
transform('shared-warnings', 'src/internal/shared/warnings.js');
407-
transform('legacy-warnings', 'src/legacy/warnings.js');

packages/svelte/scripts/process-messages/templates/legacy-warnings.js

Lines changed: 0 additions & 17 deletions
This file was deleted.

packages/svelte/src/internal/client/warnings.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,4 +151,16 @@ export function state_proxy_equality_mismatch(operator) {
151151
// TODO print a link to the documentation
152152
console.warn("state_proxy_equality_mismatch");
153153
}
154+
}
155+
156+
/**
157+
* Detected a migrated `$:` reactive block that both accesses and updates the same reactive value. This may cause recursive updates when converted to an `$effect`.
158+
*/
159+
export function legacy_recursive_reactive_block() {
160+
if (DEV) {
161+
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);
162+
} else {
163+
// TODO print a link to the documentation
164+
console.warn("legacy_recursive_reactive_block");
165+
}
154166
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
} from '../internal/client/runtime.js';
1313
import { lifecycle_outside_component } from '../internal/shared/errors.js';
1414
import { define_property, is_array } from '../internal/shared/utils.js';
15-
import * as w from './warnings.js';
15+
import * as w from '../internal/client/warnings.js';
1616

1717
/**
1818
* Takes the same options as a Svelte 4 component and the component function and returns a Svelte 4 compatible component.

0 commit comments

Comments
 (0)