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

Prevent unneeded fetching of Yarn version / index #202 #203

Merged
merged 1 commit into from
Nov 28, 2018

Conversation

charlespierce
Copy link
Contributor

@charlespierce charlespierce commented Nov 28, 2018

Fixes #202

The prepare_image function was checking if the node version exists in the catalog before fetching it, however it was only checking if yarn was set on the project, not whether it had already been downloaded. This was causing the Yarn index to be re-fetched on every invocation, showing a spinner with Fetching public registry: ... before executing any command.

Updated prepare_image to also check if !catalog.yarn.contains(yarn_version), in the same way that Node is checked, before executing the fetch.

Tested locally with a project that was showing the Fetching ... spinner and verified that no spinner is shown when executing a node or yarn command.

Copy link
Contributor

@rwjblue rwjblue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this also fix the same issue with the node command? I noticed it has the same issue as yarn earlier today but didn’t have a chance to update the issue...

Whoops, sorry about that I had missed this part of the description:

Tested locally with a project that was showing the Fetching ... spinner and verified that no spinner is shown when executing a node or yarn command.

@charlespierce
Copy link
Contributor Author

Yep, both the node and yarn shims use prepare_image to ensure that everything is downloaded so both are affected whenever a project has a yarn version set in package.json.

Copy link
Contributor

@mikrostew mikrostew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thanks @charlespierce!

@mikrostew mikrostew merged commit 4fc838c into volta-cli:master Nov 28, 2018
@charlespierce charlespierce deleted the prevent_yarn_fetch branch November 29, 2018 17:06
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.

3 participants