Updated the `mount.md` and `lifecycle.md` documentation to clarify the new `--live` option, detailing its behavior and implications for the reactive graph. Introduced the `useTicker` hook in the `renderer.ts` to facilitate access to the project's timeline during live mounts. Additionally, modified the `playback.ts` and `live-mounts.ts` to support the new live functionality, ensuring that the reactive graph remains active and responsive during playback. These changes improve the overall usability and clarity of the mounting process.
1.8 KiB
1.8 KiB
dapi mount (<path> | --code <str>)
Compiles a Solid JSX project module and executes it in the app, mounting the rendered roots into the document. Like reloading a webpage, re-mounting rebuilds the roots in place instead of adding copies: every top-level element declares its identity in the JSX with a key, and <scene key="intro"> replaces the node carrying that key (or creates it).
The full JSX code syntax lives in jsx/; start with the pipeline and roots.
Input
Exactly one of:
<path>: path to a.tsx/.jsx/.ts/.jsentry module.--code <str>: inline module source, compiled identically. Theexport default () =>wrapper is optional; a bare JSX expression (noexport defaultin the source) is wrapped into a component module automatically.
Optionally:
--live: keep the reactive graph alive after mounting, so signals, effects, timers, anduseTickerkeep driving the mounted entities. Without it the graph is disposed once the mount lands (the entities stay, reactivity stops). A live run ends when a later mount claims one of its root keys or the project closes (see jsx/lifecycle.md).
Output
None. The command exits 0 once the tree is committed and every declared asset has generated; inspect the result with dapi context, dapi node ls, or dapi node tree.
Notes
- A newly added top-level scene becomes the active scene.
- The command is long-running when assets are declared: it blocks until generation finishes (see jsx/generate.md).
- Compile errors fail before the app is contacted; mount errors insert nothing (see jsx/errors.md).