@nisli/core 0.52.0 → 0.54.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/README.md CHANGED
@@ -1,112 +1,191 @@
1
1
  # nisli
2
2
 
3
- A reactive web component framework. Signals, templates, dependency injection — no build step, no virtual DOM, no dependencies.
3
+ A small, reactive web-component framework built on browser standards. Nisli
4
+ combines fine-grained signals, typed component factories, light-DOM templates,
5
+ dependency injection, routing, and static generation without a virtual DOM or
6
+ a framework compiler.
4
7
 
5
8
  ## Install
6
9
 
7
- ```bash
10
+ ```sh
8
11
  npm install @nisli/core
9
12
  ```
10
13
 
11
- ## Quick Start
14
+ `@nisli/core` has no runtime dependencies. It works with TypeScript or plain
15
+ JavaScript and does not require a framework-specific build step.
12
16
 
13
- ```typescript
14
- import { signal, component, html } from '@nisli/core';
17
+ ## Quick start
18
+
19
+ ```ts
20
+ import { component, html, signal } from '@nisli/core';
15
21
 
16
22
  const Counter = component('x-counter', () => {
17
23
  const count = signal(0);
24
+
18
25
  return html`
19
26
  <button @click=${() => count.value++}>
20
27
  Count: ${count}
21
28
  </button>
22
29
  `;
23
30
  });
31
+
32
+ html`${Counter({})}`.mount(document.body);
33
+ ```
34
+
35
+ Signals are read with `.value` in TypeScript and passed directly to templates.
36
+ Only the bound text, attribute, class, or child slot updates when a signal
37
+ changes.
38
+
39
+ ## Components that also work as HTML
40
+
41
+ `component()` registers a standard custom element and returns its typed factory.
42
+ Factory callers can pass plain values or signals. The optional `attrs` map makes
43
+ selected host attributes live, so plain-HTML consumers and factory consumers
44
+ share the same component implementation.
45
+
46
+ ```ts
47
+ import {
48
+ children,
49
+ component,
50
+ html,
51
+ type ComponentAttrs,
52
+ } from '@nisli/core';
53
+
54
+ interface DisclosureProps {
55
+ open?: boolean;
56
+ children?: unknown;
57
+ }
58
+
59
+ const attrs = {
60
+ open: 'boolean',
61
+ } satisfies ComponentAttrs<DisclosureProps>;
62
+
63
+ const Disclosure = component<DisclosureProps, typeof attrs>(
64
+ 'x-disclosure',
65
+ (props) => {
66
+ const content = children('Nothing to show');
67
+ return html`
68
+ <section class:open=${props.open}>
69
+ ${content}
70
+ </section>
71
+ `;
72
+ },
73
+ { attrs },
74
+ );
75
+ ```
76
+
77
+ ```ts
78
+ html`${Disclosure({ open: true, children: 'Factory content' })}`;
24
79
  ```
25
80
 
