defmodule Phoenix.Component.MacroComponent do @moduledoc false # A macro component is a special type of component that can modify its content # at compile time. # # Instead of introducing a special tag syntax like `<#macro-component>`, LiveView # implements them using a special `:type` attribute as the most useful macro # components take their content and extract it to somewhere else, for example # to a file in the local file system. A good example for this is `Phoenix.LiveView.ColocatedHook` # and `Phoenix.LiveView.ColocatedJS`. # # ## AST # # Macro components work by defining a callback module that implements the # `Phoenix.LiveView.MacroComponent` behaviour. The module's `c:transform/2` callback # is called for each macro component used while LiveView compiles a HEEx component: # # ```heex #