Skip to content
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.

Commit

Permalink
perf: don't reload edges for non-dep node.package updates
Browse files Browse the repository at this point in the history
Considering that maybe that Node.package setter is more of a footgun
than it's worth.  It's nice to know that the deps will always be kept
up to date, but throwing away and reloading edges just because you
pulled in something tangential feels like it's bad-clever.
  • Loading branch information
isaacs committed Feb 24, 2020
1 parent 6405279 commit af5315e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/arborist/reify.js
Expand Up @@ -361,7 +361,9 @@ module.exports = cls => class Reifier extends Ideal(cls) {
const {meta} = this.idealTree
return meta.loadedFromDisk && meta.originalLockfileVersion < 2 &&
rpj(node.path + '/package.json').then(pkg => {
node.package = pkg
node.package.os = pkg.os
node.package.cpu = pkg.cpu
node.package.engines = pkg.engines
return this[_checkEngineAndPlatform](node)
})
}
Expand Down Expand Up @@ -647,8 +649,8 @@ module.exports = cls => class Reifier extends Ideal(cls) {
return

return rpj(node.path + '/package.json').then(pkg => {
node.package = pkg
if (pkg.scripts) {
node.package.scripts = pkg.scripts
const val = [node, pkg]
if (pkg.scripts.preinstall)
preinstall.push(val)
Expand Down

0 comments on commit af5315e

Please sign in to comment.