-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
perf(cli): optimize npm package version fetching #14604
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.