x_component v0.1.0 X.Transformer View Source
Contains a set of functions to transform compiled Elixir AST into more performance optimized AST. Also, it contains functions to transform Elixir AST for inline components.
Link to this section Summary
Functions
Transform given Elixir AST into a valid X template AST.
Transform given X template Elixir AST into optimized inline component AST.
Link to this section Functions
Link to this function
transform_expresion(ast, context, env)
View Sourcetransform_expresion(Macro.t(), atom(), Macro.Env.t()) :: Macro.t()
Transform given Elixir AST into a valid X template AST.
- transforms globals
@var
into assignsMap.get/2
function call. - transforms
@assigns
and@yield
into local variables. - add given
context
module to the local variables context. - transforms imported function call into function call from the imported module.
- expands all aliases.
Transform given X template Elixir AST into optimized inline component AST.
- replaces dynamic
:attrs
with string build in compile time when it's possible. - replaces local variables with given
assigns
. - replaces
yield
local variables with givenchildren
AST.