Skip to content

perf(nuxt): use @nuxt/devtools-onboard as a minimal devtools shim - #36581

Merged
danielroe merged 4 commits into
4.xfrom
feat/devtools-onboard-v4
Nov 4, 2026
Merged

danielroe merged 4 commits into
4.xfrom
feat/devtools-onboard-v4

Conversation

@antfu

@antfu antfu commented Oct 13, 2026

Copy link
Copy Markdown
Member

🔗 Linked issue

📚 Description

Same as #36470 but for v4.x

I have made the onboard package also accept Nuxt DevTools v3: nuxt/devtools#1122

IMO this could be considered as a non-breaking change, as Nuxt DevTools is not an API but an opt-in interface. With this, it does require existing DevTools users to install the separate @nuxt/devtools, but I think it should be acceptable. This would also make Nuxt 4.x lighter and compatible with Nuxt DevTools v4.

@antfu
antfu requested a review from danielroe as a code owner October 13, 2026 09:29
@coldtea-pr-lens

coldtea-pr-lens Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Nothing flagged · reviewed b636d2d


  • Redraw · drawn at b636d2d, the branch has moved on

Architecture

Architecture diagram for nuxt/nuxt at b636d2d

Play the walkthrough


Data flow

No data-flow sequence changed in this PR.


Tip

Switch GitHub to dark mode and the diagrams follow. The moving dots are this pull request's data in motion

🪧 More tips
  • Run npx skills add coldteadotai/pr-lens, then tell your coding agent: "Diagram the change you just made with PR Lens and attach it to the pull request."
  • Run npx @coldtea/pr-lens-cli analyze --base origin/main on a branch, then npx @coldtea/pr-lens-cli render .pr-lens/graph.json. Same lenses, your own model key, before the pull request exists
  • Click the link under each diagram to open it on a canvas you can zoom, pan and step through
  • The diagrams are links. Click one to open it on the canvas, then press W or click play to walk through the change
  • Open a diagram on the canvas, then press W or click play to walk through the change one step at a time
  • The CLI's render reads .github/pr-lens.yml and applies your renames, exclusions and lane pins at draw time
  • Set github.comment.collapsed: true in .github/pr-lens.yml to fold the comment behind one View architecture and data flow row. Drawing still runs as before
  • Set github.draw: on-demand in .github/pr-lens.yml and PR Lens stops drawing pull requests on its own. Comment @pr-lens draw on a pull request when you want that one drawn
  • Add .github/workflows/pr-lens.yml with coldteadotai/pr-lens/packages/action@v0 and your model provider's key as its api-key to run PR Lens from your own CI. Any /chat/completions endpoint works
  • After a push, tick Redraw to draw the latest commit

Thanks for using PR Lens! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

@github-actions github-actions Bot added 4.x ⚡ performance Performance degradation or optimization opportunity labels Oct 13, 2026
@socket-security

socket-security Bot commented Oct 13, 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@​nuxt/​devtools-onboard@​4.1.0921007494100

View full report

@vercel-internal-security-reviewer

Copy link
Copy Markdown

Security review details

@pkg-pr-new

pkg-pr-new Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

@nuxt/kit

pnpm add https://pkg.pr.new/@nuxt/kit@36581
npm i https://pkg.pr.new/@nuxt/kit@36581
yarn add https://pkg.pr.new/@nuxt/[email protected]

@nuxt/nitro-server

pnpm add https://pkg.pr.new/@nuxt/nitro-server@36581
npm i https://pkg.pr.new/@nuxt/nitro-server@36581
yarn add https://pkg.pr.new/@nuxt/[email protected]

nuxt

pnpm add https://pkg.pr.new/nuxt@36581
npm i https://pkg.pr.new/nuxt@36581
yarn add https://pkg.pr.new/[email protected]

@nuxt/rspack-builder

pnpm add https://pkg.pr.new/@nuxt/rspack-builder@36581
npm i https://pkg.pr.new/@nuxt/rspack-builder@36581
yarn add https://pkg.pr.new/@nuxt/[email protected]

@nuxt/schema

pnpm add https://pkg.pr.new/@nuxt/schema@36581
npm i https://pkg.pr.new/@nuxt/schema@36581
yarn add https://pkg.pr.new/@nuxt/[email protected]

@nuxt/vite-builder

pnpm add https://pkg.pr.new/@nuxt/vite-builder@36581
npm i https://pkg.pr.new/@nuxt/vite-builder@36581
yarn add https://pkg.pr.new/@nuxt/[email protected]

@nuxt/vite-server

