Lavash.SparkHeex.Transformers.ValidateEvents (Lavash v0.3.0-rc.3)

Copy Markdown View Source

Cross-validates the tokenized HEEx template against declared action entities.

Walks the LV 1.2 node tree (from Phoenix.LiveView.TagEngine.Parser) looking for phx-click / phx-submit / phx-change / phx-blur / phx-focus / phx-keydown / phx-keyup attributes whose values are string literals, and checks each event name resolves to a declared action :name. Dynamic event names (phx-click={@something}) come back as {:expr, ...} and are intentionally skipped — they can't be validated statically.

Demonstrates the same first-class-DSL idea as ValidateTemplate, but using the tokenized template rather than a regex over the source string.

Summary

Functions

after?(arg1)

Callback implementation for Spark.Dsl.Transformer.after?/1.

after_compile?()

Callback implementation for Spark.Dsl.Transformer.after_compile?/0.

before?(arg1)

Callback implementation for Spark.Dsl.Transformer.before?/1.

transform(dsl_state)

Callback implementation for Spark.Dsl.Transformer.transform/1.