Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

Commit 2cdce65

Browse files
vitbokischclaude
andcommitted
docs: update for Pyreon v0.7.11
- RefCallback<T>, RefProp<T> types - 40+ new SVG attributes, no catch-all - New HTML globals (contentEditable, popover, inert, etc.) - Compiler fix: _bindText only for simple identifiers (toLocaleString fix) - _bindText/_bindDirect runtime fallback for non-signal callables - Unhandled component errors now console.error Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 2f012b2 commit 2cdce65

3 files changed

Lines changed: 14 additions & 3 deletions

File tree

content/docs/core/index.mdx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,8 +421,9 @@ jsx(Card, {
421421
Pyreon provides comprehensive JSX type definitions for all standard HTML and SVG elements. Each element type has its own attribute interface with proper typing:
422422

423423
- **HTML elements**: `div`, `span`, `button`, `input`, `form`, `a`, `img`, etc.
424-
- **SVG elements**: `svg`, `path`, `circle`, `rect`, `g`, `text`, etc.
425-
- **Special attributes**: `class`, `style`, `ref`, `key`, `innerHTML`, `dangerouslySetInnerHTML`
424+
- **SVG elements**: `svg`, `path`, `circle`, `rect`, `g`, `text`, etc. -- includes 40+ SVG-specific attributes for gradients, patterns, markers, clipping, masking, filters, presentation, text, and path elements (no catch-all index signature)
425+
- **HTML global attributes**: `class`, `style`, `ref`, `key`, `innerHTML`, `dangerouslySetInnerHTML`, `contentEditable`, `spellCheck`, `autoCapitalize`, `translate`, `enterKeyHint`, `inputMode`, `slot`, `part`, `popover`, `popoverTarget`, `popoverTargetAction`, `inert`, `is`
426+
- **Element-specific attributes**: input (`capture`, `formNoValidate`), anchor (`hreflang`, `ping`, `referrerPolicy`), img (`fetchPriority`), video (`disablePictureInPicture`, `disableRemotePlayback`), form (`acceptCharset`, `rel`)
426427
- **Event handlers**: `onClick`, `onInput`, `onKeyDown`, `onSubmit`, etc.
427428
- **ARIA attributes**: `aria-label`, `aria-hidden`, `aria-expanded`, etc.
428429
- **Reactive props**: many attributes accept `() => T` accessors for fine-grained reactivity
@@ -865,6 +866,10 @@ interface Ref<T = unknown> {
865866
current: T | null
866867
}
867868

869+
type RefCallback<T = unknown> = (el: T | null) => void
870+
871+
type RefProp<T = unknown> = Ref<T> | RefCallback<T>
872+
868873
function createRef<T = unknown>(): Ref<T>
869874
```
870875

@@ -1910,6 +1915,8 @@ Dispatch an error to the nearest active `ErrorBoundary`. Returns `true` if the b
19101915
| `VNodeChild` | Union type for all renderable values (VNode, string, number, null, boolean, function, array) |
19111916
| `Props` | Base props interface for elements and components |
19121917
| `Ref<T>` | Mutable ref container `{ current: T \| null }` |
1918+
| `RefCallback<T>` | Function ref callback `(el: T \| null) => void` -- called with the element on mount and `null` on unmount |
1919+
| `RefProp<T>` | Union of `Ref<T> \| RefCallback<T>` -- the type accepted by the JSX `ref` prop |
19131920
| `ExtractProps<T>` | Extracts the props type from a `ComponentFn<P>`, or passes through if already a props object |
19141921
| `HigherOrderComponent<HOP, P>` | Typed higher-order component pattern `(component: ComponentFn<P>) => ComponentFn<P & HOP>` |
19151922
| `PyreonHTMLAttributes<E>` | HTML attribute types parameterized by element type (e.g., `PyreonHTMLAttributes<HTMLInputElement>`) |

content/docs/runtime-dom/index.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ When `mount` is called, the following lifecycle occurs:
7777

7878
1. **Container cleared** -- All existing DOM children are removed.
7979
2. **VNode tree walked** -- `mountChild` recursively processes each node.
80-
3. **Components initialized** -- Each component function is called once. An `EffectScope` is created for the component so all signals and effects are tracked.
80+
3. **Components initialized** -- Each component function is called once. An `EffectScope` is created for the component so all signals and effects are tracked. If a component throws during setup or render, the error is logged via `console.error` instead of being silently swallowed.
8181
4. **DOM elements created** -- `document.createElement` for element VNodes (or `cloneNode` for template-optimized elements).
8282
5. **Props applied** -- Event listeners registered, reactive effects created for dynamic attributes.
8383
6. **Children mounted** -- Recursive depth-first mount of child VNodes.
@@ -1368,6 +1368,8 @@ function StaggeredList() {
13681368
| `mountChild` | Mount a single child node (internal) |
13691369
| `createTemplate` | Create a template-cloning factory |
13701370
| `_tpl` | Compiler-emitted template instantiation |
1371+
| `_bindText` | Compiler-emitted text binding for simple signal identifiers. Falls back to `renderEffect` if the source lacks `.direct()` |
1372+
| `_bindDirect` | Compiler-emitted direct attribute binding. Falls back to `renderEffect` if the source lacks `.direct()` |
13711373
| `applyProp` | Apply a single prop to an element |
13721374
| `applyProps` | Apply all props to an element |
13731375
| `cx` | Compose class names from strings, arrays, objects (re-exported from `@pyreon/core`) |

content/docs/vite-plugin/index.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,8 @@ The Pyreon compiler transform does three things:
174174

175175
3. **Template emission** -- Element trees with 2 or more consecutive DOM elements (no components) are compiled into `_tpl()` calls. Templates use `cloneNode` internally, which is faster than creating elements one by one.
176176

177+
Within templates, the compiler emits `_bindText` only for **simple identifiers** (e.g., `count()`, `name()`). Property access calls like `value.toLocaleString()` or `row.label()` use `_bind()` instead, which preserves the correct `this` context. The `_bindText` and `_bindDirect` runtime helpers include a fallback to `renderEffect` when the source is a non-signal callable (i.e., lacks `.direct()`), making them safe for any callable value.
178+
177179
Compiler warnings are surfaced in the terminal via Vite's warning system, including the file path, line, and column number.
178180

179181
### File Extensions

0 commit comments

Comments
 (0)