ferrovue 0.4.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/README.md +378 -63
  2. package/dist/attrs.d.ts +3 -2
  3. package/dist/attrs.js +31 -26
  4. package/dist/calls.js +17 -15
  5. package/dist/children.d.ts +11 -4
  6. package/dist/children.js +110 -44
  7. package/dist/classes.d.ts +4 -0
  8. package/dist/classes.js +33 -11
  9. package/dist/cli.js +31 -5
  10. package/dist/client.d.ts +44 -6
  11. package/dist/client.js +182 -18
  12. package/dist/compiler.d.ts +1 -1
  13. package/dist/compiler.js +42 -10
  14. package/dist/component.d.ts +3 -1
  15. package/dist/component.js +114 -20
  16. package/dist/conformance.d.ts +64 -0
  17. package/dist/conformance.js +276 -0
  18. package/dist/constants.d.ts +42 -0
  19. package/dist/constants.js +292 -0
  20. package/dist/context.d.ts +40 -7
  21. package/dist/context.js +14 -5
  22. package/dist/diagnostics.d.ts +23 -0
  23. package/dist/diagnostics.js +30 -0
  24. package/dist/dynamic.d.ts +18 -0
  25. package/dist/dynamic.js +576 -0
  26. package/dist/errors.d.ts +1034 -0
  27. package/dist/errors.js +425 -0
  28. package/dist/expr.d.ts +1 -0
  29. package/dist/expr.js +120 -49
  30. package/dist/file-routes.d.ts +33 -0
  31. package/dist/file-routes.js +224 -0
  32. package/dist/fixture.d.ts +19 -10
  33. package/dist/fixture.js +23 -12
  34. package/dist/hydration.d.ts +15 -0
  35. package/dist/hydration.js +80 -0
  36. package/dist/index.d.ts +3 -2
  37. package/dist/index.js +2 -1
  38. package/dist/link-router.d.ts +24 -0
  39. package/dist/link-router.js +37 -0
  40. package/dist/lists.d.ts +4 -0
  41. package/dist/lists.js +32 -23
  42. package/dist/loops.js +18 -14
  43. package/dist/model.d.ts +43 -1
  44. package/dist/model.js +167 -7
  45. package/dist/narrowing.d.ts +8 -0
  46. package/dist/narrowing.js +40 -9
  47. package/dist/numbers.js +3 -2
  48. package/dist/page-routes.d.ts +9 -0
  49. package/dist/page-routes.js +10 -0
  50. package/dist/plugin.d.ts +13 -1
  51. package/dist/plugin.js +3 -0
  52. package/dist/plugins/client-only.d.ts +8 -0
  53. package/dist/plugins/client-only.js +110 -0
  54. package/dist/plugins/head.d.ts +15 -0
  55. package/dist/plugins/head.js +385 -0
  56. package/dist/plugins/i18n.js +14 -14
  57. package/dist/plugins/index.js +5 -1
  58. package/dist/plugins/provide.d.ts +44 -0
  59. package/dist/plugins/provide.js +528 -0
  60. package/dist/plugins/router-link.js +39 -32
  61. package/dist/plugins/router.d.ts +4 -1
  62. package/dist/plugins/router.js +65 -19
  63. package/dist/plugins/scoped.js +1 -1
  64. package/dist/plugins/shared-types.js +1 -1
  65. package/dist/plugins/stores.js +45 -33
  66. package/dist/plugins/teleport.js +3 -3
  67. package/dist/plugins/twins.d.ts +10 -0
  68. package/dist/plugins/twins.js +164 -0
  69. package/dist/routes.d.ts +13 -0
  70. package/dist/routes.js +12 -0
  71. package/dist/rust.js +64 -32
  72. package/dist/script.d.ts +3 -0
  73. package/dist/script.js +138 -20
  74. package/dist/settle.d.ts +8 -0
  75. package/dist/settle.js +39 -0
  76. package/dist/slots.js +36 -22
  77. package/dist/ssr.d.ts +3 -0
  78. package/dist/ssr.js +29 -0
  79. package/dist/strings.d.ts +3 -0
  80. package/dist/strings.js +27 -13
  81. package/dist/styles.js +13 -13
  82. package/dist/template.js +102 -21
  83. package/dist/testing.d.ts +3 -3
  84. package/dist/testing.js +3 -29
  85. package/dist/types.d.ts +5 -0
  86. package/dist/typescript.d.ts +2 -1
  87. package/dist/typescript.js +52 -21
  88. package/dist/vhtml.d.ts +4 -0
  89. package/dist/vhtml.js +63 -0
  90. package/dist/vite.d.ts +8 -2
  91. package/dist/vite.js +75 -14
  92. package/package.json +23 -5
