Repository navigation
feat: add @nuxt/devtools-onboard as the opt-in entry point of Nuxt DevTools - #1117
Merged
Merged
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
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.
What
A new
@nuxt/devtools-onboardpackage, 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:@nuxt/devtoolswhen it resolves from the project (any mode, sobuild.analyzekeeps working);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;devtools: false, when@nuxt/devtools(or its-nightly/-edgenames) is already listed inmodules, and after the user picks Disable entirely (node_modules/.devframe/hub-ui-onboard.json).@nuxt/devtoolsis an optional peer; its version range comes from the lockstep release, so the install never falls back to an older major.playgrounds/emptyand the sealedplaygrounds-ecosystem/nuxt4+nuxt5playgrounds now list@nuxt/devtools-onboardinstead of@nuxt/devtools(the latter from a packed tarball, viapack-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-onboardcan hand its base to a hub returned fromonInstalledin the same process.@nuxt/devtoolsis a Nuxt module, which only takes effect during Nuxt setup (Vite plugins, runtime plugins, Nitro hooks), so the module triggersnuxt.callHook('restart', { hard: true })instead;nuxi devre-forks and the page reloads with the real dock. Outsidenuxi devthe 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-onboardinstead of@nuxt/devtoolsand push'@nuxt/devtools-onboard'into_moduleswhere it pushes'@nuxt/devtools'today (packages/nuxt/src/core/nuxt.ts, thedevtools.enabled !== falsebranch). Nothing changes for Nuxt 4, which keeps depending on@nuxt/devtoolsdirectly.Verification
pnpm lint,pnpm typecheck, and the newloadNuxt-based unit tests (off / delegate / missing / non-dev) pass.check-dev-boot.mjspasses for both ecosystem playgrounds;nuxt5builds.@nuxt/devtoolsremoved from the dependency graph: the dimmed button appeared bottom left, the panel showedpnpm add -D @nuxt/devtools@^4.0.0-beta.3with the Nuxt branding, and after InstallnuxiloggedNuxt requested a restart. Restarting Nuxt in a new process..., and the page came back with the Nuxt DevTools trigger and/__devtools/embedded.jsserved by Vite DevTools.Created with the help of an agent.