MishkaGervaz.Form.Web.Renderer (MishkaGervaz v0.0.1-alpha.2)

Copy Markdown View Source

Bridge between LiveComponent and Form 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  UIAdapter (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

See MishkaGervaz.Form.Web.Live (the LiveComponent that delegates to render/1), MishkaGervaz.Form.Web.State (struct shape — :static / :template / etc.), MishkaGervaz.Form.Behaviours.Template, and the default template MishkaGervaz.Form.Templates.Standard.

Summary

Functions

render(assigns)

@spec render(map()) :: Phoenix.LiveView.Rendered.t()