One Phoenix.LiveComponent per cell, so the diff a change costs is that cell's alone
(spec/01 §3.2, visualize spec/15 §9.1). Its id is the cell's instance id
("<surface>-<cell>").
- Its root is the cell's
divwith the layout's classes and the instance's id, asMacaw.Surface.render/3writes it; LiveView adds itsdata-phx-componentthere. - It places what the proof rendered (spec/01 §3.3): a cell's update carries its
proof's
placed(Macaw.Live.Proof.render/3), which it places in its root without calling the component's render again: a safe value whole, a HEEx render as the proof answered it, with LiveView's change tracking, so LiveView evaluates and sends only what changed and a keyed comprehension only the entries that changed. - A keyed render (
Macaw.Live.Keyed, as macaw's built-in table answers, macaw#434) is placed as five parts, each an assign of its own: the head, the gap before, the rows as a keyed comprehension, one entry per row under its key, the gap after and the tail, each raw. An entry binds only the row's key and markup, never its version, which moves for every row of a changed chunk, so a one-row change sends that row, and moving a live range sends the gaps and the rows entering, never the head. - A connected contained cell has no
placed: its process proved its render (spec/02 §4), and the component renders it as a function component is called,module.render( kind, assigns)with the seven assigns (context,settings,declarations,drawn,deliveries,value,prepared) and LiveView's change tracking passed through, so an expression reading only unchanged assigns is neither evaluated nor sent, and a keyed comprehension sends only the entries that changed. - Its assigns are the placed render or the seven, with the module, kind and the sequence number of the last update it took.
- It takes its first assigns from
initand later ones only bysend_update/3from the page carrying a sequence number greater than the one it holds. A re-render of the parent passesinitagain, and the component ignores it. - A cell whose markup couldn't be proved renders
Macaw.Component.Drawn.render(:crashed, context)in its root in place of the component's render, and a contained cell whose process hasn't answered yetMacaw.Component.Drawn.render(:loading, context)(spec/02 §1, spec/03 §9). - A container showing panes (spec/01 §8) takes each shown pane's entry with its
update,
panes, by the pane's surface, as%Macaw.Live.Mounted{}holds a surface's. Its markup is the container's render with each pane's marker (<!--mw-pane:<surface>-->, the markup the page hands the container for it) replaced by the pane rendered asMacaw.Live.surface/1renders a surface, oneMacaw.Live.CellComponentper cell, so a pane's cell changes by its own update. - A contained value that draws segments (spec/05 §9.3) has its stream rendered after
the component's render, inside the root:
<div data-mw-stream="<instance>" data-mw-token="<token>" hidden>holding one<i data-k="<key>" data-t="<token>">per segment as a keyed comprehension, withdata-cthe segment's base64 only where markup carries its bytes. An unchanged segment's entry is not resent.