Skip to content

feat: add @nuxt/devtools-onboard as the opt-in entry point of Nuxt DevTools - #1117

Merged
antfu merged 3 commits into
mainfrom
feat/devtools-onboard
Oct 6, 2026
Merged

antfu merged 3 commits into
mainfrom
feat/devtools-onboard

Conversation

@antfubot

@antfubot antfubot commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

What

A new @nuxt/devtools-onboard package, built on @devframes/hub-ui-onboard, meant to become the dependency Nuxt 5 ships instead of @nuxt/devtools. It is a ~3 kB Nuxt module that:

  • loads @nuxt/devtools when it resolves from the project (any mode, so build.analyze keeps working);
  • otherwise, in nuxt dev, injects the 20 kB floating button. Clicking Install runs <pm> add -D @nuxt/devtools@^<version> in the project, then the module asks Nuxt for a hard restart so the real DevTools dock takes the button's place at the same /__devtools/ base;
  • stays out of the way for devtools: false, when @nuxt/devtools (or its -nightly/-edge names) is already listed in modules, and after the user picks Disable entirely (node_modules/.devframe/hub-ui-onboard.json).

@nuxt/devtools is an optional peer; its version range comes from the lockstep release, so the install never falls back to an older major.

playgrounds/empty and the sealed playgrounds-ecosystem/nuxt4 + nuxt5 playgrounds now list @nuxt/devtools-onboard instead of @nuxt/devtools (the latter from a packed tarball, via pack-local.mjs), so the e2e suite and the ecosystem checks cover the hand-off to the installed package.

Why the swap is a restart, not in-process

@devframes/hub-ui-onboard can hand its base to a hub returned from onInstalled in the same process. @nuxt/devtools is a Nuxt module, which only takes effect during Nuxt setup (Vite plugins, runtime plugins, Nitro hooks), so the module triggers nuxt.callHook('restart', { hard: true }) instead; nuxi dev re-forks and the page reloads with the real dock. Outside nuxi dev the panel's "restart your dev server" message still applies.

Follow-up in nuxt/nuxt

For Nuxt 5 to pick this up, core needs to depend on @nuxt/devtools-onboard instead of @nuxt/devtools and push '@nuxt/devtools-onboard' into _modules where it pushes '@nuxt/devtools' today (packages/nuxt/src/core/nuxt.ts, the devtools.enabled !== false branch). Nothing changes for Nuxt 4, which keeps depending on @nuxt/devtools directly.

Verification

  • pnpm lint, pnpm typecheck, and the new loadNuxt-based unit tests (off / delegate / missing / non-dev) pass.
  • check-dev-boot.mjs passes for both ecosystem playgrounds; nuxt5 builds.
  • Smoke-tested on a throwaway Nuxt 5 nightly app with @nuxt/devtools removed from the dependency graph: the dimmed button appeared bottom left, the panel showed pnpm add -D @nuxt/devtools@^4.0.0-beta.3 with the Nuxt branding, and after Install nuxi logged Nuxt requested a restart. Restarting Nuxt in a new process..., and the page came back with the Nuxt DevTools trigger and /__devtools/embedded.js served by Vite DevTools.

Created with the help of an agent.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Deploying nuxt-devtools with  Cloudflare Pages  Cloudflare Pages

Latest commit: 0795981
Status:⚡️  Build in progress...

View logs

@socket-security

socket-security Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​devframes/​hub-ui-onboard@​1.2.2741006886100

View full report

@vercel-security-reviewer

Copy link
Copy Markdown

Security review details

@antfu
antfu merged commit ff0512e into main Oct 6, 2026
6 of 7 checks passed
@antfu
antfu deleted the feat/devtools-onboard branch October 6, 2026 07:31
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