Skip to content

Commit 3c0d0af

Browse files
committed
add back accidentally removed one
1 parent 02f469b commit 3c0d0af

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,12 @@ HTML restricts where certain elements can appear. In case of a violation the bro
654654

655655
This code will work when the component is rendered on the client (which is why this is a warning rather than an error), but if you use server rendering it will cause hydration to fail.
656656

657+
### non_reactive_update
658+
659+
```
660+
`%name%` is updated, but is not declared with `$state(...)`. Changing its value will not correctly trigger updates
661+
```
662+
657663
### options_deprecated_accessors
658664

659665
```

packages/svelte/messages/compile-warnings/script.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
> Svelte 5 components are no longer classes. Instantiate them using `mount` or `hydrate` (imported from 'svelte') instead.
88
9+
## non_reactive_update
10+
11+
> `%name%` is updated, but is not declared with `$state(...)`. Changing its value will not correctly trigger updates
12+
913
## perf_avoid_inline_class
1014

1115
> Avoid 'new class' — instead, declare the class at the top level scope

packages/svelte/src/compiler/warnings.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ export const codes = [
9797
"options_renamed_ssr_dom",
9898
"export_let_unused",
9999
"legacy_component_creation",
100+
"non_reactive_update",
100101
"perf_avoid_inline_class",
101102
"perf_avoid_nested_class",
102103
"reactive_declaration_invalid_placement",
@@ -598,6 +599,15 @@ export function legacy_component_creation(node) {
598599
w(node, "legacy_component_creation", "Svelte 5 components are no longer classes. Instantiate them using `mount` or `hydrate` (imported from 'svelte') instead.");
599600
}
600601

602+
/**
603+
* `%name%` is updated, but is not declared with `$state(...)`. Changing its value will not correctly trigger updates
604+
* @param {null | NodeLike} node
605+
* @param {string} name
606+
*/
607+
export function non_reactive_update(node, name) {
608+
w(node, "non_reactive_update", `\`${name}\` is updated, but is not declared with \`$state(...)\`. Changing its value will not correctly trigger updates`);
609+
}
610+
601611
/**
602612
* Avoid 'new class' — instead, declare the class at the top level scope
603613
* @param {null | NodeLike} node

0 commit comments

Comments
 (0)