# @nibling/app The nibling app: public pages (home, actor, project, settings) and the editor, served from `playground/`. ## Development ```sh pnpm --filter @nibling/app dev ``` This serves the app on `http://127.0.0.1:5173` and starts the sandbox page's dev server (`packages/sandbox`) on port 5174. The editor never boots a kernel itself. It frames a sandbox from `http://.localhost:5174`, a separate origin per sandbox, and drives that sandbox's kernel over a MessagePort (D27). `VITE_NIBLING_SANDBOX` names the sandbox origins at build time, as a template holding `{id}`. The default is `http://{id}.localhost:5174`, and production builds use `https://{id}.nibling.run`. Setting it skips starting the sandbox's dev server, so serve sandboxes yourself then. A saved project's sandbox is named by the hash of its record URI. Drafts and tangled repos get a random name per tab. ## Measuring page loads `scripts/perf.mjs` loads routes in a cold headless Chromium and prints, per route, the time to the first `h1` (searched through shadow roots), the time the network went idle, request counts, JavaScript bytes transferred, each external host's requests and timings, repeated GET URLs, and whether a `` was ever attached. ```sh # Dev server npx vite playground --port 9311 node scripts/perf.mjs --base http://127.0.0.1:9311 / /@natemoo.re # Production build npx vite build playground && npx vite preview playground --port 9312 node scripts/perf.mjs --base http://127.0.0.1:9312 --runs 5 --json perf.json /@natemoo.re ``` Times are medians over `--runs`, measured from navigation start. To measure with the gateway, start the app with `VITE_NIBLING_GATEWAY` set, or build with it; the script measures whatever the served app reads from.