Skip to content

feat(oxc): migrate the DevTools UI onto @vitejs/devtools-ui + UnoCSS - #430

Merged
antfu merged 5 commits into
mainfrom
feat/oxc-unocss-migration
Jul 16, 2026
Merged

feat(oxc): migrate the DevTools UI onto @vitejs/devtools-ui + UnoCSS#430
antfu merged 5 commits into
mainfrom
feat/oxc-unocss-migration

Conversation

@antfubot

Copy link
Copy Markdown
Collaborator

Description

Implements plan 018: bring @vitejs/devtools-oxc — the only DevTools UI package still on @nuxt/ui + Tailwind — onto the shared stack used by the rolldown and vite analyzers. Two logical commits:

feat(ui): new shared primitives. Adds ContainerCard, OverlayModal (teleport + bg-glass panel + backdrop/Escape close), FormCheckbox, and VisualEmptyState to @vitejs/devtools-ui. They're styled only with the shared semantic shortcuts so they stay safe on both the Wind4 (Nuxt) and Wind3 (webcomponents) surfaces, each with a colocated story. No existing consumer is touched.

refactor(oxc): the actual swap. Moves the oxc client off @nuxt/ui + tailwindcss onto UnoCSS via presetDevToolsUI:

  • Plumbing: uno.config.ts with a primary scale derived from the BannerOxcDevTools cyan accent (#00F7F1); @unocss/nuxt + @vueuse/nuxt modules; shared global.css, floating-vue plugin, DM Sans/Mono, dotted-grid background and the shared dark-mode composable (storage key vite-devtools-color-scheme).
  • Components/pages: every U* component maps to the new shared primitives, DisplayFileIcon/DisplayDuration, btn-action, badge-color-*, and UnoCSS i-* icons, with inline dark: pairs folded into bg-base/color-base/border-base/op-fade. LineError swaps UTooltip for a floating-vue tooltip (the ASCII-underline column math is preserved); the Monaco config viewers keep their momoa cursor→docs mapping and follow dark mode.
  • Gates: oxc joins the root tsconfig.json project references (build / typecheck / export-snapshot now cover it); the unused @nuxt/ui and tailwindcss catalog entries are pruned; AGENTS.md and plans/README.md updated.

pnpm lint && pnpm typecheck && pnpm build && pnpm test all pass.

One deliberate deviation from the plan (a STOP condition). The plan suggested folding oxc into the repo-wide antfu ESLint run. In practice antfu's style/arrow-parens and antfu/if-newline directly conflict with oxc's oxfmt (arrowParens: "avoid"). Since @vitejs/devtools-oxc is the DevTools for the Oxc toolchain and dogfoods its own oxlint/oxfmt on itself, retiring its formatter would be a Leo-owned policy call beyond this UI-focused swap — so oxc keeps its own lint toolchain and stays out of the shared ESLint run (both pass locally). Recorded in AGENTS.md and the plan row.

Linked Issues

Implements plans/018-oxc-ui-unocss-migration.md (PR A — the src/app restructure — already landed in #424).

Additional context

I couldn't run the live side-by-side agent-browser visual diff (the sandbox kept killing the backgrounded dev server), so the look & feel was verified structurally: the cyan #00c9c4 primary, the Phosphor/carbon/lucide/vscode/twemoji/catppuccin icons, and the semantic tokens are all present in the generated CSS. A visual pass in review would be worthwhile.

This PR was created with the help of an agent.

antfubot added 2 commits July 16, 2026 05:28
Upstream reusable overlay/form/container primitives styled only with the
shared semantic shortcuts so they render on both the Wind4 (Nuxt) and Wind3
(webcomponents) surfaces. These back the oxc client's migration off @nuxt/ui
and are available to every analyzer.
… UnoCSS

Move the oxc client off @nuxt/ui + Tailwind onto the shared stack used by the
rolldown and vite analyzers: UnoCSS via presetDevToolsUI, shared semantic
tokens, DM Sans/Mono, the dotted-grid background, floating-vue tooltips and the
shared dark-mode composable. The primary scale is derived from the
BannerOxcDevTools cyan accent. @nuxt/ui overlays/forms are replaced by the new
shared Card/Modal/Checkbox/EmptyState primitives, badges by badge-color-*, and
icons by UnoCSS i-* classes; the Monaco config viewers keep their momoa
cursor-to-docs mapping and follow dark mode.

Wires oxc into the build, typecheck and export-snapshot gates (root tsconfig
reference) and prunes the unused @nuxt/ui and tailwindcss catalog entries. oxc
keeps dogfooding its own oxlint/oxfmt, whose formatting conflicts with the
repo-wide antfu ESLint config, so it stays out of the shared ESLint run.
@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@430

@vitejs/devtools-kit

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

@vitejs/devtools-oxc

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

@vitejs/devtools-rolldown

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

@vitejs/devtools-vite

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

@vitejs/devtools-vitest

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

commit: e3e2d8f

antfubot added 3 commits July 16, 2026 05:53
Import the client's main.css (which carries the floating-vue popper
overrides) from app.vue right after floating-vue's own stylesheet, instead of
via the nuxt `css` array. The array-loaded sheet landed before
floating-vue/dist/style.css, so the default dark popper background won the
cascade and tooltips/dropdowns rendered dark in light mode. Mirrors the
import order used by the rolldown and vite clients.
The lint error tooltip holds interactive links (rule details, open in editor),
so give it a hide delay and make the popper itself hoverable
(`popperTriggers: ['hover']`). Previously it faded out the moment the pointer
left the underline marker, before it could reach the panel — restoring the
hoverable-content behavior the former @nuxt/ui tooltip had.
Two issues made the .oxlintrc.json dialog look broken: Shiki paints its light
theme background (#fff) via an inline style, so the code block rendered as a
stark white panel that clashed with the translucent modal; and the dialog used
a frosted bg-glass panel that muddied over the dimmed backdrop.

Override Shiki's inline background to transparent (`!important`) and swap its
inline colors for the dual-theme `--shiki-dark` values in dark mode, and give
OverlayModal a solid `bg-base` panel so the code renders cleanly on a readable
surface in both color schemes.
@antfu
antfu merged commit 40cd2e7 into main Jul 16, 2026
9 of 10 checks passed
@antfu
antfu deleted the feat/oxc-unocss-migration branch July 16, 2026 06:10
@yuyinws yuyinws mentioned this pull request Jul 16, 2026
7 tasks
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.

2 participants