docs(requirements): split codegen helper surface

Split the oversized codegen/002 row into helper surface, string-key id, generated-command, and form-target requirements.

req: codegen/002

req: codegen/007

req: codegen/008

req: codegen/009
This commit is contained in:
slhx agent
2026-06-25 13:49:31 +02:00
parent 867c730ce9
commit edf632a11e
2 changed files with 11 additions and 2 deletions
+10 -1
View File
@@ -274,7 +274,16 @@ a `data-*` handle param is statically known or runtime-extracted.
001 `hemx_build` generates three artifacts from the generic Surface IR: (a) `hemx.generated.rs` containing ergonomic resource modules (`slots`, `targets`, `handles`, `forms`, `atoms`), (b) `hemx.syms` for proc-macro validation, (c) runtime id-lowering tables. `hemx_build` interprets tool-specific conventions (`data-hemx-*`, `h-for`, `h-key`, form controls) from the Surface. [north_star]
### req: codegen/002
002 Generated view modules expose ergonomic root-level target objects and commands that hide render/lower details: text slots provide `set(text)`, singleton partial slots provide `replace(view)`/`clear()`, keyed collection slots provide `append(view)`, `prepend(view)`, `replace(view)`, `remove(key_or_view)`, and forms provide `clear()`/`clear(field)`/`focus(field)`. String-keyed target objects accept displayable domain ids without caller-side `.to_string()` noise. Commands return `impl IntoEffect`, compose in plain Rust, preserve generated lowering, and fail to generate when the template lacks enough facts to infer the slot, key, form, or renderable view type.
002 Generated view modules expose ergonomic root-level target objects and commands that hide render/lower details for text, partial, and keyed collection slots. [north_star]
### req: codegen/009
009 Generated form targets provide `clear()`, `clear(field)`, and `focus(field)` commands. [north_star]
### req: codegen/007
007 String-keyed generated target objects accept displayable domain ids without caller-side `.to_string()` noise. [north_star]
### req: codegen/008
008 Generated commands return `impl IntoEffect`, compose in plain Rust, preserve generated lowering, and fail to generate when the template lacks facts needed to infer the slot, key, form, or renderable view type. [north_star]
### req: codegen/003
003 Generated module `handles` exports typed constants: `Handle<I>` where `I` is `Form<T>`, a param type, or `()`. Users rarely reference handles directly; they are consumed by `#[hemx::handler]` for validation.