feat(rolldown): add "Run build with devtools" button#431
Open
antfubot wants to merge 4 commits into
Open
Conversation
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.
@vitejs/devtools
@vitejs/devtools-kit
@vitejs/devtools-oxc
@vitejs/devtools-rolldown
@vitejs/devtools-vite
@vitejs/devtools-vitest
commit: |
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
vite buildchild process (via the hub terminals host) with Rolldown'sdevtoolsoutput forced on for that build.What's included
DevToolsRolldownUIgained aconfigResolvedhook that forcesrolldownOptions.devtoolswhen the spawned build carriesVITE_DEVTOOLS_ROLLDOWN=true. Core already mounts this plugin into the Vite pipeline whenever@vitejs/devtools-rolldownis installed, so it runs during the spawned build with no core-side changes and no manualDevToolsIntegrationwiring. A normalvite buildis untouched.devtoolskit:internal:navigateRPC broadcasts avite:devtools:activate-dockclient function that the shell handles by callingswitchEntry, 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 (thesessionIdis already threaded through for when it lands).run-build/wait-for-buildRPCs spawn the build (single in-flight, idempotent fixed session id) and signal completion;list-sessionsis no longer client-cached so the list stays live.RDDT0003diagnostic 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 inpackages/core/src/node/rpc/internal/navigate.ts+ the shell handler instate/context.ts.This PR was created with the help of an agent.