PrivatecreatedTracks the number of created nodes for each component type.
PrivateholderThe hidden holder group for storing pooled nodes off-screen.
PrivateinNodes currently checked out (not in free list), keyed by subtype then stable key.
PrivatepoolThe pool of reusable nodes, keyed by component type.
PrivatepristineCached nodePoolPristineDefaults section from app config. Populated
lazily the first time resolvePristineConfig() succeeds, then sticky.
undefined before AppConfig is wired (unit tests, early boot).
Shape: { '*': { field: value, ... }, <subtype>: { ... } }.
PrivatepristinePrivatepristinePristine default field values captured from the first freshly-created node of each type. Used to reset pooled nodes to a known-good state before reuse.
PrivateretainedNodes released to the pool while intentionally remaining attached to their parent.
PrivatebuildPrivatecaptureCaptures the default field values from a freshly-created node (once
per component type). Uses node.Keys() for the key list and
node[key] for direct property access.
This is the single point at which pooled-node reset state is defined.
The resulting snapshot is replayed via node.update(...) on every
get(), so any field that needs a specific "fresh" value on reuse
must end up in this snapshot.
Object-valued (non-array) fields cannot round-trip safely on Roku
(roAssociativeArray handles often can't be written back verbatim —
e.g. clippingRect's "uninitialized" marker activates the field as a
real 0x0 clip rect on replay). To keep pooled reset semantics
deterministic across all targets (web, Roku, mobile), NodePool treats
object-valued fields uniformly. For those fields:
nodePoolPristineDefaults map (wildcard + subtype
bucket) has an entry for the field, the configured value is
stored in the snapshot so the next checkout starts clean.Scoping safety: the snapshot is built from node.Keys(), so only
fields the subtype actually exposes land in the snapshot. Stray keys
in a subtype bucket in app config can't pollute unrelated subtypes.
Removes retained-parent nodes that were released for a specific parent.
Parent whose retained released nodes should be detached.
PrivateclearRetrieves a node of the specified component type from the pool, or creates a new one if none are available. Optionally applies an initial state to the node.
The type of node to retrieve.
OptionalinitialState: IStyleDictionaryOptional initial state to apply to the node.
The node instance.
Debug-only: nodes that look incorrectly parented while checked out.
Debug-only: in-use nodes per subtype (plain objects).
PrivategetBuilds the merged wildcard + subtype defaults map for a subtype.
Subtype bucket wins so a subtype can override or extend the wildcard.
Called only from pristine snapshot capture.
Returns counts of total, available, and created nodes by component type.
An object containing node counts.
Applies loaded app-config pristine overrides to already-captured subtype snapshots and keeps the updated snapshots cached.
Prepopulates the pool with a specified number of nodes of the given component type. Nodes are created off-screen and added to the pool.
The type of node to prepopulate.
The number of nodes to create.
PrivateregisterReleases a node back into the pool for reuse. Removes the node from its parent and appends it to the holder group.
The node to release.
PrivateresolveResolves nodePoolPristineDefaults.
Two-phase behavior:
PrivatetrackPrivateunregisterPrivatevalidatePrivate StaticgetPrivate StaticisPrivate StaticsubtypeParent may be a partial mock (e.g. tests) without subtype().
NodePool manages reusable SceneGraph nodes for performance and memory efficiency. Implements the INodePool interface.