Bridge between LiveComponent and Templates.
This module is a thin orchestrator that:
- Selects the appropriate template based on state
- Prepares minimal assigns for the template
- Delegates rendering to the template
Architecture
LiveComponent → Renderer (bridge) → Template → Shared (components)Performance Optimization
Renderer passes two key assigns to templates:
@static- Same reference always, LiveView skips re-render (O(1) comparison)@state- Changes trigger re-render only for parts using dynamic fields
Templates should use:
@static.*for columns, filters, ui_adapter, etc. (no re-render on user interaction)@state.*for page, filter_values, selected_ids, etc. (re-renders when changed)
See MishkaGervaz.Table.Web.Live,
MishkaGervaz.Table.Web.State,
MishkaGervaz.Table.Templates.Table,
MishkaGervaz.Table.Behaviours.Template.
Summary
Functions
@spec render(map()) :: Phoenix.LiveView.Rendered.t()