Skip to content

perf(devtools): trim @nuxt/devtools runtime dependencies - #1066

Merged
antfu merged 2 commits into
mainfrom
chore/reduce-runtime-deps
Aug 20, 2026
Merged

perf(devtools): trim @nuxt/devtools runtime dependencies#1066
antfu merged 2 commits into
mainfrom
chore/reduce-runtime-deps

Conversation

@antfubot

@antfubot antfubot commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

Reduces the runtime dependency surface and install footprint of @nuxt/devtools by consolidating onto devframe's built-in utilities and pruning deps that are unused or client-only.

Dropped from the runtime tree (consolidated onto devframe / node built-ins)

  • sirvdevframe/utils/serve-static's serveStaticNodeMiddleware, an explicit drop-in for the analyze-dir and production client static middleware.
  • ohashdevframe/utils/hash (which bundles the same ohash internally). Output is byte-identical, so existing cached local-options keys keep resolving.
  • launch-editordevframe/utils/launch-editor's launchEditor (same file:line:column target + optional editor override).
  • tinyexecnode:child_process execFile for the small analyze-build git helper.
  • ws → removed; declared but never imported.
  • birpc → removed; only referenced in a comment (unused).

devframe is promoted to a direct dependency (already present transitively via @vitejs/devtools*), so the net top-level runtime dep count drops. The unused root tinyexec / @types/ws devDependencies are removed too, and orphaned catalog entries are pruned.

Moved to devDependencies (client-only, pre-bundled)

  • structured-clone-es — used only by StateEditor.vue (with { lossy: true }, which native structuredClone can't replicate), so it belongs alongside the other client-only libs in devDependencies, not the module's runtime deps.

Out of scope (intentionally kept)

  • devtools-kit keeps tinyexec (its documented public subprocess API) and birpc (its public BirpcGroup type).
  • The module-starter playground keeps sirv (legacy module-author API demo).

Verification

  • pnpm lint
  • pnpm typecheck
  • pnpm test:unit ✅ (67 passed)
  • pnpm -C packages/devtools build:module ✅ (devframe utils correctly externalized in dist)
  • pnpm knip no longer flags any of the removed deps ✅
  • frozen-lockfile install consistent ✅

This PR was created with the help of an agent.

…e deps

Consolidate on devframe's built-in utilities instead of shipping
overlapping standalone dependencies:

- serve static assets via devframe/utils/serve-static
- hash local-options / asset keys via devframe/utils/hash (byte-identical
  to the previous ohash output, so existing cached keys keep resolving)
- open files in the editor via devframe/utils/launch-editor
- run the analyze-build git helper via node:child_process
- ws was declared but never imported

devtools-kit keeps tinyexec (its documented subprocess API) and the
module-starter playground keeps sirv (legacy-API demo).
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Aug 19, 2026

Copy link
Copy Markdown

Deploying nuxt-devtools with  Cloudflare Pages  Cloudflare Pages

Latest commit: cf43d05
Status: ✅  Deploy successful!
Preview URL: https://be5958df.nuxt-devtools.pages.dev
Branch Preview URL: https://chore-reduce-runtime-deps.nuxt-devtools.pages.dev

View logs

@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1d11cfe8-d13a-4d96-87c8-55cab421bd3d

📥 Commits

Reviewing files that changed from the base of the PR and between 636f152 and cf43d05.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (1)
  • packages/devtools/package.json

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

The change removes unused workspace and package dependencies. DevTools now uses devframe/utils/hash for hashing, serveStaticNodeMiddleware for static assets, and devframe/utils/launch-editor for editor launching. Git commands now use Node’s promisified execFile with the repository root as the working directory.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to cf43d

This PR reduces runtime dependencies while preserving the reported build and test behavior; no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the main change: reducing @nuxt/devtools runtime dependencies.
Description check ✅ Passed The description directly explains the dependency replacements, removals, scope, and verification results.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/reduce-runtime-deps

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

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…vDeps

- birpc was declared but only referenced in a comment (devtools-kit keeps
  it for its public BirpcGroup type).
- structured-clone-es is only used by the pre-bundled client
  (StateEditor.vue), so it belongs in devDependencies alongside the other
  client-only libs rather than the module's runtime dependencies.
@antfubot antfubot changed the title perf(devtools): drop launch-editor, ws, sirv, tinyexec & ohash runtime deps perf(devtools): trim @nuxt/devtools runtime dependencies Aug 19, 2026
@antfu
antfu merged commit ca107e5 into main Aug 20, 2026
5 of 6 checks passed
@antfu
antfu deleted the chore/reduce-runtime-deps branch August 20, 2026 01:47
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