Skip to content

Commit 8e17428

Browse files
chore: tidy up messages (#11327)
* start reorganising messages * tidy up * more * more * more * alphabetise * consolidate * more * more * more * more * more * more * alphabetise * more * this is no longer needed * no longer necessary * more * more * fix * regenerate messages * more * more * tighten up rune validation * more * fix * more * tweak a11y messages * add server errors * overhaul runtime errors * regenerate messages * unused * lint * more * more * Update packages/svelte/messages/compile-errors/script.md Co-authored-by: Simon H <[email protected]> * Update packages/svelte/messages/client-warnings/warnings.md Co-authored-by: Simon H <[email protected]> * fix --------- Co-authored-by: Simon H <[email protected]>
1 parent 6ad5cd4 commit 8e17428

File tree

353 files changed

+2772
-2477
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

353 files changed

+2772
-2477
lines changed

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ packages/svelte/src/compiler/errors.js
77
packages/svelte/src/compiler/warnings.js
88
packages/svelte/src/internal/client/errors.js
99
packages/svelte/src/internal/client/warnings.js
10+
packages/svelte/src/internal/shared/errors.js
1011
packages/svelte/src/internal/shared/warnings.js
12+
packages/svelte/src/internal/server/errors.js
1113
packages/svelte/tests/**/*.svelte
1214
packages/svelte/tests/**/_expected*
1315
packages/svelte/tests/**/_actual*

packages/svelte/messages/client-errors/effects.md

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
## bind_invalid_checkbox_value
2+
3+
> Using `bind:value` together with a checkbox input is not allowed. Use `bind:checked` instead
4+
5+
## bind_invalid_export
6+
7+
> Component %component% has an export named `%key%` that a consumer component is trying to access using `bind:%key%`, which is disallowed. Instead, use `bind:this` (e.g. `<%name% bind:this={component} />`) and then access the property on the bound component instance (e.g. `component.%key%`)
8+
9+
## bind_not_bindable
10+
11+
> A component is attempting to bind to a non-bindable property `%key%` belonging to %component% (i.e. `<%name% bind:%key%={...}>`). To mark a property as bindable: `let { %key% = $bindable() } = $props()`
12+
13+
## each_key_duplicate
14+
15+
> Keyed each block has duplicate key at indexes %a% and %b%
16+
17+
> Keyed each block has duplicate key `%value%` at indexes %a% and %b%
18+
19+
## effect_in_teardown
20+
21+
> `%rune%` cannot be used inside an effect cleanup function
22+
23+
## effect_orphan
24+
25+
> `%rune%` can only be used inside an effect (e.g. during component initialisation)
26+
27+
## effect_update_depth_exceeded
28+
29+
> Maximum update depth exceeded. This can happen when a reactive block or effect repeatedly sets a new value. Svelte limits the number of nested updates to prevent infinite loops
30+
31+
## hydration_missing_marker_close
32+
33+
> Missing hydration closing marker
34+
35+
## hydration_missing_marker_open
36+
37+
> Missing hydration opening marker
38+
39+
## lifecycle_legacy_only
40+
41+
> `%name%(...)` cannot be used in runes mode
42+
43+
## props_invalid_value
44+
45+
> Cannot do `bind:%key%={undefined}` when `%key%` has a fallback value
46+
47+
## props_rest_readonly
48+
49+
> Rest element properties of `$props()` such as `%property%` are readonly
50+
51+
## rune_outside_svelte
52+
53+
> The `%rune%` rune is only available inside `.svelte` and `.svelte.js/ts` files
54+
55+
## state_prototype_fixed
56+
57+
> Cannot set prototype of `$state` object
58+
59+
## state_unsafe_mutation
60+
61+
> Unsafe mutations during Svelte's render or derived phase are not permitted in runes mode. This can lead to unexpected errors and possibly cause infinite loops.
62+
>
63+
> If the object is not meant to be reactive, declare it without `$state`
64+
65+
## svelte_component_invalid_this_value
66+
67+
> The `this={...}` property of a `<svelte:component>` must be a Svelte component, if defined

packages/svelte/messages/client-errors/lifecycle.md

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

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## hydration_attribute_changed
2+
3+
> The `%attribute%` attribute on `%html%` changed its value between server and client renders. The client value, `%value%`, will be ignored in favour of the server value
4+
5+
## hydration_mismatch
6+
7+
> Hydration failed because the initial UI does not match what was rendered on the server
8+
19
## lifecycle_double_unmount
210

311
> Tried to unmount a component that was not mounted

packages/svelte/messages/compile-errors/attributes.md

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

packages/svelte/messages/compile-errors/bindings.md

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

packages/svelte/messages/compile-errors/compiler_options.md

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

packages/svelte/messages/compile-errors/components.md

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

packages/svelte/messages/compile-errors/const_tag.md

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

packages/svelte/messages/compile-errors/elements.md

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

packages/svelte/messages/compile-errors/legacy_reactivity.md

Lines changed: 0 additions & 3 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
## options_invalid_value
2+
3+
> Invalid compiler option: %details%
4+
5+
## options_removed
6+
7+
> Invalid compiler option: %details%
8+
9+
## options_unrecognised
10+
11+
> Unrecognised compiler option %keypath%

0 commit comments

Comments
 (0)