Documentation

DOC / 12 / RUNTIME

DOM ownership

Own mounted ranges, reconcile keyed children, adopt exact SSR output, and dispose listeners, effects, adapters, and nodes deterministically.

In this guideDOM ownership
Getting startedProject structureCLI referenceDeveloper loopRouting and pagesRust viewsEvents and foldsSchemas and snapshotsHyphae verified syncTyped contentBrowser runtimeDOM ownershipAdaptive assetsArtifact trustErrors and diagnosticsBuild and deployCrates and APILicensing and policy

One owner per mounted lifetime

A MountScope owns its exact DOM range, reactive descendants, listeners, observer handles, adapter generations, cancellation signals, and cleanup callbacks. Nested scopes form an explicit tree; disposing a parent retires the complete owned subtree.

mount
Claim detached authored nodes and install owned resources
update
Change only resources still owned by the live generation
dispose
Abort work, run LIFO cleanup, then remove exact owned nodes

Retain keyed identity

Keyed reconciliation preserves existing node and listener identity, creates builders only for new keys, and minimizes browser moves. Duplicate keys, hostile topology, oversized updates, foreign gaps, unsupported parents, or moved descendants fail without claiming foreign DOM.

Adopt exact SSR output

Adoptable rendering emits a versioned pliego:ssr:v1 seed. Browser preflight validates the complete structure, text, namespaces, attributes, dynamic first reads, and keyed identities before installing any listener or effect. A mismatch is diagnostic and non-mutating.

Cleanup cannot be postponed

Scope disposal emits pliego:scope-dispose, aborts provisional plugin work, drains registered resources in LIFO order, and removes DOM last. A plugin promise that never settles cannot keep registered cleanup alive; a late result is retired without mounting the obsolete generation.