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
@varinto assignsMap.get/2function call. - transforms
@assignsand@yieldinto local variables. - add given
contextmodule 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
:attrswith string build in compile time when it's possible. - replaces local variables with given
assigns. - replaces
yieldlocal variables with givenchildrenAST.