pnpm add https://pkg.pr.new/@nuxt/vite-server@36581
npm i https://pkg.pr.new/@nuxt/vite-server@36581
yarn add https://pkg.pr.new/@nuxt/[email protected]

@nuxt/webpack-builder

pnpm add https://pkg.pr.new/@nuxt/webpack-builder@36581
npm i https://pkg.pr.new/@nuxt/webpack-builder@36581
yarn add https://pkg.pr.new/@nuxt/[email protected]

commit: 8bc8350

@danielroe danielroe left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can defer this to 4.7 🙏

I'll wait to merge until then, but thank you ❤️

@danielroe
danielroe force-pushed the 4.x branch 2 times, most recently from 1525f8c to 768d213 Compare November 2, 2026 20:33
@danielroe
danielroe force-pushed the feat/devtools-onboard-v4 branch from d1ec451 to 8bc8350 Compare November 4, 2026 21:56
@codspeed

codspeed Bot commented Nov 4, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

1 warning

⚠️ 18 benchmarks are dominated by system calls

System calls cannot be simulated consistently and are left out of the measure. The reported value understates the real cost. Switch to the Walltime instrument to measure them.

Learn more about system calls

See affected benchmarks

✅ 30 untouched benchmarks
⏩ 24 skipped benchmarks1


Comparing feat/devtools-onboard-v4 (8bc8350) with 4.x (7e8e53c)

Open in CodSpeed

Footnotes

  1. 24 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Benchmark

🔴 2 regressions, 🟢 2 improvements; 34 of 38 metrics unchanged, below threshold or within noise.

Metric baseline head change
🔴 modules loaded by nuxt prepare (minimal) 857 903 +46 (+5.4%)
🔴 modules loaded by nuxt prepare (large) 858 904 +46 (+5.4%)
🟢 installed packages 516 469 -47 (-9.1%)
🟢 node_modules size 158.06 MB 144.96 MB -13.10 MB (-8.3%)
34 unchanged, below threshold or within noise
Metric baseline head change
packed tarballs 737.0 kB 737.0 kB +19 B (+0.0%)
source loaded by nuxt prepare (minimal) 10.56 MB 10.64 MB +81.4 kB (+0.8%)
source loaded by nuxt prepare (large) 10.56 MB 10.64 MB +81.4 kB (+0.8%)
nuxt prepare (minimal) 710 ms 721 ms +1.6%
nuxt prepare (large) 913 ms 919 ms +0.7%
cold nuxt dev to first response (minimal) 2.95 s 2.97 s +0.8%
cold nuxt dev to first response (large) 5.03 s 4.99 s -0.8%
edit to updated SSR response (minimal) 28 ms 29 ms +0.0%
edit to updated SSR response (large) 71 ms 71 ms -0.5%
nuxt build (minimal) 4.53 s 4.55 s +0.5%
client JS, gzip (minimal) 53.6 kB 53.6 kB 0
server output, excluding node_modules (minimal) 694.0 kB 694.0 kB 0
nuxt build (large) 10.97 s 10.91 s -0.5%
client JS, gzip (large) 182.4 kB 182.4 kB 0
server output, excluding node_modules (large) 1.58 MB 1.58 MB +1.1 kB (+0.1%)
SSR requests/s, / (minimal) 1846 1770 -4.1%
SSR requests/s, / (large) 376 377 +0.2%
SSR requests/s, /catalog/3 (large) 387 381 -1.5%
SSR requests/s, /table (large) 50 50 +0.5%
SSR requests/s, /table/plain (large) 196 200 +2.2%
initial JS, gzip (/, minimal) 48.6 kB 48.6 kB 0
initial JS files (/, minimal) 1 1 0
initial JS, gzip (/, large) 85.2 kB 85.2 kB 0
initial JS files (/, large) 14 14 0
initial JS, gzip (/catalog/3, large) 85.3 kB 85.3 kB 0
initial JS files (/catalog/3, large) 15 15 0
initial JS, gzip (/table, large) 83.5 kB 83.5 kB 0
initial JS files (/table, large) 9 9 0
initial JS, gzip (/table/plain, large) 83.5 kB 83.5 kB 0
initial JS files (/table/plain, large) 9 9 0
initial JS, gzip (/, ui) 177.7 kB 177.7 kB 0
initial JS files (/, ui) 18 18 0
initial JS, gzip (/blog, ui) 177.0 kB 177.0 kB 0
initial JS files (/blog, ui) 18 18 0
Full report

Baseline: ref:7e8e53cf2dad56fcfbd680f9d82f7315f73aa877 (7e8e53c). Head: de21eca plus any uncommitted changes.

