feat(api): streamline generated app authoring
Move the canonical examples toward generated component-root helpers, typed form decoding, async/state handler registration, and derive-driven app/component registry wiring. Tighten requirements and diagnostics for the server-first, selectorless authoring path. Verified with cargo run -p slhx-xtask -- test, cargo check --workspace, redgate list, redgate refs, redgate health --strict, and git diff --check. req: canonical/001 req: canonical/003 req: canonical/004 req: dx/002 req: derive_app/001 req: component/003 req: form/004 req: axum_integration/003
This commit is contained in:
+12
-9
@@ -4,7 +4,7 @@ A board with drag-and-drop cards, 60fps pointer-follow, optimistic updates,
|
||||
offline queue, conflict reconciliation, live presence, and SSR-first rendering —
|
||||
all without React/Vue/VDOM, in a single typed Rust codebase.
|
||||
|
||||
This is the north-star integration test for slhx + hemplate + slhx-sync.
|
||||
This is an explicitly advanced/low-level north-star boundary sketch for slhx + hemplate + slhx-sync, not the beginner-facing authoring path. Raw sync/effect/wire vocabulary below is excluded from beginner-facing examples by design.
|
||||
|
||||
---
|
||||
|
||||
@@ -270,24 +270,27 @@ The runtime does not know "presence". It executes generated DOM updates.
|
||||
|
||||
---
|
||||
|
||||
## 9. What the browser receives
|
||||
## 9. What app authors write; what the browser receives
|
||||
|
||||
Initial SSR:
|
||||
Initial SSR stays an ordinary rendered template with symbolic slhx attributes at
|
||||
the authoring boundary:
|
||||
|
||||
```html
|
||||
<section data-slhx-root data-sid="0" data-aid="0">
|
||||
<section data-slhx-root="board" data-slhx-slot="board" data-slhx-atom="board">
|
||||
...
|
||||
<article data-sid="3" data-key="42" data-hid="1">
|
||||
Fix login bug
|
||||
<article data-slhx-slot="card" data-slhx-handle="select_card" +data-card-id="card.id">
|
||||
{+ card.title +}
|
||||
</article>
|
||||
...
|
||||
</section>
|
||||
<!-- the app shell loads /slhx.js and any bootstrap state -->
|
||||
```
|
||||
|
||||
Runtime attachment: `/slhx.js` installs delegated root listeners for forms,
|
||||
clicks, and pointer/drag events. App authors keep composing generated resources;
|
||||
they do not attach per-node listeners or write selector glue.
|
||||
The compiler lowers those symbols to compact runtime metadata, but that metadata
|
||||
is not an app-authoring contract. Runtime attachment: `/slhx.js` installs
|
||||
delegated root listeners for forms, clicks, and pointer/drag events. App authors
|
||||
keep composing generated resources; they do not attach per-node listeners, copy
|
||||
numeric ids, or write selector glue.
|
||||
|
||||
No framework download. No VDOM. No hydration. No game loop.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user