Skip to content

perf(nuxi): do not bundle jiti - #1409

Merged
danielroe merged 2 commits into
mainfrom
perf/nuxi-jiti
Jul 29, 2026
Merged

perf(nuxi): do not bundle jiti#1409
danielroe merged 2 commits into
mainfrom
perf/nuxi-jiti

Conversation

@danielroe

Copy link
Copy Markdown
Member

🔗 Linked issue

📚 Description

this makes jiti an optional peer dependency of nuxi, so we use it if the project has it installed; otherwise we give a tip to install.

(it's only used in nuxi info command)

@pkg-pr-new

pkg-pr-new Bot commented Jul 29, 2026

Copy link
Copy Markdown
  • nuxt-cli-playground

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

commit: b0a61e0

@coderabbitai

coderabbitai Bot commented Jul 29, 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: c76e8ffc-33a0-4a6e-b3bb-a196df088784

📥 Commits

Reviewing files that changed from the base of the PR and between f12dd85 and b0a61e0.

📒 Files selected for processing (2)
  • packages/nuxi/package.json
  • packages/nuxt-cli/src/utils/nuxt-config.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/nuxt-cli/src/utils/nuxt-config.ts

📝 Walkthrough

Walkthrough

The nuxi package declares jiti as an optional peer dependency. Nuxt configuration loading now retries loader-required imports through jiti, resolves it from the project when necessary, preserves the original failure cause, and warns through consola when loading ultimately fails.

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

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% 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
Title check ✅ Passed The title matches the main change: jiti is no longer bundled and is treated as an optional dependency.
Description check ✅ Passed The description accurately describes making jiti optional and suggesting installation when missing.
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.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch perf/nuxi-jiti

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 Jul 29, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 2 untouched benchmarks


Comparing perf/nuxi-jiti (b0a61e0) with main (4360712)

Open in CodSpeed

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/nuxt-cli/src/utils/nuxt-config.ts`:
- Around line 44-48: Update the catch block around importConfigWithJiti to
normalize arbitrary thrown values before logging: use the Error message for
Error instances and String(error) otherwise, ensuring consola.warn never
displays undefined for non-Error failures.
- Around line 85-94: Update the dynamic import fallback around createJiti so it
only resolves jiti from rootDir when the original import failure indicates the
jiti package is missing. Re-throw all other load or dependency failures
unchanged, and preserve the existing missing-package hint and fallback import
path for the absent-module case.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 38c3a208-6909-436a-a8c7-d2d4973f3502

📥 Commits

Reviewing files that changed from the base of the PR and between 4360712 and f12dd85.

📒 Files selected for processing (2)
  • packages/nuxi/package.json
  • packages/nuxt-cli/src/utils/nuxt-config.ts

Comment thread packages/nuxt-cli/src/utils/nuxt-config.ts Outdated
Comment thread packages/nuxt-cli/src/utils/nuxt-config.ts Outdated
@danielroe
danielroe merged commit abc51da into main Jul 29, 2026
19 checks passed
@danielroe
danielroe deleted the perf/nuxi-jiti branch July 29, 2026 21:13
@github-actions github-actions Bot mentioned this pull request Jul 29, 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