ferrovue 0.5.0 → 0.7.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 (108) hide show
  1. package/README.md +306 -62
  2. package/dist/args.d.ts +28 -0
  3. package/dist/args.js +69 -0
  4. package/dist/attrs.d.ts +2 -1
  5. package/dist/attrs.js +10 -4
  6. package/dist/calls.js +5 -2
  7. package/dist/children.d.ts +2 -2
  8. package/dist/children.js +84 -16
  9. package/dist/classes.d.ts +4 -0
  10. package/dist/classes.js +23 -1
  11. package/dist/cli.js +80 -81
  12. package/dist/client-render.d.ts +23 -0
  13. package/dist/client-render.js +143 -0
  14. package/dist/client.d.ts +74 -10
  15. package/dist/client.js +373 -42
  16. package/dist/compiler.d.ts +9 -5
  17. package/dist/compiler.js +80 -18
  18. package/dist/component.d.ts +7 -3
  19. package/dist/component.js +38 -27
  20. package/dist/conformance.d.ts +85 -0
  21. package/dist/conformance.js +327 -0
  22. package/dist/constants.js +4 -2
  23. package/dist/context.d.ts +66 -10
  24. package/dist/context.js +176 -5
  25. package/dist/diagnostics.d.ts +6 -4
  26. package/dist/diagnostics.js +7 -3
  27. package/dist/dynamic.d.ts +18 -0
  28. package/dist/dynamic.js +576 -0
  29. package/dist/editor.d.ts +18 -0
  30. package/dist/editor.js +59 -0
  31. package/dist/errors.d.ts +213 -4
  32. package/dist/errors.js +129 -4
  33. package/dist/expr.d.ts +2 -0
  34. package/dist/expr.js +91 -12
  35. package/dist/fallthrough.d.ts +1 -0
  36. package/dist/fallthrough.js +10 -2
  37. package/dist/file-routes.d.ts +33 -0
  38. package/dist/file-routes.js +224 -0
  39. package/dist/files.d.ts +13 -0
  40. package/dist/files.js +49 -0
  41. package/dist/fixture.d.ts +16 -0
  42. package/dist/fixture.js +22 -7
  43. package/dist/hydration.d.ts +12 -1
  44. package/dist/hydration.js +47 -1
  45. package/dist/index.d.ts +3 -3
  46. package/dist/index.js +1 -1
  47. package/dist/inputs.d.ts +24 -0
  48. package/dist/inputs.js +40 -0
  49. package/dist/link-router.d.ts +7 -3
  50. package/dist/link-router.js +8 -4
  51. package/dist/lists.d.ts +16 -1
  52. package/dist/lists.js +78 -4
  53. package/dist/loops.js +4 -4
  54. package/dist/model.d.ts +20 -1
  55. package/dist/model.js +46 -1
  56. package/dist/numbers.js +3 -2
  57. package/dist/page-routes.d.ts +10 -0
  58. package/dist/page-routes.js +10 -0
  59. package/dist/paths.d.ts +5 -0
  60. package/dist/paths.js +7 -0
  61. package/dist/plugin.d.ts +15 -1
  62. package/dist/plugin.js +3 -0
  63. package/dist/plugins/client-only.js +3 -0
  64. package/dist/plugins/css-modules.d.ts +39 -0
  65. package/dist/plugins/css-modules.js +135 -0
  66. package/dist/plugins/head.d.ts +15 -0
  67. package/dist/plugins/head.js +385 -0
  68. package/dist/plugins/i18n.js +5 -12
  69. package/dist/plugins/index.js +4 -1
  70. package/dist/plugins/provide.d.ts +44 -0
  71. package/dist/plugins/provide.js +530 -0
  72. package/dist/plugins/router-link.js +7 -3
  73. package/dist/plugins/router.d.ts +4 -1
  74. package/dist/plugins/router.js +58 -11
  75. package/dist/plugins/scoped.d.ts +10 -0
  76. package/dist/plugins/scoped.js +17 -4
  77. package/dist/plugins/shared-types.js +2 -1
  78. package/dist/plugins/stores.js +26 -15
  79. package/dist/routes.d.ts +5 -2
  80. package/dist/routes.js +8 -2
  81. package/dist/rust.d.ts +9 -1
  82. package/dist/rust.js +83 -32
  83. package/dist/schema.d.ts +25 -0
  84. package/dist/schema.js +73 -0
  85. package/dist/script.js +31 -8
  86. package/dist/settle.d.ts +2 -0
  87. package/dist/settle.js +5 -0
  88. package/dist/slots.js +20 -4
  89. package/dist/ssr.d.ts +3 -0
  90. package/dist/ssr.js +67 -0
  91. package/dist/strings.d.ts +3 -0
  92. package/dist/strings.js +16 -2
  93. package/dist/styles.d.ts +5 -1
  94. package/dist/styles.js +131 -4
  95. package/dist/template.js +92 -11
  96. package/dist/testing.d.ts +4 -4
  97. package/dist/testing.js +3 -30
  98. package/dist/types.d.ts +5 -0
  99. package/dist/typescript.d.ts +11 -1
  100. package/dist/typescript.js +131 -36
  101. package/dist/vhtml.d.ts +4 -0
  102. package/dist/vhtml.js +63 -0
  103. package/dist/vite.d.ts +25 -11
  104. package/dist/vite.js +166 -51
  105. package/dist/volar.d.ts +15 -0
  106. package/dist/volar.js +87 -0
  107. package/package.json +41 -7
  108. package/schema.json +333 -0
