Layer-2 strictness check. Runs only when the module declares
itself as layer-2-only (via use Lavash.LiveView.Base or
use Lavash.Component.Base) and rejects any use of layer-4
features:
state :foo, optimistic: truestate :foo, animated: ...calculate :foo, rx(...), optimistic: true
The schema still accepts these keys (they live in
Lavash.Optimistic.SchemaExtension and are appended to the
base schemas in Lavash.Dsl.CommonEntities). This transformer
catches them after parse time and turns them into a friendly
compile-time error explaining the layering choice.
Why a transformer rather than removing the keys from the schema:
swapping the schema would require parameterizing
base_state_schema/0 per-extension. The transformer approach
produces better error messages and keeps the schema definition
in one place.
Summary
Functions
Callback implementation for Spark.Dsl.Transformer.after?/1.
Callback implementation for Spark.Dsl.Transformer.after_compile?/0.
Callback implementation for Spark.Dsl.Transformer.before?/1.
Callback implementation for Spark.Dsl.Transformer.transform/1.
Functions
Callback implementation for Spark.Dsl.Transformer.after?/1.
Callback implementation for Spark.Dsl.Transformer.after_compile?/0.
Callback implementation for Spark.Dsl.Transformer.before?/1.
Callback implementation for Spark.Dsl.Transformer.transform/1.