Skip to content

feat(analyze): serve the Vue SSR bundle stats - #1625

Closed
Q16solver wants to merge 1 commit into
nuxt:mainfrom
Q16solver:feat/analyze-ssr-stats
Closed

Q16solver wants to merge 1 commit into
nuxt:mainfrom
Q16solver:feat/analyze-ssr-stats

Conversation

@Q16solver

Copy link
Copy Markdown

🔗 Linked issue

Pairs with nuxt/nuxt#36630.

📚 Description

On Nuxt 5 the server builds as two Vite environments, ssr (the Vue renderer) and nitro. With nuxt/nuxt#36630, nuxt analyze writes a report for each, ssr.html and nitro.html, beside client.html. The stats server only knew /client and /nitro, so the SSR report was written but never served.

This adds /ssr to the served reports and links it from the index. On a Nuxt version that doesn't write ssr.html, the route answers with the existing This report was not generated by the analyze build. response, the same as /nitro does today.

pnpm exec vitest run packages/nuxt-cli/test/unit/commands/analyze.spec.ts passes (8/8), and eslint is clean on the file.

🤖 Generated with Claude Code

Nuxt builds its Vue server renderer as a separate `ssr` Vite environment
beside `nitro`, and its analyze plugin writes `ssr.html` for it beside
`client.html` and `nitro.html` (nuxt/nuxt fix linked in the PR). The stats
server now serves it at `/ssr` and links it from the index.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

CLI benchmark

@nuxt/cli v4.0.1 (baseline) vs v4.0.1 (this PR)

Metric baseline v4.0.1 head v4.0.1 Delta
nuxt --version wall time (median) 54 ms 52 ms -3.1%
nuxt --help wall time (median) 105 ms 108 ms +2.6%
nuxt dev --help wall time (median) 85 ms 84 ms -1.3%
nuxt --version modules loaded 35 35 0.0%
nuxt --version built-ins loaded 29 29 0.0%
nuxt --help modules loaded 135 135 0.0%
nuxt --help built-ins loaded 90 90 0.0%
nuxt dev --help modules loaded 64 64 0.0%
nuxt dev --help built-ins loaded 90 90 0.0%
Installed node_modules 2.46 MB 2.46 MB +0.0%
Published tarball (packed) 241.5 kB 241.5 kB +0.0%
Full report

@nuxt/cli v4.0.1 (baseline) vs v4.0.1 (head)

Setting Value
Baseline ref:ad8153ae532df2ed07bf6fd84d8f5ae1e766532f (v4.0.1)
Head local packages/nuxt-cli at 28d3608 (v4.0.1)
Node v24.22.0
OS Linux 6.17.0 (kernel 6.17.0-1022-azure)
CPU INTEL(R) XEON(R) PLATINUM 8573C x 4
Memory 15.6 GB
Load average at start 0.92, 0.28, 0.10
Run started 2026-10-18T02:36:44.004Z

Cold CLI startup

Median of 15 interleaved runs per command, one warmup discarded.

Command baseline v4.0.1 median head v4.0.1 median Delta baseline v4.0.1 min / p95 head v4.0.1 min / p95
nuxt --version 54 ms 52 ms -3.1% 51 ms / 57 ms 49 ms / 58 ms
nuxt --version (first output byte) 51 ms 49 ms -3.4% 48 ms / 54 ms 47 ms / 55 ms
nuxt --help 105 ms 108 ms +2.6% 100 ms / 110 ms 102 ms / 113 ms
nuxt --help (first output byte) 102 ms 105 ms +3.2% 97 ms / 106 ms 99 ms / 110 ms
nuxt dev --help 85 ms 84 ms -1.3% 79 ms / 89 ms 79 ms / 87 ms
nuxt dev --help (first output byte) 82 ms 81 ms -1.4% 76 ms / 86 ms 76 ms / 84 ms
nuxt &lt;unknown-command> (no-op) 115 ms 115 ms -0.5% 110 ms / 122 ms 108 ms / 124 ms
nuxt &lt;unknown-command> (no-op) (first output byte) 111 ms 111 ms -0.1% 107 ms / 118 ms 104 ms / 120 ms