package/dist/errors.d.ts CHANGED
@@ -35,6 +35,10 @@ export declare const ERRORS: {
35
35
  readonly title: "Unexpected construct in Vue's compiled template";
36
36
  readonly 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.";
37
37
  };
38
+ readonly FV0007: {
39
+ readonly title: "Component file name that gives no Rust module of its own";
40
+ readonly 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.";
41
+ };
38
42
  readonly FV0101: {
39
43
  readonly title: "`inheritAttrs` that is not `true` or `false`";
40
44
  };
@@ -250,7 +254,24 @@ export declare const ERRORS: {
250
254
  readonly title: "Attribute name chosen at run time";
251
255
  };
252
256
  readonly FV0418: {
253
- readonly title: "`<component :is>`";
257
+ readonly title: "`<component :is>` over a value that is not a closed set";
258
+ readonly 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.";
259
+ };
260
+ readonly FV0419: {
261
+ readonly title: "`<component :is>` naming something other than an HTML element";
262
+ };
263
+ readonly FV0420: {
264
+ readonly title: "`<component :is>` over a prop that may be absent";
265
+ };
266
+ readonly FV0421: {
267
+ readonly title: "`<component :is>` reading a key its object does not have";
268
+ };
269
+ readonly FV0422: {
270
+ readonly title: "`v-html` or `v-text` on `<component :is>`";
271
+ };
272
+ readonly FV0423: {
273
+ readonly title: "`v-show`, or `v-model` on `<select>`, in content rendered from virtual nodes";
274
+ readonly 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.";
254
275
  };