package/dist/errors.js ADDED
@@ -0,0 +1,425 @@
1
+ /** The areas codes are grouped in, by their first two digits, with the guide page that explains each. */
2
+ export const AREAS = {
3
+ "00": { name: "Components and parsing" },
4
+ "01": { name: "Script setup" },
5
+ "02": { name: "Constants and enums" },
6
+ "03": { name: "Props and types", guide: "props" },
7
+ "04": { name: "Templates and attributes", guide: "generated_code" },
8
+ "05": { name: "Child components", guide: "generated_code" },
9
+ "06": { name: "Expressions" },
10
+ "07": { name: "Strings and numbers", guide: "strings" },
11
+ "08": { name: "Lists and loops", guide: "props" },
12
+ "09": { name: "Slots", guide: "slots" },
13
+ "10": { name: "Classes, styles and scoped styles", guide: "scoped_styles" },
14
+ "11": { name: "Configuration and helpers", guide: "quick_start" },
15
+ "12": { name: "Router", guide: "routing" },
16
+ "13": { name: "Pinia stores", guide: "pinia" },
17
+ "14": { name: "vue-i18n", guide: "i18n" },
18
+ "15": { name: "Raw HTML, client-only content, teleports and Rust twins", guide: "errors_and_limits" },
19
+ "16": { name: "Provide and inject", guide: "provide_inject" },
20
+ "17": { name: "Page head", guide: "head" },
21
+ };
22
+ /** Every code the compiler raises. A code is never reused: one the compiler stops raising is marked
23
+ * `retired` and stays listed. `pnpm errors:generate` writes the guide's index from this list. */
24
+ export const ERRORS = {
25
+ FV0001: {
26
+ title: "Source file that does not parse",
27
+ detail: "A `<script setup>` block, or a file it reads, is not valid TypeScript. The message is the parser's own, with the line and column where it stopped.",
28
+ },
29
+ FV0002: { title: "Component file Vue cannot parse" },
30
+ FV0003: { title: "`<script>` without `setup`" },
31
+ FV0004: { title: "Component without a `<template>`" },
32
+ FV0005: { title: "Template Vue cannot compile" },
33
+ FV0006: {
34
+ title: "Unexpected construct in Vue's compiled template",
35
+ detail: "The compiler met output of Vue's server compiler that it has no translation for. Please report it with the component that caused it.",
36
+ },
37
+ FV0007: {
38
+ title: "Component file name that gives no Rust module of its own",
39
+ detail: "Each component is written to a Rust module named after its file in snake case (`UserCard.vue` is `user_card.rs`). A file name that is not letters, digits and `_` starting with a letter, two names with the same snake case (`FooBar.vue` and `Foo_bar.vue`), `Mod.vue`, and a name a module ferrovue writes for the project already has (`Types.vue`, `Stores.vue`) are refused.",
40
+ },
41
+ FV0101: { title: "`inheritAttrs` that is not `true` or `false`" },
42
+ FV0102: { title: "`watch` with `immediate`" },
43
+ FV0103: { title: "Effect that runs once on the server" },
44
+ FV0104: { title: "`onServerPrefetch`" },
45
+ FV0105: { title: "Statement in setup that could change what renders" },
46
+ FV0106: { title: "`defineAsyncComponent` of anything but a component of this project" },
47
+ FV0107: { title: "Unsupported statement in setup" },
48
+ FV0108: { title: "`...rest` in destructured props" },
49
+ FV0109: { title: "Destructured prop that is not a plain name" },
50
+ FV0201: { title: "Constant that refers to itself" },
51
+ FV0202: { title: "Enum member without a value after a string member" },
52
+ FV0203: { title: "Enum member value that is not a string or number literal" },
53
+ FV0204: { title: "Field a constant object does not have" },
54
+ FV0205: { title: "Spread or hole in a constant list" },
55
+ FV0206: { title: "Computed or spread key in a constant object" },
56
+ FV0207: { title: "Constant that is not a literal" },
57
+ FV0208: { title: "Constant object read whole" },
58
+ FV0209: { title: "`null` in a constant list of plain values" },
59
+ FV0210: { title: "Constant list of plain values of different types" },
60
+ FV0211: { title: "Constant list mixing plain values and objects" },
61
+ FV0212: { title: "Two constant lists with one Rust name" },
62
+ FV0213: { title: "Object in a constant list without a required field" },
63
+ FV0214: { title: "`null` for a field that is not nullable" },
64
+ FV0215: { title: "Field of the wrong type in a constant list's object" },
65
+ FV0216: { title: "Field of an unsupported type in a constant list's objects" },
66
+ FV0217: { title: "Field that is only ever `null`" },
67
+ FV0218: { title: "Field `null` in some objects and absent in others" },
68
+ FV0219: { title: "Field of different types across a constant list's objects" },
69
+ FV0220: { title: "Constant list's object type declared twice" },
70
+ FV0221: { title: "Constant list's object type named as a Rust type" },
71
+ FV0222: { title: "Constant object read by a key chosen at run time" },
72
+ FV0301: { title: "`generic` that is not a list of type parameters" },
73
+ FV0302: {
74
+ title: "Type parameter without a constraint",
75
+ detail: "A generic component renders each type parameter as its constraint, so `generic=\"T\"` alone gives the server no type. Write `generic=\"T extends string\"`.",
76
+ },
77
+ FV0303: { title: "Props declared at run time" },
78
+ FV0304: { title: "Props type not declared in the component" },
79
+ FV0305: { title: "`defineModel` without a type" },
80
+ FV0306: { title: "`defineModel` of a nullable type that is not required" },
81
+ FV0307: { title: "Default for a nullable prop" },
82
+ FV0308: { title: "Unknown type" },
83
+ FV0309: { title: "Type that is only `undefined`" },
84
+ FV0310: { title: "Object type written in place" },
85
+ FV0311: {
86
+ title: "Type that may be both `null` and `undefined`",
87
+ detail: "A Rust `Option` holds one kind of nothing, where JavaScript has two. Declare `T | null` or `x?: T`, never both. See [`props`](crate::guide::props#nullable-props).",
88
+ },
89
+ FV0312: { title: "Union of different types" },
90
+ FV0313: { title: "`Record` not keyed by `string`" },
91
+ FV0314: { title: "Type alias that refers to itself" },
92
+ FV0315: { title: "Unsupported named type" },
93
+ FV0316: { title: "Unsupported type" },
94
+ FV0317: { title: "`Record` of unsupported values" },
95
+ FV0318: { title: "Interface named as a Rust type" },
96
+ FV0319: { title: "Type declared in two files" },
97
+ FV0320: { title: "Interface with members other than plain named fields" },
98
+ FV0321: { title: "Optional field of a nullable type" },
99
+ FV0322: { title: "Prop default that is not a literal" },
100
+ FV0401: { title: "Interpolation of a value that is not a string, a number or a boolean" },
101
+ FV0402: { title: "Attribute value of an unsupported type" },
102
+ FV0403: {
103
+ title: "Attribute bound to a value Vue's server leaves out",
104
+ detail: "Vue's server renderer leaves out an attribute bound to a list, an object or a `route.query` value, and hydration then sets it to the value's `String()` without reporting a mismatch. Join a list (`.join(\",\")`) or narrow a query value to one string.",
105
+ },
106
+ FV0404: { title: "Unsafe attribute name" },
107
+ FV0405: {
108
+ title: "Custom directive not listed in `clientDirectives`",
109
+ detail: "A custom directive's `getSSRProps` may add attributes on the server, which ferrovue does not run. List a directive that adds none in `clientDirectives`.",
110
+ },
111
+ FV0406: { title: "`$attrs` on a root that takes scope ids" },
112
+ FV0407: { title: "Attributes that are not an object literal" },
113
+ FV0408: { title: "Computed or spread key in an attribute object" },
114
+ FV0409: { title: "`className` bound in place of `class`" },
115
+ FV0410: { title: "Merged attributes that are not object literals" },
116
+ FV0411: { title: "Class merged with a string that may repeat the class before it" },
117
+ FV0412: { title: "Fallthrough attribute of an unsupported type" },
118
+ FV0413: { title: "`v-model` comparing values of types it cannot compare" },
119
+ FV0414: { title: "`v-model` over an array" },
120
+ FV0415: { title: "Value read from `$attrs`" },
121
+ FV0416: { title: "Root `<Transition>` or `<KeepAlive>` around `v-if` that is given attributes" },
122
+ FV0417: { title: "Attribute name chosen at run time" },
123
+ FV0418: {
124
+ title: "`<component :is>` over a value that is not a closed set",
125
+ detail: "`<component :is>` compiles to a `match` over its choices, so each one must be known when compiling: an imported component, an HTML element's name, a `computed` or `?:` choosing among them, a prop typed as a union of string literals, or an object of imported components read by such a prop. A `string`, a `Component` or a value from elsewhere could be anything.",
126
+ },
127
+ FV0419: { title: "`<component :is>` naming something other than an HTML element" },
128
+ FV0420: { title: "`<component :is>` over a prop that may be absent" },
129
+ FV0421: { title: "`<component :is>` reading a key its object does not have" },
130
+ FV0422: { title: "`v-html` or `v-text` on `<component :is>`" },
131
+ FV0423: {
132
+ title: "`v-show`, or `v-model` on `<select>`, in content rendered from virtual nodes",
133
+ detail: "Inside an element `<component :is>` chooses, in the slot content such an element renders, and inside a `<RouterLink>`, Vue's server renders from virtual nodes, where `v-show` writes no `style` while it shows and `v-model` on a `<select>` marks no option `selected`. Bind `:style` or `:selected` yourself.",
134
+ },
135
+ FV0501: { title: "Child component that is not among the compiled components" },
136
+ FV0502: { title: "Fallthrough attribute that would reach a child's prop" },
137
+ FV0503: { title: "Child props that are not an object literal" },
138
+ FV0504: { title: "Computed or spread key in child props" },
139
+ FV0505: { title: "Attribute named by an integer" },
140
+ FV0506: { title: "Required prop not passed" },
141
+ FV0507: { title: "Required nullable prop not passed" },
142
+ FV0508: { title: "Attributes passed to a child that takes none" },
143
+ FV0509: { title: "String prop given a value that is not a string" },
144
+ FV0510: { title: "One type declared separately by parent and child" },
145
+ FV0511: { title: "Prop given a value of another type" },
146
+ FV0512: { title: "`Props` imported from a component that is not compiled" },
147
+ FV0513: { title: "Component resolved by name that is not imported" },
148
+ FV0601: { title: "Name or function not available on the server" },
149
+ FV0602: { title: "Unsupported method" },
150
+ FV0603: { title: "Unsupported call" },
151
+ FV0604: { title: "Field read on a value that is not an object" },
152
+ FV0605: { title: "Field the type does not have" },
153
+ FV0606: { title: "Value that may be absent where its target cannot take it as it is" },
154
+ FV0607: { title: "Value of an unexpected type" },
155
+ FV0608: { title: "`+` between unsupported types" },
156
+ FV0609: { title: "Comparison between unsupported or absent values" },
157
+ FV0610: { title: "Spread or hole in an array literal" },
158
+ FV0611: { title: "Array literal of different types" },
159
+ FV0612: { title: "Computed member access" },
160
+ FV0613: { title: "Value set up in a way the server cannot evaluate" },
161
+ FV0614: { title: "Logical operator between values that are not booleans" },
162
+ FV0615: { title: "`??` falling back to a computed list" },
163
+ FV0616: { title: "`??` between different types" },
164
+ FV0617: { title: "`||` between unsupported types" },
165
+ FV0618: { title: "Unsupported unary operator" },
166
+ FV0619: { title: "`==` or `!=` with anything but `null` or `undefined`" },
167
+ FV0620: { title: "Loose test against `undefined` of a value of a plugin's type" },
168
+ FV0621: { title: "Comparison of a plugin's value with `null` or `undefined`" },
169
+ FV0622: { title: "`===` between different types" },
170
+ FV0623: { title: "Branches of `?:` of different types" },
171
+ FV0624: { title: "`new` in an expression" },
172
+ FV0625: { title: "Unsupported expression" },
173
+ FV0626: { title: "Strict test of a value that may be `null` or `undefined`" },
174
+ FV0627: { title: "Strict test against the absence a value cannot have" },
175
+ FV0701: { title: "`Number()` of an unsupported value" },
176
+ FV0702: { title: "`parseInt()` or `parseFloat()` of a value that is not a string" },
177
+ FV0703: { title: "`parseInt()` with a radix other than a literal 10 or 16" },
178
+ FV0704: { title: "Unsupported `Math` method" },
179
+ FV0705: { title: "`.toFixed()` without a literal number of digits from 0 to 100" },
180
+ FV0706: {
181
+ title: "String that may hold half of a surrogate pair compared, searched or joined",
182
+ detail: "`slice`, `substring`, `at`, `charAt` and `split(\"\")` can cut a surrogate pair in half. JavaScript keeps the half where ferrovue holds U+FFFD, so two such strings may compare, search or join differently. See [`strings`](crate::guide::strings#halves-of-surrogate-pairs).",
183
+ },
184
+ FV0707: { title: "`JSON.stringify()` of an unsupported value" },
185
+ FV0708: { title: "Template literal of values that are not present strings, numbers or booleans" },
186
+ FV0709: { title: "String method with the wrong number of arguments" },
187
+ FV0710: { title: "Regular expression given to a string method" },
188
+ FV0711: { title: "String method given a value that is not a present string" },
189
+ FV0712: { title: "String method given a value that is not a present number" },
190
+ FV0713: { title: "Function given to a string method" },
191
+ FV0714: { title: "`.repeat()` by a negative or infinite count" },
192
+ FV0715: { title: "Case mapping by the server's locale" },
193
+ FV0801: { title: "`.includes()` of a value of another type than the list's" },
194
+ FV0802: { title: "`.join()` with a separator that is not a string" },
195
+ FV0803: { title: "List method on a value that is not a list" },
196
+ FV0804: { title: "List method over a list of unsupported items" },
197
+ FV0805: { title: "List method given anything but an arrow function" },
198
+ FV0806: { title: "Arrow function with a block body" },
199
+ FV0807: { title: "Arrow function index that is not a plain name" },
200
+ FV0808: { title: "Defaults or nested patterns in an arrow function's item" },
201
+ FV0809: { title: "Arrow function item bound by an unsupported pattern" },
202
+ FV0810: { title: "`.map()` to optional or unsupported values" },
203
+ FV0811: { title: "`.slice()` with more than two arguments" },
204
+ FV0812: { title: "`.slice()` of values that are not numbers" },
205
+ FV0813: { title: "List method given more than one function" },
206
+ FV0814: { title: "`Object` method of a value that is not a `Record`" },
207
+ FV0815: { title: "`Object.values()` of a record of lists" },
208
+ FV0816: { title: "`Object.entries()` outside a `v-for`" },
209
+ FV0817: { title: "Unsupported `Object` method" },
210
+ FV0818: { title: "`v-for` over `Object.entries()` without `[key, value]`" },
211
+ FV0819: { title: "`v-for` over an empty array literal" },
212
+ FV0820: { title: "`v-for` over a value that is not a list or a number" },
213
+ FV0821: { title: "Defaults or nested patterns in a `v-for` item" },
214
+ FV0822: { title: "`v-for` item bound by an unsupported pattern" },
215
+ FV0823: { title: "`v-for` key or index that is not a plain name" },
216
+ FV0901: { title: "Slots that are not an object literal" },
217
+ FV0902: { title: "Computed or spread slot name" },
218
+ FV0903: { title: "Content for a slot the child does not have" },
219
+ FV0904: { title: "Defaults or nested patterns in destructured slot props" },
220
+ FV0905: { title: "Slot props bound by an unsupported pattern" },
221
+ FV0906: { title: "Slot props taken from a slot that passes none" },
222
+ FV0907: { title: "Slot read that the template does not render" },
223
+ FV0908: { title: "Slot prop of a type with no Rust type" },
224
+ FV0909: { title: "Array literal as a slot prop" },
225
+ FV0910: { title: "Computed list as a slot prop" },
226
+ FV0911: { title: "Slot prop of an unsupported type" },
227
+ FV0912: { title: "Slot name that is not literal" },
228
+ FV0913: { title: "Slot props that are not attributes or an object literal" },
229
+ FV0914: { title: "Computed or spread key in slot props" },
230
+ FV0915: { title: "Slot prop name that is not a plain name" },
231
+ FV0916: { title: "Outlets of one slot that pass different props" },
232
+ FV0917: { title: "Interface named as a slot's props type" },
233
+ FV0918: { title: "Slot scope id given to content that takes none" },
234
+ FV0919: {
235
+ title: "`<slot>` with fallback content inside an element `<component :is>` chooses",
236
+ detail: "Inside an element that `<component :is>` chooses, Vue renders a slot's content as virtual nodes and decides whether to show the fallback by rules of their own. Give the fallback from the parent instead.",
237
+ },
238
+ FV0920: { title: "`<slot>` rendered both inside and outside an element `<component :is>` chooses" },
239
+ FV1001: { title: "Computed or spread key in a class object" },
240
+ FV1002: { title: "Computed class name that is not a string" },
241
+ FV1003: { title: "Class name with spaces around it" },
242
+ FV1004: { title: "Class binding of an unsupported type" },
243
+ FV1005: { title: "`<style module>`" },
244
+ FV1006: { title: "`v-bind()` in CSS" },
245
+ FV1007: { title: "Style binding of an unsupported type" },
246
+ FV1008: { title: "Computed or spread key in a style object" },
247
+ FV1009: { title: "Style property named by a number or starting with `:`" },
248
+ FV1010: { title: "Style array mixing a string with objects" },
249
+ FV1011: { title: "Style property whose place depends on a condition" },
250
+ FV1012: { title: "Scope ids handed to a component whose render does not take them" },
251
+ FV1013: {
252
+ title: "`class` written apart from a later `:class` in content rendered from virtual nodes",
253
+ detail: "Inside an element `<component :is>` chooses, in the slot content such an element renders, and inside a `<RouterLink>`, Vue's server renders from virtual nodes, where a static `class` written before `:class` keeps its place and its names come first. ferrovue writes them so when nothing stands between the two; with attributes between them, write the two next to each other, or `:class` first.",
254
+ },
255
+ FV1101: { title: "Helper called with the wrong number of arguments" },
256
+ FV1102: { title: "Configuration file not found" },
257
+ FV1103: { title: "Configuration file that is not valid JSON" },
258
+ FV1104: { title: "Configuration without `components` or `out`" },
259
+ FV1105: { title: "Unsupported `scopeId`" },
260
+ FV1106: { title: "`builders` that is not `true` or `false`" },
261
+ FV1107: { title: "Unknown helper type" },
262
+ FV1108: { title: "Imported function without a Rust twin" },
263
+ FV1109: { title: "Twin name that is not PascalCase" },
264
+ FV1110: { title: "Twin without `rust`" },
265
+ FV1111: { title: "Twin prop name that is not camelCase" },
266
+ FV1112: { title: "Twin slot name that is not a plain name" },
267
+ FV1201: { title: "Route parameter that is not a present string or number" },
268
+ FV1202: { title: "`to` that is not a string or an object literal" },
269
+ FV1203: { title: "Computed or spread key in a `to` object" },
270
+ FV1204: { title: "Unsupported key in a `to` object" },
271
+ FV1205: { title: "`query` that is not an object literal" },
272
+ FV1206: { title: "Computed or spread key in a query" },
273
+ FV1207: { title: "Query value that may be `null`" },
274
+ FV1208: { title: "`hash` that is not a string" },
275
+ FV1209: { title: "Route name that is not a string literal" },
276
+ FV1210: { title: "Unknown route name" },
277
+ FV1211: { title: "`params` that is not an object literal" },
278
+ FV1212: { title: "Computed or spread key in `params`" },
279
+ FV1213: { title: "Unknown route parameter" },
280
+ FV1214: { title: "Route parameter not given" },
281
+ FV1215: { title: "`to` with both `path` and `params`" },
282
+ FV1216: { title: "`path` that is not a string" },
283
+ FV1217: { title: "`to` without `name` or `path`" },
284
+ FV1218: { title: "`<RouterLink>` attributes that are not literal" },
285
+ FV1219: { title: "Computed or spread key in `<RouterLink>` attributes" },
286
+ FV1220: { title: "`custom` on `<RouterLink>`" },
287
+ FV1221: { title: "`href` or `aria-current` set on `<RouterLink>`" },
288
+ FV1222: { title: "`<RouterLink>` without `to`" },
289
+ FV1223: { title: "Element in a `<RouterLink>` given a slot scope id" },
290
+ FV1224: { title: "`<slot>` in a `<RouterLink>` that takes scope ids" },
291
+ FV1225: { title: "`<RouterLink>` without `routes` configured" },
292
+ FV1226: { title: "`<RouterLink>` attribute that is not a string literal" },
293
+ FV1227: { title: "Fallthrough attribute that would reach a `<RouterLink>` prop" },
294
+ FV1228: { title: "Fallthrough attribute that would replace a `<RouterLink>` attribute" },
295
+ FV1229: { title: "`<RouterLink>` slot other than the default" },
296
+ FV1230: { title: "Route read without `routes` configured" },
297
+ FV1231: { title: "Route field not available on the server" },
298
+ FV1232: { title: "Routes file that is not an array" },
299
+ FV1233: { title: "Route entry of an unsupported shape" },
300
+ FV1234: { title: "`typeof` of anything but a query value" },
301
+ FV1235: { title: "`??` after a query value with a fallback that is not a string" },
302
+ FV1236: { title: "`<RouterView>` in a component with `<style scoped>`" },
303
+ FV1237: { title: "`<RouterView>` in a child component" },
304
+ FV1238: { title: "`routes` that is neither a routes file nor `{ pages }`" },
305
+ FV1239: { title: "Pages folder that cannot be read" },
306
+ FV1240: {
307
+ title: "Page file name the router cannot match",
308
+ detail: "Each part of a page's path is plain text (letters, digits, `-` and `_`) or one whole parameter: `[id]`, `[[id]]` (optional) or `[...path]` (a catch-all, last). A parameter beside text in one part (`prefix-[id].vue`), a repeatable parameter (`[id]+`), an optional catch-all (`[[...path]]`), a parameter parser (`[id=int]`) and a character code (`[x+2E]`) are not matched on the server.",
309
+ },
310
+ FV1241: { title: "Named view in a page file name" },
311
+ FV1242: {
312
+ title: "`definePage()` in a page",
313
+ detail: "`definePage()` changes a page's route (its name, path, alias, meta or params) at build time. ferrovue builds the server's routes from the files' paths alone, so the two would disagree.",
314
+ },
315
+ FV1243: { title: "`<route>` block in a page" },
316
+ FV1244: { title: "`_parent.vue` with no pages to hold" },
317
+ FV1245: { title: "Page whose component name is taken or not a Rust name" },
318
+ FV1301: { title: "Type declared by two stores" },
319
+ FV1302: { title: "Store id that is not a string literal" },
320
+ FV1303: { title: "Store of an unsupported shape" },
321
+ FV1304: { title: "Store `state` without a declared return type" },
322
+ FV1305: { title: "Store `getters` that is not an object literal" },
323
+ FV1306: { title: "Getter that is not a function of the state" },
324
+ FV1307: { title: "Setup store without a block body" },
325
+ FV1308: { title: "Unsupported statement in a setup store" },
326
+ FV1309: { title: "Setup store that does not return an object" },
327
+ FV1310: { title: "Setup store returning anything but plain names" },
328
+ FV1311: { title: "Setup store returning a name it does not declare" },
329
+ FV1312: { title: "Interface named as a setup store's state type" },
330
+ FV1313: { title: "`ref<T | null>()` without a value" },
331
+ FV1314: { title: "Setup store `ref` without a type" },
332
+ FV1315: { title: "Getter with a block body" },
333
+ FV1316: { title: "Getter that reads `this`" },
334
+ FV1317: { title: "Getter that returns a function" },
335
+ FV1318: { title: "Getters that read each other" },
336
+ FV1319: { title: "Store imported by anything but its `use…` hook" },
337
+ FV1320: { title: "`storeToRefs` of anything but a store bound in setup" },
338
+ FV1321: { title: "`storeToRefs` not destructured into plain names" },
339
+ FV1322: { title: "Store hook called with arguments" },
340
+ FV1401: { title: "Locale file that is not valid JSON" },
341
+ FV1402: { title: "Locale message that does not parse" },
342
+ FV1403: { title: "Linked message with a key chosen at run time" },
343
+ FV1404: { title: "Linked message with an unknown modifier" },
344
+ FV1405: { title: "Locale message construct ferrovue does not render" },
345
+ FV1406: { title: "`t()` value that is not a present string, number or boolean" },
346
+ FV1407: { title: "`t()` without `i18n` configured" },
347
+ FV1408: { title: "`t()` with unsupported arguments" },
348
+ FV1409: { title: "`t()` key that is not a string" },
349
+ FV1410: { title: "Computed or spread key in `t()`'s named values" },
350
+ FV1411: { title: "Default message given to `t()`" },
351
+ FV1412: { title: "Plural number that is not an integer" },
352
+ FV1413: { title: "`useI18n()` not destructured into plain names" },
353
+ FV1501: { title: "Twin props that are not attributes or an object literal" },
354
+ FV1502: {
355
+ title: "`v-html` of anything but a `TrustedHtml` prop",
356
+ detail: "`v-html` writes raw HTML, which ferrovue allows only from a type you mark as trusted. See [`escaping`](crate::guide::escaping).",
357
+ },
358
+ FV1503: { title: "`TrustedHtml` prop without `trustedHtml` configured" },
359
+ FV1504: { title: "Attributes on `<ClientOnly>`" },
360
+ FV1505: { title: "`<ClientOnly>` slot other than the default and `#fallback`" },
361
+ FV1506: { title: "Slot props taken from `<ClientOnly>`'s `#fallback`" },
362
+ FV1507: { title: "`<Teleport>` in slot content whose emptiness is decided at run time" },
363
+ FV1508: { title: "`<Teleport>` target that is not a string" },
364
+ FV1509: { title: "Twin prop of a type with no Rust type" },
365
+ FV1510: { title: "Twin for a component ferrovue compiles" },
366
+ FV1511: {
367
+ title: "`<ClientOnly>` with a `#fallback` in content rendered from virtual nodes",
368
+ detail: "Inside an element `<component :is>` chooses, inside a `<RouterLink>` or a twin's slot, and in the slot content they render, Vue's server renders from virtual nodes, and `<ClientOnly>` writes an empty fragment there instead of its fallback, which the client then renders and reports as a mismatch. Leave out the `#fallback`, or move the `<ClientOnly>` outside that content.",
369
+ },
370
+ FV1512: {
371
+ title: "`v-html` on an element whose content the browser rebuilds",
372
+ detail: "The browser's HTML parser moves markup written in a `<table>`, `<thead>`, `<tbody>`, `<tfoot>`, `<tr>` or `<colgroup>` out of the table, drops the tags written in a `<select>` or `<optgroup>`, and ends SVG or MathML at an HTML tag, so the page holds other nodes than the server wrote and hydration mismatches. Put `v-html` on a `<td>`, `<th>` or `<caption>`, write the options in the template, or use an HTML element inside a `<foreignObject>` or an `<mtext>`. See [`escaping`](crate::guide::escaping).",
373
+ },
374
+ FV1513: {
375
+ title: "`v-html` in a `<p>` of HTML that may hold blocks",
376
+ detail: "A block tag in the HTML (`<p>`, `<ul>`, `<div>`) ends the `<p>` it is written in where the browser reads it. Type the prop `InlineHtml` from `ferrovue/types`, which is `ferrovue::InlineHtml` on the server and keeps only inline tags, or put the HTML in a `<div>`. Slot content placed into a child's `<p>` is not seen at compile time. See [`escaping`](crate::guide::escaping).",
377
+ },
378
+ FV1601: { title: "Injection key that is not a string literal or a symbol exported from a `.ts` file" },
379
+ FV1602: { title: "Injection key symbol without an `InjectionKey<T>` type" },
380
+ FV1603: { title: "`provide` or `inject` with unsupported arguments" },
381
+ FV1604: { title: "`inject` that is not bound to a name at the top of `<script setup>`" },
382
+ FV1605: { title: "`inject(key)!`, asserting a provider" },
383
+ FV1606: { title: "`inject` of a string key with neither a default nor a type argument" },
384
+ FV1607: { title: "Function default without the factory flag" },
385
+ FV1608: { title: "Values of different types provided under one key" },
386
+ FV1609: { title: "Provided value that may be `null` or `undefined`" },
387
+ FV1610: { title: "Provided value of a form the context does not hold" },
388
+ FV1611: { title: "Object provided or given as a default under a key without an interface type" },
389
+ FV1612: { title: "Provided or default object whose fields do not match its interface" },
390
+ FV1613: { title: "Ref and plain value under one key" },
391
+ FV1614: { title: "Key provided twice by one component" },
392
+ FV1615: { title: "Two keys that give the context one field name" },
393
+ FV1616: {
394
+ title: "`provide` in a component that holds `<RouterView>`",
395
+ detail: "The page `<RouterView>` shows is rendered from Rust and handed in as a slot, so it cannot see what the component provides. Provide the value above the router (in Rust, through the `Provides` the page is rendered with) or below it.",
396
+ },
397
+ FV1617: {
398
+ title: "String-keyed `inject` inside a Rust twin's slot",
399
+ detail: "Content in a twin's slot is a child of the library component the twin stands for, which may provide the same string key on the client. Use an `InjectionKey` symbol, which only the project provides.",
400
+ },
401
+ FV1618: { title: "Setup that assigns to an injected value" },
402
+ FV1619: { title: "Function and value provided under one key" },
403
+ FV1620: { title: "`provide` or `inject` called inside an expression" },
404
+ FV1701: { title: "Options given to `useHead`" },
405
+ FV1702: { title: "Head input that is not an object literal" },
406
+ FV1703: { title: "Head key ferrovue does not translate" },
407
+ FV1704: { title: "Spread, computed key, hole or method in a head input" },
408
+ FV1705: {
409
+ title: "Function in a head input",
410
+ detail: "unhead calls a function given as a value on the server only when it takes no arguments, as a getter (`title: () => props.title`), which ferrovue evaluates. A `titleTemplate` function and an event handler (`onload`) run with arguments or on the client.",
411
+ },
412
+ FV1706: { title: "Head value of a type the head does not take" },
413
+ FV1707: { title: "`tagPosition`, `tagPriority` or `tagDuplicateStrategy` that is not a literal it accepts" },
414
+ FV1708: { title: "`useHeadSafe`" },
415
+ FV1709: { title: "`useSeoMeta` key or value ferrovue does not translate" },
416
+ FV1710: {
417
+ title: "`class` or `style` in the head that may be `null`",
418
+ detail: "unhead's server renderer throws on a `class` or `style` of `null`. Write `?? undefined`, which leaves the attribute out.",
419
+ },
420
+ FV1711: { title: "`innerHTML` or `textContent` on a head tag that has no content" },
421
+ };
422
+ /** Where a code is documented. */
423
+ export function docsUrl(code) {
424
+ return `https://docs.rs/ferrovue/latest/ferrovue/guide/error_codes/index.html#${code.toLowerCase()}`;
425
+ }
package/dist/expr.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { type Component, type N, type Scope, type Ty, type Val } from "./model.ts";
2
2
  export declare function describeTy(ty: Ty): string;
3
3
  export declare function fieldVal(comp: Component, base: string, ty: Ty, js: string, node: N): Val;
4
+ export declare function holdsNothing(comp: Component, v: Val, want: Ty, node: N, where: string): void;
4
5
  export declare function coerce(comp: Component, v: Val, want: Ty, node: N): string;
5
6
  export declare function childOf(name: string): Component;
6
7
  export declare function expr(s: Scope, n: N): Val;