26
- ## Features
27
-
28
- - **Signals** — Fine-grained reactivity with `signal`, `computed`, `effect`
29
- - **Components** — Web Components with a composition-style setup function
30
- - **Templates** — Tagged template literals with automatic signal binding
31
- - **Dependency Injection** — `inject` any class as a singleton, `provide` overrides for testing
32
- - **Queries** — Declarative async data loading with caching and auto-refetch
33
- - **Event Emitters** — Typed event bus with auto-disposal in component context
34
- - **Lifecycle** — `onMount`, `onCleanup`, `useHostEvent`
35
- - **Refs** — Direct element access via `ref()`
36
- - **Control Flow** — `when()` for toggles, `each()` for keyed list rendering
37
-
38
- ## API
39
-
40
- ```typescript
41
- // Reactivity
42
- signal(value) // Reactive signal
43
- computed(() => expr) // Derived signal (lazy, cached)
44
- effect(() => { ... }) // Side effect that tracks dependencies
45
-
46
- // Components
47
- component('tag-name', (props, host) => html`...`)
48
- component<Props>('tag-name', (props, host) => html`...`)
49
-
50
- // Templates — signals are implicit, no .value needed
51
- html`<div>${count}</div>`
52
- html`<button @click=${handler}>Go</button>`
53
- html`<div class:active=${isActive}>...</div>`
54
-
55
- // Control flow
56
- when(condition, () => html`...`)
57
- each(items, item => item.id, (item) => html`...`)
58
-
59
- // Dependency injection — class IS the token
60
- inject(MyService) // Auto-creates singleton
61
- provide(MyService, () => mock) // Override (testing)
62
-
63
- // Queries
64
- const { data, loading, error } = query(
65
- () => ['tasks', id.value], // Cache key (tracked)
66
- () => api.getTasks(id.value), // Fetcher
67
- )
68
-
69
- // Lifecycle
70
- onMount(() => { ... })
71
- onCleanup(() => { ... })
72
- useHostEvent(host, 'click', handler)
73
-
74
- // Refs
75
- const el = ref<HTMLDivElement>()
76
- html`<div ref="${el}">...</div>`
77
-
78
- // Events
79
- class Nav extends Emitter<{ select: { id: string } }> {}
80
- inject(Nav).emit('select', { id })
81
- inject(Nav).on('select', ({ id }) => { ... })
81
+ ```html
82
+ <x-disclosure open>Plain HTML content</x-disclosure>
82
83
  ```
83
84
 
84
- ## Static Site Generation
85
+ Declared string, boolean, number, and forwarded attributes react to
86
+ `setAttribute()` after mount. `children(fallback?)` projects factory children,
87
+ initial light-DOM children, and late parser children through one reactive slot.
85
88
 
86
- Use the companion `@nisli/ssg` package when you want build-time pages,
87
- publication output, feeds, or other DOM-free static output.
89
+ ## Async derivations
88
90
 
89
- ```typescript
90
- import { buildStaticSite } from '@nisli/ssg';
91
+ Use `resource()` when a local value is derived asynchronously and does not need
92
+ query caching or invalidation policy. Only the synchronous source function is
93
+ tracked; stale work is aborted and cannot overwrite a newer result.
91
94
 
