Revised multiple files to update references from `<html-paint.md>` to `<html.md>` for consistency. Added a new file for the `<html>` element, detailing its usage, properties, and best practices for incorporating real HTML into JSX layouts. This update enhances the documentation's accuracy and provides clearer guidance for users on utilizing the `<html>` element effectively.
27 lines
1.9 KiB
Markdown
27 lines
1.9 KiB
Markdown
# `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: only a scene is mountable as a root, declaring its identity in the JSX with `scene`, and `<rect scene="intro">` replaces the scene carrying that identity (or creates it).
|
|
|
|
The full JSX code syntax lives in [jsx/](./jsx/README.md); start with the [pipeline](./jsx/README.md#pipeline) and [roots](./jsx/roots.md).
|
|
|
|
## 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`](./jsx/lifecycle.md#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>`](./jsx/surface-paint.md)/[`<html>`](./jsx/html.md) animate in exports and captures (the module's structure must be deterministic). See [jsx/lifecycle.md](./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`](./context.md), [`dapi node ls`](./node/ls.md), or [`dapi node tree`](./node/tree.md).
|
|
|
|
## 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](./jsx/generate.md)).
|
|
- Compile errors fail before the app is contacted; mount errors insert nothing (see [jsx/errors.md](./jsx/errors.md)).
|