Summary
When zpress dev starts, the TUI shows a generic "Starting dev server..." spinner during the Rspress compilation phase. On larger projects this phase can take several seconds, but the user gets no feedback about what's happening — it appears hung.
The TUI should surface Rspress/Rsbuild compilation progress so users know the server is actively working, not stuck.
Current state
The dev screen (packages/cli/src/screens/dev-screen.tsx) has three phases:
loading — shows <Spinner label="Starting dev server..." /> (~line 260-267)
ready — full TUI with activity log, stats, hotkeys
error — error alert
The loading phase covers the entire init() flow (~lines 93-191): config loading, initial sync, and startDevServer(). There's no breakdown — a 1-second sync and a 10-second Rspack compilation both show the same static spinner.
Additionally:
- There is no timeout on
init() — if sync or Rspress hangs, the spinner shows forever with no escape
startDevServer() in packages/cli/src/lib/rspress.ts (~line 77) calls dev() which returns only after compilation completes — no progress callbacks are surfaced
- Rsbuild's
progressBar is explicitly disabled (~line 111) since the TUI renders its own status, but nothing replaces it
Proposed scope
-
Break loading into sub-phases — show distinct messages:
- "Loading config..."
- "Syncing content..." (with page count when available)
- "Compiling..." (Rspress/Rspack phase)
-
Surface Rsbuild compilation progress — Rsbuild exposes onAfterDevCompile and build hooks. Consider using rsbuild.onAfterCreateCompiler or rspack's ProgressPlugin to report percentage back to the TUI.
-
Add a timeout — if init doesn't complete within a reasonable window (e.g., 60s), show a warning or allow the user to quit cleanly instead of hanging forever.
Location
packages/cli/src/screens/dev-screen.tsx — init() function (~lines 93-191), loading phase render (~lines 259-267)
packages/cli/src/lib/rspress.ts — startDevServer() (~line 77), startServer() (~line 85)
Related
Summary
When
zpress devstarts, the TUI shows a generic "Starting dev server..." spinner during the Rspress compilation phase. On larger projects this phase can take several seconds, but the user gets no feedback about what's happening — it appears hung.The TUI should surface Rspress/Rsbuild compilation progress so users know the server is actively working, not stuck.
Current state
The dev screen (
packages/cli/src/screens/dev-screen.tsx) has three phases:loading— shows<Spinner label="Starting dev server..." />(~line 260-267)ready— full TUI with activity log, stats, hotkeyserror— error alertThe
loadingphase covers the entireinit()flow (~lines 93-191): config loading, initial sync, andstartDevServer(). There's no breakdown — a 1-second sync and a 10-second Rspack compilation both show the same static spinner.Additionally:
init()— if sync or Rspress hangs, the spinner shows forever with no escapestartDevServer()inpackages/cli/src/lib/rspress.ts(~line 77) callsdev()which returns only after compilation completes — no progress callbacks are surfacedprogressBaris explicitly disabled (~line 111) since the TUI renders its own status, but nothing replaces itProposed scope
Break
loadinginto sub-phases — show distinct messages:Surface Rsbuild compilation progress — Rsbuild exposes
onAfterDevCompileand build hooks. Consider usingrsbuild.onAfterCreateCompileror rspack'sProgressPluginto report percentage back to the TUI.Add a timeout — if init doesn't complete within a reasonable window (e.g., 60s), show a warning or allow the user to quit cleanly instead of hanging forever.
Location
packages/cli/src/screens/dev-screen.tsx—init()function (~lines 93-191), loading phase render (~lines 259-267)packages/cli/src/lib/rspress.ts—startDevServer()(~line 77),startServer()(~line 85)Related