Skip to content

feat(rolldown): add "Run build with devtools" button#431

Open
antfubot wants to merge 4 commits into
mainfrom
feat/rolldown-run-build-button
Open

feat(rolldown): add "Run build with devtools" button#431
antfubot wants to merge 4 commits into
mainfrom
feat/rolldown-run-build-button

Conversation

@antfubot

@antfubot antfubot commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

Description

Adds a "Run build with devtools" button to the Rolldown DevTools so you can produce a build session without leaving DevTools — no manual config wiring required.

Clicking it:

  1. Spawns a vite build child process (via the hub terminals host) with Rolldown's devtools output forced on for that build.
  2. Navigates the host shell to the Terminals dock so the build streams into view.
  3. Refreshes the session list when the build exits, surfacing the new entry.

What's included

  • rolldown — build flag: DevToolsRolldownUI gained a configResolved hook that forces rolldownOptions.devtools when the spawned build carries VITE_DEVTOOLS_ROLLDOWN=true. Core already mounts this plugin into the Vite pipeline whenever @vitejs/devtools-rolldown is installed, so it runs during the spawned build with no core-side changes and no manual DevToolsIntegration wiring. A normal vite build is untouched.
  • core — dock-activation bridge: an interim devtoolskit:internal:navigate RPC broadcasts a vite:devtools:activate-dock client function that the shell handles by calling switchEntry, letting a mounted plugin iframe navigate the host to another dock. Cross-iframe dock navigation is a hub concern, so this is a deliberate Vite-side shim; focusing the exact terminal session is deferred to an upstream @devframes/* capability (the sessionId is already threaded through for when it lands).
  • rolldown: run-build / wait-for-build RPCs spawn the build (single in-flight, idempotent fixed session id) and signal completion; list-sessions is no longer client-cached so the list stays live.
  • rolldown UI: a primary button in the empty state and a persistent header action, each with a spinner, inline error surface, and auto-refresh on build exit.
  • docs: RDDT0003 diagnostic for build-spawn failures.

Scoped to running inside Vite DevTools during vite dev.

Linked Issues

Additional context

A companion upstream proposal for @devframes/hub / @devframes/plugin-terminals (a first-class cross-iframe dock-activation API + terminal session focus-by-id) will let core drop the interim navigate shim and enable exact-session focus. Reviewers: worth a look at the dock-activation bridge in packages/core/src/node/rpc/internal/navigate.ts + the shell handler in state/context.ts.

This PR was created with the help of an agent.

Adds a button to the Rolldown DevTools that spawns a `vite build` with Rolldown's devtools output forced on, streams it into the Terminals dock, and refreshes the session list once the new build lands.

- core: env-gated `DevToolsRolldownBuildFlag` build plugin forces
  `rolldownOptions.devtools` when `VITE_DEVTOOLS_ROLLDOWN` is set on a spawned
  build, so no manual `DevToolsIntegration` wiring is needed.
- core: interim dock-activation bridge (`devtoolskit:internal:navigate` RPC ->
  `vite:devtools:activate-dock` client broadcast -> shell `switchEntry`) so a
  mounted iframe can navigate the host to the Terminals dock. Exact terminal
  session focus is deferred to an upstream `@devframes/*` capability.
- rolldown: `run-build` / `wait-for-build` RPCs spawn `vite build` via the
  terminals host (single in-flight, idempotent) and signal completion; the
  session list is no longer client-cached so it stays live.
- rolldown UI: primary button in the empty state plus a persistent header
  action, with a spinner, error surface, and auto-refresh on build exit.
- docs: RDDT0003 diagnostic for build-spawn failures.
@pkg-pr-new

pkg-pr-new Bot commented Jul 16, 2026

Copy link
Copy Markdown

Open in StackBlitz

@vitejs/devtools

npm i https://pkg.pr.new/vitejs/devtools/@vitejs/devtools@431

@vitejs/devtools-kit

npm i https://pkg.pr.new/vitejs/devtools/@vitejs/devtools-kit@431

@vitejs/devtools-oxc

npm i https://pkg.pr.new/vitejs/devtools/@vitejs/devtools-oxc@431

@vitejs/devtools-rolldown

npm i https://pkg.pr.new/vitejs/devtools/@vitejs/devtools-rolldown@431

@vitejs/devtools-vite

npm i https://pkg.pr.new/vitejs/devtools/@vitejs/devtools-vite@431

@vitejs/devtools-vitest

npm i https://pkg.pr.new/vitejs/devtools/@vitejs/devtools-vitest@431

commit: 033c2ae

antfubot added 3 commits July 16, 2026 06:59
Move the env-gated `rolldownOptions.devtools` flag out of a dedicated core plugin and into `DevToolsRolldownUI`'s own `configResolved` hook. Core mounts this plugin into the Vite pipeline whenever `@vitejs/devtools-rolldown` is installed, so it runs during the spawned build without core needing to know about the env var.
The "Run build" button no longer jumps to the Terminals tab on the initial click. It starts the build in place; clicking it again while it is building opens that build's Terminals session to watch it stream.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant