Expand description
The app’s compiled fragments and what an instance of one carries. Fragments at run time: the app’s declared fragment set, the marker a fragment instance carries, and the argument binding an instantiation resolves its placeholders against.
A fragment is compiled once and instantiated many times. The compiler
puts every declaration in the artifact’s
FragmentTable; FragmentLibrary
is that table as a world resource, so anything holding the world can
instantiate by key. The instantiation itself lives with the rest of the
DOM command applier, which is the only caller.
Arguments are static: they substitute once, when the instance is built.
A value that changes while the app runs is a bind-* attribute inside
the fragment body, which the spawn path seeds and the per-tick binding
systems drive. FragmentInstance records what an instance was built
with, which is what a build reads back to write a component’s body into
the document it emits.
Structs§
- Fragment
Instance - Marks the root of an instantiated fragment with the key it came from and the arguments it was built with.
- Fragment
Library - The app’s declared fragments, keyed by fragment key.
- Slot
Placeholder - Marks a spawned
<slot>: the element a use site’s child replaces.
Enums§
- Fragment
Fault - Why a fragment could not be instantiated.
Functions§
- bind_
args - Bind the fragment’s parameters: every declared parameter takes its default, then the use site’s arguments override. An argument naming something the fragment does not declare is kept, so a body written against a wider parameter list than its declaration still resolves.
- install
- Put the app’s declared fragments in
world, replacing whatever set was there. - instance_
body - The element an instance spawns from, or why it cannot.
- report_
once - Report a fragment fault once per
(key, fault)pair. A command issued every tick reports the first time and stays quiet after, so a broken key is visible without flooding the log. - slot_
name_ of - The slot name an element occupies, or
Nonewhen it is not a slot.