255
276
  readonly FV0501: {
256
277
  readonly title: "Child component that is not among the compiled components";
@@ -291,6 +312,9 @@ export declare const ERRORS: {
291
312
  readonly FV0513: {
292
313
  readonly title: "Component resolved by name that is not imported";
293
314
  };
315
+ readonly FV0514: {
316
+ readonly title: "Listener of unknown name given to a child with a prop named like a listener";
317
+ };
294
318
  readonly FV0601: {
295
319
  readonly title: "Name or function not available on the server";
296
320
  };
@@ -372,6 +396,9 @@ export declare const ERRORS: {
372
396
  readonly FV0627: {
373
397
  readonly title: "Strict test against the absence a value cannot have";
374
398
  };
399
+ readonly FV0628: {
400
+ readonly title: "`as` or `satisfies` stating a type the value does not have";
401
+ };
375
402
  readonly FV0701: {
376
403
  readonly title: "`Number()` of an unsupported value";
377
404
  };
@@ -431,7 +458,7 @@ export declare const ERRORS: {
431
458
  readonly title: "List method over a list of unsupported items";
432
459
  };
433
460
  readonly FV0805: {
434
- readonly title: "List method given anything but an arrow function";
461
+ readonly title: "List method given anything but an arrow function or `Boolean`";
435
462
  };
436
463
  readonly FV0806: {
437
464
  readonly title: "Arrow function with a block body";
@@ -541,6 +568,13 @@ export declare const ERRORS: {
541
568
  readonly FV0918: {
542
569
  readonly title: "Slot scope id given to content that takes none";
543
570
  };
571
+ readonly FV0919: {
572
+ readonly title: "`<slot>` with fallback content inside an element `<component :is>` chooses";
573
+ readonly 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.";
574
+ };
575
+ readonly FV0920: {
576
+ readonly title: "`<slot>` rendered both inside and outside an element `<component :is>` chooses";
577
+ };
544
578
  readonly FV1001: {
545
579
  readonly title: "Computed or spread key in a class object";
546
580
  };
@@ -554,10 +588,12 @@ export declare const ERRORS: {
554
588
  readonly title: "Class binding of an unsupported type";
555
589
  };
556
590
  readonly FV1005: {
557
- readonly title: "`<style module>`";
591
+ readonly title: "`<style module>` without `cssModules` in the configuration";
592
+ readonly detail: "Vite names a CSS module's classes by `css.modules.generateScopedName`. ferrovue computes the same names when `cssModules` in `ferrovue.config.json` is set as that option is; without it, it cannot know them.";
558
593
  };
559
594
  readonly FV1006: {
560
- readonly title: "`v-bind()` in CSS";
595
+ readonly title: "`v-bind()` in CSS of a value that is not a string or a number";
596
+ readonly detail: "Vue's server writes a variable `v-bind()` sets from a string or a number, `initial` for `null` and `undefined`, and warns of anything else.";
561
597
  };
562
598
  readonly FV1007: {
563
599
  readonly title: "Style binding of an unsupported type";
@@ -577,6 +613,17 @@ export declare const ERRORS: {
577
613
  readonly FV1012: {
578
614
  readonly title: "Scope ids handed to a component whose render does not take them";
579
615
  };
616
+ readonly FV1013: {
617
+ readonly title: "`class` written apart from a later `:class` in content rendered from virtual nodes";
618
+ readonly 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.";
619
+ };
620
+ readonly FV1014: {
621
+ readonly title: "`<style module>` whose class names ferrovue cannot compute";
622
+ readonly detail: "ferrovue names the classes of a CSS module written in the component in plain CSS, as postcss-modules does in Vite. A module in another file (`src`), one a preprocessor compiles (`lang`), and one that imports names from another file (`composes: x from \"./a.css\"`, `@value x from \"./a.css\"`) are refused.";
623
+ };
624
+ readonly FV1015: {
625
+ readonly title: "`useCssModule` of a module the component does not declare";
626
+ };
580
627
  readonly FV1101: {
581
628
  readonly title: "Helper called with the wrong number of arguments";
582
629
  };
@@ -613,6 +660,27 @@ export declare const ERRORS: {
613
660
  readonly FV1112: {
614
661
  readonly title: "Twin slot name that is not a plain name";
615
662
  };
663
+ readonly FV1113: {
664
+ readonly title: "Configuration that is not a JSON object";
665
+ };
666
+ readonly FV1114: {
667
+ readonly title: "Unknown configuration key";
668
+ readonly detail: "A key ferrovue does not read is refused, as it is most often a misspelt one (`component` for `components`). The message names the key it most likely means.";
669
+ };
670
+ readonly FV1115: {
671
+ readonly title: "Configuration value of the wrong type";
672
+ };
673
+ readonly FV1116: {
674
+ readonly title: "Directory the configuration names that cannot be read";
675
+ };
676
+ readonly FV1117: {
677
+ readonly title: "Deprecated configuration key";
678
+ readonly detail: "A warning: ferrovue still reads the key, and stops reading it in the next major release. The message names what to write instead. A key is deprecated for at least one minor release before it is removed.";
679
+ };
680
+ readonly FV1118: {
681
+ readonly title: "Deprecated command-line option";
682
+ readonly detail: "A warning: the option still works, and is removed in the next major release. The message names what to use instead. An option is deprecated for at least one minor release before it is removed.";
683
+ };
616
684
  readonly FV1201: {
617
685
  readonly title: "Route parameter that is not a present string or number";
618
686
  };
@@ -724,6 +792,38 @@ export declare const ERRORS: {
724
792
  readonly FV1237: {
725
793
  readonly title: "`<RouterView>` in a child component";
726
794
  };
795
+ readonly FV1238: {
796
+ readonly title: "`routes` that is neither a routes file nor `{ pages }`";
797
+ };
798
+ readonly FV1239: {
799
+ readonly title: "Pages folder that cannot be read";
800
+ };
801
+ readonly FV1240: {
802
+ readonly title: "Page file name the router cannot match";
803
+ readonly 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.";
804
+ };
805
+ readonly FV1241: {
806
+ readonly title: "Named view in a page file name";
807
+ };
808
+ readonly FV1242: {
809
+ readonly title: "`definePage()` in a page";
810
+ readonly 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.";
811
+ };
812
+ readonly FV1243: {
813
+ readonly title: "`<route>` block in a page";
814
+ };
815
+ readonly FV1244: {
816
+ readonly title: "`_parent.vue` with no pages to hold";
817
+ };
818
+ readonly FV1245: {
819
+ readonly title: "Page whose component name is taken or not a Rust name";
820
+ };
821
+ readonly FV1246: {
822
+ readonly title: "Routes file that cannot be read";
823
+ };
824
+ readonly FV1247: {
825
+ readonly title: "Routes file that is not valid JSON";
826
+ };
727
827
  readonly FV1301: {
728
828
  readonly title: "Type declared by two stores";
729
829
  };
@@ -860,6 +960,115 @@ export declare const ERRORS: {
860
960
  readonly FV1510: {
861
961
  readonly title: "Twin for a component ferrovue compiles";
862
962
  };
963
+ readonly FV1511: {
964
+ readonly title: "`<ClientOnly>` with a `#fallback` in content rendered from virtual nodes";
965
+ readonly 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.";
966
+ };
967
+ readonly FV1512: {
968
+ readonly title: "`v-html` on an element whose content the browser rebuilds";
969
+ readonly 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).";
970
+ };
971
+ readonly FV1513: {
972
+ readonly title: "`v-html` in a `<p>` of HTML that may hold blocks";
973
+ readonly 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).";
974
+ };
975
+ readonly FV1601: {
976
+ readonly title: "Injection key that is not a string literal or a symbol exported from a `.ts` file";
977
+ };
978
+ readonly FV1602: {
979
+ readonly title: "Injection key symbol without an `InjectionKey<T>` type";
980
+ };
981
+ readonly FV1603: {
982
+ readonly title: "`provide` or `inject` with unsupported arguments";
983
+ };
984
+ readonly FV1604: {
985
+ readonly title: "`inject` that is not bound to a name at the top of `<script setup>`";
986
+ };
987
+ readonly FV1605: {
988
+ readonly title: "`inject(key)!`, asserting a provider";
989
+ };
990
+ readonly FV1606: {
991
+ readonly title: "`inject` of a string key with neither a default nor a type argument";
992
+ };
993
+ readonly FV1607: {
994
+ readonly title: "Function default without the factory flag";
995
+ };
996
+ readonly FV1608: {
997
+ readonly title: "Values of different types provided under one key";
998
+ };
999
+ readonly FV1609: {
1000
+ readonly title: "Provided value that may be `null` or `undefined`";
1001
+ };
1002
+ readonly FV1610: {
1003
+ readonly title: "Provided value of a form the context does not hold";
1004
+ };
1005
+ readonly FV1611: {
1006
+ readonly title: "Object provided or given as a default under a key without an interface type";
1007
+ };
1008
+ readonly FV1612: {
1009
+ readonly title: "Provided or default object whose fields do not match its interface";
1010
+ };
1011
+ readonly FV1613: {
1012
+ readonly title: "Ref and plain value under one key";
1013
+ };
1014
+ readonly FV1614: {
1015
+ readonly title: "Key provided twice by one component";
1016
+ };
1017
+ readonly FV1615: {
1018
+ readonly title: "Two keys that give the context one field name";
1019
+ };
1020
+ readonly FV1616: {
1021
+ readonly title: "`provide` in a component that holds `<RouterView>`";
1022
+ readonly 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.";
1023
+ };
1024
+ readonly FV1617: {
1025
+ readonly title: "String-keyed `inject` inside a Rust twin's slot";
1026
+ readonly 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.";
1027
+ };
1028
+ readonly FV1618: {
1029
+ readonly title: "Setup that assigns to an injected value";
1030
+ };
1031
+ readonly FV1619: {
1032
+ readonly title: "Function and value provided under one key";
1033
+ };
1034
+ readonly FV1620: {
1035
+ readonly title: "`provide` or `inject` called inside an expression";
1036
+ };
1037
+ readonly FV1701: {
1038
+ readonly title: "Options given to `useHead`";
1039
+ };
1040
+ readonly FV1702: {
1041
+ readonly title: "Head input that is not an object literal";
1042
+ };
1043
+ readonly FV1703: {
1044
+ readonly title: "Head key ferrovue does not translate";
1045
+ };
1046
+ readonly FV1704: {
1047
+ readonly title: "Spread, computed key, hole or method in a head input";
1048
+ };
1049
+ readonly FV1705: {
1050
+ readonly title: "Function in a head input";
1051
+ readonly 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.";
1052
+ };
1053
+ readonly FV1706: {
1054
+ readonly title: "Head value of a type the head does not take";
1055
+ };
1056
+ readonly FV1707: {
1057
+ readonly title: "`tagPosition`, `tagPriority` or `tagDuplicateStrategy` that is not a literal it accepts";
1058
+ };
1059
+ readonly FV1708: {
1060
+ readonly title: "`useHeadSafe`";
1061
+ };
1062
+ readonly FV1709: {
1063
+ readonly title: "`useSeoMeta` key or value ferrovue does not translate";
1064
+ };
1065
+ readonly FV1710: {
1066
+ readonly title: "`class` or `style` in the head that may be `null`";
1067
+ readonly detail: "unhead's server renderer throws on a `class` or `style` of `null`. Write `?? undefined`, which leaves the attribute out.";
1068
+ };
1069
+ readonly FV1711: {
1070
+ readonly title: "`innerHTML` or `textContent` on a head tag that has no content";
1071
+ };
863
1072
  };
864
1073
  /** A stable error code, as `FV0604`. */
865
1074
  export type Code = keyof typeof ERRORS;
package/dist/errors.js CHANGED
@@ -16,6 +16,8 @@ export const AREAS = {
16
16
  "13": { name: "Pinia stores", guide: "pinia" },
17
17
  "14": { name: "vue-i18n", guide: "i18n" },
18
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" },
19
21
  };
20
22
  /** Every code the compiler raises. A code is never reused: one the compiler stops raising is marked
21
23
  * `retired` and stays listed. `pnpm errors:generate` writes the guide's index from this list. */
@@ -32,6 +34,10 @@ export const ERRORS = {
32
34
  title: "Unexpected construct in Vue's compiled template",
33
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.",
34
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
+ },
35
41
  FV0101: { title: "`inheritAttrs` that is not `true` or `false`" },
36
42
  FV0102: { title: "`watch` with `immediate`" },
37
43
  FV0103: { title: "Effect that runs once on the server" },
@@ -114,7 +120,18 @@ export const ERRORS = {
114
120
  FV0415: { title: "Value read from `$attrs`" },
115
121
  FV0416: { title: "Root `<Transition>` or `<KeepAlive>` around `v-if` that is given attributes" },
116
122
  FV0417: { title: "Attribute name chosen at run time" },
117
- FV0418: { title: "`<component :is>`" },
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
+ },
118
135
  FV0501: { title: "Child component that is not among the compiled components" },
119
136
  FV0502: { title: "Fallthrough attribute that would reach a child's prop" },
120
137
  FV0503: { title: "Child props that are not an object literal" },
@@ -128,6 +145,7 @@ export const ERRORS = {
128
145
  FV0511: { title: "Prop given a value of another type" },
129
146
  FV0512: { title: "`Props` imported from a component that is not compiled" },
130
147
  FV0513: { title: "Component resolved by name that is not imported" },
148
+ FV0514: { title: "Listener of unknown name given to a child with a prop named like a listener" },
131
149
  FV0601: { title: "Name or function not available on the server" },
132
150
  FV0602: { title: "Unsupported method" },
133
151
  FV0603: { title: "Unsupported call" },
@@ -155,6 +173,7 @@ export const ERRORS = {
155
173
  FV0625: { title: "Unsupported expression" },
156
174
  FV0626: { title: "Strict test of a value that may be `null` or `undefined`" },
157
175
  FV0627: { title: "Strict test against the absence a value cannot have" },
176
+ FV0628: { title: "`as` or `satisfies` stating a type the value does not have" },
158
177
  FV0701: { title: "`Number()` of an unsupported value" },
159
178
  FV0702: { title: "`parseInt()` or `parseFloat()` of a value that is not a string" },
160
179
  FV0703: { title: "`parseInt()` with a radix other than a literal 10 or 16" },
@@ -177,7 +196,7 @@ export const ERRORS = {
177
196
  FV0802: { title: "`.join()` with a separator that is not a string" },
178
197
  FV0803: { title: "List method on a value that is not a list" },
179
198
  FV0804: { title: "List method over a list of unsupported items" },
180
- FV0805: { title: "List method given anything but an arrow function" },
199
+ FV0805: { title: "List method given anything but an arrow function or `Boolean`" },
181
200
  FV0806: { title: "Arrow function with a block body" },
182
201
  FV0807: { title: "Arrow function index that is not a plain name" },
183
202
  FV0808: { title: "Defaults or nested patterns in an arrow function's item" },
@@ -214,18 +233,38 @@ export const ERRORS = {
214
233
  FV0916: { title: "Outlets of one slot that pass different props" },
215
234
  FV0917: { title: "Interface named as a slot's props type" },
216
235
  FV0918: { title: "Slot scope id given to content that takes none" },
236
+ FV0919: {
237
+ title: "`<slot>` with fallback content inside an element `<component :is>` chooses",
238
+ 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.",
239
+ },
240
+ FV0920: { title: "`<slot>` rendered both inside and outside an element `<component :is>` chooses" },
217
241
  FV1001: { title: "Computed or spread key in a class object" },
218
242
  FV1002: { title: "Computed class name that is not a string" },
219
243
  FV1003: { title: "Class name with spaces around it" },
220
244
  FV1004: { title: "Class binding of an unsupported type" },
221
- FV1005: { title: "`<style module>`" },
222
- FV1006: { title: "`v-bind()` in CSS" },
245
+ FV1005: {
246
+ title: "`<style module>` without `cssModules` in the configuration",
247
+ detail: "Vite names a CSS module's classes by `css.modules.generateScopedName`. ferrovue computes the same names when `cssModules` in `ferrovue.config.json` is set as that option is; without it, it cannot know them.",
248
+ },
249
+ FV1006: {
250
+ title: "`v-bind()` in CSS of a value that is not a string or a number",
251
+ detail: "Vue's server writes a variable `v-bind()` sets from a string or a number, `initial` for `null` and `undefined`, and warns of anything else.",
252
+ },
223
253
  FV1007: { title: "Style binding of an unsupported type" },
224
254
  FV1008: { title: "Computed or spread key in a style object" },
225
255
  FV1009: { title: "Style property named by a number or starting with `:`" },
226
256
  FV1010: { title: "Style array mixing a string with objects" },
227
257
  FV1011: { title: "Style property whose place depends on a condition" },
228
258
  FV1012: { title: "Scope ids handed to a component whose render does not take them" },
259
+ FV1013: {
260
+ title: "`class` written apart from a later `:class` in content rendered from virtual nodes",
261
+ 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.",
262
+ },
263
+ FV1014: {
264
+ title: "`<style module>` whose class names ferrovue cannot compute",
265
+ detail: "ferrovue names the classes of a CSS module written in the component in plain CSS, as postcss-modules does in Vite. A module in another file (`src`), one a preprocessor compiles (`lang`), and one that imports names from another file (`composes: x from \"./a.css\"`, `@value x from \"./a.css\"`) are refused.",
266
+ },
267
+ FV1015: { title: "`useCssModule` of a module the component does not declare" },
229
268
  FV1101: { title: "Helper called with the wrong number of arguments" },
230
269
  FV1102: { title: "Configuration file not found" },
231
270
  FV1103: { title: "Configuration file that is not valid JSON" },
@@ -238,6 +277,21 @@ export const ERRORS = {
238
277
  FV1110: { title: "Twin without `rust`" },
239
278
  FV1111: { title: "Twin prop name that is not camelCase" },
240
279
  FV1112: { title: "Twin slot name that is not a plain name" },
280
+ FV1113: { title: "Configuration that is not a JSON object" },
281
+ FV1114: {
282
+ title: "Unknown configuration key",
283
+ detail: "A key ferrovue does not read is refused, as it is most often a misspelt one (`component` for `components`). The message names the key it most likely means.",
284
+ },
285
+ FV1115: { title: "Configuration value of the wrong type" },
286
+ FV1116: { title: "Directory the configuration names that cannot be read" },
287
+ FV1117: {
288
+ title: "Deprecated configuration key",
289
+ detail: "A warning: ferrovue still reads the key, and stops reading it in the next major release. The message names what to write instead. A key is deprecated for at least one minor release before it is removed.",
290
+ },
291
+ FV1118: {
292
+ title: "Deprecated command-line option",
293
+ detail: "A warning: the option still works, and is removed in the next major release. The message names what to use instead. An option is deprecated for at least one minor release before it is removed.",
294
+ },
241
295
  FV1201: { title: "Route parameter that is not a present string or number" },
242
296
  FV1202: { title: "`to` that is not a string or an object literal" },
243
297
  FV1203: { title: "Computed or spread key in a `to` object" },
@@ -275,6 +329,22 @@ export const ERRORS = {
275
329
  FV1235: { title: "`??` after a query value with a fallback that is not a string" },
276
330
  FV1236: { title: "`<RouterView>` in a component with `<style scoped>`" },
277
331
  FV1237: { title: "`<RouterView>` in a child component" },
332
+ FV1238: { title: "`routes` that is neither a routes file nor `{ pages }`" },
333
+ FV1239: { title: "Pages folder that cannot be read" },
334
+ FV1240: {
335
+ title: "Page file name the router cannot match",
336
+ 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.",
337
+ },
338
+ FV1241: { title: "Named view in a page file name" },
339
+ FV1242: {
340
+ title: "`definePage()` in a page",
341
+ 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.",
342
+ },
343
+ FV1243: { title: "`<route>` block in a page" },
344
+ FV1244: { title: "`_parent.vue` with no pages to hold" },
345
+ FV1245: { title: "Page whose component name is taken or not a Rust name" },
346
+ FV1246: { title: "Routes file that cannot be read" },
347
+ FV1247: { title: "Routes file that is not valid JSON" },
278
348
  FV1301: { title: "Type declared by two stores" },
279
349
  FV1302: { title: "Store id that is not a string literal" },
280
350
  FV1303: { title: "Store of an unsupported shape" },
@@ -323,6 +393,61 @@ export const ERRORS = {
323
393
  FV1508: { title: "`<Teleport>` target that is not a string" },
324
394
  FV1509: { title: "Twin prop of a type with no Rust type" },
325
395
  FV1510: { title: "Twin for a component ferrovue compiles" },
396
+ FV1511: {
397
+ title: "`<ClientOnly>` with a `#fallback` in content rendered from virtual nodes",
398
+ 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.",
399
+ },
400
+ FV1512: {
401
+ title: "`v-html` on an element whose content the browser rebuilds",
402
+ 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).",
403
+ },
404
+ FV1513: {
405
+ title: "`v-html` in a `<p>` of HTML that may hold blocks",
406
+ 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).",
407
+ },
408
+ FV1601: { title: "Injection key that is not a string literal or a symbol exported from a `.ts` file" },
409
+ FV1602: { title: "Injection key symbol without an `InjectionKey<T>` type" },
410
+ FV1603: { title: "`provide` or `inject` with unsupported arguments" },
411
+ FV1604: { title: "`inject` that is not bound to a name at the top of `<script setup>`" },
412
+ FV1605: { title: "`inject(key)!`, asserting a provider" },
413
+ FV1606: { title: "`inject` of a string key with neither a default nor a type argument" },
414
+ FV1607: { title: "Function default without the factory flag" },
415
+ FV1608: { title: "Values of different types provided under one key" },
416
+ FV1609: { title: "Provided value that may be `null` or `undefined`" },
417
+ FV1610: { title: "Provided value of a form the context does not hold" },
418
+ FV1611: { title: "Object provided or given as a default under a key without an interface type" },
419
+ FV1612: { title: "Provided or default object whose fields do not match its interface" },
420
+ FV1613: { title: "Ref and plain value under one key" },
421
+ FV1614: { title: "Key provided twice by one component" },
422
+ FV1615: { title: "Two keys that give the context one field name" },
423
+ FV1616: {
424
+ title: "`provide` in a component that holds `<RouterView>`",
425
+ 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.",
426
+ },
427
+ FV1617: {
428
+ title: "String-keyed `inject` inside a Rust twin's slot",
429
+ 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.",
430
+ },
431
+ FV1618: { title: "Setup that assigns to an injected value" },
432
+ FV1619: { title: "Function and value provided under one key" },
433
+ FV1620: { title: "`provide` or `inject` called inside an expression" },
434
+ FV1701: { title: "Options given to `useHead`" },
435
+ FV1702: { title: "Head input that is not an object literal" },
436
+ FV1703: { title: "Head key ferrovue does not translate" },
437
+ FV1704: { title: "Spread, computed key, hole or method in a head input" },
438
+ FV1705: {
439
+ title: "Function in a head input",
440
+ 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.",
441
+ },
442
+ FV1706: { title: "Head value of a type the head does not take" },
443
+ FV1707: { title: "`tagPosition`, `tagPriority` or `tagDuplicateStrategy` that is not a literal it accepts" },
444
+ FV1708: { title: "`useHeadSafe`" },
445
+ FV1709: { title: "`useSeoMeta` key or value ferrovue does not translate" },
446
+ FV1710: {
447
+ title: "`class` or `style` in the head that may be `null`",
448
+ detail: "unhead's server renderer throws on a `class` or `style` of `null`. Write `?? undefined`, which leaves the attribute out.",
449
+ },
450
+ FV1711: { title: "`innerHTML` or `textContent` on a head tag that has no content" },
326
451
  };
327
452
  /** Where a code is documented. */
328
453
  export function docsUrl(code) {
package/dist/expr.d.ts CHANGED
@@ -4,4 +4,6 @@ export declare function fieldVal(comp: Component, base: string, ty: Ty, js: stri
4
4
  export declare function holdsNothing(comp: Component, v: Val, want: Ty, node: N, where: string): void;
5
5
  export declare function coerce(comp: Component, v: Val, want: Ty, node: N): string;
6
6
  export declare function childOf(name: string): Component;
7
+ /** `n` with the type `t` given to each empty array literal it may evaluate to, as an `as T[]` on it. */
8
+ export declare function typedBy(n: N, t: N): N;
7
9
  export declare function expr(s: Scope, n: N): Val;