InternalWhat this class's preMerge returned for the diff that last merged, or undefined if it defines none — or if nothing has merged since the class was installed, which includes the join.
The subtree being rendered: null for the root tree, a component id otherwise.
Characters written so far, counting what an open root was split off from. A buffer that records positions brackets spans with this.
Summed on read rather than tracked on write: only a buffer that records positions ever asks, and tracking it charged every render that never does. Roots nest shallowly, so the walk is short.
Brackets one entry of a keyed comprehension. Entries hold dynamics without
being one themselves, so they are opened separately from enter.
Brackets a root element: everything written in between is a single
element, attrs are added to its start tag, and clearInnerHTML
additionally discards its contents (LiveView skips re-rendering a root
that did not change and reuses what is already in the DOM).
The default isolates the element so it can rewrite it without touching
what came before. A buffer that records positions overrides both, keeping
it continuous and applying its edits at the end instead; length stays
continuous across the pair either way.
OptionalclearInnerHTML: booleanBrackets the dynamic at statics[index] of node. Called around every
dynamic of every render, so the default has to be cheap; see
ReportingBuffer for what a buffer can do with it.
Static OptionalpreCalled before each diff merges into the rendered tree, and skipped entirely by a class that does not define it. Whatever it returns is handed to the constructor of every buffer that renders from that diff.
Anything a class wants to keep from the diff has to be copied here: the merge adopts diff subtrees into the tree and then mutates them.
Not called for the join, which has no previous render to compare against.
What the renderer writes HTML through.
One buffer is constructed per subtree render and discarded once its HTML has been taken, so a buffer class — not a buffer instance — is what gets installed, with
liveSocket.attachDebugBuffer. A tool can subclass this to observe or annotate the output; to be told which parts of the page a patch touched, extend ReportingBuffer rather than this class.The default does nothing at all and buffers into a string.