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
fix(npm): show a progress bar when initializing the node_modules folder #18136
fix(npm): show a progress bar when initializing the node_modules folder #18136
Conversation
While you're working on it, could you also change the progress bar to be lazy-initiated (ie. on the first usage), it shows up on startup flamegraphs even though it's not used. |
This has been bothering me for a while and it became more painful while working on #18136 because injecting the shared progress bar became very verbose. Basically we should move the creation of all these npm structs up to a higher level. This is a stepping stone for a future refactor where we can improve how we create all our structs.
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.
LGTM, checked locally works really nicely
// only check if progress bars are supported once we go | ||
// to update so that we lazily initialize the progress bar | ||
if ProgressBar::are_supported() { | ||
let entry = self.inner.add_entry(kind, msg.to_string()); |
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.
Nice, thanks for fixing this!
This has been bothering me for a while and it became more painful while working on #18136 because injecting the shared progress bar became very verbose. Basically we should move the creation of all these npm structs up to a higher level. This is a stepping stone for a future refactor where we can improve how we create all our structs.
…er (#18136) Creating the node_modules folder when the packages are already downloaded can take a bit of time and not knowing what is going on can be confusing. It's better to show a progress bar.
Creating the node_modules folder when the packages are already downloaded can take a bit of time and not knowing what is going on can be confusing. It's better to show a progress bar.
2023-03-11_16-24-55.mp4
Note: Right now this does not look good when a package gets downloaded at the same time. I'll refactor the progress bars on Monday.