docs(requirements): align surface build contract
Clarify that slhx consumes hemplate Surface facts and may request in-process hemplate extraction for simple build scripts, without owning .heml parsing semantics. req: surface/001 req: surface/008 req: build/001 req: boundary/003
This commit is contained in:
+4
-4
@@ -183,7 +183,7 @@ Global exports (`ui::slots::*`, `ui::handles::*`, `ui::components::*`) are opt-i
|
||||
## surface
|
||||
|
||||
### req: surface/001
|
||||
001 `hemplate_build` scans `.heml` files and emits `$OUT_DIR/hemplate.surface.postcard` (postcard-encoded, deterministic, versioned).
|
||||
001 `hemplate_build` may scan `.heml` files and emit `$OUT_DIR/hemplate.surface.postcard` (postcard-encoded, deterministic, versioned). `slhx_build` may also be called in-process with precomputed hemplate Surface facts or, for simple build scripts, ask hemplate to parse/extract the Surface before slhx interprets it. slhx owns no independent `.heml` parser.
|
||||
|
||||
### req: surface/002
|
||||
002 The Surface contains: nodes (NodeId, parent, scope, element, attrs, source span), scopes (ScopeKind: Root | If | Match | Case | For { binding, key_expr }), forms (form controls with raw HTML types), and component uses.
|
||||
@@ -207,7 +207,7 @@ Global exports (`ui::slots::*`, `ui::handles::*`, `ui::components::*`) are opt-i
|
||||
008 The Surface records hemplate structural directives as first-class facts:
|
||||
`h-for`, `h-key`, `h-if`, `h-else-if`, `h-else`, `h-match`, `h-case`,
|
||||
dynamic `+attr` bindings, and interpolated attr/text expressions. slhx consumes
|
||||
these facts; it never parses `.heml` source directly.
|
||||
these facts; if a build script points slhx_build at `.heml` files, hemplate still performs parsing and Surface extraction.
|
||||
|
||||
### req: surface/009
|
||||
009 Raw/pre-rendered HTML insertions are opaque Surface holes. The parent
|
||||
@@ -742,7 +742,7 @@ what a valid business email is.
|
||||
## build
|
||||
|
||||
### req: build/001
|
||||
001 Build order: `.heml` → `hemplate_build` → `hemplate.surface.postcard` → `slhx_build` → `slhx.generated.rs` + `slhx.syms` + diagnostics.
|
||||
001 Build order: `.heml` → hemplate Surface facts (precomputed by `hemplate_build` or extracted in-process by hemplate for `slhx_build`) → `slhx_build` → `slhx.generated.rs` + `slhx.syms` + diagnostics.
|
||||
|
||||
### req: build/002
|
||||
002 Proc-macros (`#[slhx::handler]`, `#[slhx::surface]`) are side-effect free. They read generated artifacts (`slhx.syms`, `slhx.generated.rs`) but never parse `.heml`, never process generic Surface IR, and never write files. Global codegen lives only in `build.rs` invoked by `slhx_build`. [north_star]
|
||||
@@ -801,7 +801,7 @@ Optional ergonomic macros may exist: `#[slhx::surface]`, `#[slhx::component]`,
|
||||
002 hemplate never interprets `data-slhx-*` or any other tool-prefixed attributes. It records them faithfully as generic raw attributes in the Surface.
|
||||
|
||||
### req: boundary/003
|
||||
003 slhx never parses `.heml` directly. It consumes `hemplate.surface.postcard` emitted by `hemplate_build`. slhx interprets tool-specific conventions (`data-slhx-handle`, `data-slhx-slot`, etc.) from the generic Surface.
|
||||
003 slhx never owns `.heml` parsing semantics directly. It consumes hemplate Surface facts, either from `hemplate.surface.postcard` emitted by `hemplate_build` or from in-process hemplate Surface extraction requested by `slhx_build`. slhx interprets tool-specific conventions (`data-slhx-handle`, `data-slhx-slot`, etc.) from the generic Surface.
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user