pnpm run dev builds the Rust shell and opens the WebView on the renderer’s Vite dev server, which runs on port 4242 with strictPort, so a second server fails instead of moving to another port. The browser build’s servers use 4280 (dev:web) and 4281 (preview:web). pnpm run kill:ports frees every dev port the repo uses (4242, 4280, 4281, 4282, 4290, 4292, 5599, 5601, 6006) and stops this checkout’s app and wrangler processes, so an orphaned server cannot hold a port the next run needs.

Dependencies are pre-bundled by hand

optimizeDeps.include in apps/renderer/vite.config.ts lists third-party runtime packages for Vite to pre-bundle at start. It looks redundant and is not.

Vite pre-bundles third-party dependencies when the dev server starts, finding them by crawling the import graph from the entry. The router is configured with autoCodeSplitting, so every route is a lazy chunk the crawl does not reach. A package that only a route imports is therefore found the first time someone navigates to that route, and Vite answers by re-bundling and reloading the whole page mid-render (new dependencies optimized… reloading). That reload is a multi-second “Loading…” that looks like a slow query.

Listing the packages moves that work to server start, so navigation does not stall. The list names exactly the bare specifiers the shipped source imports, subpaths included (@jeliroco-multimedia/blunt-ui/parts, react-dom/client), and apps/renderer/src/prebundle.test.ts fails on one missing or one nothing imports. Without that, a new package that only a lazy route imports would bring the stall back for that route alone, the shape that gets misread as “that screen is slow”. @sqlite.org/sqlite-wasm is excluded instead, because pre-bundling moves the module away from the sqlite3.wasm it fetches relative to itself.

A report that a screen is slow the first time and fine afterwards is checked against this list before the screen is profiled. Driving the App (CDP) measures the real app’s time to content.

Monorepo Layout · Driving the App (CDP) · DB Dev Commands