package mosaic
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=9e4e90d17f9b2af1b07071fe425bc2c519c849c4f1d1ab73cde512be2d874849
sha512=06e9c4a741590942e81a27738d0b5c0413fafec8cf3b7dae047ad69f155e7b718aa4223818dc161b7d028efffcfd3365905e264d6fd31d453910ddfa91dcf9b9
doc/mosaic/Mosaic/Reconciler/index.html
Module Mosaic.ReconcilerSource
The virtual-DOM reconciler used by run.
Note. This module is part of the internal implementation and its interface may change between versions.
Reconciler for diffing and patching Vnode.t trees.
The reconciler bridges the declarative Vnode.t tree produced by a view function and the imperative Renderable.t tree. On each render call it flattens the vnode tree, matches fibers by key (preferred) then by position, reuses or creates Box and Text nodes, destroys unmatched fibers, and commits child placement. Vnode.Embed nodes are attached but bypass the reconciler lifecycle.
Fiber tracking and instance management are internal; this module exposes only the container, render, and unmount operations.
Types
The type for a mutable reconciler bound to a container node. Tracks the current fiber tree between render calls.
Constructors
create ~container is a reconciler that manages children of container. The reconciler starts with an empty fiber tree; existing children of container are not adopted.
Accessors
container r is the container node of r.
Reconciliation
render r vnode reconciles vnode against the previous fiber tree, applying minimal mutations to the renderable tree rooted at container r. Fibers unmatched in the new tree are destroyed and their renderable nodes removed. Ref callbacks (Vnode.attrs.ref) fire for newly created elements. Requests a render on container r after reconciliation completes.