ilha 0.16.3 → 0.17.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/AGENTS.md +1 -1
- package/MIGRATIONS.json +10 -0
- package/MIGRATIONS.md +19 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/dist/jsx-dev-runtime.d.ts +1 -1
- package/dist/jsx-dev-runtime.js +1 -1
- package/dist/jsx-runtime.d.ts +2 -2
- package/dist/jsx-runtime.js +2 -2
- package/dist/{mount-nRxVumCX.js → mount-DasU5vUu.js} +1 -1
- package/dist/{paint-core-cWLlHxoA.js → paint-core-CeZAur6B.js} +1 -1
- package/dist/renderer.js +1 -1
- package/dist/test.js +1 -1
- package/dist/{vnode-C_vM-l5s.js → vnode-BCzd8Wty.js} +6 -1
- package/dist/{vnode-rJ7hy6yD.d.ts → vnode-_Uzvb-v-.d.ts} +14 -4
- package/llms.txt +1 -1
- package/package.json +1 -1
package/AGENTS.md
CHANGED
package/MIGRATIONS.json
CHANGED
|
@@ -101,6 +101,16 @@
|
|
|
101
101
|
"docs": "https://ilha.build/guide/ui/state",
|
|
102
102
|
"before": "const save = atom(Atom.fn((draft: Draft) => saveDraft(draft)));\nsave.set(draft as never);",
|
|
103
103
|
"after": "const save = atom(Atom.fn((draft: Draft) => saveDraft(draft)));\nsave.set(draft);"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"id": "h-typed-props",
|
|
107
|
+
"kind": "changed",
|
|
108
|
+
"api": "h",
|
|
109
|
+
"import": "ilha",
|
|
110
|
+
"replacement": "h() is type-checked like JSX. Intrinsic tags take exactly their JSX props; unknown tags, misspelt attributes, and wrongly typed handlers are compile errors. Custom elements (`my-widget`) still take any props. A tag typed as plain `string` (or props typed as `Record<string, unknown>`) no longer type-checks: narrow the tag to `keyof JSX.IntrinsicElements` and type the props as `JSX.IntrinsicElements[tag]`.",
|
|
111
|
+
"docs": "https://ilha.build/guide/recipes/h",
|
|
112
|
+
"before": "h(\"button\", { onClick: \"alert(1)\" }, \"x\");",
|
|
113
|
+
"after": "h(\"button\", { type: \"button\", onclick: () => go() }, \"x\");"
|
|
104
114
|
}
|
|
105
115
|
]
|
|
106
116
|
}
|
package/MIGRATIONS.md
CHANGED
|
@@ -217,3 +217,22 @@ After:
|
|
|
217
217
|
const save = atom(Atom.fn((draft: Draft) => saveDraft(draft)));
|
|
218
218
|
save.set(draft);
|
|
219
219
|
```
|
|
220
|
+
|
|
221
|
+
## h
|
|
222
|
+
|
|
223
|
+
- Status: changed
|
|
224
|
+
- Import: `ilha`
|
|
225
|
+
- Replacement: h() is type-checked like JSX. Intrinsic tags take exactly their JSX props; unknown tags, misspelt attributes, and wrongly typed handlers are compile errors. Custom elements (`my-widget`) still take any props. A tag typed as plain `string` (or props typed as `Record<string, unknown>`) no longer type-checks: narrow the tag to `keyof JSX.IntrinsicElements` and type the props as `JSX.IntrinsicElements[tag]`.
|
|
226
|
+
- Docs: https://ilha.build/guide/recipes/h
|
|
227
|
+
|
|
228
|
+
Before:
|
|
229
|
+
|
|
230
|
+
```ts
|
|
231
|
+
h("button", { onClick: "alert(1)" }, "x");
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
After:
|
|
235
|
+
|
|
236
|
+
```ts
|
|
237
|
+
h("button", { type: "button", onclick: () => go() }, "x");
|
|
238
|
+
```
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { _ as View, a as Component, b as WatchOnceCleanup, f as MountOptions, h as UnsafeHtml, i as AtomOptions, l as Instruction, n as AtomHandle, r as AtomLazyOptions, s as Fragment, t as AtomEquality, v as WatchCallback, x as Yielded, y as WatchContext } from "./types-a9_yNjbT.js";
|
|
2
|
-
import {
|
|
2
|
+
import { n as h } from "./vnode-_Uzvb-v-.js";
|
|
3
3
|
import { r as watch } from "./runtime-3jr7FulJ.js";
|
|
4
4
|
import { n as mount, r as renderToString, t as RenderToStringOptions } from "./mount-ChhKs7A2.js";
|
|
5
5
|
import * as Atom from "effect/reactivity/Atom";
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { _ as IlhaError, c as batch, d as untrack, f as wrapHandle, g as makeFiber, h as getFiber, i as runSetup, l as instr, m as closeFiber, o as interpret, p as clearFiberView, s as atom } from "./start-j8x3mJSh.js";
|
|
2
2
|
import { i as errorView, o as isFunction } from "./shared-Bz14CT7Z.js";
|
|
3
|
-
import { n as unsafe } from "./paint-core-
|
|
4
|
-
import { r as renderToString, t as mount } from "./mount-
|
|
5
|
-
import {
|
|
3
|
+
import { n as unsafe } from "./paint-core-CeZAur6B.js";
|
|
4
|
+
import { r as renderToString, t as mount } from "./mount-DasU5vUu.js";
|
|
5
|
+
import { i as Fragment, n as h } from "./vnode-BCzd8Wty.js";
|
|
6
6
|
import * as Atom from "effect/reactivity/Atom";
|
|
7
7
|
import * as Effect from "effect/Effect";
|
|
8
8
|
import * as Stream from "effect/Stream";
|
package/dist/jsx-dev-runtime.js
CHANGED
package/dist/jsx-runtime.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { _ as View, d as JsxComponent, o as ComponentFn, p as PropBag, s as Fragment } from "./types-a9_yNjbT.js";
|
|
2
|
-
import { n as JSX, t as
|
|
3
|
-
export declare const jsx: (type: string | Fragment | ComponentFn | JsxComponent, props: PropBag | null, key?: string | number) => ReturnType<typeof
|
|
2
|
+
import { n as h, r as JSX, t as createVNode } from "./vnode-_Uzvb-v-.js";
|
|
3
|
+
export declare const jsx: (type: string | Fragment | ComponentFn | JsxComponent, props: PropBag | null, key?: string | number) => ReturnType<typeof createVNode>;
|
|
4
4
|
export declare const jsxs: typeof jsx;
|
|
5
5
|
export declare const jsxDEV: typeof jsx;
|
|
6
6
|
export { Fragment, type JSX, type View, h };
|
package/dist/jsx-runtime.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as Fragment, n as h, t as createVNode } from "./vnode-BCzd8Wty.js";
|
|
2
2
|
|
|
3
3
|
// src/jsx-runtime.ts
|
|
4
|
-
const jsx = (type, props, key) =>
|
|
4
|
+
const jsx = (type, props, key) => createVNode(type, key === void 0 ? props : {
|
|
5
5
|
...props,
|
|
6
6
|
key
|
|
7
7
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as startRoot, v as ilhaError, y as ilhaWarn } from "./start-j8x3mJSh.js";
|
|
2
2
|
import { c as isObject, n as KEY_ATTR, r as SLOT_ATTR } from "./shared-Bz14CT7Z.js";
|
|
3
|
-
import { i as bindEvents, r as adoptEvents, t as createPainter } from "./paint-core-
|
|
3
|
+
import { i as bindEvents, r as adoptEvents, t as createPainter } from "./paint-core-CeZAur6B.js";
|
|
4
4
|
|
|
5
5
|
// src/morph.ts
|
|
6
6
|
const PRESERVE_ATTR = "data-morph-preserve";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { g as makeFiber, i as runSetup, m as closeFiber, n as notifyRoots, r as rootListeners, u as isAtomHandle, y as ilhaWarn } from "./start-j8x3mJSh.js";
|
|
2
2
|
import { a as hasBrand, c as isObject, d as skip, l as isString, n as KEY_ATTR, o as isFunction, p as unwrap, r as SLOT_ATTR, s as isIterable, t as KEEP, u as noop } from "./shared-Bz14CT7Z.js";
|
|
3
|
-
import {
|
|
3
|
+
import { i as Fragment, r as isVNode } from "./vnode-BCzd8Wty.js";
|
|
4
4
|
import * as Effect from "effect/Effect";
|
|
5
5
|
import * as Stream from "effect/Stream";
|
|
6
6
|
|
package/dist/renderer.js
CHANGED
package/dist/test.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { f as toError, l as isString } from "./shared-Bz14CT7Z.js";
|
|
2
|
-
import { n as mountWithRuntime, r as renderToString } from "./mount-
|
|
2
|
+
import { n as mountWithRuntime, r as renderToString } from "./mount-DasU5vUu.js";
|
|
3
3
|
import { inspect } from "./debug.js";
|
|
4
4
|
|
|
5
5
|
// src/test.ts
|
|
@@ -4,6 +4,11 @@ import { a as hasBrand } from "./shared-Bz14CT7Z.js";
|
|
|
4
4
|
const Fragment = Symbol("ilha.Fragment");
|
|
5
5
|
|
|
6
6
|
// src/vnode.ts
|
|
7
|
+
/**
|
|
8
|
+
* Untyped factory behind `h`; the JSX runtime forwards through here.
|
|
9
|
+
*
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
7
12
|
const createVNode = (type, props, ...rest) => {
|
|
8
13
|
const { key, children, ...own } = props ?? {};
|
|
9
14
|
return {
|
|
@@ -17,4 +22,4 @@ const createVNode = (type, props, ...rest) => {
|
|
|
17
22
|
const h = createVNode;
|
|
18
23
|
const isVNode = (x) => hasBrand(x, "$$ilha");
|
|
19
24
|
|
|
20
|
-
export {
|
|
25
|
+
export { Fragment as i, h as n, isVNode as r, createVNode as t };
|
|
@@ -574,6 +574,7 @@ declare namespace JSX {
|
|
|
574
574
|
use: SVGAttributes & {
|
|
575
575
|
href?: Attr;
|
|
576
576
|
};
|
|
577
|
+
foreignObject: SVGAttributes;
|
|
577
578
|
symbol: SVGAttributes;
|
|
578
579
|
text: SVGAttributes;
|
|
579
580
|
tspan: SVGAttributes;
|
|
@@ -590,12 +591,21 @@ declare namespace JSX {
|
|
|
590
591
|
export {};
|
|
591
592
|
}
|
|
592
593
|
/**
|
|
593
|
-
*
|
|
594
|
-
*
|
|
594
|
+
* Untyped factory behind `h`; the JSX runtime forwards through here.
|
|
595
|
+
*
|
|
596
|
+
* @internal
|
|
597
|
+
*/
|
|
598
|
+
declare const createVNode: (type: string | Fragment | ComponentFn | JsxComponent, props: PropBag | null | undefined, ...rest: View[]) => VNode;
|
|
599
|
+
/**
|
|
600
|
+
* Build a vnode. Intrinsic tags take exactly the props JSX accepts, so an
|
|
601
|
+
* unknown tag, a misspelt attribute or a wrongly typed handler is a compile
|
|
602
|
+
* error here exactly as in JSX. Custom elements (`my-widget`) stay a plain
|
|
603
|
+
* prop bag, and components keep their own prop types.
|
|
595
604
|
*/
|
|
596
605
|
interface HFn {
|
|
606
|
+
<K extends keyof JSX.IntrinsicElements>(type: K, props: JSX.IntrinsicElements[K] | null | undefined, ...rest: View[]): VNode;
|
|
597
607
|
<P>(type: (props: P) => ReturnType<JsxComponent>, props: P | null | undefined, ...rest: View[]): VNode;
|
|
598
|
-
(type: string | Fragment | ComponentFn | JsxComponent, props: PropBag | null | undefined, ...rest: View[]): VNode;
|
|
608
|
+
(type: `${string}-${string}` | Fragment | ComponentFn | JsxComponent, props: PropBag | null | undefined, ...rest: View[]): VNode;
|
|
599
609
|
}
|
|
600
610
|
declare const h: HFn;
|
|
601
|
-
export {
|
|
611
|
+
export { h as n, JSX as r, createVNode as t };
|
package/llms.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# ilha
|
|
2
2
|
|
|
3
|
-
> Tiny, isomorphic islands UI library on Effect 4. Function components, order-based `atom()` slots, JSX, SSR via `renderToString`, hydration via `mount(host, C, { hydrate: true })`. Version 0.
|
|
3
|
+
> Tiny, isomorphic islands UI library on Effect 4. Function components, order-based `atom()` slots, JSX, SSR via `renderToString`, hydration via `mount(host, C, { hydrate: true })`. Version 0.17.0.
|
|
4
4
|
|
|
5
5
|
Start with the canonical-usage table: exactly one API per task, plus a never-do list.
|
|
6
6
|
|