-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
shrinkwrap: no need to read package.json when read shrinkwrap #504
Conversation
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.
Two minor changes. Otherwise, yes, I can see that value isn't being used in this function, so it should be safe to remove the unnecessary file read.
lib/install/read-shrinkwrap.js
Outdated
@@ -31,7 +31,7 @@ function readShrinkwrap (child, next) { | |||
} | |||
child.package._shrinkwrap = parsed | |||
} | |||
).then(() => next(), next) |
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 is a functional change outside the scope of the intent of this PR. It means that a return value will be passed to the next
function as the first argument, which would be interpreted as an error. Currently, no return value is being provided, but it makes the code more brittle.
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.
Yep, I would undo this change.
no need to read package.json when read shrinkwrap.
avoid to read package.json when read shrinkwrap.
This looks good to me now. We'll review it for the next 6.x release. Thanks! |
The PR includes a simple change that removes the unnecessary operation when readShrinkwrap.
This change will optimize performance when
npm install
.