Skip to content

fix(dev): time startup phases + stop hook names leaking into labels - #1495

Merged
danielroe merged 1 commit into
mainfrom
fix/phase-visibility
Aug 25, 2026
Merged

fix(dev): time startup phases + stop hook names leaking into labels#1495
danielroe merged 1 commit into
mainfrom
fix/phase-visibility

Conversation

@danielroe

Copy link
Copy Markdown
Member

🔗 Linked issue

📚 Description

testing the new cli on npmx.dev, 33s of a 41s startup sat on Generating types

this PR gives every phase its own timer + ignores any hook that was already running when the phase began. hook names themselves are mapped to labels (modules:done to finishing module setup, nitro:rollup:before to bundling the server, and so on) and anything in a Nuxt/Nitro/bundler namespace without a label isn't narrated at all; a hook outside those namespaces still shows ...

two smaller things:

  • Setting up modules counts what has installed (setting up modules · 4 installed) - and when v4.6 ships, we'll get module names too.
  • the spinner only repaints the line when its text changes.

@pkg-pr-new

pkg-pr-new Bot commented Aug 25, 2026

Copy link
Copy Markdown
  • nuxt-cli-playground

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

commit: 0d91904

@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

CLI benchmark

@nuxt/cli v4.0.0-alpha.0 (baseline) vs v4.0.0-alpha.0 (this PR)

Metric baseline v4.0.0-alpha.0 head v4.0.0-alpha.0 Delta
nuxt --version wall time (median) 70 ms 70 ms +0.9%
nuxt --help wall time (median) 145 ms 144 ms -0.3%
nuxt dev --help wall time (median) 110 ms 113 ms +2.0%
nuxt --version modules loaded 38 38 0.0%
nuxt --help modules loaded 134 134 0.0%
nuxt dev --help modules loaded 79 79 0.0%
Installed node_modules 2.35 MB 2.36 MB +0.2%
Published tarball (packed) 277.9 kB 279.7 kB +0.6%
Full report

@nuxt/cli v4.0.0-alpha.0 (baseline) vs v4.0.0-alpha.0 (head)

Setting Value
Baseline ref:1b8752993b5d5cb59084443b84ce06d885f9219c (v4.0.0-alpha.0)
Head local packages/nuxt-cli at 46b7793 (v4.0.0-alpha.0)
Node v24.19.0
OS Linux 6.17.0 (kernel 6.17.0-1022-azure)
CPU AMD EPYC 9V74 80-Core Processor x 4
Memory 15.6 GB
Load average at start 0.93, 0.29, 0.10
Run started 2026-08-25T17:14:40.475Z

Cold CLI startup

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

Command baseline v4.0.0-alpha.0 median head v4.0.0-alpha.0 median Delta baseline v4.0.0-alpha.0 min / p95 head v4.0.0-alpha.0 min / p95
nuxt --version 70 ms 70 ms +0.9% 67 ms / 77 ms 68 ms / 74 ms
nuxt --version (first output byte) 65 ms 65 ms +0.1% 62 ms / 72 ms 63 ms / 69 ms
nuxt --help 145 ms 144 ms -0.3% 141 ms / 151 ms 138 ms / 162 ms
nuxt --help (first output byte) 138 ms 138 ms -0.4% 135 ms / 144 ms 132 ms / 154 ms
nuxt dev --help 110 ms 113 ms +2.0% 107 ms / 124 ms 108 ms / 118 ms
nuxt dev --help (first output byte) 104 ms 107 ms +2.6% 102 ms / 118 ms 102 ms / 112 ms
nuxt <unknown-command> (no-op) 156 ms 154 ms -1.3% 150 ms / 167 ms 150 ms / 162 ms
nuxt <unknown-command> (no-op) (first output byte) 150 ms 147 ms -1.7% 144 ms / 160 ms 144 ms / 155 ms

Module load cost

Counted with a module.registerHooks load hook, compile cache disabled. Counts every JS module actually evaluated on that code path (built-ins excluded, native addons excluded).

Command baseline v4.0.0-alpha.0 modules head v4.0.0-alpha.0 modules Delta baseline v4.0.0-alpha.0 source bytes head v4.0.0-alpha.0 source bytes Delta
nuxt --version 38 38 0.0% 298.1 kB 298.1 kB 0.0%
nuxt --help 134 134 0.0% 1002.9 kB 1007.6 kB +0.5%
nuxt dev --help 79 79 0.0% 604.3 kB 608.9 kB +0.8%

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.0-alpha.0 head v4.0.0-alpha.0 Delta
Direct dependencies of @nuxt/cli 21 21 0.0%
Packages in the installed tree (unique name@version) 34 34 0.0%
Unique package names 34 34 0.0%
Package directories on disk (cross-check) 28 28 0.0%
Installed node_modules on disk 2.35 MB 2.36 MB +0.2%
Installed files 418 418 0.0%
Install wall time (warm npm cache, median of 3) 712 ms 675 ms -5.2%
Published tarball (packed) 277.9 kB 279.7 kB +0.6%
Published tarball (unpacked) 960.5 kB 966.5 kB +0.6%
Files in tarball 130 130 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.

@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

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: 56024e1b-3ca5-4340-9a87-ae11ed777b3e

📥 Commits

Reviewing files that changed from the base of the PR and between d970997 and 0d91904.

⛔ Files ignored due to path filters (2)
  • capture/output/nuxt-dev-plain-restart.svg is excluded by !**/*.svg
  • capture/output/nuxt-dev-plain-static.svg is excluded by !**/*.svg
📒 Files selected for processing (2)
  • capture/output/nuxt-dev-plain-restart.txt
  • capture/output/nuxt-dev-plain-static.txt
🚧 Files skipped from review as they are similar to previous changes (1)
  • capture/output/nuxt-dev-plain-restart.txt

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

The startup progress system now tracks elapsed time for the current phase. DevProgress uses phase-aware hook labels, impatience thresholds, stale-hook filtering, and installed-module counts. Terminal reporters show phase and total elapsed time and optimize spinner redraws. The DevUI stores phase timing, restores it from progress snapshots, resets it across status changes, and displays it after 2.5 seconds. Tests cover narration, elapsed-time formatting, spinner updates, and TUI output.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Merge Risk: ⚪ Minimal · up to 0d919

This PR changes startup progress reporting and spinner output without any identified merge-blocking risk; it is ready to merge 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 47.37% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 19 functions across 14 files. (2 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main changes: timing startup phases and preventing hook names from leaking into labels.
Description check ✅ Passed The description directly explains the startup timing, hook filtering, module counts, and spinner repaint changes.
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

Docstring coverage is 47.37% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 19 functions across 14 files. (2 skipped: 2 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/phase-visibility

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.

@codspeed-hq

codspeed-hq Bot commented Aug 25, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 2 untouched benchmarks


Comparing fix/phase-visibility (0d91904) with main (1b87529)

Open in CodSpeed

@danielroe
danielroe force-pushed the fix/phase-visibility branch from 2ac8758 to 0d91904 Compare August 25, 2026 17:13
@danielroe
danielroe added this pull request to the merge queue Aug 25, 2026
Merged via the queue into main with commit 7c7bbb5 Aug 25, 2026
22 checks passed
@danielroe
danielroe deleted the fix/phase-visibility branch August 25, 2026 17:27
@github-actions github-actions Bot mentioned this pull request Aug 25, 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.

1 participant