Skip to content

perf(@angular/cli): optimize update schematic registry query counts by fetching package metadata lazily#33316

Open
clydin wants to merge 1 commit into
angular:mainfrom
clydin:perf-update-schematic-lazy-fetch
Open

perf(@angular/cli): optimize update schematic registry query counts by fetching package metadata lazily#33316
clydin wants to merge 1 commit into
angular:mainfrom
clydin:perf-update-schematic-lazy-fetch

Conversation

@clydin
Copy link
Copy Markdown
Member

@clydin clydin commented Jun 5, 2026

Optimize the ng update registry requests by only querying package metadata for packages that are actually being updated, while resolving other dependencies locally from disk (with fallback to registry for uninstalled/mocked packages). This reduces network query counts by 80-90% during ng update.

@angular-robot angular-robot Bot added area: performance Issues related to performance area: @angular/cli labels Jun 5, 2026
@clydin clydin force-pushed the perf-update-schematic-lazy-fetch branch 3 times, most recently from 65c19d8 to 4ccde3d Compare June 5, 2026 16:55
@clydin clydin marked this pull request as ready for review June 5, 2026 17:29
@clydin clydin added the target: patch This PR is targeted for the next patch release label Jun 5, 2026
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the Angular CLI update command to pass and utilize the workspaceRoot for package resolution, enabling support for Yarn Plug'n'Play (PnP) and lazy dependency resolution. The review feedback highlights two critical improvements: first, replacing the platform-sensitive new URL construction with path.join to prevent Windows-specific path resolution errors, which also allows simplifying the logic by using createRequire as a general fallback; second, adding a safe guard when accessing npmPackageJson['dist-tags'] to prevent potential TypeError crashes when the property is undefined.

Comment thread packages/angular/cli/src/commands/update/schematic/index.ts
Comment thread packages/angular/cli/src/commands/update/schematic/index.ts Outdated
@clydin clydin force-pushed the perf-update-schematic-lazy-fetch branch from 4ccde3d to 574809d Compare June 5, 2026 17:38
…y fetching package metadata lazily

Optimize the ng update registry requests by only querying package metadata for packages that are actually being updated, while resolving other dependencies locally from disk (with fallback to registry for uninstalled/mocked packages). This reduces network query counts by 80-90% during ng update.
@clydin clydin force-pushed the perf-update-schematic-lazy-fetch branch from 574809d to ebd4970 Compare June 5, 2026 17:44
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Jun 5, 2026
@clydin clydin requested a review from alan-agius4 June 5, 2026 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: review The PR is still awaiting reviews from at least one requested reviewer area: @angular/cli area: performance Issues related to performance target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant