Optionalhost: ComponentHostLive components in insertion order.
Number of attached components.
Registers component, replacing any existing component of the same
typeName. The replaced component is detached (never disposed) and a
development warning is emitted (§6a).
Order: the new component is registered first, then onAttach runs, so a
component that inspects host.getComponent(...) from onAttach sees
itself. On replacement the old component's onDetach runs before the new
component's onAttach.
Disposes every component in reverse insertion order (teardown mirrors
construction, as in disposeAll), detaching each one first. The registry
is empty afterwards.
Returns the attached component of type, or undefined.
True when a component of type is attached.
Removes component and runs its onDetach. Returns false when the
component is not the one currently attached for its type. Detaching does
not dispose (§6a).
One-component-per-type storage with §6a lifecycle, in insertion order.
Constructed with the host that components will see; a
Nodepasses itself. When no host is supplied the registry acts as its own host, which keeps it usable standalone (and in tests).