Skip to content
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

Conversation

dsherret
Copy link
Member

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.

@bartlomieju
Copy link
Member

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.

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.

dsherret added a commit that referenced this pull request Mar 13, 2023
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.
@dsherret dsherret marked this pull request as ready for review March 13, 2023 15:13
Copy link
Member

@bartlomieju bartlomieju left a 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

Comment on lines +289 to +292
// 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());
Copy link
Member

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!

@dsherret dsherret enabled auto-merge (squash) March 13, 2023 18:14
@dsherret dsherret merged commit 44b0d4c into denoland:main Mar 13, 2023
9 checks passed
kt3k pushed a commit that referenced this pull request Mar 16, 2023
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.
kt3k pushed a commit that referenced this pull request Mar 16, 2023
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants