SPIKE (spike/elixir-to-lit): emits the Lit element module for a spec that
declared state / template ~TSR / action (docs/notes/spike-elixir-to-lit.md
§codegen).
Output (colocated with the component's .ex):
<tag>.element.generated.mjs— aLitElementsubclass mixed withTesseraElement(CONTRACT.md §4): reactive properties from state + attrs + props (with Lit property options —attributerename/disable,reflect, typed converters incl.Arrayfor:list), arender()built from the template, one method per action (running the JS translated at compile time), one method per declared lifecycle hook (shouldUpdate/willUpdate/firstUpdated/updated),emitrouted through@noizu/tessera-core'semit(so thedata-tsr-onHologram bridge keeps working), and an exportedregister().<snake>.mjs— the:jsentry wrapper (register();top-level — load-bearing for Hologram page bundles, CONTRACT.md §5). Written only when it does not exist, so a hand-written element.mjsis never clobbered.
Deterministic: same spec in, same bytes out (golden fixtures pin it).
Summary
Functions
The <tag>.element.generated.mjs text for a template-bearing spec.
Path of the generated element module under dir. Takeover layers are keyed
by the BASE tag like their merged specs — the stem carries the declaring
module so sibling layers don't clobber each other's artifacts (§5.8/§5.9).
The generated :js entry wrapper for Hologram hosts (top-level
register(), CONTRACT.md §5).
Write-if-changed element_module/1 (returns :written | :unchanged | {:error, reason}).
Write the wrapper only when it does not exist (a hand-written element
.mjs is never clobbered). Returns :written | :exists | {:error, reason}.
Functions
@spec element_module(Noizu.Tessera.Spec.t()) :: String.t()
The <tag>.element.generated.mjs text for a template-bearing spec.
@spec element_path(Noizu.Tessera.Spec.t(), String.t()) :: String.t()
Path of the generated element module under dir. Takeover layers are keyed
by the BASE tag like their merged specs — the stem carries the declaring
module so sibling layers don't clobber each other's artifacts (§5.8/§5.9).
@spec wrapper_module(Noizu.Tessera.Spec.t()) :: String.t()
The generated :js entry wrapper for Hologram hosts (top-level
register(), CONTRACT.md §5).
@spec write_element_module(Noizu.Tessera.Spec.t(), String.t()) :: :written | :unchanged | {:error, term()}
Write-if-changed element_module/1 (returns :written | :unchanged | {:error, reason}).
@spec write_wrapper_module(Noizu.Tessera.Spec.t(), String.t()) :: :written | :exists | {:error, term()}
Write the wrapper only when it does not exist (a hand-written element
.mjs is never clobbered). Returns :written | :exists | {:error, reason}.