Register a precompiled expression function. Build-time tooling
(see spektrum-compile.js) emits one call per unique template
expression, letting Spektrum run under strict CSP — the runtime
never reaches the new Function fallback when the cache hits.
Registrations live in their own unbounded registry: they are never
evicted, and they take precedence over on-demand compiles.
fn receives (state, scope). scope carries the per-iteration
data-each bindings (the loop variable, $index, $path, …) and is
undefined outside a loop; an expression used inside data-each must
read it to resolve the loop variable.
Register a precompiled expression function. Build-time tooling (see
spektrum-compile.js) emits one call per unique template expression, letting Spektrum run under strict CSP — the runtime never reaches thenew Functionfallback when the cache hits.Registrations live in their own unbounded registry: they are never evicted, and they take precedence over on-demand compiles.
fnreceives(state, scope).scopecarries the per-iterationdata-eachbindings (the loop variable,$index,$path, …) and is undefined outside a loop; an expression used insidedata-eachmust read it to resolve the loop variable.