perf(@angular/cli): avoid redundant package version resolution in ng add#32715
perf(@angular/cli): avoid redundant package version resolution in ng add#32715clydin merged 1 commit intoangular:mainfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request optimizes the ng add command by preventing redundant package version resolutions, ensuring subsequent operations use the exact resolved version and eliminating unnecessary registry lookups. However, the current implementation introduces a security risk by trusting the name and version fields from the package manifest to update the package identifier. This could lead to package substitution or path traversal attacks if a malicious manifest is provided. A validation check is required to ensure the manifest data aligns with the requested package.
c18d934 to
05c4898
Compare
The `ng add` command would previously resolve the package version from the registry multiple times during execution. This change updates the package identifier with the exact version from the manifest once it has been fetched from the registry, preventing subsequent redundant lookups. Additionally, the already-parsed package identifier is now passed directly to the package manager's `getManifest` method.
05c4898 to
7040590
Compare
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
The
ng addcommand would previously resolve the package version from the registry multiple times during execution. This change updates the package identifier with the exact version from the manifest once it has been fetched from the registry, preventing subsequent redundant lookups. Additionally, the already-parsed package identifier is now passed directly to the package manager'sgetManifestmethod.