perf(cli): optimize npm package version fetching#14604
perf(cli): optimize npm package version fetching#14604Magnus1X wants to merge 1 commit intotauri-apps:devfrom
Conversation
Package Changes Through 85e7151There are 2 changes which include tauri-macos-sign with patch, tauri-bundler with patch Planned Package VersionsThe following package releases are the planned based on the context of changes in this pull request.
Add another change file through the GitHub UI by following this link. Read about change files or the docs at github.com/jbolda/covector |
|
I am dobtful with this really improved performance, and memory side
|
Legend-Master
left a comment
There was a problem hiding this comment.
Thanks for contributing! Do you mind also adding a change file?
https://github.com/tauri-apps/tauri/blob/dev/.changes/README.md
I am dobtful with this really improved performance, and memory side
This is mainly for batching the package manager calls through migrating to current_package_versions, that plays a much bigger role in terms of performance so I think this is worth while the trade offs
| version: Option<String>, | ||
| frontend_dir: PathBuf, | ||
| package_manager: PackageManager, | ||
| current_version: Option<semver::Version>, |
There was a problem hiding this comment.
Is there any differences between this and the version parameter above?
| let mut packages = vec![("@tauri-apps/api", None)]; | ||
| if let Some(cli) = &metadata.js_cli.version { | ||
| packages.push(("@tauri-apps/cli", Some(cli.clone()))); | ||
| } |
There was a problem hiding this comment.
This change doesn't really do anything, please revert
Description
This PR optimizes the
tauri infocommand by batching npm package version checks. Previously, the CLI spawned a new process for each package to check its version, which could be slow.What’s changed
crates/tauri-cli/src/info/packages_nodejs.rsandcrates/tauri-cli/src/info/plugins.rsto usecurrent_package_versions.Why
This change significantly reduces the overhead of running
tauri info, especially in projects with many plugins, by minimizing the number of shell commands executed. This results in a faster and more responsive CLI experience.