92
- await buildStaticSite({
93
- outDir: 'dist',
94
- routes: [
95
- { path: '/', render: () => '<article>...</article>' },
96
- ],
95
+ ```ts
96
+ import { component, html, resource } from '@nisli/core';
97
+
98
+ const Markdown = component<{ content: string }>('x-markdown', (props) => {
99
+ const rendered = resource(
100
+ () => props.content.value || undefined,
101
+ (content, signal) => renderMarkdown(content, { signal }),
102
+ );
103
+
104
+ return html`<article html:inner=${rendered.data}></article>`;
97
105
  });
98
106
  ```
99
107
 
100
- `@nisli/core` stays focused on component authoring and the browser runtime.
101
- `@nisli/ssg` owns static site generation; static rendering internals stay behind
102
- the build tool.
108
+ `data`, `loading`, and `error` are readonly signals. `refresh()` reruns the
109
+ current source; component teardown disposes automatically, while standalone
110
+ callers can use `dispose()`. Returning `undefined` from the source disables the
111
+ resource and clears its current state.
112
+
113
+ ## Core capabilities
114
+
115
+ - Fine-grained reactivity: `signal`, `computed`, `effect`, `untrack`, `flush`,
116
+ and awaitable `tick`.
117
+ - Typed web components: composition-style synchronous setup, signal-backed
118
+ props, typed factories, and live attribute declarations.
119
+ - Safe light-DOM templates: signal bindings, typed events and modifiers,
120
+ `class:*`, trusted `html:inner`, refs, and dynamic HTML tags through `el()`.
121
+ - Stable control flow: lazy `when()` branches and keyed `each()` lists that
122
+ preserve focus, scroll position, and component state.
123
+ - Two scopes of dependency injection: app-wide singleton services with
124
+ `inject`/`provide`, and portal-safe subtree state with `createContext`.
125
+ - Lifecycle and resilience: `onMount`, `onCleanup`, `useHostEvent`, automatic
126
+ effect/event cleanup, move-resilient disconnects, and component error
127
+ boundaries.
128
+ - Async work: `resource` handles local async derivations; `query` and
129
+ `QueryClient` add shared caching, invalidation, and reactive refetching.
130
+ - Typed application events with `Emitter` and automatic component cleanup.
131
+
132
+ ## Ecosystem
133
+
134
+ The Nisli repository contains four independently versioned packages and the
135
+ site that exercises them together:
136
+
137
+ - [`@nisli/core`](https://github.com/gkoreli/nisli/tree/main/packages/core) —
138
+ component authoring and browser runtime.
139
+ - [`@nisli/router`](https://github.com/gkoreli/nisli/tree/main/packages/router)
140
+ — one typed route catalog for browser, Vite, static builds, and edge/Worker
141
+ matching. It includes codecs, redirects, managed SEO metadata,
142
+ render-separated catalogs, and accessible outlets.
143
+ - [`@nisli/ssg`](https://github.com/gkoreli/nisli/tree/main/packages/ssg) —
144
+ renders normal Nisli templates and the shared application router to static
145
+ output.
146
+ - [`@nisli/ui`](https://github.com/gkoreli/nisli/tree/main/packages/ui) —
147
+ “shadcn for Nisli”: a CLI and source registry that copy accessible, Tailwind
148
+ v4 components into your project.
149
+ - [`packages/www`](https://github.com/gkoreli/nisli/tree/main/packages/www) —
150
+ the private nisli.dev application and end-to-end integration surface.
151
+
152
+ ### Source-owned UI components
153
+
154
+ ```sh
155
+ npm install -D @nisli/ui tailwindcss tw-animate-css
156
+ npx nisli-ui init
157
+ npx nisli-ui add button dialog tabs
158
+ ```
159
+
160
+ Import `tailwindcss`, `tw-animate-css`, and the copied
161
+ `nisli-ui/styles/theme.css` in that order. The copied `ui-*` components support
162
+ typed Nisli factories and plain HTML; your application owns the resulting
163
+ source.
164
+
165
+ ### One router across environments
103
166
 
104
- ## Vite HMR Plugin
167
+ ```ts
168
+ import { html } from '@nisli/core';
169
+ import { defineRouter, route } from '@nisli/router';
170
+
171
+ export const AppRouter = defineRouter({
172
+ home: route('/', {
173
+ metadata: { title: 'Home' },
174
+ render: () => html`<h1>Home</h1>`,
175
+ }),
176
+ });
177
+ ```
105
178
 
106
- `@nisli/core/vite-hmr` — a dev-only Vite plugin for granular component hot module replacement. Edit a component, it re-mounts in place with no page reload.
179
+ Mount `AppRouter({})` in the browser, pass the same router to
180
+ `nisliRoutes(AppRouter)` for Vite direct-route fallback, and pass it to
181
+ `buildStaticSite({ router: AppRouter })` for static output. Larger applications
182
+ can author an environment-neutral catalog from `@nisli/router/catalog` and
183
+ attach client renderers later with `bindRenders()`.
184
+
185
+ ### Vite HMR
107
186
 
108
187
  ```ts
109
- // vite.config.ts
188
+ import { defineConfig } from 'vite';
110
189
  import { nisliHmr } from '@nisli/core/vite-hmr';
111
190
 
112
191
  export default defineConfig({
@@ -114,21 +193,18 @@ export default defineConfig({
114
193
  });
115
194
  ```
116
195
 
117
- Used in production by [backlog-mcp](https://github.com/gkoreli/backlog-mcp) — a single Vite process serves the SPA + API on one origin, with component edits hot-swapping via this plugin.
118
-
119
- ## Size
196
+ The development-only plugin remounts an edited component in place without a
197
+ full page reload.
120
198
 
121
- ~2,600 lines of TypeScript. Zero dependencies.
199
+ Architecture decisions live in the
200
+ [`docs/adr`](https://github.com/gkoreli/nisli/tree/main/docs/adr) directory.
201
+ Package-specific usage and release history live beside each package.
122
202
 
123
203
  ## Inspiration
124
204
 
125
- nisli stands on the shoulders of giants:
126
-
127
- - [React](https://react.dev) — Component model, declarative UI
128
- - [Solid](https://www.solidjs.com) — Signals, fine-grained reactivity, no virtual DOM
129
- - [Lit](https://lit.dev) — Web Components, tagged template literals
130
- - [Angular](https://angular.dev) — Dependency injection, typed tokens
131
- - [Vue](https://vuejs.org) — Composition-style setup functions, reactive system design
205
+ Nisli stands on the shoulders of React's component model, Solid's fine-grained
206
+ reactivity, Lit's web components and templates, Angular's dependency injection,
207
+ and Vue's composition-style authoring.
132
208
 
133
209
  ## License
134
210
 
@@ -13,21 +13,78 @@
13
13
  import { type Signal, type ReadonlySignal } from './signal.js';
14
14
  import type { TemplateResult } from './template.js';
15
15
  /**
16
- * Maps a props interface to reactive signals.
17
- * Each prop `P[K]` becomes `Signal<P[K]>`.
16
+ * Narrows one prop's reactive value to the runtime type its `attrs`
17
+ * declaration guarantees (ADR 0025 candidate (b)). Only the two kinds core
18
+ * reconciles to a NON-`undefined` runtime value narrow; everything else is
19
+ * left as the author's `T` (= `P[K]`):
20
+ *
21
+ * - `'boolean'` / `{ type:'boolean' }` (any default) → `boolean` — a declared
22
+ * boolean is absent→`false`, never `undefined`.
23
+ * - `{ type:'number'; default }` → `number` — the default guarantees a value.
24
+ * - `'number'` / `{ type:'number' }` WITHOUT a default → `number | undefined`.
25
+ * - `'string'` / `{ type:'string' }` / `'forward'` / undeclared → `T` unchanged
26
+ * (a string attr is genuinely absent→`undefined`; forwarding does not touch
27
+ * the value type).
28
+ *
29
+ * SOUND FALLBACK on an incompatible declaration: the narrowed runtime type is
30
+ * applied ONLY when the declared kind and `NonNullable<T>` (the prop's author
31
+ * type) agree EXACTLY — mutual assignability, BOTH directions. A one-way check
32
+ * (`boolean extends NonNullable<T>`) is unsound: it would still narrow a
33
+ * `boolean | string` prop to `boolean` (silently dropping `string`), and a
34
+ * one-way check the other way would widen a literal `true`/`1` prop. So a
35
+ * declaration is honored only when `NonNullable<T>` IS the kind — `boolean` for
36
+ * a boolean declaration, `number` for a numeric one — via {@link IsExactKind}.
37
+ * Every genuine mismatch or partial overlap (`boolean | string` declared
38
+ * `'boolean'`, `'boolean'` on a `string` prop, a numeric decl on a boolean prop,
39
+ * a literal `true`/`1` prop) falls back to `T` unchanged — never a compile-time
40
+ * lie about the value. The whole registry declares props as exactly `boolean` /
41
+ * `number`, so it narrows as before; only unions/literals/mismatches are refused.
42
+ *
43
+ * `D` is the declaration at that key (or `undefined` when the key is absent
44
+ * from the `attrs` map, in which case the caller passes `T` through directly).
45
+ */
46
+ export type AttrValueType<T, D> = D extends 'boolean' ? (IsExactKind<T, boolean> extends true ? boolean : T) : D extends {
47
+ type: 'boolean';
48
+ } ? (IsExactKind<T, boolean> extends true ? boolean : T) : D extends {
49
+ type: 'number';
50
+ default: number;
51
+ } ? (IsExactKind<T, number> extends true ? number : T) : D extends 'number' ? (IsExactKind<T, number> extends true ? number | undefined : T) : D extends {
52
+ type: 'number';
53
+ } ? (IsExactKind<T, number> extends true ? number | undefined : T) : T;
54
+ /**
55
+ * `true` iff `NonNullable<T>` is EXACTLY `K` — mutually assignable in both
56
+ * directions (`NonNullable<T> extends K` AND `K extends NonNullable<T>`). The
57
+ * tuple wrappers block distribution so `boolean` (`= true | false`) is compared
58
+ * whole: `boolean | string` is NOT exactly `boolean` (fails the first arm), and
59
+ * `true` is NOT exactly `boolean` (fails the second), so both are refused.
60
+ */
61
+ type IsExactKind<T, K> = [
62
+ NonNullable<T>
63
+ ] extends [K] ? ([K] extends [NonNullable<T>] ? true : false) : false;
64
+ /**
65
+ * Maps a props interface to reactive signals, narrowed by the `attrs`
66
+ * declaration `A` (ADR 0025 candidate (b)).
67
+ *
68
+ * Each prop `P[K]` becomes `Signal<AttrValueType<P[K], A[K]>>` when `K` is
69
+ * declared in `A`, otherwise `Signal<P[K]>`. So a declared `'boolean'` types as
70
+ * `Signal<boolean>` (not `Signal<boolean | undefined>`), retiring the
71
+ * registry's `as boolean` stopgap. `A` defaults to `{}` (no declared keys →
72
+ * every prop unchanged), so `ReactiveProps<P>` keeps its pre-candidate-(b)
73
+ * meaning and existing single-argument uses are unaffected.
18
74
  *
19
75
  * Optionality is stripped (`-?`): the props Proxy always returns a signal,
20
76
  * even for props never set — an optional prop `variant?: T` is
21
77
  * `Signal<T | undefined>`, not `Signal<T> | undefined`.
22
78
  */
23
- export type ReactiveProps<P> = {
24
- readonly [K in keyof P]-?: Signal<P[K]>;
79
+ export type ReactiveProps<P, A extends ComponentAttrs<P> = {}> = {
80
+ readonly [K in keyof P]-?: Signal<K extends keyof A ? AttrValueType<P[K], A[K]> : P[K]>;
25
81
  };
26
82
  /**
27
- * The setup function signature. Receives reactive props and host element.
28
- * Returns a TemplateResult to be mounted into the component.
83
+ * The setup function signature. Receives reactive props (narrowed by the
84
+ * `attrs` declaration `A`) and the host element. Returns a TemplateResult to be
85
+ * mounted into the component.
29
86
  */
30
- export type SetupFunction<P> = (props: ReactiveProps<P>, host: HTMLElement) => TemplateResult;
87
+ export type SetupFunction<P, A extends ComponentAttrs<P> = {}> = (props: ReactiveProps<P, A>, host: HTMLElement) => TemplateResult;
31
88
  /**
32
89
  * Accepts either a Signal<T> (reactive) or a plain T (static, auto-wrapped).
33
90
  * This eliminates the need to wrap static values in `signal()` at call sites.
@@ -92,6 +149,19 @@ export type AttrDecl = 'string' | 'boolean' | 'number' | 'forward' | {
92
149
  default?: number;
93
150
  attr?: string;
94
151
  };
152
+ /**
153
+ * The `attrs` declaration map for a props interface `P`: prop keys → attribute
154
+ * behavior. This is the type an `attrs` object satisfies; capture its literal
155
+ * type with `typeof` and pass it as `component`'s second type argument to
156
+ * unlock declared-type narrowing (ADR 0025 candidate (b)):
157
+ *
158
+ * ```ts
159
+ * const attrs = { checked: 'boolean' } satisfies ComponentAttrs<SwitchProps>;
160
+ * const Switch = component<SwitchProps, typeof attrs>('ui-switch', setup, { attrs });
161
+ * // inside setup: props.checked.value is `boolean`, not `boolean | undefined`
162
+ * ```
163
+ */
164
+ export type ComponentAttrs<P> = Partial<Record<Extract<keyof P, string>, AttrDecl>>;
95
165
  /** Options for component() registration */
96
166
  export interface ComponentOptions<P = unknown> {
97
167
  /** Custom error fallback renderer */
@@ -101,7 +171,7 @@ export interface ComponentOptions<P = unknown> {
101
171
  * to attribute declarations. Omitted entirely → zero cost (empty
102
172
  * `observedAttributes`, no `attributeChangedCallback` work).
103
173
  */
104
- attrs?: Partial<Record<Extract<keyof P, string>, AttrDecl>>;
174
+ attrs?: ComponentAttrs<P>;
105
175
  }
106
176
  /**
107
177
  * Define a web component with typed props and a setup function.
@@ -123,4 +193,7 @@ export interface ComponentOptions<P = unknown> {
123
193
  * TaskItem({ task: taskSignal, selected: isSelected })
124
194
  * ```
125
195
  */
126
- export declare function component<P extends object = Record<string, never>>(tagName: string, setup: SetupFunction<P>, options?: ComponentOptions<P>): ComponentFactory<P>;
196
+ export declare function component<P extends object = Record<string, never>, A extends ComponentAttrs<P> = {}>(tagName: string, setup: SetupFunction<P, A>, ...[options]: [keyof A] extends [never] ? [options?: ComponentOptions<P>] : [options: ComponentOptions<P> & {
197
+ attrs: A;
198
+ }]): ComponentFactory<P>;
199
+ export {};
package/dist/component.js CHANGED
@@ -123,7 +123,15 @@ function createPropsProxy() {
123
123
  * TaskItem({ task: taskSignal, selected: isSelected })
124
124
  * ```
125
125
  */
126
- export function component(tagName, setup, options) {
126
+ export function component(tagName, setup,
127
+ // When `A` is explicitly given a non-empty attrs literal (the narrowing
128
+ // opt-in), the options argument — carrying `attrs: A` — is REQUIRED: a
129
+ // `component<P, typeof attrs>(tag, setup)` that types the props as narrowed but
130
+ // never actually wires the attrs at runtime would be a compile-time lie. When
131
+ // `A` is `{}` (the legacy default, no second type arg), options stays optional
132
+ // exactly as before. `attrs` in that legacy branch is still validated as
133
+ // `ComponentAttrs<P>` via `ComponentOptions<P>`.
134
+ ...[options]) {
127
135
  // Attribute-reactivity wiring (ADR 0025 item 3). Computed once
128
136
  // per component definition; empty when no `attrs` declared (→ zero cost).
129
137
  const attrEntries = new Map(); // by attrName
@@ -144,6 +152,7 @@ export function component(tagName, setup, options) {
144
152
  _propsProxy = null;
145
153
  _mounted = false;
146
154
  _templateResult = null;
155
+ _errorTemplateResult = null;
147
156
  _teardownScheduled = false;
148
157
  // Props explicitly set via _setProp (factory / direct assignment) are
149
158
  // "pinned": an explicit prop wins, so attribute writes no longer overwrite
@@ -227,6 +236,8 @@ export function component(tagName, setup, options) {
227
236
  // CONTEXT is established by runWithContext(host, …) below; setup then
228
237
  // runs with seed + capture already in place.
229
238
  runWithContext(host, () => {
239
+ // The Proxy is runtime-untyped; the declared narrowing (A) is a
240
+ // compile-time view the setup function requested (ADR 0025 (b)).
230
241
  this._templateResult = setup(this._propsProxy.props, this);
231
242
  });
232
243
  // Mount the template result
@@ -239,6 +250,17 @@ export function component(tagName, setup, options) {
239
250
  catch (err) {
240
251
  const error = err instanceof Error ? err : new Error(String(err));
241
252
  console.error(`Component <${tagName}> setup error:`, error);
253
+ // Setup may already have registered effects/lifecycle cleanup, or
254
+ // mountTemplate() may have partially installed bindings before
255
+ // throwing. Tear that partial scope down BEFORE mounting the error
256
+ // fallback so no hidden work survives behind it (issue 0010).
257
+ if (this._templateResult?.dispose) {
258
+ this._templateResult.dispose();
259
+ }
260
+ this._templateResult = null;
261
+ host.dispose();
262
+ this._host = null;
263
+ this.replaceChildren();
242
264
  if (options?.onError) {
243
265
  try {
244
266
  const fallback = options.onError(error, this);
@@ -246,10 +268,15 @@ export function component(tagName, setup, options) {
246
268
  this.innerHTML = fallback;
247
269
  }
248
270
  else {
271
+ this._errorTemplateResult = fallback;
249
272
  mountTemplate(this, fallback);
250
273
  }
251
274
  }
252
275
  catch (_) {
276
+ if (this._errorTemplateResult?.dispose) {
277
+ this._errorTemplateResult.dispose();
278
+ }
279
+ this._errorTemplateResult = null;
253
280
  this.innerHTML = `<div style="color:red;padding:4px">Error in &lt;${tagName}&gt;</div>`;
254
281
  }
255
282
  }
@@ -276,16 +303,43 @@ export function component(tagName, setup, options) {
276
303
  this._teardownScheduled = false;
277
304
  if (this.isConnected)
278
305
  return;
279
- this._mounted = false;
280
- if (this._templateResult?.dispose) {
281
- this._templateResult.dispose();
282
- }
283
- if (this._host) {
284
- this._host.dispose();
285
- this._host = null;
286
- }
306
+ this._teardownNow();
287
307
  });
288
308
  }
309
+ /**
310
+ * Synchronously dispose the current component scope and restore any
311
+ * projected light-DOM children as direct host children. Normal disconnect
312
+ * calls this after the move-detection microtask; HMR calls it directly so
313
+ * reconnect cannot be defeated by the `_mounted` guard (issues 0001/0002).
314
+ */
315
+ _teardownNow() {
316
+ this._mounted = false;
317
+ if (this._templateResult?.dispose) {
318
+ this._templateResult.dispose();
319
+ }
320
+ this._templateResult = null;
321
+ if (this._errorTemplateResult?.dispose) {
322
+ this._errorTemplateResult.dispose();
323
+ }
324
+ this._errorTemplateResult = null;
325
+ if (this._host) {
326
+ this._host.dispose();
327
+ this._host = null;
328
+ }
329
+ // children() records the plain light-DOM nodes it owns during cleanup.
330
+ // Replacing the rendered tree with those nodes preserves author content
331
+ // for a later true reconnect/HMR setup; components without projection
332
+ // simply become empty before the fresh setup appends its new subtree.
333
+ const captured = this
334
+ .__capturedChildren ?? [];
335
+ this.replaceChildren(...captured);
336
+ }
337
+ /** @internal — transport-agnostic HMR in-place remount hook. */
338
+ _remount() {
339
+ this._teardownScheduled = false;
340
+ this._teardownNow();
341
+ this.connectedCallback();
342
+ }
289
343
  /**
290
344
  * Set a prop value. Called by the factory and by direct property assignment.
291
345
  * The Proxy intercepts and creates/updates backing signals.
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sourceRoot":"","sources":["../src/component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,OAAO,EAAoC,MAAM,aAAa,CAAC;AAClH,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,mBAAmB,EAAsB,MAAM,cAAc,CAAC;AAEnG,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,gFAAgF;AAChF,8DAA8D;AAC9D,cAAc,CAAC,GAAG,EAAE;IAClB,IAAI,UAAU,EAAE,EAAE,CAAC;QACjB,MAAM,IAAI,GAAG,mBAAmB,EAAE,CAAC;QACnC,OAAO,CAAC,QAAoB,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,QA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AC,CAAC;IAC3D,CAAC;IACD,KAAK,MAAM,GAAG,IAAI,WAAW,EAAE,CAAC;QAC9B,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC;YAAE,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACxD,CAAC;AACH,CAAC"}
@@ -106,6 +106,10 @@ export function remount(tag) {
106
106
  const elements = document.querySelectorAll(tag);
107
107
  elements.forEach((node) => {
108
108
  const el = node;
109
+ if (el._remount) {
110
+ el._remount();
111
+ return;
112
+ }
109
113
  // Dispose first: must run BEFORE clearing DOM or effects/subscriptions
110
114
  // leak across reloads (ADR 0008.1 hazard).
111
115
  el.disconnectedCallback?.();
@@ -1 +1 @@
1
- {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/hmr/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAYH,uEAAuE;AAEvE,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAoB,CAAC;AAE7C,0EAA0E;AAC1E,MAAM,eAAe,GAAG,IAAI,GAAG,EAAU,CAAC;AAC1C,IAAI,gBAAgB,GAAG,KAAK,CAAC;AAE7B;;;;;GAKG;AACH,IAAI,iBAAiB,GAAG,KAAK,CAAC;AAE9B;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB;IAC9B,iBAAiB,GAAG,IAAI,CAAC;IACzB,gBAAgB,GAAG,KAAK,CAAC;AAC3B,CAAC;AAED,mEAAmE;AACnE,MAAM,UAAU,cAAc;IAC5B,iBAAiB,GAAG,KAAK,CAAC;AAC5B,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,UAAU,CAAC,GAAW,EAAE,KAAe;IACrD,MAAM,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC/B,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACzB,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAA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AAC,QAAQ,EAAE,CAAC;YACd,OAAO;QACT,CAAC;QACD,uEAAuE;QACvE,2CAA2C;QAC3C,EAAE,CAAC,oBAAoB,EAAE,EAAE,CAAC;QAC5B,wEAAwE;QACxE,EAAE,CAAC,eAAe,EAAE,CAAC;QACrB,gDAAgD;QAChD,EAAE,CAAC,iBAAiB,EAAE,EAAE,CAAC;IAC3B,CAAC,CAAC,CAAC;AACL,CAAC;AAED,qEAAqE;AACrE,MAAM,UAAU,eAAe;IAC7B,QAAQ,CAAC,KAAK,EAAE,CAAC;IACjB,eAAe,CAAC,KAAK,EAAE,CAAC;IACxB,gBAAgB,GAAG,KAAK,CAAC;IACzB,iBAAiB,GAAG,KAAK,CAAC;AAC5B,CAAC"}
package/dist/index.d.ts CHANGED
@@ -18,9 +18,10 @@ export { runWithContext, getCurrentComponent, hasContext, type ComponentHost, }
18
18
  export { Emitter } from './emitter.js';
19
19
  export { inject, provide, createToken, resetInjector, type Constructor, type InjectionToken, } from './injector.js';
20
20
  export { createContext, type Context, type Inject, } from './element-context.js';
21
- export { component, type ReactiveProps, type SetupFunction, type ComponentFactory, type ComponentOptions, type AttrDecl, type PropInput, type HostAttrs, } from './component.js';
21
+ export { component, type ReactiveProps, type AttrValueType, type SetupFunction, type ComponentFactory, type ComponentOptions, type AttrDecl, type ComponentAttrs, type PropInput, type HostAttrs, } from './component.js';
22
22
  export { html, el, when, each, type TemplateResult, type TypedEventHandler, type ElProps, type ElChild, } from './template.js';
23
23
  export { ref, isRef, type Ref, } from './ref.js';
24
24
  export { onMount, onCleanup, useHostEvent, } from './lifecycle.js';
25
25
  export { children, } from './projection.js';
26
26
  export { query, QueryClient, type QueryResult, type QueryOptions, } from './query.js';
27
+ export { resource, type ResourceResult, } from './resource.js';
package/dist/index.js CHANGED
@@ -35,4 +35,6 @@ export { onMount, onCleanup, useHostEvent, } from './lifecycle.js';
35
35
  export { children, } from './projection.js';
36
36
  // ── Declarative data loading ────────────────────────────────────────
37
37
  export { query, QueryClient, } from './query.js';
38
+ // ── Local async derivations ─────────────────────────────────────────
39
+ export { resource, } from './resource.js';
38
40
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,uEAAuE;AACvE,OAAO,EACL,MAAM,EACN,QAAQ,EACR,MAAM,EACN,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,YAAY,EACZ,OAAO,EACP,YAAY,GAGb,MAAM,aAAa,CAAC;AAErB,uEAAuE;AACvE,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,UAAU,GAEX,MAAM,cAAc,CAAC;AAEtB,uEAAuE;AACvE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,uEAAuE;AACvE,OAAO,EACL,MAAM,EACN,OAAO,EACP,WAAW,EACX,aAAa,GAGd,MAAM,eAAe,CAAC;AAEvB,uEAAuE;AACvE,OAAO,EACL,aAAa,GAGd,MAAM,sBAAsB,CAAC;AAE9B,uEAAuE;AACvE,OAAO,EACL,SAAS,GAQV,MAAM,gBAAgB,CAAC;AAExB,uEAAuE;AACvE,OAAO,EACL,IAAI,EACJ,EAAE,EACF,IAAI,EACJ,IAAI,GAKL,MAAM,eAAe,CAAC;AAEvB,uEAAuE;AACvE,OAAO,EACL,GAAG,EACH,KAAK,GAEN,MAAM,UAAU,CAAC;AAElB,uEAAuE;AACvE,OAAO,EACL,OAAO,EACP,SAAS,EACT,YAAY,GACb,MAAM,gBAAgB,CAAC;AAExB,2DAA2D;AAC3D,OAAO,EACL,QAAQ,GACT,MAAM,iBAAiB,CAAC;AAEzB,uEAAuE;AACvE,OAAO,EACL,KAAK,EACL,WAAW,GAGZ,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,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