editor/reference/mount.md
konstantin-paulus c1bc3f0085 Update package.json and README for consistency and clarity
Modified the "check" script in package.json to reference the correct "examples" directory. Updated the README to replace "video editor" with "media compositor" for improved accuracy and restructured some sentences for better readability. Removed outdated documentation files related to assets, CLI, composition, distribution, and getting started, streamlining the documentation for a more focused user experience.
2026-07-20 15:53:30 +02:00

1.9 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 / .js entry module.
  • --code <str>: inline module source, compiled identically. The export default () => wrapper is optional; a bare JSX expression (no export default in the source) is wrapped into a component module automatically.

Lifecycle

A mount stays live: its reactive graph keeps running after the command returns, so signals, effects, timers, and useTicker keep driving the mounted entities. The compiled module is persisted with the document and re-executed in every context, so the mount is restored on reload and its ticker-driven <surface>/<html> animate in exports and captures (the module's structure must be deterministic). 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).