Skip to content

perf: update local-pkg to v2 - #572

Merged
atinux merged 1 commit into
nuxt:mainfrom
onmax:perf/local-pkg-v2
Nov 5, 2026
Merged

atinux merged 1 commit into
nuxt:mainfrom
onmax:perf/local-pkg-v2

Conversation

@onmax

@onmax onmax commented Nov 4, 2026

Copy link
Copy Markdown
Member

🔗 Linked issue

Replaces #568.

📚 Description

hasFullCollection checks if @iconify/json is installed, from every layer root, once per collection. With local-pkg 1, a missing package costs hundreds of statSync calls per path. In an app with 20 layers that was about 70,000 calls per build, or 123,000 with externalizeIconsJson.

local-pkg 2.0.0 includes antfu-collective/local-pkg#23, so the same build makes no statSync calls. v2 is ESM only and needs Node 20.19, which @nuxt/kit already requires.

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedlocal-pkg@​2.0.01001008583100

View full report

@onmax
onmax marked this pull request as ready for review November 4, 2026 13:56
@pkg-pr-new

pkg-pr-new Bot commented Nov 4, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/@nuxt/icon@572

commit: 8f52d34

@coderabbitai

coderabbitai Bot commented Nov 4, 2026

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The package manifest updates the local-pkg dependency range from ^1.2.1 to ^2.0.0.

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

Merge Risk: Minimal · up to 8f52d

No actionable merge-blocking risk was identified in this dependency update.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title states a performance update of the local-pkg dependency to v2. The changeset bumps local-pkg from ^1.2.1 to ^2.0.0 in package.json, and the description links this to fewer statSync calls. Th…
Description check Passed The description explains the reason for the change. It cites excess statSync calls from hasFullCollection when local-pkg 1 checks for a missing @iconify/json package. It links the fix to local-pkg 2.0…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
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: Title check

Explanation

The title states a performance update of the local-pkg dependency to v2. The changeset bumps local-pkg from ^1.2.1 to ^2.0.0 in package.json, and the description links this to fewer statSync calls. The title is specific and matches the main change. Its prefix is a conventional commit type (perf), which fits the stated intent.

Full details: Description check

Explanation

The description explains the reason for the change. It cites excess statSync calls from hasFullCollection when local-pkg 1 checks for a missing @iconify/json package. It links the fix to local-pkg 2.0.0 and notes the ESM-only change and the Node 20.19 requirement. This relates directly to the single package.json change.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

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

Warning

Some tools did not complete. Review the errors below.

ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install timed out. The project may have too many dependencies for the sandbox.

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
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 96f0644b-9cc9-475e-a548-1f6462acd2c1
Commits

Reviewing files that changed from the base of the PR and between 205afe2 and 8f52d34.

Files ignored due to path filters: 1
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
Files selected for processing: 1
  • package.json

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

@atinux atinux left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you!

@atinux
atinux merged commit be96b44 into nuxt:main Nov 5, 2026
5 checks passed
@github-actions github-actions Bot mentioned this pull request Nov 5, 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