feat(slhx): add concise public render helper

Expose slhx::render(view) as the short SafeHtml composition helper and keep render_html(view) as a compatibility alias, matching generated modules' lean page-building path.

req: dx/006

req: html_safety/002
This commit is contained in:
slhx agent
2026-06-01 23:15:31 +02:00
parent 0d4a643759
commit f7d9f820e2
2 changed files with 30 additions and 7 deletions
+1 -1
View File
@@ -76,7 +76,7 @@ slhx competes with React by making frontend frameworks unnecessary for most apps
005 Error messages must explain fixes in author language, not internal language. Say “add `h-key="todo.id"` to this `h-for`”, not “missing ScopeKey for ResourceRef”.
### req: dx/006
006 Generated resource methods are the preferred authoring API: `slots::todo_list.render(view)`, `slots::card.replace(key, view)`, `slots::count.text(42)`, `atoms::user.set(user)`. Generated view modules also expose `render(view)` for trusted hemplate-to-`SafeHtml` page and fragment composition; `render_html(view)` remains as an explicit compatibility alias. These return `impl IntoEffect` or `SafeHtml` at the boundary. Raw `Effect` constructors, opcodes, and `EffectWriter` remain low-level. [north_star]
006 Generated resource methods are the preferred authoring API: `slots::todo_list.render(view)`, `slots::card.replace(key, view)`, `slots::count.text(42)`, `atoms::user.set(user)`. The public facade and generated view modules expose `render(view)` for trusted hemplate-to-`SafeHtml` page and fragment composition; `render_html(view)` remains as an explicit compatibility alias. These return `impl IntoEffect` or `SafeHtml` at the boundary. Raw `Effect` constructors, opcodes, and `EffectWriter` remain low-level. [north_star]
### req: dx/007
007 Tuple composition of `IntoEffect` is the canonical batch syntax: `(a, b, c)` implements `IntoEffect` up to arity 12. `Effect::batch((...))` is available but not required for the happy path.