Fixtures: minimal (a single app.vue); large (generated app with ~170 pages, ~370 components, plugins, middleware, server routes and a layer, plus a 1000-row listing page in two flavours (/table with a <NuxtLink> per row, /table/plain with a plain anchor)); ui (Nuxt UI landing page and blog index with ~690 component instances).

Node.js v26.13.0 on Linux 7.0.0-1017-azure, unknown (4 cores, 15.6 GB), load average 1.83, 1.59, 0.92.

Install footprint

Fresh npm install of nuxt into an empty project. Tarball size is the sum of the packed workspace packages.

Metric baseline head delta
installed packages 516 469 -9.1%
node_modules files 11758 11085 -5.7%
node_modules size 158.06 MB 144.96 MB -8.3%
packed tarballs 737.0 kB 737.0 kB +0.0%

Modules loaded

JavaScript modules evaluated by nuxt prepare, counted with a module.registerHooks load hook and the compile cache disabled. Built-ins are counted separately, internals included.

Fixture baseline modules head modules delta baseline source head source delta baseline built-ins head built-ins
minimal 857 903 +5.4% 10.56 MB 10.64 MB +0.8% 117 117
large 858 904 +5.4% 10.56 MB 10.64 MB +0.8% 117 117

nuxt prepare

Wall time of nuxt prepare from process spawn to exit, with .nuxt deleted before each run. Median of 10 interleaved runs after one warmup, so the Node.js compile cache is warm.

Fixture baseline median head median delta baseline min / max head min / max
minimal 710 ms 721 ms +1.6% 699 ms / 733 ms 710 ms / 739 ms
large 913 ms 919 ms +0.7% 895 ms / 938 ms 891 ms / 942 ms

nuxt dev startup

nuxt dev from process spawn until each route responds with a 200 containing its expected content. Routes are requested in order, so later routes measure the first request to a page not yet transformed. Cold runs delete .nuxt and node_modules/.cache first; warm runs keep them. Median of 5 interleaved runs after one warmup.

Fixture / mode / metric baseline median head median delta baseline min / max head min / max
minimal / cold / start to first / 2.95 s 2.97 s +0.8% 2.92 s / 3.01 s 2.97 s / 3.06 s
minimal / warm / start to first / 2.86 s 2.86 s +0.0% 2.84 s / 2.89 s 2.82 s / 2.89 s
large / cold / start to first / 5.03 s 4.99 s -0.8% 5.02 s / 5.09 s 4.96 s / 5.05 s
large / cold / then /catalog/3 58 ms 66 ms +12.7% 57 ms / 60 ms 59 ms / 70 ms
large / cold / then /table 184 ms 183 ms -0.8% 182 ms / 186 ms 175 ms / 196 ms
large / cold / then /table/plain 29 ms 29 ms +0.4% 28 ms / 29 ms 28 ms / 30 ms
large / warm / start to first / 4.81 s 4.87 s +1.3% 4.78 s / 4.90 s 4.73 s / 4.97 s
large / warm / then /catalog/3 57 ms 56 ms -0.3% 56 ms / 57 ms 56 ms / 65 ms
large / warm / then /table 178 ms 180 ms +1.1% 175 ms / 182 ms 172 ms / 185 ms
large / warm / then /table/plain 28 ms 30 ms +7.2% 27 ms / 29 ms 28 ms / 40 ms

Dev server updates

Time from writing a change to a component until a dev server SSR response for / contains it, polling every 5 ms. Both dev servers run side by side and edits alternate between them. Median of 20 edits after one warmup edit.

Fixture (edited file) baseline median head median delta baseline min / max head min / max
minimal (app/app.vue) 28 ms 29 ms +0.0% 23 ms / 62 ms 23 ms / 65 ms
large (app/components/base/Item0.vue) 71 ms 71 ms -0.5% 65 ms / 410 ms 64 ms / 968 ms

nuxt build

Wall time of nuxt build with .nuxt, .output and node_modules/.cache deleted before each run. Median of 3 interleaved runs.

Fixture baseline median head median delta baseline min / max head min / max
minimal 4.53 s 4.55 s +0.5% 4.47 s / 4.70 s 4.45 s / 4.62 s
large 10.97 s 10.91 s -0.5% 10.90 s / 10.99 s 10.81 s / 10.92 s

Output of the last build of each target.