Module load cost

Counted with a module.registerHooks load hook, compile cache disabled. Counts every JS module actually evaluated on that code path (native addons excluded). Built-ins loaded after bootstrap are counted separately, including the internal modules they load.

Command baseline v4.0.1 modules head v4.0.1 modules Delta baseline v4.0.1 source bytes head v4.0.1 source bytes Delta baseline v4.0.1 built-ins head v4.0.1 built-ins Delta
nuxt --version 35 35 0.0% 298.0 kB 298.0 kB 0.0% 29 29 0.0%
nuxt --help 135 135 0.0% 847.7 kB 847.9 kB +0.0% 90 90 0.0%
nuxt dev --help 64 64 0.0% 455.5 kB 455.5 kB 0.0% 90 90 0.0%

Install footprint and published tarball

Each version installed on its own into an empty project with nothing but @nuxt/cli as a dependency, so the tree is exactly the CLI and its transitive dependencies. npm cache is warm and the registry is only consulted for metadata, so install wall time is indicative, not a network benchmark.

Metric baseline v4.0.1 head v4.0.1 Delta
Direct dependencies of @nuxt/cli 23 23 0.0%
Packages in the installed tree (unique name@version) 39 39 0.0%
Unique package names 39 39 0.0%
Package directories on disk (cross-check) 32 32 0.0%
Installed node_modules on disk 2.46 MB 2.46 MB +0.0%
Installed files 436 436 0.0%
Install wall time (warm npm cache, median of 3) 1.02 s 1.03 s +0.6%
Published tarball (packed) 241.5 kB 241.5 kB +0.0%
Published tarball (unpacked) 783.9 kB 784.0 kB +0.0%
Files in tarball 101 101 0.0%

Interleaved runs on a shared runner: trust the deltas, not the absolute timings. The dev, restart and build suites run locally via pnpm bench:cli.

@pkg-pr-new

pkg-pr-new Bot commented Oct 18, 2026

Copy link
Copy Markdown
  • nuxt-cli-playground

    npm i https://pkg.pr.new/create-nuxt@1625
    
    npm i https://pkg.pr.new/nuxi@1625
    
    npm i https://pkg.pr.new/@nuxt/cli@1625
    

commit: 6e9f553

@coderabbitai

coderabbitai Bot commented Oct 18, 2026

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 28eb6dc5-764b-4b1c-a366-c1e81e4988c0
📥 Commits

Reviewing files that changed from the base of the PR and between ad8153a and 6e9f553.

📒 Files selected for processing: 1
  • packages/nuxt-cli/src/commands/analyze.ts

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

📝 Walkthrough

The analysis index now links to Vue SSR bundle stats. The stats server maps /ssr to ssr.html. If the report is missing, the existing handler returns 404.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to 6e9f5

The SSR report link follows the analyzer’s optional-report pattern; if a build does not generate the report, users receive an explanatory 404. No actionable merge-blocking risk remains.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly and concisely identifies the main change: serving Vue SSR bundle statistics in the analyze command.
Description check Passed The description directly explains the /ssr route, index link, missing-report behavior, related issue, and validation results.
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
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.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@codecov-commenter

codecov-commenter commented Oct 18, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@ad8153a). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1625   +/-   ##
=======================================
  Coverage        ?   84.14%           
=======================================
  Files           ?      181           
  Lines           ?    11591           
  Branches        ?     3319           
=======================================
  Hits            ?     9753           
  Misses          ?     1548           
  Partials        ?      290           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codspeed

codspeed Bot commented Oct 18, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

⚠️ 2 benchmarks spent significant time in system calls

System calls cannot be consistently instrumented, so they are not included in the measure, which understates the real cost. Please switch to the Walltime instrument to accurately measure system calls.

Measurement and system calls

✅ 2 untouched benchmarks


Comparing Q16solver:feat/analyze-ssr-stats (6e9f553) with main (ad8153a)

Open in CodSpeed

@Q16solver Q16solver closed this Oct 18, 2026
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