@nativele/ts-dom 0.5.3 → 0.5.5
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 +46 -0
- package/README.md +3 -3
- package/README.zh-TW.md +3 -3
- package/dist/{a11y-Bw-8ZIAK.mjs → a11y-CiEJj_e6.mjs} +16 -14
- package/dist/cli.mjs +163 -25
- package/dist/{lint-qEPgmmMa.mjs → lint-Did4w-NL.mjs} +2 -2
- package/dist/oxlint-plugin.mjs +2 -2
- package/dist/vite-plugin.mjs +5 -2
- package/llms.txt +3 -1
- package/package.json +1 -1
- package/skills/README.md +33 -13
- package/skills/nativele-angular/SKILL.md +2 -4
- package/skills/nativele-architecture/SKILL.md +19 -9
- package/skills/nativele-core/SKILL.md +2 -2
- package/skills/nativele-integration/SKILL.md +7 -9
- package/skills/nativele-react/SKILL.md +11 -15
- package/skills/nativele-state-management/SKILL.md +4 -4
- package/skills/nativele-svelte/SKILL.md +9 -13
- package/skills/nativele-tailwind/SKILL.md +1 -1
- package/skills/nativele-tanstack-query/SKILL.md +1 -1
- package/skills/nativele-testing/SKILL.md +7 -7
- package/skills/nativele-vite/SKILL.md +6 -6
- package/skills/nativele-vue/SKILL.md +5 -5
- package/skills/nativele-zod/SKILL.md +1 -1
|
@@ -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.5.1 |
|
|
28
|
+
| @nativele/ts-dom | 0.5.1 (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,7 +33,7 @@ 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-05 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`),
|
|
36
|
+
Verified on 2026-11-05 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
|
|
|
@@ -219,7 +219,7 @@ define("nv-light-card", LightCard);
|
|
|
219
219
|
3. **camelCase prop names in templates.** Write Nativele props as they are declared: `:selectedItem="item"`, `:maxCount="3"`. Vue sets a kebab-case binding (`:selected-item`) as an attribute, because the element has no property of that name: a number or string still converts from the attribute, an object or array arrives as `"[object Object]"` and the prop stays `null`. `vue-tsc` does not report this (limitation 8).
|
|
220
220
|
4. **Exact event names.** On a custom element, Vue listens to the event name exactly as written after `@`: `@item-select` hears `item-select`, `@pickedOne` hears `pickedOne`, and `@itemSelect` never hears `item-select`. Name events in kebab-case and write that name. Nativele events do not bubble by default, so the listener goes on the element that emits.
|
|
221
221
|
5. **`v-model` does not work on a Nativele component.** It compiles, `vue-tsc` accepts it and Vue logs no warning; it writes the first value into the element, but typing never updates the Vue state. Use a prop and an event, as `nv-text-field` above: `:value="text" @value-change="(e) => (text = e.detail.value)"`. In the component, compare before writing the input's value, so the cursor does not jump (see "A Small Reminder About Form Inputs" in the components guide).
|
|
222
|
-
6. **Light DOM slots and Vue children do not mix
|
|
222
|
+
6. **Light DOM slots and Vue children do not mix** (https://github.com/Pixmi/nativele/blob/main/docs/components.md#slots-and-children-managed-by-a-framework). When Vue inserts, removes or reorders the children of a Light DOM host with slots (`v-if`, `v-for`), the update throws (`Cannot read properties of null (reading 'insertBefore')`, `Cannot set properties of null (setting '__vnode')`) and the slots show the wrong children. Use `shadow: true`, or one stable element per slot as in the example.
|
|
223
223
|
7. **Lifecycle follows the DOM.** When a keyed `v-for` reorders Nativele elements, Vue moves the same element with `insertBefore`: it runs `disconnected()` then `connected()`, keeps its props and its Light DOM slot children, and `bind` subscriptions end and start again. `<KeepAlive>` deactivation takes the element out of the document (`disconnected()`, no store updates while inactive); activation puts the same element back (`connected()`, and `bind` calls back at once with the current value). `v-if` removal runs `disconnected()` and ends the subscriptions. So subscribe in `connected()`, as the lists guide says for moved items.
|
|
224
224
|
8. **What `vue-tsc` checks.** With the declaration from step 7, it reports a wrong prop type (`count="1"` on a number prop), a wrong object shape and a wrong use of `e.detail`. It does not report an unknown prop name, an unknown tag with the prefix, a kebab-case prop name, `v-model`, or an event name whose case differs from the declared one. In a template, mark an expected error with `<!-- @vue-expect-error -->`; `// @ts-expect-error` is rendered as text and suppresses nothing.
|
|
225
225
|
9. Not verified: server-side rendering and hydration, Nuxt, `<Transition>` around Nativele elements, and Vue versions other than 3.5.
|
|
@@ -235,7 +235,7 @@ npx vue-tsc -b # expect: no output
|
|
|
235
235
|
npx vite build # expect: built
|
|
236
236
|
```
|
|
237
237
|
|
|
238
|
-
`ts-dom check` runs `vue-tsc` instead of `tsc` when `vue-tsc`
|
|
238
|
+
`ts-dom check` runs `vue-tsc` instead of `tsc` when the project's `package.json` lists `vue-tsc` (in `dependencies` or `devDependencies`) and it resolves from the project folder, so it also reports type errors in `.vue` files.
|
|
239
239
|
|
|
240
240
|
Prove that the declaration types props: keep a `.vue` file that the app never imports (the example uses `src/TypesCheck.vue`) with one wrong case per kind under `<!-- @vue-expect-error -->`:
|
|
241
241
|
|
|
@@ -252,7 +252,7 @@ Prove that the declaration types props: keep a `.vue` file that the app never im
|
|
|
252
252
|
|
|
253
253
|
`vue-tsc -b` passes only while each of these is an error; if the declaration stops working, it reports `TS2578: Unused '@ts-expect-error' directive`.
|
|
254
254
|
|
|
255
|
-
In the browser, against the dev server (production builds drop Vue warnings), check that an element with an object prop has no attribute for it (`el.getAttributeNames()`) and that `el.item` is the object, that the listener runs once per event, that a kebab-case Vue component still renders, and that there are no errors or `[Vue warn]` lines in the console.
|
|
255
|
+
In the browser, against the dev server (production builds drop Vue warnings), check that an element with an object prop has no attribute for it (`el.getAttributeNames()`) and that `el.item` is the object, that the listener runs once per event, that a kebab-case Vue component still renders, and that there are no errors or `[Vue warn]` lines in the console. A reference implementation of these checks is the [`verify.mjs`](https://github.com/Pixmi/nativele/blob/main/skills/nativele-vue/example/verify.mjs) of the trial's example project, which does them with Playwright, plus the `v-model` replacement, a component defined after mount, children that Vue reorders, adds and removes in both slot modes, and the lifecycle under `v-for`, `<KeepAlive>` and `v-if`. A Light DOM component has no `<slot>` elements once rendered; read a slot with `el.assignedNodes(name)`, where `""` is the default slot, and compare elements only, because Vue leaves comment and empty text nodes among the children.
|
|
256
256
|
|
|
257
257
|
## Troubleshooting
|
|
258
258
|
|
|
@@ -23,7 +23,7 @@ metadata:
|
|
|
23
23
|
|
|
24
24
|
| Tool | Verified version |
|
|
25
25
|
|---|---|
|
|
26
|
-
| @nativele/ts-dom | 0.5.2 |
|
|
26
|
+
| @nativele/ts-dom | 0.5.2 (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 |
|