Transforms compiled HEEx template AST to inject Lavash-specific attributes.
This module post-processes the AST generated by Phoenix's ~H sigil to:
- Inject
__lavash_client_bindings__into<.lavash_component>calls
This operates on the compiled AST, making it robust and compatible with all HEEx features.
How it works
After ~H compiles a template, the AST contains component calls as maps with
keys like :module, :id, :__changed__. We use Macro.prewalk/2 to find
these maps and inject additional assigns.
Usage
This is automatically applied via @before_compile in Lavash.Component.Compiler.
You don't need to call this directly.
Summary
Functions
Transforms an AST to inject __lavash_client_bindings__ into component calls.