Skip to content

feat(build,dev): add --profile support#1243

Open
danielroe wants to merge 6 commits intomainfrom
feat/profile-2
Open

feat(build,dev): add --profile support#1243
danielroe wants to merge 6 commits intomainfrom
feat/profile-2

Conversation

@danielroe
Copy link
Member

🔗 Linked issue

📚 Description

paired with nuxt/nuxt#34468 - this allows enabling profiling nuxt builds with a new --profile flag

@github-actions
Copy link
Contributor

github-actions bot commented Mar 9, 2026

📦 Bundle Size Comparison

📈 nuxi

Metric Base Head Diff
Rendered 3375.70 KB 3699.01 KB +323.31 KB (+9.58%)

📈 nuxt-cli

Metric Base Head Diff
Rendered 138.80 KB 142.22 KB +3.42 KB (+2.47%)

➡️ create-nuxt

Metric Base Head Diff
Rendered 1645.98 KB 1645.98 KB 0.00 KB (0.00%)

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 9, 2026

  • nuxt-cli-playground

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

commit: cd04391

@codspeed-hq
Copy link

codspeed-hq bot commented Mar 9, 2026

Merging this PR will not alter performance

✅ 2 untouched benchmarks


Comparing feat/profile-2 (cd04391) with main (77f8619)

Open in CodSpeed

@coderabbitai
Copy link

coderabbitai bot commented Mar 9, 2026

Warning

Rate limit exceeded

@danielroe has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 24 minutes and 7 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 122ebeac-dd04-4d39-8a21-d073c44c279c

📥 Commits

Reviewing files that changed from the base of the PR and between 338aebf and cd04391.

📒 Files selected for processing (6)
  • packages/nuxi/bin/nuxi.mjs
  • packages/nuxi/src/commands/build.ts
  • packages/nuxi/src/dev/index.ts
  • packages/nuxi/src/utils/profile.ts
  • packages/nuxt-cli/bin/nuxi.mjs
  • types.d.ts
📝 Walkthrough

Walkthrough

Adds a new exported profileArgs in packages/nuxi/src/commands/_shared.ts that defines a --profile CLI option. The option is spread into build, dev, and generate command argument sets. Runtime handling is added: commands compute a perfValue from the profile argument (distinguishing verbose vs other truthy values) and inject debug.perf into Nitro/DevServer overrides when profiling is requested. NuxtDevContext.args is extended with an optional profile?: string | boolean.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 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 (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat(build,dev): add --profile support' clearly and concisely describes the main change: adding a new --profile flag for profiling support across build and dev commands.
Description check ✅ Passed The description is related to the changeset, mentioning the --profile flag and its purpose. However, it lacks specificity and references a linked issue placeholder without an actual issue number.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/profile-2

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 and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/nuxi/src/commands/build.ts`:
- Around line 67-68: The issue is that spreading ctx.data?.overrides after
adding { debug: { perf: perfValue } } replaces any existing overrides.debug and
can silently discard --profile; fix by merging the debug objects instead of
replacing them: build a merged debug object from ctx.data?.overrides?.debug and
the new perf entry (e.g. merge existing debug first, then add perf if perfValue)
and then spread that merged debug into the final options while still spreading
the rest of ctx.data?.overrides; update the construction that currently uses
...(perfValue && { debug: { perf: perfValue } }), ...ctx.data?.overrides to use
the merged debug so both existing debug keys and the perf flag are preserved.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 91ef465f-202c-404a-a1ca-c975b68814e6

📥 Commits

Reviewing files that changed from the base of the PR and between 914cac7 and 338aebf.

📒 Files selected for processing (3)
  • packages/nuxi/src/commands/_shared.ts
  • packages/nuxi/src/commands/build.ts
  • packages/nuxi/src/dev/index.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/nuxi/src/dev/index.ts
  • packages/nuxi/src/commands/_shared.ts

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