Fixture / output baseline head delta
minimal / client JS 143.0 kB 143.0 kB 0.0%
minimal / client JS (gzip) 53.6 kB 53.6 kB 0.0%
minimal / client JS files 3 3 0.0%
minimal / client CSS 4.5 kB 4.5 kB 0.0%
minimal / server output, excluding node_modules 694.0 kB 694.0 kB 0.0%
minimal / server node_modules 327.1 kB 327.1 kB 0.0%
large / client JS 416.4 kB 416.4 kB 0.0%
large / client JS (gzip) 182.4 kB 182.4 kB 0.0%
large / client JS files 241 241 0.0%
large / client CSS 0 B 0 B 0%
large / server output, excluding node_modules 1.58 MB 1.58 MB +0.1%
large / server node_modules 458.7 kB 458.7 kB 0.0%

Production SSR throughput

Requests per second against the production server (node .output/server/index.mjs), 8 concurrent connections for 2 s per round, after 300 warmup requests. Both servers run side by side and rounds alternate between them. Median of 5 rounds; latency is the median of each round's median.

Fixture / route baseline req/s head req/s delta baseline min / max head min / max baseline latency head latency
minimal / / 1846 1770 -4.1% 1607 / 1927 1598 / 1860 4.0 ms 4.2 ms
large / / 376 377 +0.2% 358 / 387 349 / 393 21 ms 19 ms
large / /catalog/3 387 381 -1.5% 381 / 392 364 / 384 20 ms 20 ms
large / /table 50 50 +0.5% 49 / 51 48 / 50 157 ms 158 ms
large / /table/plain 196 200 +2.2% 190 / 198 192 / 204 39 ms 38 ms

Initial page weight

Gzipped size of what each server-rendered route asks the browser to load before hydration: the entry script and every modulepreload, the stylesheets, and the HTML itself. Measured once from the last production build of each target. Apart from a few bytes of HTML that vary with the build id, these sizes are deterministic.

Fixture / route / asset baseline head delta
minimal / / / JS 48.6 kB 48.6 kB 0.0%
minimal / / / JS files 1 1 0.0%
minimal / / / CSS 0 B 0 B 0%
minimal / / / CSS files 0 0 0%
minimal / / / HTML 605 B 602 B -0.5%
minimal / all client JS 53.6 kB 53.6 kB 0.0%
minimal / all client JS files 3 3 0.0%
large / / / JS 85.2 kB 85.2 kB 0.0%
large / / / JS files 14 14 0.0%
large / / / CSS 0 B 0 B 0%
large / / / CSS files 0 0 0%
large / / / HTML 939 B 936 B -0.3%
large / /catalog/3 / JS 85.3 kB 85.3 kB 0.0%
large / /catalog/3 / JS files 15 15 0.0%
large / /catalog/3 / CSS 0 B 0 B 0%
large / /catalog/3 / CSS files 0 0 0%
large / /catalog/3 / HTML 957 B 954 B -0.3%
large / /table / JS 83.5 kB 83.5 kB 0.0%
large / /table / JS files 9 9 0.0%
large / /table / CSS 0 B 0 B 0%
large / /table / CSS files 0 0 0%
large / /table / HTML 31.7 kB 31.7 kB +0.0%
large / /table/plain / JS 83.5 kB 83.5 kB 0.0%
large / /table/plain / JS files 9 9 0.0%
large / /table/plain / CSS 0 B 0 B 0%
large / /table/plain / CSS files 0 0 0%
large / /table/plain / HTML 31.5 kB 31.5 kB +0.0%
large / all client JS 182.4 kB 182.4 kB 0.0%
large / all client JS files 241 241 0.0%
ui / / / JS 177.7 kB 177.7 kB 0.0%
ui / / / JS files 18 18 0.0%
ui / / / CSS 25.9 kB 25.9 kB 0.0%
ui / / / CSS files 1 1 0.0%
ui / / / HTML 14.6 kB 14.6 kB 0.0%
ui / /blog / JS 177.0 kB 177.0 kB 0.0%
ui / /blog / JS files 18 18 0.0%
ui / /blog / CSS 25.9 kB 25.9 kB 0.0%
ui / /blog / CSS files 1 1 0.0%
ui / /blog / HTML 9.0 kB 9.0 kB 0.0%
ui / all client JS 224.1 kB 224.1 kB 0.0%
ui / all client JS files 29 29 0.0%

Interleaved runs on a shared runner. Counts are flagged on any change, client JS sizes from 0.1% and install or server sizes from 1%; timings only from 5% and when the medians fall outside each other's min / max range. Run locally with pnpm bench.

@danielroe
danielroe merged commit b2c2307 into 4.x Nov 4, 2026
63 of 65 checks passed
@danielroe
danielroe deleted the feat/devtools-onboard-v4 branch November 4, 2026 22:34
This was referenced Nov 4, 2026
@github-actions github-actions Bot mentioned this pull request Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4.x ⚡ performance Performance degradation or optimization opportunity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants