@nativele/ts-dom 0.5.5 → 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.
- package/CHANGELOG.md +60 -0
- package/README.md +5 -0
- package/README.zh-TW.md +5 -0
- package/dist/{a11y-CiEJj_e6.mjs → a11y-KXbo-8o3.mjs} +119 -27
- package/dist/cli.mjs +273 -50
- package/dist/{lint-Did4w-NL.mjs → lint-DUsdDKZ-.mjs} +33 -8
- package/dist/oxlint-plugin.mjs +3 -3
- package/dist/vite-plugin.mjs +1 -1
- package/docs/architecture.md +188 -0
- package/docs/components.md +367 -0
- package/docs/contributing.md +80 -0
- package/docs/design.md +55 -0
- package/docs/lists.md +150 -0
- package/docs/performance.md +24 -0
- package/docs/recipes.md +189 -0
- package/docs/templates.md +73 -0
- package/docs/tooling.md +251 -0
- package/llms.txt +5 -5
- package/package.json +2 -1
- package/skills/README.md +19 -2
- package/skills/nativele-angular/SKILL.md +15 -11
- package/skills/nativele-architecture/SKILL.md +14 -11
- package/skills/nativele-ci/SKILL.md +148 -0
- package/skills/nativele-core/SKILL.md +16 -13
- package/skills/nativele-formatting/SKILL.md +167 -0
- package/skills/nativele-integration/SKILL.md +11 -8
- package/skills/nativele-linting/SKILL.md +174 -0
- package/skills/nativele-monorepo/SKILL.md +298 -0
- package/skills/nativele-react/SKILL.md +12 -9
- package/skills/nativele-state-management/SKILL.md +4 -4
- package/skills/nativele-svelte/SKILL.md +10 -8
- package/skills/nativele-tailwind/SKILL.md +8 -7
- package/skills/nativele-tanstack-query/SKILL.md +5 -5
- package/skills/nativele-testing/SKILL.md +19 -13
- package/skills/nativele-typescript/SKILL.md +186 -0
- package/skills/nativele-vite/SKILL.md +18 -14
- package/skills/nativele-vue/SKILL.md +9 -7
- package/skills/nativele-zod/SKILL.md +6 -6
|
@@ -3,8 +3,8 @@ name: nativele-vite
|
|
|
3
3
|
description: "Add Nativele to an existing Vite app without a UI framework, and set up the tsDom() Vite plugin correctly: dirs and Vite's root, multi-page apps, the build script, and what vite dev does when a template or component changes. Use when a project depends on vite (or vite-plus) and @nativele/ts-dom."
|
|
4
4
|
metadata:
|
|
5
5
|
tier: official
|
|
6
|
-
nativele: ">=0.
|
|
7
|
-
verified: "2026-11-
|
|
6
|
+
nativele: ">=0.6.0 <0.7.0"
|
|
7
|
+
verified: "2026-11-06"
|
|
8
8
|
tools: "vite@8.3.6 typescript@7.0.2 create-vite@9.3.4 vite-plus@1.5.0"
|
|
9
9
|
author: "Nativele maintainers"
|
|
10
10
|
detects: "vite vite-plus"
|
|
@@ -24,13 +24,13 @@ metadata:
|
|
|
24
24
|
|
|
25
25
|
| Tool | Verified version |
|
|
26
26
|
|---|---|
|
|
27
|
-
| @nativele/ts-dom | 0.
|
|
27
|
+
| @nativele/ts-dom | 0.6.0 (the last agent trial) |
|
|
28
28
|
| vite | 8.3.6 |
|
|
29
29
|
| typescript | 7.0.2 |
|
|
30
30
|
| create-vite (`vanilla-ts` template, the starting point) | 9.3.4 |
|
|
31
31
|
| vite-plus | 1.5.0 (checked by hand with `vp dev`, `vp build` and `vp lint`) |
|
|
32
32
|
|
|
33
|
-
Verified on 2026-11-
|
|
33
|
+
Verified on 2026-11-06 in Google Chrome 148 with the example project in the Nativele repository (`skills/nativele-vite/example`), and by an agent trial: a fresh agent did real work with only the Skill, and the result was checked independently. The example is a reference; it is not run in CI. With a different major version of Vite, treat every step as unverified.
|
|
34
34
|
|
|
35
35
|
## Set-up
|
|
36
36
|
|
|
@@ -38,7 +38,7 @@ Starting from the `vanilla-ts` template, which already has `"type": "module"`, a
|
|
|
38
38
|
|
|
39
39
|
1. `npm i @nativele/ts-dom`.
|
|
40
40
|
2. Keep the components in their own folder, for example `src/nv/`, each as `x.html` plus `x.ts` (write them with `nativele-core`).
|
|
41
|
-
3.
|
|
41
|
+
3. The `tsconfig.json` must meet Nativele's requirements; in this template only an explicit `"strict": true` is missing, and `"include": ["src"]` already covers `src/nv`. Check and adjust it with the TypeScript Skill (`npx ts-dom skills nativele-typescript`).
|
|
42
42
|
4. Create `vite.config.ts` (the template has none, so `ts-dom doctor` cannot report the plugin as missing yet):
|
|
43
43
|
|
|
44
44
|
```ts
|
|
@@ -48,7 +48,7 @@ Starting from the `vanilla-ts` template, which already has `"type": "module"`, a
|
|
|
48
48
|
export default defineConfig({ plugins: [tsDom({ dirs: ["src/nv"] })] });
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
`dirs` is resolved against Vite's `root`, not against the folder you run commands in (see step 8). The other options are in the setup guide.
|
|
51
|
+
`dirs` is resolved against Vite's `root`, not against the folder you run commands in (see step 8). The other options are in the setup guide. When the project has a formatter, the whitespace mode is decided by the formatting Skill (`npx ts-dom skills nativele-formatting`); give the plugin that mode (for `collapse`: `tsDom({ dirs: ["src/nv"], whitespace: "collapse" })`), and pass the same mode (`--whitespace=collapse`) to every `ts-dom gen` and `ts-dom check` in the scripts.
|
|
52
52
|
|
|
53
53
|
5. Replace `tsc` in the build script with `ts-dom check`, given the same folder:
|
|
54
54
|
|
|
@@ -56,22 +56,22 @@ Starting from the `vanilla-ts` template, which already has `"type": "module"`, a
|
|
|
56
56
|
npm pkg set scripts.build="ts-dom check src/nv && vite build"
|
|
57
57
|
```
|
|
58
58
|
|
|
59
|
-
The generated files are not committed, so on a clean checkout `tsc` runs before anything has written them and fails with `TS2307: Cannot find module './x.html.js'` and follow-on errors. `ts-dom check` writes them, then runs `tsc` and the lint rules. `vite build` writes them too, but it never type-checks.
|
|
59
|
+
The generated files are not committed, so on a clean checkout `tsc` runs before anything has written them and fails with `TS2307: Cannot find module './x.html.js'` and follow-on errors. `ts-dom check` writes them, then runs `tsc` and the lint rules. `vite build` writes them too, but it never type-checks. CI starts from such a checkout; the rest of what its job needs is in `npx ts-dom skills nativele-ci`.
|
|
60
60
|
|
|
61
61
|
6. Add `*.html.ts` and `ts-dom-tags.ts` to `.gitignore`.
|
|
62
62
|
7. Import each page's components from that page's entry module, and write the tags straight into the page's HTML (`<hello-card name="home"></hello-card>`; attributes reach string props). Import the component modules the way the project imports its own (`./nv/hello-card.ts` in this template), and templates always as `./x.html.js`.
|
|
63
|
-
8. When `root` is a sub-folder (a multi-page app or
|
|
63
|
+
8. When `root` is a sub-folder (a multi-page app, or an app kept in `web/` of the same package), each path is relative to a different folder (an app with its own `package.json` in a workspace is covered by `npx ts-dom skills nativele-monorepo` instead):
|
|
64
64
|
|
|
65
65
|
| Setting | Relative to | With `root: "web"` |
|
|
66
66
|
|---|---|---|
|
|
67
67
|
| `tsDom({ dirs })` | Vite's `root` | `["src/nv"]` |
|
|
68
68
|
| `ts-dom check`, `doctor`, `gen`, `lint` arguments | the folder they run in (the one with `package.json` and `tsconfig.json`) | `web/src/nv` |
|
|
69
|
-
| `include` in `tsconfig.json` | the tsconfig's folder | `["web/src"]` |
|
|
69
|
+
| `include` in `tsconfig.json` (owned by `nativele-typescript`) | the tsconfig's folder | `["web/src"]` |
|
|
70
70
|
| `build.rolldownOptions.input` | write absolute paths (see Troubleshooting) | `resolve(import.meta.dirname, "web/about.html")` |
|
|
71
71
|
|
|
72
72
|
Nativele needs nothing per page: each page's entry imports the components that page uses.
|
|
73
73
|
|
|
74
|
-
9. With Vite+ instead of Vite, import `defineConfig` from `"vite-plus"`; the plugin, `dirs` and the build script are the same
|
|
74
|
+
9. With Vite+ instead of Vite, import `defineConfig` from `"vite-plus"`; the plugin, `dirs` and the build script are the same. The `lint` block of the config belongs to the linting Skill (`npx ts-dom skills nativele-linting`). If `vp build` then stops with `Cannot find package 'vite'`, see Troubleshooting.
|
|
75
75
|
|
|
76
76
|
## Example
|
|
77
77
|
|
|
@@ -162,7 +162,7 @@ define("hello-card", HelloCard);
|
|
|
162
162
|
3. **Neither `vite dev` nor `vite build` type-checks.** Run `ts-dom check` (the build script in step 5 does), and run it after a template change that `vite dev` accepted without complaint.
|
|
163
163
|
4. **A wrong `dirs` fails without a warning from the plugin.** If `dirs` does not point at the templates from Vite's `root` (for example `["web/src/nv"]` with `root: "web"`), nothing is generated, and the first sign is an unresolved `./x.html.js` (see Troubleshooting).
|
|
164
164
|
5. **Pass one folder to every `ts-dom` command.** `ts-dom-tags.ts` is written into the folder a command is given, so `ts-dom check web` next to `ts-dom check web/src/nv` leaves a second `ts-dom-tags.ts` in `web/`; delete it and use the same folder everywhere.
|
|
165
|
-
6. Not verified: hot updates under a framework plugin (React Fast Refresh, Vue), server-side rendering, Vite library mode,
|
|
165
|
+
6. Not verified: hot updates under a framework plugin (React Fast Refresh, Vue), server-side rendering, Vite library mode, and Vite versions other than 8.3. An app with its own `package.json` in a workspace is covered by `nativele-monorepo`.
|
|
166
166
|
|
|
167
167
|
## Verify
|
|
168
168
|
|
|
@@ -179,10 +179,10 @@ Then run `npm run dev`, open every page and check that its components render and
|
|
|
179
179
|
|
|
180
180
|
| Symptom | Cause | Fix |
|
|
181
181
|
|---|---|---|
|
|
182
|
-
| `TS2307: Cannot find module './x.html.js'` from `npm run build` on a clean checkout | the build script starts with `tsc`, before anything generated the files | `"build": "ts-dom check <folder> && vite build"` |
|
|
182
|
+
| `TS2307: Cannot find module './x.html.js'` from `npm run build` on a clean checkout | the build script starts with `tsc`, before anything generated the files | `"build": "ts-dom check <folder> && vite build"`; for CI, `nativele-ci` |
|
|
183
183
|
| `vite build`: `[UNRESOLVED_IMPORT] Could not resolve './x.html.js'`; `vite dev`: `Failed to resolve import "./x.html.js"` and a 500 for the module | `dirs` is not relative to Vite's `root`, or leaves out the folder | give `dirs` relative to `root` (`["src/nv"]` with `root: "web"`) |
|
|
184
184
|
| `ts-dom check`: `[dir-not-found] The folder src does not exist` | the commands default to `src` in the folder they run in | pass the folder from there: `ts-dom check web/src/nv` |
|
|
185
|
-
| `ts-dom doctor`: `[tsconfig-misses-templates]`; `ts-dom check`: `TS18003: No inputs were found` | `include` is relative to the tsconfig, not to Vite's `root` | `"include": ["web/src"]` |
|
|
185
|
+
| `ts-dom doctor`: `[tsconfig-misses-templates]`; `ts-dom check`: `TS18003: No inputs were found` | `include` is relative to the tsconfig, not to Vite's `root` | `"include": ["web/src"]` (`nativele-typescript`) |
|
|
186
186
|
| An edit to a component has no effect until the page is reloaded by hand | a module calls `import.meta.hot.accept()` | remove it |
|
|
187
187
|
| A template edit never reaches the page, and the terminal shows `error [rule-id]` | the template breaks a template rule | fix it by the `Fix:` hint; once the template generates again, the page shows it |
|
|
188
188
|
| `vite dev`: `(!) Failed to run dependency scan ... failed to resolve rolldownOptions.input value: "web/index.html"` | `vite dev` resolves a relative `input` against `root` | write absolute paths, as in the example |
|
|
@@ -192,6 +192,10 @@ Then run `npm run dev`, open every page and check that its components render and
|
|
|
192
192
|
## See also
|
|
193
193
|
|
|
194
194
|
- The Vite plugin, its options and the dev server: https://github.com/Pixmi/nativele/blob/main/docs/tooling.md#with-vite-optional
|
|
195
|
-
-
|
|
195
|
+
- The `lint` block of `vite.config.ts` (Vite+) and the ts-dom rules: https://github.com/Pixmi/nativele/blob/main/skills/nativele-linting/SKILL.md
|
|
196
196
|
- What `ts-dom check`, `doctor` and `gen` check and write: https://github.com/Pixmi/nativele/blob/main/docs/tooling.md#checks
|
|
197
197
|
- Writing the components: `npx ts-dom skills nativele-core`
|
|
198
|
+
- The tsconfig: https://github.com/Pixmi/nativele/blob/main/skills/nativele-typescript/SKILL.md
|
|
199
|
+
- The whitespace mode with a formatter: https://github.com/Pixmi/nativele/blob/main/skills/nativele-formatting/SKILL.md
|
|
200
|
+
- CI: https://github.com/Pixmi/nativele/blob/main/skills/nativele-ci/SKILL.md
|
|
201
|
+
- An app in a workspace: https://github.com/Pixmi/nativele/blob/main/skills/nativele-monorepo/SKILL.md
|
|
@@ -3,8 +3,8 @@ name: nativele-vue
|
|
|
3
3
|
description: "Use Nativele web components inside a Vue 3 app: telling the template compiler which tags are custom elements, passing props, listening to events, replacing v-model, children and slots, lifecycle with v-for, v-if and KeepAlive, and SFC template types. Use when a project depends on vue and @nativele/ts-dom."
|
|
4
4
|
metadata:
|
|
5
5
|
tier: official
|
|
6
|
-
nativele: ">=0.
|
|
7
|
-
verified: "2026-11-
|
|
6
|
+
nativele: ">=0.6.0 <0.7.0"
|
|
7
|
+
verified: "2026-11-06"
|
|
8
8
|
tools: "vue@3.5.44 vite@8.3.6 @vitejs/plugin-vue@6.0.10 vue-tsc@3.3.14 typescript@6.0.3 @vue/tsconfig@0.9.1"
|
|
9
9
|
author: "Nativele maintainers"
|
|
10
10
|
detects: "vue"
|
|
@@ -25,7 +25,7 @@ Nativele components are native custom elements. Vue renders them like any other
|
|
|
25
25
|
|
|
26
26
|
| Tool | Verified version |
|
|
27
27
|
|---|---|
|
|
28
|
-
| @nativele/ts-dom | 0.
|
|
28
|
+
| @nativele/ts-dom | 0.6.0 (the last agent trial) |
|
|
29
29
|
| vue | 3.5.44 |
|
|
30
30
|
| vite | 8.3.6 |
|
|
31
31
|
| @vitejs/plugin-vue | 6.0.10 |
|
|
@@ -33,13 +33,13 @@ Nativele components are native custom elements. Vue renders them like any other
|
|
|
33
33
|
| typescript | 6.0.3 |
|
|
34
34
|
| @vue/tsconfig | 0.9.1 |
|
|
35
35
|
|
|
36
|
-
Verified on 2026-11-
|
|
36
|
+
Verified on 2026-11-06 in Google Chrome 148, starting from `create-vite` 9.3.4 with the `vue-ts` template, with the example project in the Nativele repository (`skills/nativele-vue/example`), and by an agent trial: a fresh agent did real work with only the Skill, and the result was checked independently. The example is a reference; it is not run in CI. With a different major version of Vue, treat every step as unverified.
|
|
37
37
|
|
|
38
38
|
## Set-up
|
|
39
39
|
|
|
40
40
|
1. Keep the Nativele components in their own folder, for example `src/nv/`, each as `x.html` plus `x.ts`, written with the core Skill (`npx ts-dom skills add nativele-core`). Give every Nativele tag one prefix that no Vue component uses, for example `nv-` (`define("nv-info-card", InfoCard)`); step 4 depends on it.
|
|
41
41
|
2. Install: `npm i @nativele/ts-dom`.
|
|
42
|
-
3.
|
|
42
|
+
3. The tsconfig that covers that folder must meet Nativele's requirements, `strict` among them (in the `vue-ts` template, `tsconfig.app.json` extends `@vue/tsconfig/tsconfig.dom.json`, which sets it). Check and adjust it with the TypeScript Skill (`npx ts-dom skills nativele-typescript`), which also says which TypeScript version `vue-tsc` needs.
|
|
43
43
|
4. Add the Nativele Vite plugin, and tell Vue's template compiler that the tags with the prefix are custom elements:
|
|
44
44
|
|
|
45
45
|
```ts
|
|
@@ -95,7 +95,7 @@ Verified on 2026-11-05 in Google Chrome 148, starting from `create-vite` 9.3.4 w
|
|
|
95
95
|
|
|
96
96
|
The component class must be exported and passed to `define()` in a folder that `ts-dom gen` scans, so it appears in `ts-dom-tags.ts`. A template ref is typed from the same map: `useTemplateRef<HTMLElementTagNameMap["nv-info-card"]>("card")`.
|
|
97
97
|
|
|
98
|
-
The generated files are not committed, so on a clean checkout the type check in `npm run build` runs before anything has written them and fails with `TS2307: Cannot find module './x.html.js'
|
|
98
|
+
The generated files are not committed, so on a clean checkout the type check in `npm run build` runs before anything has written them and fails with `TS2307: Cannot find module './x.html.js'` (why: `nativele-typescript`). Generate them first: `"build": "ts-dom gen src/nv && vue-tsc -b && vite build"` (the template's script with `ts-dom gen src/nv &&` in front). CI starts from such a checkout; the rest of what its job needs is in `npx ts-dom skills nativele-ci`.
|
|
99
99
|
|
|
100
100
|
## Example
|
|
101
101
|
|
|
@@ -258,7 +258,7 @@ In the browser, against the dev server (production builds drop Vue warnings), ch
|
|
|
258
258
|
|
|
259
259
|
| Symptom | Cause | Fix |
|
|
260
260
|
|---|---|---|
|
|
261
|
-
| `TS2307: Cannot find module './x.html.js'` from `npm run build` on a clean checkout | `vue-tsc -b` runs before the generated files exist | start the script with `ts-dom gen src/nv
|
|
261
|
+
| `TS2307: Cannot find module './x.html.js'` from `npm run build` on a clean checkout | `vue-tsc -b` runs before the generated files exist | start the script with `ts-dom gen src/nv &&`; for CI, `nativele-ci` |
|
|
262
262
|
| `[Vue warn]: Failed to resolve component: nv-info-card` | `isCustomElement` is missing, or does not match the tag | set it as in step 4, with the prefix your tags use |
|
|
263
263
|
| A kebab-case Vue component (`<hello-box>`, `<router-view>`) renders as an empty element, with no warning | `isCustomElement` matches every hyphenated tag | match only the Nativele prefix (`tag.startsWith("nv-")`) |
|
|
264
264
|
| An object prop shows `[object Object]`, or the element has an attribute holding it | the element was not defined when Vue rendered it, or the prop is written in kebab-case | import the module before `mount()`; write `:selectedItem`, not `:selected-item`; for a module loaded later, use `.item` |
|
|
@@ -277,3 +277,5 @@ In the browser, against the dev server (production builds drop Vue warnings), ch
|
|
|
277
277
|
- Slots, Light DOM and Shadow DOM: https://github.com/Pixmi/nativele/blob/main/docs/components.md#light-default-and-shadow
|
|
278
278
|
- Moved elements, connecting and subscriptions: https://github.com/Pixmi/nativele/blob/main/docs/lists.md#moving-items-connecting-and-subscriptions
|
|
279
279
|
- Setup, the Vite plugin and checks: https://github.com/Pixmi/nativele/blob/main/docs/tooling.md
|
|
280
|
+
- The tsconfig and `vue-tsc`'s TypeScript version: https://github.com/Pixmi/nativele/blob/main/skills/nativele-typescript/SKILL.md
|
|
281
|
+
- CI: https://github.com/Pixmi/nativele/blob/main/skills/nativele-ci/SKILL.md
|
|
@@ -3,8 +3,8 @@ name: nativele-zod
|
|
|
3
3
|
description: "Validate a form inside a Nativele component with Zod 4 (or Valibot 1): read the values on submit and on blur, safeParse, map issue paths (also nested and array fields) to per-field messages in state shown with data-if, set aria-invalid and aria-describedby, focus the first invalid field, and emit the parsed data typed with z.infer. Use when a project depends on zod or valibot and @nativele/ts-dom."
|
|
4
4
|
metadata:
|
|
5
5
|
tier: experimental
|
|
6
|
-
nativele: ">=0.
|
|
7
|
-
verified: "2026-11-
|
|
6
|
+
nativele: ">=0.6.0 <0.7.0"
|
|
7
|
+
verified: "2026-11-06"
|
|
8
8
|
tools: "zod@4.6.7 valibot@1.5.0 vite@8.3.6 typescript@7.0.2 create-vite@9.3.4"
|
|
9
9
|
author: "Nativele maintainers"
|
|
10
10
|
detects: "zod valibot"
|
|
@@ -23,14 +23,14 @@ metadata:
|
|
|
23
23
|
|
|
24
24
|
| Tool | Verified version |
|
|
25
25
|
|---|---|
|
|
26
|
-
| @nativele/ts-dom | 0.
|
|
26
|
+
| @nativele/ts-dom | 0.6.0 (the last agent trial) |
|
|
27
27
|
| zod | 4.6.7 (the procedure was also run with 3.25.76, with the schema changes in limitation 10) |
|
|
28
28
|
| valibot | 1.5.0 (limitation 11) |
|
|
29
29
|
| vite | 8.3.6 |
|
|
30
30
|
| typescript | 7.0.2 |
|
|
31
31
|
| create-vite (`vanilla-ts` template, the starting point) | 9.3.4 |
|
|
32
32
|
|
|
33
|
-
Verified on 2026-11-
|
|
33
|
+
Verified on 2026-11-06 in Google Chrome 148, with Playwright against both the Vite dev server and `vite preview` of the production build, in a fresh `npm create vite@latest -- --template vanilla-ts` app set up with Nativele by the `nativele-vite` Skill (components in `src/nv/`). These steps use Zod 4.6.7; Zod 3.25.76 and Valibot 1.5.0 need only the schema changes in Known limitations 10 and 11. With any other major version of Zod or Valibot, treat every step as unverified.
|
|
34
34
|
|
|
35
35
|
## Set-up
|
|
36
36
|
|
|
@@ -257,7 +257,7 @@ What it does, as checked in the browser:
|
|
|
257
257
|
7. **Blur does not bubble.** Use `data-on-focusout` on the `<form>`, which receives every field's blur; `e.target` is the field. Validate the whole form and take only that field's message, so checks that read more than one field still apply. The example skips checkboxes on blur, because tabbing past an unchecked box would show its message too early.
|
|
258
258
|
8. **`aria-invalid` needs the value `"true"`.** `toggleAttribute("aria-invalid", on)` writes `aria-invalid=""`, which Chrome's accessibility tree reports as not invalid. Set `input.ariaInvalid = invalid ? "true" : null`. Whether a screen reader announces the message was not checked; the accessibility tree shows each invalid input with its message as the description.
|
|
259
259
|
9. **Checks across fields**: `.refine((d) => d.password === d.confirm, { message: "Passwords differ", path: ["confirm"] })` puts the message under `confirm`. Give such a refinement a `path`; without one its path is empty and the map key is `""`, which no field shows. In Zod 4 the object-level `refine` runs only when every failing field failed a check on a value of the right type (`too_small`, `invalid_format`, a field's own `refine`); a field that fails with `invalid_value` or `invalid_type` stops it, and the cross-field message is missing until that field is fixed. Those are `z.literal(...)` (an unchecked `z.literal(true)` box), `z.enum([...])` given an empty `<select>`, and `z.coerce.number()` given text. Write them so they fail with a check instead: a box as `z.boolean().refine((v) => v, "...")`, a select as `z.string().min(1, "Choose a role").pipe(z.enum([...]))`, a number as in the example (checked with `safeParse` in Node). Valibot's `v.forward(v.partialCheck(...))` does not have this problem.
|
|
260
|
-
10. **Zod 4 vs Zod 3.** These steps use Zod 4. The same component,
|
|
260
|
+
10. **Zod 4 vs Zod 3.** These steps use Zod 4. The same component, browser checks and `issue.path.join(".")` passed with Zod 3.25.76 after these schema changes:
|
|
261
261
|
|
|
262
262
|
| In the schema | Zod 4.6.7 | Zod 3.25.76 |
|
|
263
263
|
|---|---|---|
|
|
@@ -268,7 +268,7 @@ What it does, as checked in the browser:
|
|
|
268
268
|
|
|
269
269
|
`safeParse`, `result.error.issues`, `issue.path`, `issue.message` and `z.infer` were used the same way in both.
|
|
270
270
|
|
|
271
|
-
11. **Valibot 1.5.0 fits the same procedure.** Only `signup.ts` changes; the component, template and
|
|
271
|
+
11. **Valibot 1.5.0 fits the same procedure.** Only `signup.ts` changes; the component, template and browser checks passed unchanged:
|
|
272
272
|
|
|
273
273
|
```ts
|
|
274
274
|
// src/nv/signup.ts with Valibot
|