update major versions for npm deps + remove log option - #4427

Merged
lukekarrys merged 17 commits into
release-nextfrom
lk/log-deps
Feb 23, 2022
Merged

update major versions for npm deps + remove log option#4427
lukekarrys merged 17 commits into
release-nextfrom
lk/log-deps

Conversation

@lukekarrys

@lukekarryslukekarrys commented Feb 16, 2022

Copy link
Copy Markdown
Contributor

This PR makes breaking changes to the following workspaces (all except libnpmfund):

@npmcli/arborist
libnpmaccess
libnpmdiff
libnpmexec
libnpmhook
libnpmorg
libnpmpack
libnpmpublish
libnpmsearch
libnpmteam
libnpmversion

arborist should be published first, and then bumped inside libnpmexec and libnpmfund before those are published.

npm@8.5.0 /Users/lukekarrys/projects/npm/cli
├── @npmcli/arborist@4.3.1 -> ./workspaces/arborist
├── libnpmaccess@5.0.1 -> ./workspaces/libnpmaccess
├── libnpmdiff@3.0.0 -> ./workspaces/libnpmdiff
├─┬ libnpmexec@3.0.3 -> ./workspaces/libnpmexec
│ └── @npmcli/arborist@4.3.1 deduped -> ./workspaces/arborist
├─┬ libnpmfund@2.0.2 -> ./workspaces/libnpmfund
│ └── @npmcli/arborist@4.3.1 deduped -> ./workspaces/arborist
├── libnpmhook@7.0.1 -> ./workspaces/libnpmhook
├── libnpmorg@3.0.1 -> ./workspaces/libnpmorg
├── libnpmpack@3.1.0 -> ./workspaces/libnpmpack
├── libnpmpublish@5.0.1 -> ./workspaces/libnpmpublish
├── libnpmsearch@4.0.1 -> ./workspaces/libnpmsearch
├── libnpmteam@3.0.1 -> ./workspaces/libnpmteam
└── libnpmversion@2.0.2 -> ./workspaces/libnpmversion

@npm-robot

npm-robot commented Feb 16, 2022

Copy link
Copy Markdown
Contributor

found 20 benchmarks with statistically significant performance improvements

  • app-large: clean, lock-only, cache-only, cache-only:peer-deps, modules-only, no-lock, no-cache, no-modules, no-clean, no-clean:audit
  • app-medium: clean, lock-only, cache-only, cache-only:peer-deps, modules-only, no-lock, no-cache, no-modules, no-clean, no-clean:audit
timing results
app-largecleanlock-onlycache-onlycache-only
peer-deps
modules-onlyno-lockno-cacheno-modulesno-cleanno-clean
audit
npm@853.734 ±0.6032.257 ±0.2452.811 ±47.5322.225 ±1.033.316 ±0.043.308 ±0.012.777 ±0.1012.829 ±0.162.677 ±0.023.762 ±0.00
#44270.487 ±0.010.487 ±0.010.493 ±0.010.489 ±0.000.486 ±0.000.485 ±0.010.483 ±0.000.482 ±0.000.482 ±0.000.487 ±0.00
app-mediumcleanlock-onlycache-onlycache-only
peer-deps
modules-onlyno-lockno-cacheno-modulesno-cleanno-clean
audit
npm@839.059 ±1.4025.581 ±0.1014.313 ±0.1815.488 ±0.023.045 ±0.032.998 ±0.012.689 ±0.039.578 ±0.102.512 ±0.033.434 ±0.02
#44270.491 ±0.010.507 ±0.010.484 ±0.000.481 ±0.000.488 ±0.010.480 ±0.000.491 ±0.000.491 ±0.020.486 ±0.000.489 ±0.00

@lukekarrys
lukekarrysforce-pushed the lk/log-deps branch 2 times, most recently from 8b3bcf6 to b1cc530CompareFebruary 22, 2022 06:30
@lukekarrys
lukekarrys marked this pull request as ready for review February 22, 2022 06:43
@lukekarrys
lukekarrys requested a review from a team as a code ownerFebruary 22, 2022 06:43
@lukekarryslukekarrys changed the title lk/log depsupdate major versions for npm deps + remove log optionFeb 22, 2022
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: this drops support for the `log` property and the
banner is shown using the silent option
BREAKING CHANGE: this drops support for the `log` property
BREAKING CHANGE: this drops support for the `log` property
nlf
nlf approved these changes Feb 23, 2022

@nlfnlf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this one is a doozy lol

we looked at this together during our pairing session, i then checked out this branch and kicked the tires briefly and saw no issues. i think this is good to land!

@lukekarrys
lukekarrys merged commit ce1c2bf into release-nextFeb 23, 2022
@lukekarrys
lukekarrys deleted the lk/log-deps branch February 23, 2022 23:59
@XhmikosR

XhmikosR commented Feb 24, 2022

Copy link
Copy Markdown
Contributor

@lukekarrys I don't want to open a new issue, but happy to do it if you think it's worth it.

There are still some duplicate packages that in theory could be deduplicated by updating the deps where needed upstream:

C:\Users\xmr\Desktop\cli>git checkout release-next
Already on 'release-next'
Your branch is up to date with 'origin/release-next'.
C:\Users\xmr\Desktop\cli>find-duplicate-dependencies
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!
This package has the following duplicate dependencies:
lru-cache:
[
{
name: 'lru-cache',
version: '6.0.0',
from: 'lru-cache@6.0.0',
path: 'npm/cacache'
},
{
name: 'lru-cache',
version: '7.3.1',
from: 'lru-cache@7.3.1',
path: 'npm/make-fetch-happen'
}
]
make-fetch-happen:
[
{
name: 'make-fetch-happen',
version: '10.0.3',
from: 'make-fetch-happen@10.0.3',
path: 'npm'
},
{
name: 'make-fetch-happen',
version: '9.1.0',
from: 'make-fetch-happen@9.1.0',
path: 'npm/node-gyp'
}
]
ms:
[
{
name: 'ms',
version: '2.1.2',
from: 'ms@2.1.2',
path: 'npm/make-fetch-happen/agentkeepalive/debug'
},
{
name: 'ms',
version: '2.1.3',
from: 'ms@2.1.3',
path: 'npm/make-fetch-happen/agentkeepalive/humanize-ms'
}
]
http-proxy-agent:
[
{
name: 'http-proxy-agent',
version: '5.0.0',
from: 'http-proxy-agent@5.0.0',
path: 'npm/make-fetch-happen'
},
{
name: 'http-proxy-agent',
version: '4.0.1',
from: 'http-proxy-agent@4.0.1',
path: 'npm/node-gyp/make-fetch-happen'
}
]
@tootallnate/once:
[
{
name: '@tootallnate/once',
version: '2.0.0',
from: '@tootallnate/once@2.0.0',
path: 'npm/make-fetch-happen/http-proxy-agent'
},
{
name: '@tootallnate/once',
version: '1.1.2',
from: '@tootallnate/once@1.1.2',
path: 'npm/node-gyp/make-fetch-happen/http-proxy-agent'
}
]

Should save a few bytes/files if these are deduped :)

EDIT: these deps might be unused or used as devDependencies (needs a closer look):

  • chownr
  • write-file-atomic

@XhmikosR

XhmikosR commented Feb 24, 2022

Copy link
Copy Markdown
Contributor

It seems there are plenty of useless files still included too (untested):

Files that could possibly be removed
 node_modules/ansicolors/test/ansicolors.js | 71 --
node_modules/ansistyles/test/ansistyles.js | 15 -
node_modules/archy/examples/beep.js | 24 -
node_modules/archy/examples/multi_line.js | 25 -
node_modules/archy/test/beep.js | 40 -
node_modules/archy/test/multi_line.js | 45 -
node_modules/archy/test/non_unicode.js | 40 -
node_modules/colors/examples/normal-usage.js | 82 --
node_modules/colors/examples/safe-string.js | 79 --
node_modules/concat-map/example/map.js | 6 -
node_modules/concat-map/test/map.js | 39 -
node_modules/delegates/test/index.js | 94 --
node_modules/dezalgo/test/basic.js | 29 -
node_modules/encoding/test/test.js | 49 -
node_modules/err-code/test/test.js | 159 ---
node_modules/function-bind/test/index.js | 252 -----
node_modules/gauge/lib/demo.js | 45 -
node_modules/has/test/index.js | 10 -
node_modules/ip/test/api-test.js | 407 -------
node_modules/is-core-module/test/index.js | 130 ---
node_modules/isexe/test/basic.js | 221 ----
node_modules/jsonparse/examples/twitterfeed.js | 30 -
node_modules/jsonparse/test/big-token.js | 24 -
node_modules/jsonparse/test/boundary.js | 110 --
node_modules/jsonparse/test/offset.js | 67 --
node_modules/jsonparse/test/primitives.js | 57 -
node_modules/jsonparse/test/surrogate.js | 26 -
node_modules/jsonparse/test/unvalid.js | 15 -
node_modules/jsonparse/test/utf8.js | 38 -
node_modules/minipass-sized/test/basic.js | 83 --
.../node-gyp/gyp/tools/emacs/testdata/media.gyp | 1105 -------------------
.../gyp/tools/emacs/testdata/media.gyp.fontified | 1107 --------------------
node_modules/node-gyp/test/common.js | 3 -
.../test/fixtures/VS_2017_BuildTools_minimal.txt | 1 -
.../test/fixtures/VS_2017_Community_workload.txt | 1 -
.../node-gyp/test/fixtures/VS_2017_Express.txt | 1 -
.../node-gyp/test/fixtures/VS_2017_Unusable.txt | 1 -
.../test/fixtures/VS_2019_BuildTools_minimal.txt | 1 -
.../test/fixtures/VS_2019_Community_workload.txt | 1 -
.../node-gyp/test/fixtures/VS_2019_Preview.txt | 1 -
node_modules/node-gyp/test/fixtures/ca-bundle.crt | 40 -
node_modules/node-gyp/test/fixtures/ca.crt | 21 -
.../test/fixtures/nodedir/include/node/config.gypi | 6 -
node_modules/node-gyp/test/fixtures/server.crt | 21 -
node_modules/node-gyp/test/fixtures/server.key | 27 -
.../node-gyp/test/fixtures/test-charmap.py | 31 -
node_modules/node-gyp/test/process-exec-sync.js | 140 ---
node_modules/node-gyp/test/simple-proxy.js | 27 -
node_modules/node-gyp/test/test-addon.js | 150 ---
.../node-gyp/test/test-configure-python.js | 82 --
.../node-gyp/test/test-create-config-gypi.js | 70 --
node_modules/node-gyp/test/test-download.js | 207 ----
.../node-gyp/test/test-find-accessible-sync.js | 84 --
.../node-gyp/test/test-find-node-directory.js | 119 ---
node_modules/node-gyp/test/test-find-python.js | 226 ----
.../node-gyp/test/test-find-visualstudio.js | 676 ------------
node_modules/node-gyp/test/test-install.js | 46 -
node_modules/node-gyp/test/test-options.js | 31 -
node_modules/node-gyp/test/test-process-release.js | 434 --------
.../npm-normalize-package-bin/test/array.js | 37 -
.../npm-normalize-package-bin/test/nobin.js | 35 -
.../npm-normalize-package-bin/test/object.js | 141 ---
.../npm-normalize-package-bin/test/string.js | 37 -
node_modules/promise-all-reject-late/test/index.js | 88 --
node_modules/promise-retry/test/test.js | 263 -----
node_modules/promzard/example/buffer.js | 12 -
node_modules/promzard/example/index.js | 11 -
.../promzard/example/npm-init/init-input.js | 191 ----
node_modules/promzard/example/npm-init/init.js | 37 -
.../promzard/example/npm-init/package.json | 10 -
node_modules/promzard/example/substack-input.js | 61 --
node_modules/promzard/test/basic.js | 91 --
node_modules/promzard/test/buffer.js | 84 --
node_modules/promzard/test/exports.input | 5 -
node_modules/promzard/test/exports.js | 48 -
node_modules/promzard/test/fn.input | 18 -
node_modules/promzard/test/fn.js | 56 -
node_modules/promzard/test/simple.input | 8 -
node_modules/promzard/test/simple.js | 30 -
node_modules/promzard/test/validate.input | 8 -
node_modules/promzard/test/validate.js | 20 -
node_modules/qrcode-terminal/example/basic.js | 2 -
node_modules/qrcode-terminal/example/basic.png | Bin 46426 -> 0 bytes
node_modules/qrcode-terminal/example/callback.js | 4 -
.../qrcode-terminal/example/small-qrcode.js | 6 -
node_modules/qrcode-terminal/test/main.js | 63 --
node_modules/retry/example/dns.js | 31 -
node_modules/retry/example/stop.js | 40 -
node_modules/retry/test/common.js | 10 -
.../retry/test/integration/test-forever.js | 24 -
.../retry/test/integration/test-retry-operation.js | 258 -----
.../retry/test/integration/test-retry-wrap.js | 101 --
.../retry/test/integration/test-timeouts.js | 69 --
node_modules/socks/docs/examples/index.md | 17 -
.../docs/examples/javascript/associateExample.md | 90 --
.../socks/docs/examples/javascript/bindExample.md | 83 --
.../docs/examples/javascript/connectExample.md | 258 -----
.../docs/examples/typescript/associateExample.md | 93 --
.../socks/docs/examples/typescript/bindExample.md | 86 --
.../docs/examples/typescript/connectExample.md | 265 -----
node_modules/text-table/example/align.js | 8 -
node_modules/text-table/example/center.js | 8 -
node_modules/text-table/example/dotalign.js | 9 -
node_modules/text-table/example/doubledot.js | 11 -
node_modules/text-table/example/table.js | 6 -
node_modules/text-table/test/align.js | 18 -
node_modules/text-table/test/ansi-colors.js | 32 -
node_modules/text-table/test/center.js | 18 -
node_modules/text-table/test/dotalign.js | 20 -
node_modules/text-table/test/doubledot.js | 24 -
node_modules/text-table/test/table.js | 14 -
node_modules/unique-filename/test/index.js | 23 -
node_modules/unique-slug/test/index.js | 13 -
.../validate-npm-package-name/test/index.js | 109 --
node_modules/wcwidth/test/index.js | 64 --
115 files changed, 10140 deletions(-)

BTW, nice to see that some work is done already in regards to the file size/number of files! https://packagephobia.com/result?p=npm%406.14.16%2Cnpm%407.24.2%2Cnpm%408.5.1

@wraithgar

Copy link
Copy Markdown
Contributor

Most of those are because we're waiting on node-gyp to land its next semver major nodejs/node-gyp#2603

@XhmikosR

Copy link
Copy Markdown
Contributor

Both issues?

BTW when I do npm install I get thousands of modified files on my machine.

@lukekarrys

Copy link
Copy Markdown
ContributorAuthor

It seems there are plenty of useless files still included too (untested)

This is interesting, but I'd be concerned with removing files from any valid dependencies due to the nature of JavaScript, dynamic requires, etc. Not saying we would never do that, but it seems like not the lowest hanging fruit vs the effort/impact.

There are still some duplicate packages that in theory could be deduplicated by updating the deps where needed upstream:

  • lru-cache: This will be handled by the next cacache release (which is on our list).
  • make-fetch-happen: waiting on node-gyp@9
  • ms: These should get deduped somehow. I'd be open to a PR/issue about this.
  • http-proxy-agent: waiting on node-gyp@9
  • @tootallnate/once: waiting on node-gyp@9

EDIT: these deps might be unused or used as devDependencies (needs a closer look):

I just checked both of those and they are deduped in production deps but not dev/docs. We're not as concerned about those.

@lukekarrys

Copy link
Copy Markdown
ContributorAuthor

BTW when I do npm install I get thousands of modified files on my machine.

@XhmikosR That shouldn't be happening 😄 I just tested on my machine with a brand new clone of the repo and npm i and got nothing modified. It might be worth opening an issue with all the details so we can see what's going on.

@XhmikosR

Copy link
Copy Markdown
Contributor

Thanks for the replies!

It seems there are plenty of useless files still included too (untested)

This is interesting, but I'd be concerned with removing files from any valid dependencies due to the nature of JavaScript, dynamic requires, etc. Not saying we would never do that, but it seems like not the lowest hanging fruit vs the effort/impact.

There are still some duplicate packages that in theory could be deduplicated by updating the deps where needed upstream:

* `lru-cache`: This will be handled by the next cacache release (which is on our list).
* `make-fetch-happen`: waiting on `node-gyp@9`
* `ms`: These should get deduped somehow. I'd be open to a PR/issue about this.
* `http-proxy-agent`: waiting on `node-gyp@9`
* `@tootallnate/once`: waiting on `node-gyp@9`

EDIT: these deps might be unused or used as devDependencies (needs a closer look):

I just checked both of those and they are deduped in production deps but not dev/docs. We're not as concerned about those.

AFAICT you are already ignoring plenty of dev-related files from production deps hence why I suggested this. I'm not saying these are super important, I agree with you. I'm just saying it should be looked at later, because the gains should be significant :)

@XhmikosR That shouldn't be happening 😄 I just tested on my machine with a brand new clone of the repo and npm i and got nothing modified. It might be worth opening an issue with all the details so we can see what's going on.

I suspect it's something related to Windows and symlinks, so as long as you get a clean repo that's enough for me :)

@lukekarrys

Copy link
Copy Markdown
ContributorAuthor

AFAICT you are already ignoring plenty of dev-related files from production deps hence why I suggested this.

I think it's a good suggestion, but I'm not aware of anywhere we are already doing this. We try to do it in all our own modules via package.json#files so only the minimum necessary files are in the tarball. And we bundle 3rd party deps, but try to not ever change code inside node_modules/ outside of deduping. For most of the files you listed I think the best course of action would be PRs implementing package.json#files.

@XhmikosR

Copy link
Copy Markdown
Contributor

#3362 and https://github.com/npm/cli/blob/latest/node_modules/.gitignore

I do open upstream PRs when possible and I agree that is the optimal solution, but until then you could also leverage the current solution :)

@lukekarrys

Copy link
Copy Markdown
ContributorAuthor

Thank you for showing me that we have a current solution already. I must've missed that we are doing that! 😄

Sign up for freeto 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.

5 participants

@lukekarrys@npm-robot@XhmikosR@wraithgar@nlf
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

update major versions for npm deps + remove log option - #4427

Merged
lukekarrys merged 17 commits into
release-nextfrom
lk/log-deps
Feb 23, 2022
Merged

update major versions for npm deps + remove log option#4427
lukekarrys merged 17 commits into
release-nextfrom
lk/log-deps

Conversation

@lukekarrys

@lukekarryslukekarrys commented Feb 16, 2022

Copy link
Copy Markdown
Contributor

This PR makes breaking changes to the following workspaces (all except libnpmfund):

@npmcli/arborist
libnpmaccess
libnpmdiff
libnpmexec
libnpmhook
libnpmorg
libnpmpack
libnpmpublish
libnpmsearch
libnpmteam
libnpmversion

arborist should be published first, and then bumped inside libnpmexec and libnpmfund before those are published.

npm@8.5.0 /Users/lukekarrys/projects/npm/cli
├── @npmcli/arborist@4.3.1 -> ./workspaces/arborist
├── libnpmaccess@5.0.1 -> ./workspaces/libnpmaccess
├── libnpmdiff@3.0.0 -> ./workspaces/libnpmdiff
├─┬ libnpmexec@3.0.3 -> ./workspaces/libnpmexec
│ └── @npmcli/arborist@4.3.1 deduped -> ./workspaces/arborist
├─┬ libnpmfund@2.0.2 -> ./workspaces/libnpmfund
│ └── @npmcli/arborist@4.3.1 deduped -> ./workspaces/arborist
├── libnpmhook@7.0.1 -> ./workspaces/libnpmhook
├── libnpmorg@3.0.1 -> ./workspaces/libnpmorg
├── libnpmpack@3.1.0 -> ./workspaces/libnpmpack
├── libnpmpublish@5.0.1 -> ./workspaces/libnpmpublish
├── libnpmsearch@4.0.1 -> ./workspaces/libnpmsearch
├── libnpmteam@3.0.1 -> ./workspaces/libnpmteam
└── libnpmversion@2.0.2 -> ./workspaces/libnpmversion

@npm-robot

npm-robot commented Feb 16, 2022

Copy link
Copy Markdown
Contributor

found 20 benchmarks with statistically significant performance improvements

  • app-large: clean, lock-only, cache-only, cache-only:peer-deps, modules-only, no-lock, no-cache, no-modules, no-clean, no-clean:audit
  • app-medium: clean, lock-only, cache-only, cache-only:peer-deps, modules-only, no-lock, no-cache, no-modules, no-clean, no-clean:audit
timing results
app-largecleanlock-onlycache-onlycache-only
peer-deps
modules-onlyno-lockno-cacheno-modulesno-cleanno-clean
audit
npm@853.734 ±0.6032.257 ±0.2452.811 ±47.5322.225 ±1.033.316 ±0.043.308 ±0.012.777 ±0.1012.829 ±0.162.677 ±0.023.762 ±0.00
#44270.487 ±0.010.487 ±0.010.493 ±0.010.489 ±0.000.486 ±0.000.485 ±0.010.483 ±0.000.482 ±0.000.482 ±0.000.487 ±0.00
app-mediumcleanlock-onlycache-onlycache-only
peer-deps
modules-onlyno-lockno-cacheno-modulesno-cleanno-clean
audit
npm@839.059 ±1.4025.581 ±0.1014.313 ±0.1815.488 ±0.023.045 ±0.032.998 ±0.012.689 ±0.039.578 ±0.102.512 ±0.033.434 ±0.02
#44270.491 ±0.010.507 ±0.010.484 ±0.000.481 ±0.000.488 ±0.010.480 ±0.000.491 ±0.000.491 ±0.020.486 ±0.000.489 ±0.00

@lukekarrys
lukekarrysforce-pushed the lk/log-deps branch 2 times, most recently from 8b3bcf6 to b1cc530CompareFebruary 22, 2022 06:30
@lukekarrys
lukekarrys marked this pull request as ready for review February 22, 2022 06:43
@lukekarrys
lukekarrys requested a review from a team as a code ownerFebruary 22, 2022 06:43
@lukekarryslukekarrys changed the title lk/log depsupdate major versions for npm deps + remove log optionFeb 22, 2022
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: this drops support for the `log` property and the
banner is shown using the silent option
BREAKING CHANGE: this drops support for the `log` property
BREAKING CHANGE: this drops support for the `log` property
nlf
nlf approved these changes Feb 23, 2022

@nlfnlf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this one is a doozy lol

we looked at this together during our pairing session, i then checked out this branch and kicked the tires briefly and saw no issues. i think this is good to land!

@lukekarrys
lukekarrys merged commit ce1c2bf into release-nextFeb 23, 2022
@lukekarrys
lukekarrys deleted the lk/log-deps branch February 23, 2022 23:59
@XhmikosR

XhmikosR commented Feb 24, 2022

Copy link
Copy Markdown
Contributor

@lukekarrys I don't want to open a new issue, but happy to do it if you think it's worth it.

There are still some duplicate packages that in theory could be deduplicated by updating the deps where needed upstream:

C:\Users\xmr\Desktop\cli>git checkout release-next
Already on 'release-next'
Your branch is up to date with 'origin/release-next'.
C:\Users\xmr\Desktop\cli>find-duplicate-dependencies
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!
This package has the following duplicate dependencies:
lru-cache:
[
{
name: 'lru-cache',
version: '6.0.0',
from: 'lru-cache@6.0.0',
path: 'npm/cacache'
},
{
name: 'lru-cache',
version: '7.3.1',
from: 'lru-cache@7.3.1',
path: 'npm/make-fetch-happen'
}
]
make-fetch-happen:
[
{
name: 'make-fetch-happen',
version: '10.0.3',
from: 'make-fetch-happen@10.0.3',
path: 'npm'
},
{
name: 'make-fetch-happen',
version: '9.1.0',
from: 'make-fetch-happen@9.1.0',
path: 'npm/node-gyp'
}
]
ms:
[
{
name: 'ms',
version: '2.1.2',
from: 'ms@2.1.2',
path: 'npm/make-fetch-happen/agentkeepalive/debug'
},
{
name: 'ms',
version: '2.1.3',
from: 'ms@2.1.3',
path: 'npm/make-fetch-happen/agentkeepalive/humanize-ms'
}
]
http-proxy-agent:
[
{
name: 'http-proxy-agent',
version: '5.0.0',
from: 'http-proxy-agent@5.0.0',
path: 'npm/make-fetch-happen'
},
{
name: 'http-proxy-agent',
version: '4.0.1',
from: 'http-proxy-agent@4.0.1',
path: 'npm/node-gyp/make-fetch-happen'
}
]
@tootallnate/once:
[
{
name: '@tootallnate/once',
version: '2.0.0',
from: '@tootallnate/once@2.0.0',
path: 'npm/make-fetch-happen/http-proxy-agent'
},
{
name: '@tootallnate/once',
version: '1.1.2',
from: '@tootallnate/once@1.1.2',
path: 'npm/node-gyp/make-fetch-happen/http-proxy-agent'
}
]

Should save a few bytes/files if these are deduped :)

EDIT: these deps might be unused or used as devDependencies (needs a closer look):

  • chownr
  • write-file-atomic

@XhmikosR

XhmikosR commented Feb 24, 2022

Copy link
Copy Markdown
Contributor

It seems there are plenty of useless files still included too (untested):

Files that could possibly be removed
 node_modules/ansicolors/test/ansicolors.js | 71 --
node_modules/ansistyles/test/ansistyles.js | 15 -
node_modules/archy/examples/beep.js | 24 -
node_modules/archy/examples/multi_line.js | 25 -
node_modules/archy/test/beep.js | 40 -
node_modules/archy/test/multi_line.js | 45 -
node_modules/archy/test/non_unicode.js | 40 -
node_modules/colors/examples/normal-usage.js | 82 --
node_modules/colors/examples/safe-string.js | 79 --
node_modules/concat-map/example/map.js | 6 -
node_modules/concat-map/test/map.js | 39 -
node_modules/delegates/test/index.js | 94 --
node_modules/dezalgo/test/basic.js | 29 -
node_modules/encoding/test/test.js | 49 -
node_modules/err-code/test/test.js | 159 ---
node_modules/function-bind/test/index.js | 252 -----
node_modules/gauge/lib/demo.js | 45 -
node_modules/has/test/index.js | 10 -
node_modules/ip/test/api-test.js | 407 -------
node_modules/is-core-module/test/index.js | 130 ---
node_modules/isexe/test/basic.js | 221 ----
node_modules/jsonparse/examples/twitterfeed.js | 30 -
node_modules/jsonparse/test/big-token.js | 24 -
node_modules/jsonparse/test/boundary.js | 110 --
node_modules/jsonparse/test/offset.js | 67 --
node_modules/jsonparse/test/primitives.js | 57 -
node_modules/jsonparse/test/surrogate.js | 26 -
node_modules/jsonparse/test/unvalid.js | 15 -
node_modules/jsonparse/test/utf8.js | 38 -
node_modules/minipass-sized/test/basic.js | 83 --
.../node-gyp/gyp/tools/emacs/testdata/media.gyp | 1105 -------------------
.../gyp/tools/emacs/testdata/media.gyp.fontified | 1107 --------------------
node_modules/node-gyp/test/common.js | 3 -
.../test/fixtures/VS_2017_BuildTools_minimal.txt | 1 -
.../test/fixtures/VS_2017_Community_workload.txt | 1 -
.../node-gyp/test/fixtures/VS_2017_Express.txt | 1 -
.../node-gyp/test/fixtures/VS_2017_Unusable.txt | 1 -
.../test/fixtures/VS_2019_BuildTools_minimal.txt | 1 -
.../test/fixtures/VS_2019_Community_workload.txt | 1 -
.../node-gyp/test/fixtures/VS_2019_Preview.txt | 1 -
node_modules/node-gyp/test/fixtures/ca-bundle.crt | 40 -
node_modules/node-gyp/test/fixtures/ca.crt | 21 -
.../test/fixtures/nodedir/include/node/config.gypi | 6 -
node_modules/node-gyp/test/fixtures/server.crt | 21 -
node_modules/node-gyp/test/fixtures/server.key | 27 -
.../node-gyp/test/fixtures/test-charmap.py | 31 -
node_modules/node-gyp/test/process-exec-sync.js | 140 ---
node_modules/node-gyp/test/simple-proxy.js | 27 -
node_modules/node-gyp/test/test-addon.js | 150 ---
.../node-gyp/test/test-configure-python.js | 82 --
.../node-gyp/test/test-create-config-gypi.js | 70 --
node_modules/node-gyp/test/test-download.js | 207 ----
.../node-gyp/test/test-find-accessible-sync.js | 84 --
.../node-gyp/test/test-find-node-directory.js | 119 ---
node_modules/node-gyp/test/test-find-python.js | 226 ----
.../node-gyp/test/test-find-visualstudio.js | 676 ------------
node_modules/node-gyp/test/test-install.js | 46 -
node_modules/node-gyp/test/test-options.js | 31 -
node_modules/node-gyp/test/test-process-release.js | 434 --------
.../npm-normalize-package-bin/test/array.js | 37 -
.../npm-normalize-package-bin/test/nobin.js | 35 -
.../npm-normalize-package-bin/test/object.js | 141 ---
.../npm-normalize-package-bin/test/string.js | 37 -
node_modules/promise-all-reject-late/test/index.js | 88 --
node_modules/promise-retry/test/test.js | 263 -----
node_modules/promzard/example/buffer.js | 12 -
node_modules/promzard/example/index.js | 11 -
.../promzard/example/npm-init/init-input.js | 191 ----
node_modules/promzard/example/npm-init/init.js | 37 -
.../promzard/example/npm-init/package.json | 10 -
node_modules/promzard/example/substack-input.js | 61 --
node_modules/promzard/test/basic.js | 91 --
node_modules/promzard/test/buffer.js | 84 --
node_modules/promzard/test/exports.input | 5 -
node_modules/promzard/test/exports.js | 48 -
node_modules/promzard/test/fn.input | 18 -
node_modules/promzard/test/fn.js | 56 -
node_modules/promzard/test/simple.input | 8 -
node_modules/promzard/test/simple.js | 30 -
node_modules/promzard/test/validate.input | 8 -
node_modules/promzard/test/validate.js | 20 -
node_modules/qrcode-terminal/example/basic.js | 2 -
node_modules/qrcode-terminal/example/basic.png | Bin 46426 -> 0 bytes
node_modules/qrcode-terminal/example/callback.js | 4 -
.../qrcode-terminal/example/small-qrcode.js | 6 -
node_modules/qrcode-terminal/test/main.js | 63 --
node_modules/retry/example/dns.js | 31 -
node_modules/retry/example/stop.js | 40 -
node_modules/retry/test/common.js | 10 -
.../retry/test/integration/test-forever.js | 24 -
.../retry/test/integration/test-retry-operation.js | 258 -----
.../retry/test/integration/test-retry-wrap.js | 101 --
.../retry/test/integration/test-timeouts.js | 69 --
node_modules/socks/docs/examples/index.md | 17 -
.../docs/examples/javascript/associateExample.md | 90 --
.../socks/docs/examples/javascript/bindExample.md | 83 --
.../docs/examples/javascript/connectExample.md | 258 -----
.../docs/examples/typescript/associateExample.md | 93 --
.../socks/docs/examples/typescript/bindExample.md | 86 --
.../docs/examples/typescript/connectExample.md | 265 -----
node_modules/text-table/example/align.js | 8 -
node_modules/text-table/example/center.js | 8 -
node_modules/text-table/example/dotalign.js | 9 -
node_modules/text-table/example/doubledot.js | 11 -
node_modules/text-table/example/table.js | 6 -
node_modules/text-table/test/align.js | 18 -
node_modules/text-table/test/ansi-colors.js | 32 -
node_modules/text-table/test/center.js | 18 -
node_modules/text-table/test/dotalign.js | 20 -
node_modules/text-table/test/doubledot.js | 24 -
node_modules/text-table/test/table.js | 14 -
node_modules/unique-filename/test/index.js | 23 -
node_modules/unique-slug/test/index.js | 13 -
.../validate-npm-package-name/test/index.js | 109 --
node_modules/wcwidth/test/index.js | 64 --
115 files changed, 10140 deletions(-)

BTW, nice to see that some work is done already in regards to the file size/number of files! https://packagephobia.com/result?p=npm%406.14.16%2Cnpm%407.24.2%2Cnpm%408.5.1

@wraithgar

Copy link
Copy Markdown
Contributor

Most of those are because we're waiting on node-gyp to land its next semver major nodejs/node-gyp#2603

@XhmikosR

Copy link
Copy Markdown
Contributor

Both issues?

BTW when I do npm install I get thousands of modified files on my machine.

@lukekarrys

Copy link
Copy Markdown
ContributorAuthor

It seems there are plenty of useless files still included too (untested)

This is interesting, but I'd be concerned with removing files from any valid dependencies due to the nature of JavaScript, dynamic requires, etc. Not saying we would never do that, but it seems like not the lowest hanging fruit vs the effort/impact.

There are still some duplicate packages that in theory could be deduplicated by updating the deps where needed upstream:

  • lru-cache: This will be handled by the next cacache release (which is on our list).
  • make-fetch-happen: waiting on node-gyp@9
  • ms: These should get deduped somehow. I'd be open to a PR/issue about this.
  • http-proxy-agent: waiting on node-gyp@9
  • @tootallnate/once: waiting on node-gyp@9

EDIT: these deps might be unused or used as devDependencies (needs a closer look):

I just checked both of those and they are deduped in production deps but not dev/docs. We're not as concerned about those.

@lukekarrys

Copy link
Copy Markdown
ContributorAuthor

BTW when I do npm install I get thousands of modified files on my machine.

@XhmikosR That shouldn't be happening 😄 I just tested on my machine with a brand new clone of the repo and npm i and got nothing modified. It might be worth opening an issue with all the details so we can see what's going on.

@XhmikosR

Copy link
Copy Markdown
Contributor

Thanks for the replies!

It seems there are plenty of useless files still included too (untested)

This is interesting, but I'd be concerned with removing files from any valid dependencies due to the nature of JavaScript, dynamic requires, etc. Not saying we would never do that, but it seems like not the lowest hanging fruit vs the effort/impact.

There are still some duplicate packages that in theory could be deduplicated by updating the deps where needed upstream:

* `lru-cache`: This will be handled by the next cacache release (which is on our list).
* `make-fetch-happen`: waiting on `node-gyp@9`
* `ms`: These should get deduped somehow. I'd be open to a PR/issue about this.
* `http-proxy-agent`: waiting on `node-gyp@9`
* `@tootallnate/once`: waiting on `node-gyp@9`

EDIT: these deps might be unused or used as devDependencies (needs a closer look):

I just checked both of those and they are deduped in production deps but not dev/docs. We're not as concerned about those.

AFAICT you are already ignoring plenty of dev-related files from production deps hence why I suggested this. I'm not saying these are super important, I agree with you. I'm just saying it should be looked at later, because the gains should be significant :)

@XhmikosR That shouldn't be happening 😄 I just tested on my machine with a brand new clone of the repo and npm i and got nothing modified. It might be worth opening an issue with all the details so we can see what's going on.

I suspect it's something related to Windows and symlinks, so as long as you get a clean repo that's enough for me :)

@lukekarrys

Copy link
Copy Markdown
ContributorAuthor

AFAICT you are already ignoring plenty of dev-related files from production deps hence why I suggested this.

I think it's a good suggestion, but I'm not aware of anywhere we are already doing this. We try to do it in all our own modules via package.json#files so only the minimum necessary files are in the tarball. And we bundle 3rd party deps, but try to not ever change code inside node_modules/ outside of deduping. For most of the files you listed I think the best course of action would be PRs implementing package.json#files.

@XhmikosR

Copy link
Copy Markdown
Contributor

#3362 and https://github.com/npm/cli/blob/latest/node_modules/.gitignore

I do open upstream PRs when possible and I agree that is the optimal solution, but until then you could also leverage the current solution :)

@lukekarrys

Copy link
Copy Markdown
ContributorAuthor

Thank you for showing me that we have a current solution already. I must've missed that we are doing that! 😄

Sign up for freeto 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.

5 participants

@lukekarrys@npm-robot@XhmikosR@wraithgar@nlf
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

update major versions for npm deps + remove log option - #4427

Merged
lukekarrys merged 17 commits into
release-nextfrom
lk/log-deps
Feb 23, 2022
Merged

update major versions for npm deps + remove log option#4427
lukekarrys merged 17 commits into
release-nextfrom
lk/log-deps

Conversation

@lukekarrys

@lukekarryslukekarrys commented Feb 16, 2022

Copy link
Copy Markdown
Contributor

This PR makes breaking changes to the following workspaces (all except libnpmfund):

@npmcli/arborist
libnpmaccess
libnpmdiff
libnpmexec
libnpmhook
libnpmorg
libnpmpack
libnpmpublish
libnpmsearch
libnpmteam
libnpmversion

arborist should be published first, and then bumped inside libnpmexec and libnpmfund before those are published.

npm@8.5.0 /Users/lukekarrys/projects/npm/cli
├── @npmcli/arborist@4.3.1 -> ./workspaces/arborist
├── libnpmaccess@5.0.1 -> ./workspaces/libnpmaccess
├── libnpmdiff@3.0.0 -> ./workspaces/libnpmdiff
├─┬ libnpmexec@3.0.3 -> ./workspaces/libnpmexec
│ └── @npmcli/arborist@4.3.1 deduped -> ./workspaces/arborist
├─┬ libnpmfund@2.0.2 -> ./workspaces/libnpmfund
│ └── @npmcli/arborist@4.3.1 deduped -> ./workspaces/arborist
├── libnpmhook@7.0.1 -> ./workspaces/libnpmhook
├── libnpmorg@3.0.1 -> ./workspaces/libnpmorg
├── libnpmpack@3.1.0 -> ./workspaces/libnpmpack
├── libnpmpublish@5.0.1 -> ./workspaces/libnpmpublish
├── libnpmsearch@4.0.1 -> ./workspaces/libnpmsearch
├── libnpmteam@3.0.1 -> ./workspaces/libnpmteam
└── libnpmversion@2.0.2 -> ./workspaces/libnpmversion

@npm-robot

npm-robot commented Feb 16, 2022

Copy link
Copy Markdown
Contributor

found 20 benchmarks with statistically significant performance improvements

  • app-large: clean, lock-only, cache-only, cache-only:peer-deps, modules-only, no-lock, no-cache, no-modules, no-clean, no-clean:audit
  • app-medium: clean, lock-only, cache-only, cache-only:peer-deps, modules-only, no-lock, no-cache, no-modules, no-clean, no-clean:audit
timing results
app-largecleanlock-onlycache-onlycache-only
peer-deps
modules-onlyno-lockno-cacheno-modulesno-cleanno-clean
audit
npm@853.734 ±0.6032.257 ±0.2452.811 ±47.5322.225 ±1.033.316 ±0.043.308 ±0.012.777 ±0.1012.829 ±0.162.677 ±0.023.762 ±0.00
#44270.487 ±0.010.487 ±0.010.493 ±0.010.489 ±0.000.486 ±0.000.485 ±0.010.483 ±0.000.482 ±0.000.482 ±0.000.487 ±0.00
app-mediumcleanlock-onlycache-onlycache-only
peer-deps
modules-onlyno-lockno-cacheno-modulesno-cleanno-clean
audit
npm@839.059 ±1.4025.581 ±0.1014.313 ±0.1815.488 ±0.023.045 ±0.032.998 ±0.012.689 ±0.039.578 ±0.102.512 ±0.033.434 ±0.02
#44270.491 ±0.010.507 ±0.010.484 ±0.000.481 ±0.000.488 ±0.010.480 ±0.000.491 ±0.000.491 ±0.020.486 ±0.000.489 ±0.00

@lukekarrys
lukekarrysforce-pushed the lk/log-deps branch 2 times, most recently from 8b3bcf6 to b1cc530CompareFebruary 22, 2022 06:30
@lukekarrys
lukekarrys marked this pull request as ready for review February 22, 2022 06:43
@lukekarrys
lukekarrys requested a review from a team as a code ownerFebruary 22, 2022 06:43
@lukekarryslukekarrys changed the title lk/log depsupdate major versions for npm deps + remove log optionFeb 22, 2022
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: this drops support for the `log` property and the
banner is shown using the silent option
BREAKING CHANGE: this drops support for the `log` property
BREAKING CHANGE: this drops support for the `log` property
nlf
nlf approved these changes Feb 23, 2022

@nlfnlf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this one is a doozy lol

we looked at this together during our pairing session, i then checked out this branch and kicked the tires briefly and saw no issues. i think this is good to land!

@lukekarrys
lukekarrys merged commit ce1c2bf into release-nextFeb 23, 2022
@lukekarrys
lukekarrys deleted the lk/log-deps branch February 23, 2022 23:59
@XhmikosR

XhmikosR commented Feb 24, 2022

Copy link
Copy Markdown
Contributor

@lukekarrys I don't want to open a new issue, but happy to do it if you think it's worth it.

There are still some duplicate packages that in theory could be deduplicated by updating the deps where needed upstream:

C:\Users\xmr\Desktop\cli>git checkout release-next
Already on 'release-next'
Your branch is up to date with 'origin/release-next'.
C:\Users\xmr\Desktop\cli>find-duplicate-dependencies
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!
This package has the following duplicate dependencies:
lru-cache:
[
{
name: 'lru-cache',
version: '6.0.0',
from: 'lru-cache@6.0.0',
path: 'npm/cacache'
},
{
name: 'lru-cache',
version: '7.3.1',
from: 'lru-cache@7.3.1',
path: 'npm/make-fetch-happen'
}
]
make-fetch-happen:
[
{
name: 'make-fetch-happen',
version: '10.0.3',
from: 'make-fetch-happen@10.0.3',
path: 'npm'
},
{
name: 'make-fetch-happen',
version: '9.1.0',
from: 'make-fetch-happen@9.1.0',
path: 'npm/node-gyp'
}
]
ms:
[
{
name: 'ms',
version: '2.1.2',
from: 'ms@2.1.2',
path: 'npm/make-fetch-happen/agentkeepalive/debug'
},
{
name: 'ms',
version: '2.1.3',
from: 'ms@2.1.3',
path: 'npm/make-fetch-happen/agentkeepalive/humanize-ms'
}
]
http-proxy-agent:
[
{
name: 'http-proxy-agent',
version: '5.0.0',
from: 'http-proxy-agent@5.0.0',
path: 'npm/make-fetch-happen'
},
{
name: 'http-proxy-agent',
version: '4.0.1',
from: 'http-proxy-agent@4.0.1',
path: 'npm/node-gyp/make-fetch-happen'
}
]
@tootallnate/once:
[
{
name: '@tootallnate/once',
version: '2.0.0',
from: '@tootallnate/once@2.0.0',
path: 'npm/make-fetch-happen/http-proxy-agent'
},
{
name: '@tootallnate/once',
version: '1.1.2',
from: '@tootallnate/once@1.1.2',
path: 'npm/node-gyp/make-fetch-happen/http-proxy-agent'
}
]

Should save a few bytes/files if these are deduped :)

EDIT: these deps might be unused or used as devDependencies (needs a closer look):

  • chownr
  • write-file-atomic

@XhmikosR

XhmikosR commented Feb 24, 2022

Copy link
Copy Markdown
Contributor

It seems there are plenty of useless files still included too (untested):

Files that could possibly be removed
 node_modules/ansicolors/test/ansicolors.js | 71 --
node_modules/ansistyles/test/ansistyles.js | 15 -
node_modules/archy/examples/beep.js | 24 -
node_modules/archy/examples/multi_line.js | 25 -
node_modules/archy/test/beep.js | 40 -
node_modules/archy/test/multi_line.js | 45 -
node_modules/archy/test/non_unicode.js | 40 -
node_modules/colors/examples/normal-usage.js | 82 --
node_modules/colors/examples/safe-string.js | 79 --
node_modules/concat-map/example/map.js | 6 -
node_modules/concat-map/test/map.js | 39 -
node_modules/delegates/test/index.js | 94 --
node_modules/dezalgo/test/basic.js | 29 -
node_modules/encoding/test/test.js | 49 -
node_modules/err-code/test/test.js | 159 ---
node_modules/function-bind/test/index.js | 252 -----
node_modules/gauge/lib/demo.js | 45 -
node_modules/has/test/index.js | 10 -
node_modules/ip/test/api-test.js | 407 -------
node_modules/is-core-module/test/index.js | 130 ---
node_modules/isexe/test/basic.js | 221 ----
node_modules/jsonparse/examples/twitterfeed.js | 30 -
node_modules/jsonparse/test/big-token.js | 24 -
node_modules/jsonparse/test/boundary.js | 110 --
node_modules/jsonparse/test/offset.js | 67 --
node_modules/jsonparse/test/primitives.js | 57 -
node_modules/jsonparse/test/surrogate.js | 26 -
node_modules/jsonparse/test/unvalid.js | 15 -
node_modules/jsonparse/test/utf8.js | 38 -
node_modules/minipass-sized/test/basic.js | 83 --
.../node-gyp/gyp/tools/emacs/testdata/media.gyp | 1105 -------------------
.../gyp/tools/emacs/testdata/media.gyp.fontified | 1107 --------------------
node_modules/node-gyp/test/common.js | 3 -
.../test/fixtures/VS_2017_BuildTools_minimal.txt | 1 -
.../test/fixtures/VS_2017_Community_workload.txt | 1 -
.../node-gyp/test/fixtures/VS_2017_Express.txt | 1 -
.../node-gyp/test/fixtures/VS_2017_Unusable.txt | 1 -
.../test/fixtures/VS_2019_BuildTools_minimal.txt | 1 -
.../test/fixtures/VS_2019_Community_workload.txt | 1 -
.../node-gyp/test/fixtures/VS_2019_Preview.txt | 1 -
node_modules/node-gyp/test/fixtures/ca-bundle.crt | 40 -
node_modules/node-gyp/test/fixtures/ca.crt | 21 -
.../test/fixtures/nodedir/include/node/config.gypi | 6 -
node_modules/node-gyp/test/fixtures/server.crt | 21 -
node_modules/node-gyp/test/fixtures/server.key | 27 -
.../node-gyp/test/fixtures/test-charmap.py | 31 -
node_modules/node-gyp/test/process-exec-sync.js | 140 ---
node_modules/node-gyp/test/simple-proxy.js | 27 -
node_modules/node-gyp/test/test-addon.js | 150 ---
.../node-gyp/test/test-configure-python.js | 82 --
.../node-gyp/test/test-create-config-gypi.js | 70 --
node_modules/node-gyp/test/test-download.js | 207 ----
.../node-gyp/test/test-find-accessible-sync.js | 84 --
.../node-gyp/test/test-find-node-directory.js | 119 ---
node_modules/node-gyp/test/test-find-python.js | 226 ----
.../node-gyp/test/test-find-visualstudio.js | 676 ------------
node_modules/node-gyp/test/test-install.js | 46 -
node_modules/node-gyp/test/test-options.js | 31 -
node_modules/node-gyp/test/test-process-release.js | 434 --------
.../npm-normalize-package-bin/test/array.js | 37 -
.../npm-normalize-package-bin/test/nobin.js | 35 -
.../npm-normalize-package-bin/test/object.js | 141 ---
.../npm-normalize-package-bin/test/string.js | 37 -
node_modules/promise-all-reject-late/test/index.js | 88 --
node_modules/promise-retry/test/test.js | 263 -----
node_modules/promzard/example/buffer.js | 12 -
node_modules/promzard/example/index.js | 11 -
.../promzard/example/npm-init/init-input.js | 191 ----
node_modules/promzard/example/npm-init/init.js | 37 -
.../promzard/example/npm-init/package.json | 10 -
node_modules/promzard/example/substack-input.js | 61 --
node_modules/promzard/test/basic.js | 91 --
node_modules/promzard/test/buffer.js | 84 --
node_modules/promzard/test/exports.input | 5 -
node_modules/promzard/test/exports.js | 48 -
node_modules/promzard/test/fn.input | 18 -
node_modules/promzard/test/fn.js | 56 -
node_modules/promzard/test/simple.input | 8 -
node_modules/promzard/test/simple.js | 30 -
node_modules/promzard/test/validate.input | 8 -
node_modules/promzard/test/validate.js | 20 -
node_modules/qrcode-terminal/example/basic.js | 2 -
node_modules/qrcode-terminal/example/basic.png | Bin 46426 -> 0 bytes
node_modules/qrcode-terminal/example/callback.js | 4 -
.../qrcode-terminal/example/small-qrcode.js | 6 -
node_modules/qrcode-terminal/test/main.js | 63 --
node_modules/retry/example/dns.js | 31 -
node_modules/retry/example/stop.js | 40 -
node_modules/retry/test/common.js | 10 -
.../retry/test/integration/test-forever.js | 24 -
.../retry/test/integration/test-retry-operation.js | 258 -----
.../retry/test/integration/test-retry-wrap.js | 101 --
.../retry/test/integration/test-timeouts.js | 69 --
node_modules/socks/docs/examples/index.md | 17 -
.../docs/examples/javascript/associateExample.md | 90 --
.../socks/docs/examples/javascript/bindExample.md | 83 --
.../docs/examples/javascript/connectExample.md | 258 -----
.../docs/examples/typescript/associateExample.md | 93 --
.../socks/docs/examples/typescript/bindExample.md | 86 --
.../docs/examples/typescript/connectExample.md | 265 -----
node_modules/text-table/example/align.js | 8 -
node_modules/text-table/example/center.js | 8 -
node_modules/text-table/example/dotalign.js | 9 -
node_modules/text-table/example/doubledot.js | 11 -
node_modules/text-table/example/table.js | 6 -
node_modules/text-table/test/align.js | 18 -
node_modules/text-table/test/ansi-colors.js | 32 -
node_modules/text-table/test/center.js | 18 -
node_modules/text-table/test/dotalign.js | 20 -
node_modules/text-table/test/doubledot.js | 24 -
node_modules/text-table/test/table.js | 14 -
node_modules/unique-filename/test/index.js | 23 -
node_modules/unique-slug/test/index.js | 13 -
.../validate-npm-package-name/test/index.js | 109 --
node_modules/wcwidth/test/index.js | 64 --
115 files changed, 10140 deletions(-)

BTW, nice to see that some work is done already in regards to the file size/number of files! https://packagephobia.com/result?p=npm%406.14.16%2Cnpm%407.24.2%2Cnpm%408.5.1

@wraithgar

Copy link
Copy Markdown
Contributor

Most of those are because we're waiting on node-gyp to land its next semver major nodejs/node-gyp#2603

@XhmikosR

Copy link
Copy Markdown
Contributor

Both issues?

BTW when I do npm install I get thousands of modified files on my machine.

@lukekarrys

Copy link
Copy Markdown
ContributorAuthor

It seems there are plenty of useless files still included too (untested)

This is interesting, but I'd be concerned with removing files from any valid dependencies due to the nature of JavaScript, dynamic requires, etc. Not saying we would never do that, but it seems like not the lowest hanging fruit vs the effort/impact.

There are still some duplicate packages that in theory could be deduplicated by updating the deps where needed upstream:

  • lru-cache: This will be handled by the next cacache release (which is on our list).
  • make-fetch-happen: waiting on node-gyp@9
  • ms: These should get deduped somehow. I'd be open to a PR/issue about this.
  • http-proxy-agent: waiting on node-gyp@9
  • @tootallnate/once: waiting on node-gyp@9

EDIT: these deps might be unused or used as devDependencies (needs a closer look):

I just checked both of those and they are deduped in production deps but not dev/docs. We're not as concerned about those.

@lukekarrys

Copy link
Copy Markdown
ContributorAuthor

BTW when I do npm install I get thousands of modified files on my machine.

@XhmikosR That shouldn't be happening 😄 I just tested on my machine with a brand new clone of the repo and npm i and got nothing modified. It might be worth opening an issue with all the details so we can see what's going on.

@XhmikosR

Copy link
Copy Markdown
Contributor

Thanks for the replies!

It seems there are plenty of useless files still included too (untested)

This is interesting, but I'd be concerned with removing files from any valid dependencies due to the nature of JavaScript, dynamic requires, etc. Not saying we would never do that, but it seems like not the lowest hanging fruit vs the effort/impact.

There are still some duplicate packages that in theory could be deduplicated by updating the deps where needed upstream:

* `lru-cache`: This will be handled by the next cacache release (which is on our list).
* `make-fetch-happen`: waiting on `node-gyp@9`
* `ms`: These should get deduped somehow. I'd be open to a PR/issue about this.
* `http-proxy-agent`: waiting on `node-gyp@9`
* `@tootallnate/once`: waiting on `node-gyp@9`

EDIT: these deps might be unused or used as devDependencies (needs a closer look):

I just checked both of those and they are deduped in production deps but not dev/docs. We're not as concerned about those.

AFAICT you are already ignoring plenty of dev-related files from production deps hence why I suggested this. I'm not saying these are super important, I agree with you. I'm just saying it should be looked at later, because the gains should be significant :)

@XhmikosR That shouldn't be happening 😄 I just tested on my machine with a brand new clone of the repo and npm i and got nothing modified. It might be worth opening an issue with all the details so we can see what's going on.

I suspect it's something related to Windows and symlinks, so as long as you get a clean repo that's enough for me :)

@lukekarrys

Copy link
Copy Markdown
ContributorAuthor

AFAICT you are already ignoring plenty of dev-related files from production deps hence why I suggested this.

I think it's a good suggestion, but I'm not aware of anywhere we are already doing this. We try to do it in all our own modules via package.json#files so only the minimum necessary files are in the tarball. And we bundle 3rd party deps, but try to not ever change code inside node_modules/ outside of deduping. For most of the files you listed I think the best course of action would be PRs implementing package.json#files.

@XhmikosR

Copy link
Copy Markdown
Contributor

#3362 and https://github.com/npm/cli/blob/latest/node_modules/.gitignore

I do open upstream PRs when possible and I agree that is the optimal solution, but until then you could also leverage the current solution :)

@lukekarrys

Copy link
Copy Markdown
ContributorAuthor

Thank you for showing me that we have a current solution already. I must've missed that we are doing that! 😄

Sign up for freeto 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.

5 participants

@lukekarrys@npm-robot@XhmikosR@wraithgar@nlf
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

update major versions for npm deps + remove log option - #4427

Merged
lukekarrys merged 17 commits into
release-nextfrom
lk/log-deps
Feb 23, 2022
Merged

update major versions for npm deps + remove log option#4427
lukekarrys merged 17 commits into
release-nextfrom
lk/log-deps

Conversation

@lukekarrys

@lukekarryslukekarrys commented Feb 16, 2022

Copy link
Copy Markdown
Contributor

This PR makes breaking changes to the following workspaces (all except libnpmfund):

@npmcli/arborist
libnpmaccess
libnpmdiff
libnpmexec
libnpmhook
libnpmorg
libnpmpack
libnpmpublish
libnpmsearch
libnpmteam
libnpmversion

arborist should be published first, and then bumped inside libnpmexec and libnpmfund before those are published.

npm@8.5.0 /Users/lukekarrys/projects/npm/cli
├── @npmcli/arborist@4.3.1 -> ./workspaces/arborist
├── libnpmaccess@5.0.1 -> ./workspaces/libnpmaccess
├── libnpmdiff@3.0.0 -> ./workspaces/libnpmdiff
├─┬ libnpmexec@3.0.3 -> ./workspaces/libnpmexec
│ └── @npmcli/arborist@4.3.1 deduped -> ./workspaces/arborist
├─┬ libnpmfund@2.0.2 -> ./workspaces/libnpmfund
│ └── @npmcli/arborist@4.3.1 deduped -> ./workspaces/arborist
├── libnpmhook@7.0.1 -> ./workspaces/libnpmhook
├── libnpmorg@3.0.1 -> ./workspaces/libnpmorg
├── libnpmpack@3.1.0 -> ./workspaces/libnpmpack
├── libnpmpublish@5.0.1 -> ./workspaces/libnpmpublish
├── libnpmsearch@4.0.1 -> ./workspaces/libnpmsearch
├── libnpmteam@3.0.1 -> ./workspaces/libnpmteam
└── libnpmversion@2.0.2 -> ./workspaces/libnpmversion

@npm-robot

npm-robot commented Feb 16, 2022

Copy link
Copy Markdown
Contributor

found 20 benchmarks with statistically significant performance improvements

  • app-large: clean, lock-only, cache-only, cache-only:peer-deps, modules-only, no-lock, no-cache, no-modules, no-clean, no-clean:audit
  • app-medium: clean, lock-only, cache-only, cache-only:peer-deps, modules-only, no-lock, no-cache, no-modules, no-clean, no-clean:audit
timing results
app-largecleanlock-onlycache-onlycache-only
peer-deps
modules-onlyno-lockno-cacheno-modulesno-cleanno-clean
audit
npm@853.734 ±0.6032.257 ±0.2452.811 ±47.5322.225 ±1.033.316 ±0.043.308 ±0.012.777 ±0.1012.829 ±0.162.677 ±0.023.762 ±0.00
#44270.487 ±0.010.487 ±0.010.493 ±0.010.489 ±0.000.486 ±0.000.485 ±0.010.483 ±0.000.482 ±0.000.482 ±0.000.487 ±0.00
app-mediumcleanlock-onlycache-onlycache-only
peer-deps
modules-onlyno-lockno-cacheno-modulesno-cleanno-clean
audit
npm@839.059 ±1.4025.581 ±0.1014.313 ±0.1815.488 ±0.023.045 ±0.032.998 ±0.012.689 ±0.039.578 ±0.102.512 ±0.033.434 ±0.02
#44270.491 ±0.010.507 ±0.010.484 ±0.000.481 ±0.000.488 ±0.010.480 ±0.000.491 ±0.000.491 ±0.020.486 ±0.000.489 ±0.00

@lukekarrys
lukekarrysforce-pushed the lk/log-deps branch 2 times, most recently from 8b3bcf6 to b1cc530CompareFebruary 22, 2022 06:30
@lukekarrys
lukekarrys marked this pull request as ready for review February 22, 2022 06:43
@lukekarrys
lukekarrys requested a review from a team as a code ownerFebruary 22, 2022 06:43
@lukekarryslukekarrys changed the title lk/log depsupdate major versions for npm deps + remove log optionFeb 22, 2022
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: this drops support for the `log` property and the
banner is shown using the silent option
BREAKING CHANGE: this drops support for the `log` property
BREAKING CHANGE: this drops support for the `log` property
nlf
nlf approved these changes Feb 23, 2022

@nlfnlf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this one is a doozy lol

we looked at this together during our pairing session, i then checked out this branch and kicked the tires briefly and saw no issues. i think this is good to land!

@lukekarrys
lukekarrys merged commit ce1c2bf into release-nextFeb 23, 2022
@lukekarrys
lukekarrys deleted the lk/log-deps branch February 23, 2022 23:59
@XhmikosR

XhmikosR commented Feb 24, 2022

Copy link
Copy Markdown
Contributor

@lukekarrys I don't want to open a new issue, but happy to do it if you think it's worth it.

There are still some duplicate packages that in theory could be deduplicated by updating the deps where needed upstream:

C:\Users\xmr\Desktop\cli>git checkout release-next
Already on 'release-next'
Your branch is up to date with 'origin/release-next'.
C:\Users\xmr\Desktop\cli>find-duplicate-dependencies
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!
This package has the following duplicate dependencies:
lru-cache:
[
{
name: 'lru-cache',
version: '6.0.0',
from: 'lru-cache@6.0.0',
path: 'npm/cacache'
},
{
name: 'lru-cache',
version: '7.3.1',
from: 'lru-cache@7.3.1',
path: 'npm/make-fetch-happen'
}
]
make-fetch-happen:
[
{
name: 'make-fetch-happen',
version: '10.0.3',
from: 'make-fetch-happen@10.0.3',
path: 'npm'
},
{
name: 'make-fetch-happen',
version: '9.1.0',
from: 'make-fetch-happen@9.1.0',
path: 'npm/node-gyp'
}
]
ms:
[
{
name: 'ms',
version: '2.1.2',
from: 'ms@2.1.2',
path: 'npm/make-fetch-happen/agentkeepalive/debug'
},
{
name: 'ms',
version: '2.1.3',
from: 'ms@2.1.3',
path: 'npm/make-fetch-happen/agentkeepalive/humanize-ms'
}
]
http-proxy-agent:
[
{
name: 'http-proxy-agent',
version: '5.0.0',
from: 'http-proxy-agent@5.0.0',
path: 'npm/make-fetch-happen'
},
{
name: 'http-proxy-agent',
version: '4.0.1',
from: 'http-proxy-agent@4.0.1',
path: 'npm/node-gyp/make-fetch-happen'
}
]
@tootallnate/once:
[
{
name: '@tootallnate/once',
version: '2.0.0',
from: '@tootallnate/once@2.0.0',
path: 'npm/make-fetch-happen/http-proxy-agent'
},
{
name: '@tootallnate/once',
version: '1.1.2',
from: '@tootallnate/once@1.1.2',
path: 'npm/node-gyp/make-fetch-happen/http-proxy-agent'
}
]

Should save a few bytes/files if these are deduped :)

EDIT: these deps might be unused or used as devDependencies (needs a closer look):

  • chownr
  • write-file-atomic

@XhmikosR

XhmikosR commented Feb 24, 2022

Copy link
Copy Markdown
Contributor

It seems there are plenty of useless files still included too (untested):

Files that could possibly be removed
 node_modules/ansicolors/test/ansicolors.js | 71 --
node_modules/ansistyles/test/ansistyles.js | 15 -
node_modules/archy/examples/beep.js | 24 -
node_modules/archy/examples/multi_line.js | 25 -
node_modules/archy/test/beep.js | 40 -
node_modules/archy/test/multi_line.js | 45 -
node_modules/archy/test/non_unicode.js | 40 -
node_modules/colors/examples/normal-usage.js | 82 --
node_modules/colors/examples/safe-string.js | 79 --
node_modules/concat-map/example/map.js | 6 -
node_modules/concat-map/test/map.js | 39 -
node_modules/delegates/test/index.js | 94 --
node_modules/dezalgo/test/basic.js | 29 -
node_modules/encoding/test/test.js | 49 -
node_modules/err-code/test/test.js | 159 ---
node_modules/function-bind/test/index.js | 252 -----
node_modules/gauge/lib/demo.js | 45 -
node_modules/has/test/index.js | 10 -
node_modules/ip/test/api-test.js | 407 -------
node_modules/is-core-module/test/index.js | 130 ---
node_modules/isexe/test/basic.js | 221 ----
node_modules/jsonparse/examples/twitterfeed.js | 30 -
node_modules/jsonparse/test/big-token.js | 24 -
node_modules/jsonparse/test/boundary.js | 110 --
node_modules/jsonparse/test/offset.js | 67 --
node_modules/jsonparse/test/primitives.js | 57 -
node_modules/jsonparse/test/surrogate.js | 26 -
node_modules/jsonparse/test/unvalid.js | 15 -
node_modules/jsonparse/test/utf8.js | 38 -
node_modules/minipass-sized/test/basic.js | 83 --
.../node-gyp/gyp/tools/emacs/testdata/media.gyp | 1105 -------------------
.../gyp/tools/emacs/testdata/media.gyp.fontified | 1107 --------------------
node_modules/node-gyp/test/common.js | 3 -
.../test/fixtures/VS_2017_BuildTools_minimal.txt | 1 -
.../test/fixtures/VS_2017_Community_workload.txt | 1 -
.../node-gyp/test/fixtures/VS_2017_Express.txt | 1 -
.../node-gyp/test/fixtures/VS_2017_Unusable.txt | 1 -
.../test/fixtures/VS_2019_BuildTools_minimal.txt | 1 -
.../test/fixtures/VS_2019_Community_workload.txt | 1 -
.../node-gyp/test/fixtures/VS_2019_Preview.txt | 1 -
node_modules/node-gyp/test/fixtures/ca-bundle.crt | 40 -
node_modules/node-gyp/test/fixtures/ca.crt | 21 -
.../test/fixtures/nodedir/include/node/config.gypi | 6 -
node_modules/node-gyp/test/fixtures/server.crt | 21 -
node_modules/node-gyp/test/fixtures/server.key | 27 -
.../node-gyp/test/fixtures/test-charmap.py | 31 -
node_modules/node-gyp/test/process-exec-sync.js | 140 ---
node_modules/node-gyp/test/simple-proxy.js | 27 -
node_modules/node-gyp/test/test-addon.js | 150 ---
.../node-gyp/test/test-configure-python.js | 82 --
.../node-gyp/test/test-create-config-gypi.js | 70 --
node_modules/node-gyp/test/test-download.js | 207 ----
.../node-gyp/test/test-find-accessible-sync.js | 84 --
.../node-gyp/test/test-find-node-directory.js | 119 ---
node_modules/node-gyp/test/test-find-python.js | 226 ----
.../node-gyp/test/test-find-visualstudio.js | 676 ------------
node_modules/node-gyp/test/test-install.js | 46 -
node_modules/node-gyp/test/test-options.js | 31 -
node_modules/node-gyp/test/test-process-release.js | 434 --------
.../npm-normalize-package-bin/test/array.js | 37 -
.../npm-normalize-package-bin/test/nobin.js | 35 -
.../npm-normalize-package-bin/test/object.js | 141 ---
.../npm-normalize-package-bin/test/string.js | 37 -
node_modules/promise-all-reject-late/test/index.js | 88 --
node_modules/promise-retry/test/test.js | 263 -----
node_modules/promzard/example/buffer.js | 12 -
node_modules/promzard/example/index.js | 11 -
.../promzard/example/npm-init/init-input.js | 191 ----
node_modules/promzard/example/npm-init/init.js | 37 -
.../promzard/example/npm-init/package.json | 10 -
node_modules/promzard/example/substack-input.js | 61 --
node_modules/promzard/test/basic.js | 91 --
node_modules/promzard/test/buffer.js | 84 --
node_modules/promzard/test/exports.input | 5 -
node_modules/promzard/test/exports.js | 48 -
node_modules/promzard/test/fn.input | 18 -
node_modules/promzard/test/fn.js | 56 -
node_modules/promzard/test/simple.input | 8 -
node_modules/promzard/test/simple.js | 30 -
node_modules/promzard/test/validate.input | 8 -
node_modules/promzard/test/validate.js | 20 -
node_modules/qrcode-terminal/example/basic.js | 2 -
node_modules/qrcode-terminal/example/basic.png | Bin 46426 -> 0 bytes
node_modules/qrcode-terminal/example/callback.js | 4 -
.../qrcode-terminal/example/small-qrcode.js | 6 -
node_modules/qrcode-terminal/test/main.js | 63 --
node_modules/retry/example/dns.js | 31 -
node_modules/retry/example/stop.js | 40 -
node_modules/retry/test/common.js | 10 -
.../retry/test/integration/test-forever.js | 24 -
.../retry/test/integration/test-retry-operation.js | 258 -----
.../retry/test/integration/test-retry-wrap.js | 101 --
.../retry/test/integration/test-timeouts.js | 69 --
node_modules/socks/docs/examples/index.md | 17 -
.../docs/examples/javascript/associateExample.md | 90 --
.../socks/docs/examples/javascript/bindExample.md | 83 --
.../docs/examples/javascript/connectExample.md | 258 -----
.../docs/examples/typescript/associateExample.md | 93 --
.../socks/docs/examples/typescript/bindExample.md | 86 --
.../docs/examples/typescript/connectExample.md | 265 -----
node_modules/text-table/example/align.js | 8 -
node_modules/text-table/example/center.js | 8 -
node_modules/text-table/example/dotalign.js | 9 -
node_modules/text-table/example/doubledot.js | 11 -
node_modules/text-table/example/table.js | 6 -
node_modules/text-table/test/align.js | 18 -
node_modules/text-table/test/ansi-colors.js | 32 -
node_modules/text-table/test/center.js | 18 -
node_modules/text-table/test/dotalign.js | 20 -
node_modules/text-table/test/doubledot.js | 24 -
node_modules/text-table/test/table.js | 14 -
node_modules/unique-filename/test/index.js | 23 -
node_modules/unique-slug/test/index.js | 13 -
.../validate-npm-package-name/test/index.js | 109 --
node_modules/wcwidth/test/index.js | 64 --
115 files changed, 10140 deletions(-)

BTW, nice to see that some work is done already in regards to the file size/number of files! https://packagephobia.com/result?p=npm%406.14.16%2Cnpm%407.24.2%2Cnpm%408.5.1

@wraithgar

Copy link
Copy Markdown
Contributor

Most of those are because we're waiting on node-gyp to land its next semver major nodejs/node-gyp#2603

@XhmikosR

Copy link
Copy Markdown
Contributor

Both issues?

BTW when I do npm install I get thousands of modified files on my machine.

@lukekarrys

Copy link
Copy Markdown
ContributorAuthor

It seems there are plenty of useless files still included too (untested)

This is interesting, but I'd be concerned with removing files from any valid dependencies due to the nature of JavaScript, dynamic requires, etc. Not saying we would never do that, but it seems like not the lowest hanging fruit vs the effort/impact.

There are still some duplicate packages that in theory could be deduplicated by updating the deps where needed upstream:

  • lru-cache: This will be handled by the next cacache release (which is on our list).
  • make-fetch-happen: waiting on node-gyp@9
  • ms: These should get deduped somehow. I'd be open to a PR/issue about this.
  • http-proxy-agent: waiting on node-gyp@9
  • @tootallnate/once: waiting on node-gyp@9

EDIT: these deps might be unused or used as devDependencies (needs a closer look):

I just checked both of those and they are deduped in production deps but not dev/docs. We're not as concerned about those.

@lukekarrys

Copy link
Copy Markdown
ContributorAuthor

BTW when I do npm install I get thousands of modified files on my machine.

@XhmikosR That shouldn't be happening 😄 I just tested on my machine with a brand new clone of the repo and npm i and got nothing modified. It might be worth opening an issue with all the details so we can see what's going on.

@XhmikosR

Copy link
Copy Markdown
Contributor

Thanks for the replies!

It seems there are plenty of useless files still included too (untested)

This is interesting, but I'd be concerned with removing files from any valid dependencies due to the nature of JavaScript, dynamic requires, etc. Not saying we would never do that, but it seems like not the lowest hanging fruit vs the effort/impact.

There are still some duplicate packages that in theory could be deduplicated by updating the deps where needed upstream:

* `lru-cache`: This will be handled by the next cacache release (which is on our list).
* `make-fetch-happen`: waiting on `node-gyp@9`
* `ms`: These should get deduped somehow. I'd be open to a PR/issue about this.
* `http-proxy-agent`: waiting on `node-gyp@9`
* `@tootallnate/once`: waiting on `node-gyp@9`

EDIT: these deps might be unused or used as devDependencies (needs a closer look):

I just checked both of those and they are deduped in production deps but not dev/docs. We're not as concerned about those.

AFAICT you are already ignoring plenty of dev-related files from production deps hence why I suggested this. I'm not saying these are super important, I agree with you. I'm just saying it should be looked at later, because the gains should be significant :)

@XhmikosR That shouldn't be happening 😄 I just tested on my machine with a brand new clone of the repo and npm i and got nothing modified. It might be worth opening an issue with all the details so we can see what's going on.

I suspect it's something related to Windows and symlinks, so as long as you get a clean repo that's enough for me :)

@lukekarrys

Copy link
Copy Markdown
ContributorAuthor

AFAICT you are already ignoring plenty of dev-related files from production deps hence why I suggested this.

I think it's a good suggestion, but I'm not aware of anywhere we are already doing this. We try to do it in all our own modules via package.json#files so only the minimum necessary files are in the tarball. And we bundle 3rd party deps, but try to not ever change code inside node_modules/ outside of deduping. For most of the files you listed I think the best course of action would be PRs implementing package.json#files.

@XhmikosR

Copy link
Copy Markdown
Contributor

#3362 and https://github.com/npm/cli/blob/latest/node_modules/.gitignore

I do open upstream PRs when possible and I agree that is the optimal solution, but until then you could also leverage the current solution :)

@lukekarrys

Copy link
Copy Markdown
ContributorAuthor

Thank you for showing me that we have a current solution already. I must've missed that we are doing that! 😄

Sign up for freeto 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.

5 participants

@lukekarrys@npm-robot@XhmikosR@wraithgar@nlf
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

update major versions for npm deps + remove log option - #4427

Merged
lukekarrys merged 17 commits into
release-nextfrom
lk/log-deps
Feb 23, 2022
Merged

update major versions for npm deps + remove log option#4427
lukekarrys merged 17 commits into
release-nextfrom
lk/log-deps

Conversation

@lukekarrys

@lukekarryslukekarrys commented Feb 16, 2022

Copy link
Copy Markdown
Contributor

This PR makes breaking changes to the following workspaces (all except libnpmfund):

@npmcli/arborist
libnpmaccess
libnpmdiff
libnpmexec
libnpmhook
libnpmorg
libnpmpack
libnpmpublish
libnpmsearch
libnpmteam
libnpmversion

arborist should be published first, and then bumped inside libnpmexec and libnpmfund before those are published.

npm@8.5.0 /Users/lukekarrys/projects/npm/cli
├── @npmcli/arborist@4.3.1 -> ./workspaces/arborist
├── libnpmaccess@5.0.1 -> ./workspaces/libnpmaccess
├── libnpmdiff@3.0.0 -> ./workspaces/libnpmdiff
├─┬ libnpmexec@3.0.3 -> ./workspaces/libnpmexec
│ └── @npmcli/arborist@4.3.1 deduped -> ./workspaces/arborist
├─┬ libnpmfund@2.0.2 -> ./workspaces/libnpmfund
│ └── @npmcli/arborist@4.3.1 deduped -> ./workspaces/arborist
├── libnpmhook@7.0.1 -> ./workspaces/libnpmhook
├── libnpmorg@3.0.1 -> ./workspaces/libnpmorg
├── libnpmpack@3.1.0 -> ./workspaces/libnpmpack
├── libnpmpublish@5.0.1 -> ./workspaces/libnpmpublish
├── libnpmsearch@4.0.1 -> ./workspaces/libnpmsearch
├── libnpmteam@3.0.1 -> ./workspaces/libnpmteam
└── libnpmversion@2.0.2 -> ./workspaces/libnpmversion

@npm-robot

npm-robot commented Feb 16, 2022

Copy link
Copy Markdown
Contributor

found 20 benchmarks with statistically significant performance improvements

  • app-large: clean, lock-only, cache-only, cache-only:peer-deps, modules-only, no-lock, no-cache, no-modules, no-clean, no-clean:audit
  • app-medium: clean, lock-only, cache-only, cache-only:peer-deps, modules-only, no-lock, no-cache, no-modules, no-clean, no-clean:audit
timing results
app-largecleanlock-onlycache-onlycache-only
peer-deps
modules-onlyno-lockno-cacheno-modulesno-cleanno-clean
audit
npm@853.734 ±0.6032.257 ±0.2452.811 ±47.5322.225 ±1.033.316 ±0.043.308 ±0.012.777 ±0.1012.829 ±0.162.677 ±0.023.762 ±0.00
#44270.487 ±0.010.487 ±0.010.493 ±0.010.489 ±0.000.486 ±0.000.485 ±0.010.483 ±0.000.482 ±0.000.482 ±0.000.487 ±0.00
app-mediumcleanlock-onlycache-onlycache-only
peer-deps
modules-onlyno-lockno-cacheno-modulesno-cleanno-clean
audit
npm@839.059 ±1.4025.581 ±0.1014.313 ±0.1815.488 ±0.023.045 ±0.032.998 ±0.012.689 ±0.039.578 ±0.102.512 ±0.033.434 ±0.02
#44270.491 ±0.010.507 ±0.010.484 ±0.000.481 ±0.000.488 ±0.010.480 ±0.000.491 ±0.000.491 ±0.020.486 ±0.000.489 ±0.00

@lukekarrys
lukekarrysforce-pushed the lk/log-deps branch 2 times, most recently from 8b3bcf6 to b1cc530CompareFebruary 22, 2022 06:30
@lukekarrys
lukekarrys marked this pull request as ready for review February 22, 2022 06:43
@lukekarrys
lukekarrys requested a review from a team as a code ownerFebruary 22, 2022 06:43
@lukekarryslukekarrys changed the title lk/log depsupdate major versions for npm deps + remove log optionFeb 22, 2022
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: this drops support for the `log` property and the
banner is shown using the silent option
BREAKING CHANGE: this drops support for the `log` property
BREAKING CHANGE: this drops support for the `log` property
nlf
nlf approved these changes Feb 23, 2022

@nlfnlf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this one is a doozy lol

we looked at this together during our pairing session, i then checked out this branch and kicked the tires briefly and saw no issues. i think this is good to land!

@lukekarrys
lukekarrys merged commit ce1c2bf into release-nextFeb 23, 2022
@lukekarrys
lukekarrys deleted the lk/log-deps branch February 23, 2022 23:59
@XhmikosR

XhmikosR commented Feb 24, 2022

Copy link
Copy Markdown
Contributor

@lukekarrys I don't want to open a new issue, but happy to do it if you think it's worth it.

There are still some duplicate packages that in theory could be deduplicated by updating the deps where needed upstream:

C:\Users\xmr\Desktop\cli>git checkout release-next
Already on 'release-next'
Your branch is up to date with 'origin/release-next'.
C:\Users\xmr\Desktop\cli>find-duplicate-dependencies
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!
This package has the following duplicate dependencies:
lru-cache:
[
{
name: 'lru-cache',
version: '6.0.0',
from: 'lru-cache@6.0.0',
path: 'npm/cacache'
},
{
name: 'lru-cache',
version: '7.3.1',
from: 'lru-cache@7.3.1',
path: 'npm/make-fetch-happen'
}
]
make-fetch-happen:
[
{
name: 'make-fetch-happen',
version: '10.0.3',
from: 'make-fetch-happen@10.0.3',
path: 'npm'
},
{
name: 'make-fetch-happen',
version: '9.1.0',
from: 'make-fetch-happen@9.1.0',
path: 'npm/node-gyp'
}
]
ms:
[
{
name: 'ms',
version: '2.1.2',
from: 'ms@2.1.2',
path: 'npm/make-fetch-happen/agentkeepalive/debug'
},
{
name: 'ms',
version: '2.1.3',
from: 'ms@2.1.3',
path: 'npm/make-fetch-happen/agentkeepalive/humanize-ms'
}
]
http-proxy-agent:
[
{
name: 'http-proxy-agent',
version: '5.0.0',
from: 'http-proxy-agent@5.0.0',
path: 'npm/make-fetch-happen'
},
{
name: 'http-proxy-agent',
version: '4.0.1',
from: 'http-proxy-agent@4.0.1',
path: 'npm/node-gyp/make-fetch-happen'
}
]
@tootallnate/once:
[
{
name: '@tootallnate/once',
version: '2.0.0',
from: '@tootallnate/once@2.0.0',
path: 'npm/make-fetch-happen/http-proxy-agent'
},
{
name: '@tootallnate/once',
version: '1.1.2',
from: '@tootallnate/once@1.1.2',
path: 'npm/node-gyp/make-fetch-happen/http-proxy-agent'
}
]

Should save a few bytes/files if these are deduped :)

EDIT: these deps might be unused or used as devDependencies (needs a closer look):

  • chownr
  • write-file-atomic

@XhmikosR

XhmikosR commented Feb 24, 2022

Copy link
Copy Markdown
Contributor

It seems there are plenty of useless files still included too (untested):

Files that could possibly be removed
 node_modules/ansicolors/test/ansicolors.js | 71 --
node_modules/ansistyles/test/ansistyles.js | 15 -
node_modules/archy/examples/beep.js | 24 -
node_modules/archy/examples/multi_line.js | 25 -
node_modules/archy/test/beep.js | 40 -
node_modules/archy/test/multi_line.js | 45 -
node_modules/archy/test/non_unicode.js | 40 -
node_modules/colors/examples/normal-usage.js | 82 --
node_modules/colors/examples/safe-string.js | 79 --
node_modules/concat-map/example/map.js | 6 -
node_modules/concat-map/test/map.js | 39 -
node_modules/delegates/test/index.js | 94 --
node_modules/dezalgo/test/basic.js | 29 -
node_modules/encoding/test/test.js | 49 -
node_modules/err-code/test/test.js | 159 ---
node_modules/function-bind/test/index.js | 252 -----
node_modules/gauge/lib/demo.js | 45 -
node_modules/has/test/index.js | 10 -
node_modules/ip/test/api-test.js | 407 -------
node_modules/is-core-module/test/index.js | 130 ---
node_modules/isexe/test/basic.js | 221 ----
node_modules/jsonparse/examples/twitterfeed.js | 30 -
node_modules/jsonparse/test/big-token.js | 24 -
node_modules/jsonparse/test/boundary.js | 110 --
node_modules/jsonparse/test/offset.js | 67 --
node_modules/jsonparse/test/primitives.js | 57 -
node_modules/jsonparse/test/surrogate.js | 26 -
node_modules/jsonparse/test/unvalid.js | 15 -
node_modules/jsonparse/test/utf8.js | 38 -
node_modules/minipass-sized/test/basic.js | 83 --
.../node-gyp/gyp/tools/emacs/testdata/media.gyp | 1105 -------------------
.../gyp/tools/emacs/testdata/media.gyp.fontified | 1107 --------------------
node_modules/node-gyp/test/common.js | 3 -
.../test/fixtures/VS_2017_BuildTools_minimal.txt | 1 -
.../test/fixtures/VS_2017_Community_workload.txt | 1 -
.../node-gyp/test/fixtures/VS_2017_Express.txt | 1 -
.../node-gyp/test/fixtures/VS_2017_Unusable.txt | 1 -
.../test/fixtures/VS_2019_BuildTools_minimal.txt | 1 -
.../test/fixtures/VS_2019_Community_workload.txt | 1 -
.../node-gyp/test/fixtures/VS_2019_Preview.txt | 1 -
node_modules/node-gyp/test/fixtures/ca-bundle.crt | 40 -
node_modules/node-gyp/test/fixtures/ca.crt | 21 -
.../test/fixtures/nodedir/include/node/config.gypi | 6 -
node_modules/node-gyp/test/fixtures/server.crt | 21 -
node_modules/node-gyp/test/fixtures/server.key | 27 -
.../node-gyp/test/fixtures/test-charmap.py | 31 -
node_modules/node-gyp/test/process-exec-sync.js | 140 ---
node_modules/node-gyp/test/simple-proxy.js | 27 -
node_modules/node-gyp/test/test-addon.js | 150 ---
.../node-gyp/test/test-configure-python.js | 82 --
.../node-gyp/test/test-create-config-gypi.js | 70 --
node_modules/node-gyp/test/test-download.js | 207 ----
.../node-gyp/test/test-find-accessible-sync.js | 84 --
.../node-gyp/test/test-find-node-directory.js | 119 ---
node_modules/node-gyp/test/test-find-python.js | 226 ----
.../node-gyp/test/test-find-visualstudio.js | 676 ------------
node_modules/node-gyp/test/test-install.js | 46 -
node_modules/node-gyp/test/test-options.js | 31 -
node_modules/node-gyp/test/test-process-release.js | 434 --------
.../npm-normalize-package-bin/test/array.js | 37 -
.../npm-normalize-package-bin/test/nobin.js | 35 -
.../npm-normalize-package-bin/test/object.js | 141 ---
.../npm-normalize-package-bin/test/string.js | 37 -
node_modules/promise-all-reject-late/test/index.js | 88 --
node_modules/promise-retry/test/test.js | 263 -----
node_modules/promzard/example/buffer.js | 12 -
node_modules/promzard/example/index.js | 11 -
.../promzard/example/npm-init/init-input.js | 191 ----
node_modules/promzard/example/npm-init/init.js | 37 -
.../promzard/example/npm-init/package.json | 10 -
node_modules/promzard/example/substack-input.js | 61 --
node_modules/promzard/test/basic.js | 91 --
node_modules/promzard/test/buffer.js | 84 --
node_modules/promzard/test/exports.input | 5 -
node_modules/promzard/test/exports.js | 48 -
node_modules/promzard/test/fn.input | 18 -
node_modules/promzard/test/fn.js | 56 -
node_modules/promzard/test/simple.input | 8 -
node_modules/promzard/test/simple.js | 30 -
node_modules/promzard/test/validate.input | 8 -
node_modules/promzard/test/validate.js | 20 -
node_modules/qrcode-terminal/example/basic.js | 2 -
node_modules/qrcode-terminal/example/basic.png | Bin 46426 -> 0 bytes
node_modules/qrcode-terminal/example/callback.js | 4 -
.../qrcode-terminal/example/small-qrcode.js | 6 -
node_modules/qrcode-terminal/test/main.js | 63 --
node_modules/retry/example/dns.js | 31 -
node_modules/retry/example/stop.js | 40 -
node_modules/retry/test/common.js | 10 -
.../retry/test/integration/test-forever.js | 24 -
.../retry/test/integration/test-retry-operation.js | 258 -----
.../retry/test/integration/test-retry-wrap.js | 101 --
.../retry/test/integration/test-timeouts.js | 69 --
node_modules/socks/docs/examples/index.md | 17 -
.../docs/examples/javascript/associateExample.md | 90 --
.../socks/docs/examples/javascript/bindExample.md | 83 --
.../docs/examples/javascript/connectExample.md | 258 -----
.../docs/examples/typescript/associateExample.md | 93 --
.../socks/docs/examples/typescript/bindExample.md | 86 --
.../docs/examples/typescript/connectExample.md | 265 -----
node_modules/text-table/example/align.js | 8 -
node_modules/text-table/example/center.js | 8 -
node_modules/text-table/example/dotalign.js | 9 -
node_modules/text-table/example/doubledot.js | 11 -
node_modules/text-table/example/table.js | 6 -
node_modules/text-table/test/align.js | 18 -
node_modules/text-table/test/ansi-colors.js | 32 -
node_modules/text-table/test/center.js | 18 -
node_modules/text-table/test/dotalign.js | 20 -
node_modules/text-table/test/doubledot.js | 24 -
node_modules/text-table/test/table.js | 14 -
node_modules/unique-filename/test/index.js | 23 -
node_modules/unique-slug/test/index.js | 13 -
.../validate-npm-package-name/test/index.js | 109 --
node_modules/wcwidth/test/index.js | 64 --
115 files changed, 10140 deletions(-)

BTW, nice to see that some work is done already in regards to the file size/number of files! https://packagephobia.com/result?p=npm%406.14.16%2Cnpm%407.24.2%2Cnpm%408.5.1

@wraithgar

Copy link
Copy Markdown
Contributor

Most of those are because we're waiting on node-gyp to land its next semver major nodejs/node-gyp#2603

@XhmikosR

Copy link
Copy Markdown
Contributor

Both issues?

BTW when I do npm install I get thousands of modified files on my machine.

@lukekarrys

Copy link
Copy Markdown
ContributorAuthor

It seems there are plenty of useless files still included too (untested)

This is interesting, but I'd be concerned with removing files from any valid dependencies due to the nature of JavaScript, dynamic requires, etc. Not saying we would never do that, but it seems like not the lowest hanging fruit vs the effort/impact.

There are still some duplicate packages that in theory could be deduplicated by updating the deps where needed upstream:

  • lru-cache: This will be handled by the next cacache release (which is on our list).
  • make-fetch-happen: waiting on node-gyp@9
  • ms: These should get deduped somehow. I'd be open to a PR/issue about this.
  • http-proxy-agent: waiting on node-gyp@9
  • @tootallnate/once: waiting on node-gyp@9

EDIT: these deps might be unused or used as devDependencies (needs a closer look):

I just checked both of those and they are deduped in production deps but not dev/docs. We're not as concerned about those.

@lukekarrys

Copy link
Copy Markdown
ContributorAuthor

BTW when I do npm install I get thousands of modified files on my machine.

@XhmikosR That shouldn't be happening 😄 I just tested on my machine with a brand new clone of the repo and npm i and got nothing modified. It might be worth opening an issue with all the details so we can see what's going on.

@XhmikosR

Copy link
Copy Markdown
Contributor

Thanks for the replies!

It seems there are plenty of useless files still included too (untested)

This is interesting, but I'd be concerned with removing files from any valid dependencies due to the nature of JavaScript, dynamic requires, etc. Not saying we would never do that, but it seems like not the lowest hanging fruit vs the effort/impact.

There are still some duplicate packages that in theory could be deduplicated by updating the deps where needed upstream:

* `lru-cache`: This will be handled by the next cacache release (which is on our list).
* `make-fetch-happen`: waiting on `node-gyp@9`
* `ms`: These should get deduped somehow. I'd be open to a PR/issue about this.
* `http-proxy-agent`: waiting on `node-gyp@9`
* `@tootallnate/once`: waiting on `node-gyp@9`

EDIT: these deps might be unused or used as devDependencies (needs a closer look):

I just checked both of those and they are deduped in production deps but not dev/docs. We're not as concerned about those.

AFAICT you are already ignoring plenty of dev-related files from production deps hence why I suggested this. I'm not saying these are super important, I agree with you. I'm just saying it should be looked at later, because the gains should be significant :)

@XhmikosR That shouldn't be happening 😄 I just tested on my machine with a brand new clone of the repo and npm i and got nothing modified. It might be worth opening an issue with all the details so we can see what's going on.

I suspect it's something related to Windows and symlinks, so as long as you get a clean repo that's enough for me :)

@lukekarrys

Copy link
Copy Markdown
ContributorAuthor

AFAICT you are already ignoring plenty of dev-related files from production deps hence why I suggested this.

I think it's a good suggestion, but I'm not aware of anywhere we are already doing this. We try to do it in all our own modules via package.json#files so only the minimum necessary files are in the tarball. And we bundle 3rd party deps, but try to not ever change code inside node_modules/ outside of deduping. For most of the files you listed I think the best course of action would be PRs implementing package.json#files.

@XhmikosR

Copy link
Copy Markdown
Contributor

#3362 and https://github.com/npm/cli/blob/latest/node_modules/.gitignore

I do open upstream PRs when possible and I agree that is the optimal solution, but until then you could also leverage the current solution :)

@lukekarrys

Copy link
Copy Markdown
ContributorAuthor

Thank you for showing me that we have a current solution already. I must've missed that we are doing that! 😄

Sign up for freeto 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.

5 participants

@lukekarrys@npm-robot@XhmikosR@wraithgar@nlf
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

update major versions for npm deps + remove log option - #4427

Merged
lukekarrys merged 17 commits into
release-nextfrom
lk/log-deps
Feb 23, 2022
Merged

update major versions for npm deps + remove log option#4427
lukekarrys merged 17 commits into
release-nextfrom
lk/log-deps

Conversation

@lukekarrys

@lukekarryslukekarrys commented Feb 16, 2022

Copy link
Copy Markdown
Contributor

This PR makes breaking changes to the following workspaces (all except libnpmfund):

@npmcli/arborist
libnpmaccess
libnpmdiff
libnpmexec
libnpmhook
libnpmorg
libnpmpack
libnpmpublish
libnpmsearch
libnpmteam
libnpmversion

arborist should be published first, and then bumped inside libnpmexec and libnpmfund before those are published.

npm@8.5.0 /Users/lukekarrys/projects/npm/cli
├── @npmcli/arborist@4.3.1 -> ./workspaces/arborist
├── libnpmaccess@5.0.1 -> ./workspaces/libnpmaccess
├── libnpmdiff@3.0.0 -> ./workspaces/libnpmdiff
├─┬ libnpmexec@3.0.3 -> ./workspaces/libnpmexec
│ └── @npmcli/arborist@4.3.1 deduped -> ./workspaces/arborist
├─┬ libnpmfund@2.0.2 -> ./workspaces/libnpmfund
│ └── @npmcli/arborist@4.3.1 deduped -> ./workspaces/arborist
├── libnpmhook@7.0.1 -> ./workspaces/libnpmhook
├── libnpmorg@3.0.1 -> ./workspaces/libnpmorg
├── libnpmpack@3.1.0 -> ./workspaces/libnpmpack
├── libnpmpublish@5.0.1 -> ./workspaces/libnpmpublish
├── libnpmsearch@4.0.1 -> ./workspaces/libnpmsearch
├── libnpmteam@3.0.1 -> ./workspaces/libnpmteam
└── libnpmversion@2.0.2 -> ./workspaces/libnpmversion

@npm-robot

npm-robot commented Feb 16, 2022

Copy link
Copy Markdown
Contributor

found 20 benchmarks with statistically significant performance improvements

  • app-large: clean, lock-only, cache-only, cache-only:peer-deps, modules-only, no-lock, no-cache, no-modules, no-clean, no-clean:audit
  • app-medium: clean, lock-only, cache-only, cache-only:peer-deps, modules-only, no-lock, no-cache, no-modules, no-clean, no-clean:audit
timing results
app-largecleanlock-onlycache-onlycache-only
peer-deps
modules-onlyno-lockno-cacheno-modulesno-cleanno-clean
audit
npm@853.734 ±0.6032.257 ±0.2452.811 ±47.5322.225 ±1.033.316 ±0.043.308 ±0.012.777 ±0.1012.829 ±0.162.677 ±0.023.762 ±0.00
#44270.487 ±0.010.487 ±0.010.493 ±0.010.489 ±0.000.486 ±0.000.485 ±0.010.483 ±0.000.482 ±0.000.482 ±0.000.487 ±0.00
app-mediumcleanlock-onlycache-onlycache-only
peer-deps
modules-onlyno-lockno-cacheno-modulesno-cleanno-clean
audit
npm@839.059 ±1.4025.581 ±0.1014.313 ±0.1815.488 ±0.023.045 ±0.032.998 ±0.012.689 ±0.039.578 ±0.102.512 ±0.033.434 ±0.02
#44270.491 ±0.010.507 ±0.010.484 ±0.000.481 ±0.000.488 ±0.010.480 ±0.000.491 ±0.000.491 ±0.020.486 ±0.000.489 ±0.00

@lukekarrys
lukekarrysforce-pushed the lk/log-deps branch 2 times, most recently from 8b3bcf6 to b1cc530CompareFebruary 22, 2022 06:30
@lukekarrys
lukekarrys marked this pull request as ready for review February 22, 2022 06:43
@lukekarrys
lukekarrys requested a review from a team as a code ownerFebruary 22, 2022 06:43
@lukekarryslukekarrys changed the title lk/log depsupdate major versions for npm deps + remove log optionFeb 22, 2022
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: this drops support for the `log` property and the
banner is shown using the silent option
BREAKING CHANGE: this drops support for the `log` property
BREAKING CHANGE: this drops support for the `log` property
nlf
nlf approved these changes Feb 23, 2022

@nlfnlf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this one is a doozy lol

we looked at this together during our pairing session, i then checked out this branch and kicked the tires briefly and saw no issues. i think this is good to land!

@lukekarrys
lukekarrys merged commit ce1c2bf into release-nextFeb 23, 2022
@lukekarrys
lukekarrys deleted the lk/log-deps branch February 23, 2022 23:59
@XhmikosR

XhmikosR commented Feb 24, 2022

Copy link
Copy Markdown
Contributor

@lukekarrys I don't want to open a new issue, but happy to do it if you think it's worth it.

There are still some duplicate packages that in theory could be deduplicated by updating the deps where needed upstream:

C:\Users\xmr\Desktop\cli>git checkout release-next
Already on 'release-next'
Your branch is up to date with 'origin/release-next'.
C:\Users\xmr\Desktop\cli>find-duplicate-dependencies
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!
This package has the following duplicate dependencies:
lru-cache:
[
{
name: 'lru-cache',
version: '6.0.0',
from: 'lru-cache@6.0.0',
path: 'npm/cacache'
},
{
name: 'lru-cache',
version: '7.3.1',
from: 'lru-cache@7.3.1',
path: 'npm/make-fetch-happen'
}
]
make-fetch-happen:
[
{
name: 'make-fetch-happen',
version: '10.0.3',
from: 'make-fetch-happen@10.0.3',
path: 'npm'
},
{
name: 'make-fetch-happen',
version: '9.1.0',
from: 'make-fetch-happen@9.1.0',
path: 'npm/node-gyp'
}
]
ms:
[
{
name: 'ms',
version: '2.1.2',
from: 'ms@2.1.2',
path: 'npm/make-fetch-happen/agentkeepalive/debug'
},
{
name: 'ms',
version: '2.1.3',
from: 'ms@2.1.3',
path: 'npm/make-fetch-happen/agentkeepalive/humanize-ms'
}
]
http-proxy-agent:
[
{
name: 'http-proxy-agent',
version: '5.0.0',
from: 'http-proxy-agent@5.0.0',
path: 'npm/make-fetch-happen'
},
{
name: 'http-proxy-agent',
version: '4.0.1',
from: 'http-proxy-agent@4.0.1',
path: 'npm/node-gyp/make-fetch-happen'
}
]
@tootallnate/once:
[
{
name: '@tootallnate/once',
version: '2.0.0',
from: '@tootallnate/once@2.0.0',
path: 'npm/make-fetch-happen/http-proxy-agent'
},
{
name: '@tootallnate/once',
version: '1.1.2',
from: '@tootallnate/once@1.1.2',
path: 'npm/node-gyp/make-fetch-happen/http-proxy-agent'
}
]

Should save a few bytes/files if these are deduped :)

EDIT: these deps might be unused or used as devDependencies (needs a closer look):

  • chownr
  • write-file-atomic

@XhmikosR

XhmikosR commented Feb 24, 2022

Copy link
Copy Markdown
Contributor

It seems there are plenty of useless files still included too (untested):

Files that could possibly be removed
 node_modules/ansicolors/test/ansicolors.js | 71 --
node_modules/ansistyles/test/ansistyles.js | 15 -
node_modules/archy/examples/beep.js | 24 -
node_modules/archy/examples/multi_line.js | 25 -
node_modules/archy/test/beep.js | 40 -
node_modules/archy/test/multi_line.js | 45 -
node_modules/archy/test/non_unicode.js | 40 -
node_modules/colors/examples/normal-usage.js | 82 --
node_modules/colors/examples/safe-string.js | 79 --
node_modules/concat-map/example/map.js | 6 -
node_modules/concat-map/test/map.js | 39 -
node_modules/delegates/test/index.js | 94 --
node_modules/dezalgo/test/basic.js | 29 -
node_modules/encoding/test/test.js | 49 -
node_modules/err-code/test/test.js | 159 ---
node_modules/function-bind/test/index.js | 252 -----
node_modules/gauge/lib/demo.js | 45 -
node_modules/has/test/index.js | 10 -
node_modules/ip/test/api-test.js | 407 -------
node_modules/is-core-module/test/index.js | 130 ---
node_modules/isexe/test/basic.js | 221 ----
node_modules/jsonparse/examples/twitterfeed.js | 30 -
node_modules/jsonparse/test/big-token.js | 24 -
node_modules/jsonparse/test/boundary.js | 110 --
node_modules/jsonparse/test/offset.js | 67 --
node_modules/jsonparse/test/primitives.js | 57 -
node_modules/jsonparse/test/surrogate.js | 26 -
node_modules/jsonparse/test/unvalid.js | 15 -
node_modules/jsonparse/test/utf8.js | 38 -
node_modules/minipass-sized/test/basic.js | 83 --
.../node-gyp/gyp/tools/emacs/testdata/media.gyp | 1105 -------------------
.../gyp/tools/emacs/testdata/media.gyp.fontified | 1107 --------------------
node_modules/node-gyp/test/common.js | 3 -
.../test/fixtures/VS_2017_BuildTools_minimal.txt | 1 -
.../test/fixtures/VS_2017_Community_workload.txt | 1 -
.../node-gyp/test/fixtures/VS_2017_Express.txt | 1 -
.../node-gyp/test/fixtures/VS_2017_Unusable.txt | 1 -
.../test/fixtures/VS_2019_BuildTools_minimal.txt | 1 -
.../test/fixtures/VS_2019_Community_workload.txt | 1 -
.../node-gyp/test/fixtures/VS_2019_Preview.txt | 1 -
node_modules/node-gyp/test/fixtures/ca-bundle.crt | 40 -
node_modules/node-gyp/test/fixtures/ca.crt | 21 -
.../test/fixtures/nodedir/include/node/config.gypi | 6 -
node_modules/node-gyp/test/fixtures/server.crt | 21 -
node_modules/node-gyp/test/fixtures/server.key | 27 -
.../node-gyp/test/fixtures/test-charmap.py | 31 -
node_modules/node-gyp/test/process-exec-sync.js | 140 ---
node_modules/node-gyp/test/simple-proxy.js | 27 -
node_modules/node-gyp/test/test-addon.js | 150 ---
.../node-gyp/test/test-configure-python.js | 82 --
.../node-gyp/test/test-create-config-gypi.js | 70 --
node_modules/node-gyp/test/test-download.js | 207 ----
.../node-gyp/test/test-find-accessible-sync.js | 84 --
.../node-gyp/test/test-find-node-directory.js | 119 ---
node_modules/node-gyp/test/test-find-python.js | 226 ----
.../node-gyp/test/test-find-visualstudio.js | 676 ------------
node_modules/node-gyp/test/test-install.js | 46 -
node_modules/node-gyp/test/test-options.js | 31 -
node_modules/node-gyp/test/test-process-release.js | 434 --------
.../npm-normalize-package-bin/test/array.js | 37 -
.../npm-normalize-package-bin/test/nobin.js | 35 -
.../npm-normalize-package-bin/test/object.js | 141 ---
.../npm-normalize-package-bin/test/string.js | 37 -
node_modules/promise-all-reject-late/test/index.js | 88 --
node_modules/promise-retry/test/test.js | 263 -----
node_modules/promzard/example/buffer.js | 12 -
node_modules/promzard/example/index.js | 11 -
.../promzard/example/npm-init/init-input.js | 191 ----
node_modules/promzard/example/npm-init/init.js | 37 -
.../promzard/example/npm-init/package.json | 10 -
node_modules/promzard/example/substack-input.js | 61 --
node_modules/promzard/test/basic.js | 91 --
node_modules/promzard/test/buffer.js | 84 --
node_modules/promzard/test/exports.input | 5 -
node_modules/promzard/test/exports.js | 48 -
node_modules/promzard/test/fn.input | 18 -
node_modules/promzard/test/fn.js | 56 -
node_modules/promzard/test/simple.input | 8 -
node_modules/promzard/test/simple.js | 30 -
node_modules/promzard/test/validate.input | 8 -
node_modules/promzard/test/validate.js | 20 -
node_modules/qrcode-terminal/example/basic.js | 2 -
node_modules/qrcode-terminal/example/basic.png | Bin 46426 -> 0 bytes
node_modules/qrcode-terminal/example/callback.js | 4 -
.../qrcode-terminal/example/small-qrcode.js | 6 -
node_modules/qrcode-terminal/test/main.js | 63 --
node_modules/retry/example/dns.js | 31 -
node_modules/retry/example/stop.js | 40 -
node_modules/retry/test/common.js | 10 -
.../retry/test/integration/test-forever.js | 24 -
.../retry/test/integration/test-retry-operation.js | 258 -----
.../retry/test/integration/test-retry-wrap.js | 101 --
.../retry/test/integration/test-timeouts.js | 69 --
node_modules/socks/docs/examples/index.md | 17 -
.../docs/examples/javascript/associateExample.md | 90 --
.../socks/docs/examples/javascript/bindExample.md | 83 --
.../docs/examples/javascript/connectExample.md | 258 -----
.../docs/examples/typescript/associateExample.md | 93 --
.../socks/docs/examples/typescript/bindExample.md | 86 --
.../docs/examples/typescript/connectExample.md | 265 -----
node_modules/text-table/example/align.js | 8 -
node_modules/text-table/example/center.js | 8 -
node_modules/text-table/example/dotalign.js | 9 -
node_modules/text-table/example/doubledot.js | 11 -
node_modules/text-table/example/table.js | 6 -
node_modules/text-table/test/align.js | 18 -
node_modules/text-table/test/ansi-colors.js | 32 -
node_modules/text-table/test/center.js | 18 -
node_modules/text-table/test/dotalign.js | 20 -
node_modules/text-table/test/doubledot.js | 24 -
node_modules/text-table/test/table.js | 14 -
node_modules/unique-filename/test/index.js | 23 -
node_modules/unique-slug/test/index.js | 13 -
.../validate-npm-package-name/test/index.js | 109 --
node_modules/wcwidth/test/index.js | 64 --
115 files changed, 10140 deletions(-)

BTW, nice to see that some work is done already in regards to the file size/number of files! https://packagephobia.com/result?p=npm%406.14.16%2Cnpm%407.24.2%2Cnpm%408.5.1

@wraithgar

Copy link
Copy Markdown
Contributor

Most of those are because we're waiting on node-gyp to land its next semver major nodejs/node-gyp#2603

@XhmikosR

Copy link
Copy Markdown
Contributor

Both issues?

BTW when I do npm install I get thousands of modified files on my machine.

@lukekarrys

Copy link
Copy Markdown
ContributorAuthor

It seems there are plenty of useless files still included too (untested)

This is interesting, but I'd be concerned with removing files from any valid dependencies due to the nature of JavaScript, dynamic requires, etc. Not saying we would never do that, but it seems like not the lowest hanging fruit vs the effort/impact.

There are still some duplicate packages that in theory could be deduplicated by updating the deps where needed upstream:

  • lru-cache: This will be handled by the next cacache release (which is on our list).
  • make-fetch-happen: waiting on node-gyp@9
  • ms: These should get deduped somehow. I'd be open to a PR/issue about this.
  • http-proxy-agent: waiting on node-gyp@9
  • @tootallnate/once: waiting on node-gyp@9

EDIT: these deps might be unused or used as devDependencies (needs a closer look):

I just checked both of those and they are deduped in production deps but not dev/docs. We're not as concerned about those.

@lukekarrys

Copy link
Copy Markdown
ContributorAuthor

BTW when I do npm install I get thousands of modified files on my machine.

@XhmikosR That shouldn't be happening 😄 I just tested on my machine with a brand new clone of the repo and npm i and got nothing modified. It might be worth opening an issue with all the details so we can see what's going on.

@XhmikosR

Copy link
Copy Markdown
Contributor

Thanks for the replies!

It seems there are plenty of useless files still included too (untested)

This is interesting, but I'd be concerned with removing files from any valid dependencies due to the nature of JavaScript, dynamic requires, etc. Not saying we would never do that, but it seems like not the lowest hanging fruit vs the effort/impact.

There are still some duplicate packages that in theory could be deduplicated by updating the deps where needed upstream:

* `lru-cache`: This will be handled by the next cacache release (which is on our list).
* `make-fetch-happen`: waiting on `node-gyp@9`
* `ms`: These should get deduped somehow. I'd be open to a PR/issue about this.
* `http-proxy-agent`: waiting on `node-gyp@9`
* `@tootallnate/once`: waiting on `node-gyp@9`

EDIT: these deps might be unused or used as devDependencies (needs a closer look):

I just checked both of those and they are deduped in production deps but not dev/docs. We're not as concerned about those.

AFAICT you are already ignoring plenty of dev-related files from production deps hence why I suggested this. I'm not saying these are super important, I agree with you. I'm just saying it should be looked at later, because the gains should be significant :)

@XhmikosR That shouldn't be happening 😄 I just tested on my machine with a brand new clone of the repo and npm i and got nothing modified. It might be worth opening an issue with all the details so we can see what's going on.

I suspect it's something related to Windows and symlinks, so as long as you get a clean repo that's enough for me :)

@lukekarrys

Copy link
Copy Markdown
ContributorAuthor

AFAICT you are already ignoring plenty of dev-related files from production deps hence why I suggested this.

I think it's a good suggestion, but I'm not aware of anywhere we are already doing this. We try to do it in all our own modules via package.json#files so only the minimum necessary files are in the tarball. And we bundle 3rd party deps, but try to not ever change code inside node_modules/ outside of deduping. For most of the files you listed I think the best course of action would be PRs implementing package.json#files.

@XhmikosR

Copy link
Copy Markdown
Contributor

#3362 and https://github.com/npm/cli/blob/latest/node_modules/.gitignore

I do open upstream PRs when possible and I agree that is the optimal solution, but until then you could also leverage the current solution :)

@lukekarrys

Copy link
Copy Markdown
ContributorAuthor

Thank you for showing me that we have a current solution already. I must've missed that we are doing that! 😄

Sign up for freeto 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.

5 participants

@lukekarrys@npm-robot@XhmikosR@wraithgar@nlf
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

update major versions for npm deps + remove log option - #4427

Merged
lukekarrys merged 17 commits into
release-nextfrom
lk/log-deps
Feb 23, 2022
Merged

update major versions for npm deps + remove log option#4427
lukekarrys merged 17 commits into
release-nextfrom
lk/log-deps

Conversation

@lukekarrys

@lukekarryslukekarrys commented Feb 16, 2022

Copy link
Copy Markdown
Contributor

This PR makes breaking changes to the following workspaces (all except libnpmfund):

@npmcli/arborist
libnpmaccess
libnpmdiff
libnpmexec
libnpmhook
libnpmorg
libnpmpack
libnpmpublish
libnpmsearch
libnpmteam
libnpmversion

arborist should be published first, and then bumped inside libnpmexec and libnpmfund before those are published.

npm@8.5.0 /Users/lukekarrys/projects/npm/cli
├── @npmcli/arborist@4.3.1 -> ./workspaces/arborist
├── libnpmaccess@5.0.1 -> ./workspaces/libnpmaccess
├── libnpmdiff@3.0.0 -> ./workspaces/libnpmdiff
├─┬ libnpmexec@3.0.3 -> ./workspaces/libnpmexec
│ └── @npmcli/arborist@4.3.1 deduped -> ./workspaces/arborist
├─┬ libnpmfund@2.0.2 -> ./workspaces/libnpmfund
│ └── @npmcli/arborist@4.3.1 deduped -> ./workspaces/arborist
├── libnpmhook@7.0.1 -> ./workspaces/libnpmhook
├── libnpmorg@3.0.1 -> ./workspaces/libnpmorg
├── libnpmpack@3.1.0 -> ./workspaces/libnpmpack
├── libnpmpublish@5.0.1 -> ./workspaces/libnpmpublish
├── libnpmsearch@4.0.1 -> ./workspaces/libnpmsearch
├── libnpmteam@3.0.1 -> ./workspaces/libnpmteam
└── libnpmversion@2.0.2 -> ./workspaces/libnpmversion

@npm-robot

npm-robot commented Feb 16, 2022

Copy link
Copy Markdown
Contributor

found 20 benchmarks with statistically significant performance improvements

  • app-large: clean, lock-only, cache-only, cache-only:peer-deps, modules-only, no-lock, no-cache, no-modules, no-clean, no-clean:audit
  • app-medium: clean, lock-only, cache-only, cache-only:peer-deps, modules-only, no-lock, no-cache, no-modules, no-clean, no-clean:audit
timing results
app-largecleanlock-onlycache-onlycache-only
peer-deps
modules-onlyno-lockno-cacheno-modulesno-cleanno-clean
audit
npm@853.734 ±0.6032.257 ±0.2452.811 ±47.5322.225 ±1.033.316 ±0.043.308 ±0.012.777 ±0.1012.829 ±0.162.677 ±0.023.762 ±0.00
#44270.487 ±0.010.487 ±0.010.493 ±0.010.489 ±0.000.486 ±0.000.485 ±0.010.483 ±0.000.482 ±0.000.482 ±0.000.487 ±0.00
app-mediumcleanlock-onlycache-onlycache-only
peer-deps
modules-onlyno-lockno-cacheno-modulesno-cleanno-clean
audit
npm@839.059 ±1.4025.581 ±0.1014.313 ±0.1815.488 ±0.023.045 ±0.032.998 ±0.012.689 ±0.039.578 ±0.102.512 ±0.033.434 ±0.02
#44270.491 ±0.010.507 ±0.010.484 ±0.000.481 ±0.000.488 ±0.010.480 ±0.000.491 ±0.000.491 ±0.020.486 ±0.000.489 ±0.00

@lukekarrys
lukekarrysforce-pushed the lk/log-deps branch 2 times, most recently from 8b3bcf6 to b1cc530CompareFebruary 22, 2022 06:30
@lukekarrys
lukekarrys marked this pull request as ready for review February 22, 2022 06:43
@lukekarrys
lukekarrys requested a review from a team as a code ownerFebruary 22, 2022 06:43
@lukekarryslukekarrys changed the title lk/log depsupdate major versions for npm deps + remove log optionFeb 22, 2022
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: this drops support for the `log` property and the
banner is shown using the silent option
BREAKING CHANGE: this drops support for the `log` property
BREAKING CHANGE: this drops support for the `log` property
nlf
nlf approved these changes Feb 23, 2022

@nlfnlf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this one is a doozy lol

we looked at this together during our pairing session, i then checked out this branch and kicked the tires briefly and saw no issues. i think this is good to land!

@lukekarrys
lukekarrys merged commit ce1c2bf into release-nextFeb 23, 2022
@lukekarrys
lukekarrys deleted the lk/log-deps branch February 23, 2022 23:59
@XhmikosR

XhmikosR commented Feb 24, 2022

Copy link
Copy Markdown
Contributor

@lukekarrys I don't want to open a new issue, but happy to do it if you think it's worth it.

There are still some duplicate packages that in theory could be deduplicated by updating the deps where needed upstream:

C:\Users\xmr\Desktop\cli>git checkout release-next
Already on 'release-next'
Your branch is up to date with 'origin/release-next'.
C:\Users\xmr\Desktop\cli>find-duplicate-dependencies
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!
This package has the following duplicate dependencies:
lru-cache:
[
{
name: 'lru-cache',
version: '6.0.0',
from: 'lru-cache@6.0.0',
path: 'npm/cacache'
},
{
name: 'lru-cache',
version: '7.3.1',
from: 'lru-cache@7.3.1',
path: 'npm/make-fetch-happen'
}
]
make-fetch-happen:
[
{
name: 'make-fetch-happen',
version: '10.0.3',
from: 'make-fetch-happen@10.0.3',
path: 'npm'
},
{
name: 'make-fetch-happen',
version: '9.1.0',
from: 'make-fetch-happen@9.1.0',
path: 'npm/node-gyp'
}
]
ms:
[
{
name: 'ms',
version: '2.1.2',
from: 'ms@2.1.2',
path: 'npm/make-fetch-happen/agentkeepalive/debug'
},
{
name: 'ms',
version: '2.1.3',
from: 'ms@2.1.3',
path: 'npm/make-fetch-happen/agentkeepalive/humanize-ms'
}
]
http-proxy-agent:
[
{
name: 'http-proxy-agent',
version: '5.0.0',
from: 'http-proxy-agent@5.0.0',
path: 'npm/make-fetch-happen'
},
{
name: 'http-proxy-agent',
version: '4.0.1',
from: 'http-proxy-agent@4.0.1',
path: 'npm/node-gyp/make-fetch-happen'
}
]
@tootallnate/once:
[
{
name: '@tootallnate/once',
version: '2.0.0',
from: '@tootallnate/once@2.0.0',
path: 'npm/make-fetch-happen/http-proxy-agent'
},
{
name: '@tootallnate/once',
version: '1.1.2',
from: '@tootallnate/once@1.1.2',
path: 'npm/node-gyp/make-fetch-happen/http-proxy-agent'
}
]

Should save a few bytes/files if these are deduped :)

EDIT: these deps might be unused or used as devDependencies (needs a closer look):

  • chownr
  • write-file-atomic

@XhmikosR

XhmikosR commented Feb 24, 2022

Copy link
Copy Markdown
Contributor

It seems there are plenty of useless files still included too (untested):

Files that could possibly be removed
 node_modules/ansicolors/test/ansicolors.js | 71 --
node_modules/ansistyles/test/ansistyles.js | 15 -
node_modules/archy/examples/beep.js | 24 -
node_modules/archy/examples/multi_line.js | 25 -
node_modules/archy/test/beep.js | 40 -
node_modules/archy/test/multi_line.js | 45 -
node_modules/archy/test/non_unicode.js | 40 -
node_modules/colors/examples/normal-usage.js | 82 --
node_modules/colors/examples/safe-string.js | 79 --
node_modules/concat-map/example/map.js | 6 -
node_modules/concat-map/test/map.js | 39 -
node_modules/delegates/test/index.js | 94 --
node_modules/dezalgo/test/basic.js | 29 -
node_modules/encoding/test/test.js | 49 -
node_modules/err-code/test/test.js | 159 ---
node_modules/function-bind/test/index.js | 252 -----
node_modules/gauge/lib/demo.js | 45 -
node_modules/has/test/index.js | 10 -
node_modules/ip/test/api-test.js | 407 -------
node_modules/is-core-module/test/index.js | 130 ---
node_modules/isexe/test/basic.js | 221 ----
node_modules/jsonparse/examples/twitterfeed.js | 30 -
node_modules/jsonparse/test/big-token.js | 24 -
node_modules/jsonparse/test/boundary.js | 110 --
node_modules/jsonparse/test/offset.js | 67 --
node_modules/jsonparse/test/primitives.js | 57 -
node_modules/jsonparse/test/surrogate.js | 26 -
node_modules/jsonparse/test/unvalid.js | 15 -
node_modules/jsonparse/test/utf8.js | 38 -
node_modules/minipass-sized/test/basic.js | 83 --
.../node-gyp/gyp/tools/emacs/testdata/media.gyp | 1105 -------------------
.../gyp/tools/emacs/testdata/media.gyp.fontified | 1107 --------------------
node_modules/node-gyp/test/common.js | 3 -
.../test/fixtures/VS_2017_BuildTools_minimal.txt | 1 -
.../test/fixtures/VS_2017_Community_workload.txt | 1 -
.../node-gyp/test/fixtures/VS_2017_Express.txt | 1 -
.../node-gyp/test/fixtures/VS_2017_Unusable.txt | 1 -
.../test/fixtures/VS_2019_BuildTools_minimal.txt | 1 -
.../test/fixtures/VS_2019_Community_workload.txt | 1 -
.../node-gyp/test/fixtures/VS_2019_Preview.txt | 1 -
node_modules/node-gyp/test/fixtures/ca-bundle.crt | 40 -
node_modules/node-gyp/test/fixtures/ca.crt | 21 -
.../test/fixtures/nodedir/include/node/config.gypi | 6 -
node_modules/node-gyp/test/fixtures/server.crt | 21 -
node_modules/node-gyp/test/fixtures/server.key | 27 -
.../node-gyp/test/fixtures/test-charmap.py | 31 -
node_modules/node-gyp/test/process-exec-sync.js | 140 ---
node_modules/node-gyp/test/simple-proxy.js | 27 -
node_modules/node-gyp/test/test-addon.js | 150 ---
.../node-gyp/test/test-configure-python.js | 82 --
.../node-gyp/test/test-create-config-gypi.js | 70 --
node_modules/node-gyp/test/test-download.js | 207 ----
.../node-gyp/test/test-find-accessible-sync.js | 84 --
.../node-gyp/test/test-find-node-directory.js | 119 ---
node_modules/node-gyp/test/test-find-python.js | 226 ----
.../node-gyp/test/test-find-visualstudio.js | 676 ------------
node_modules/node-gyp/test/test-install.js | 46 -
node_modules/node-gyp/test/test-options.js | 31 -
node_modules/node-gyp/test/test-process-release.js | 434 --------
.../npm-normalize-package-bin/test/array.js | 37 -
.../npm-normalize-package-bin/test/nobin.js | 35 -
.../npm-normalize-package-bin/test/object.js | 141 ---
.../npm-normalize-package-bin/test/string.js | 37 -
node_modules/promise-all-reject-late/test/index.js | 88 --
node_modules/promise-retry/test/test.js | 263 -----
node_modules/promzard/example/buffer.js | 12 -
node_modules/promzard/example/index.js | 11 -
.../promzard/example/npm-init/init-input.js | 191 ----
node_modules/promzard/example/npm-init/init.js | 37 -
.../promzard/example/npm-init/package.json | 10 -
node_modules/promzard/example/substack-input.js | 61 --
node_modules/promzard/test/basic.js | 91 --
node_modules/promzard/test/buffer.js | 84 --
node_modules/promzard/test/exports.input | 5 -
node_modules/promzard/test/exports.js | 48 -
node_modules/promzard/test/fn.input | 18 -
node_modules/promzard/test/fn.js | 56 -
node_modules/promzard/test/simple.input | 8 -
node_modules/promzard/test/simple.js | 30 -
node_modules/promzard/test/validate.input | 8 -
node_modules/promzard/test/validate.js | 20 -
node_modules/qrcode-terminal/example/basic.js | 2 -
node_modules/qrcode-terminal/example/basic.png | Bin 46426 -> 0 bytes
node_modules/qrcode-terminal/example/callback.js | 4 -
.../qrcode-terminal/example/small-qrcode.js | 6 -
node_modules/qrcode-terminal/test/main.js | 63 --
node_modules/retry/example/dns.js | 31 -
node_modules/retry/example/stop.js | 40 -
node_modules/retry/test/common.js | 10 -
.../retry/test/integration/test-forever.js | 24 -
.../retry/test/integration/test-retry-operation.js | 258 -----
.../retry/test/integration/test-retry-wrap.js | 101 --
.../retry/test/integration/test-timeouts.js | 69 --
node_modules/socks/docs/examples/index.md | 17 -
.../docs/examples/javascript/associateExample.md | 90 --
.../socks/docs/examples/javascript/bindExample.md | 83 --
.../docs/examples/javascript/connectExample.md | 258 -----
.../docs/examples/typescript/associateExample.md | 93 --
.../socks/docs/examples/typescript/bindExample.md | 86 --
.../docs/examples/typescript/connectExample.md | 265 -----
node_modules/text-table/example/align.js | 8 -
node_modules/text-table/example/center.js | 8 -
node_modules/text-table/example/dotalign.js | 9 -
node_modules/text-table/example/doubledot.js | 11 -
node_modules/text-table/example/table.js | 6 -
node_modules/text-table/test/align.js | 18 -
node_modules/text-table/test/ansi-colors.js | 32 -
node_modules/text-table/test/center.js | 18 -
node_modules/text-table/test/dotalign.js | 20 -
node_modules/text-table/test/doubledot.js | 24 -
node_modules/text-table/test/table.js | 14 -
node_modules/unique-filename/test/index.js | 23 -
node_modules/unique-slug/test/index.js | 13 -
.../validate-npm-package-name/test/index.js | 109 --
node_modules/wcwidth/test/index.js | 64 --
115 files changed, 10140 deletions(-)

BTW, nice to see that some work is done already in regards to the file size/number of files! https://packagephobia.com/result?p=npm%406.14.16%2Cnpm%407.24.2%2Cnpm%408.5.1

@wraithgar

Copy link
Copy Markdown
Contributor

Most of those are because we're waiting on node-gyp to land its next semver major nodejs/node-gyp#2603

@XhmikosR

Copy link
Copy Markdown
Contributor

Both issues?

BTW when I do npm install I get thousands of modified files on my machine.

@lukekarrys

Copy link
Copy Markdown
ContributorAuthor

It seems there are plenty of useless files still included too (untested)

This is interesting, but I'd be concerned with removing files from any valid dependencies due to the nature of JavaScript, dynamic requires, etc. Not saying we would never do that, but it seems like not the lowest hanging fruit vs the effort/impact.

There are still some duplicate packages that in theory could be deduplicated by updating the deps where needed upstream:

  • lru-cache: This will be handled by the next cacache release (which is on our list).
  • make-fetch-happen: waiting on node-gyp@9
  • ms: These should get deduped somehow. I'd be open to a PR/issue about this.
  • http-proxy-agent: waiting on node-gyp@9
  • @tootallnate/once: waiting on node-gyp@9

EDIT: these deps might be unused or used as devDependencies (needs a closer look):

I just checked both of those and they are deduped in production deps but not dev/docs. We're not as concerned about those.

@lukekarrys

Copy link
Copy Markdown
ContributorAuthor

BTW when I do npm install I get thousands of modified files on my machine.

@XhmikosR That shouldn't be happening 😄 I just tested on my machine with a brand new clone of the repo and npm i and got nothing modified. It might be worth opening an issue with all the details so we can see what's going on.

@XhmikosR

Copy link
Copy Markdown
Contributor

Thanks for the replies!

It seems there are plenty of useless files still included too (untested)

This is interesting, but I'd be concerned with removing files from any valid dependencies due to the nature of JavaScript, dynamic requires, etc. Not saying we would never do that, but it seems like not the lowest hanging fruit vs the effort/impact.

There are still some duplicate packages that in theory could be deduplicated by updating the deps where needed upstream:

* `lru-cache`: This will be handled by the next cacache release (which is on our list).
* `make-fetch-happen`: waiting on `node-gyp@9`
* `ms`: These should get deduped somehow. I'd be open to a PR/issue about this.
* `http-proxy-agent`: waiting on `node-gyp@9`
* `@tootallnate/once`: waiting on `node-gyp@9`

EDIT: these deps might be unused or used as devDependencies (needs a closer look):

I just checked both of those and they are deduped in production deps but not dev/docs. We're not as concerned about those.

AFAICT you are already ignoring plenty of dev-related files from production deps hence why I suggested this. I'm not saying these are super important, I agree with you. I'm just saying it should be looked at later, because the gains should be significant :)

@XhmikosR That shouldn't be happening 😄 I just tested on my machine with a brand new clone of the repo and npm i and got nothing modified. It might be worth opening an issue with all the details so we can see what's going on.

I suspect it's something related to Windows and symlinks, so as long as you get a clean repo that's enough for me :)

@lukekarrys

Copy link
Copy Markdown
ContributorAuthor

AFAICT you are already ignoring plenty of dev-related files from production deps hence why I suggested this.

I think it's a good suggestion, but I'm not aware of anywhere we are already doing this. We try to do it in all our own modules via package.json#files so only the minimum necessary files are in the tarball. And we bundle 3rd party deps, but try to not ever change code inside node_modules/ outside of deduping. For most of the files you listed I think the best course of action would be PRs implementing package.json#files.

@XhmikosR

Copy link
Copy Markdown
Contributor

#3362 and https://github.com/npm/cli/blob/latest/node_modules/.gitignore

I do open upstream PRs when possible and I agree that is the optimal solution, but until then you could also leverage the current solution :)

@lukekarrys

Copy link
Copy Markdown
ContributorAuthor

Thank you for showing me that we have a current solution already. I must've missed that we are doing that! 😄

Sign up for freeto 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.

5 participants

@lukekarrys@npm-robot@XhmikosR@wraithgar@nlf
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

update major versions for npm deps + remove log option - #4427

Merged
lukekarrys merged 17 commits into
release-nextfrom
lk/log-deps
Feb 23, 2022
Merged

update major versions for npm deps + remove log option#4427
lukekarrys merged 17 commits into
release-nextfrom
lk/log-deps

Conversation

@lukekarrys

@lukekarryslukekarrys commented Feb 16, 2022

Copy link
Copy Markdown
Contributor

This PR makes breaking changes to the following workspaces (all except libnpmfund):

@npmcli/arborist
libnpmaccess
libnpmdiff
libnpmexec
libnpmhook
libnpmorg
libnpmpack
libnpmpublish
libnpmsearch
libnpmteam
libnpmversion

arborist should be published first, and then bumped inside libnpmexec and libnpmfund before those are published.

npm@8.5.0 /Users/lukekarrys/projects/npm/cli
├── @npmcli/arborist@4.3.1 -> ./workspaces/arborist
├── libnpmaccess@5.0.1 -> ./workspaces/libnpmaccess
├── libnpmdiff@3.0.0 -> ./workspaces/libnpmdiff
├─┬ libnpmexec@3.0.3 -> ./workspaces/libnpmexec
│ └── @npmcli/arborist@4.3.1 deduped -> ./workspaces/arborist
├─┬ libnpmfund@2.0.2 -> ./workspaces/libnpmfund
│ └── @npmcli/arborist@4.3.1 deduped -> ./workspaces/arborist
├── libnpmhook@7.0.1 -> ./workspaces/libnpmhook
├── libnpmorg@3.0.1 -> ./workspaces/libnpmorg
├── libnpmpack@3.1.0 -> ./workspaces/libnpmpack
├── libnpmpublish@5.0.1 -> ./workspaces/libnpmpublish
├── libnpmsearch@4.0.1 -> ./workspaces/libnpmsearch
├── libnpmteam@3.0.1 -> ./workspaces/libnpmteam
└── libnpmversion@2.0.2 -> ./workspaces/libnpmversion

@npm-robot

npm-robot commented Feb 16, 2022

Copy link
Copy Markdown
Contributor

found 20 benchmarks with statistically significant performance improvements

  • app-large: clean, lock-only, cache-only, cache-only:peer-deps, modules-only, no-lock, no-cache, no-modules, no-clean, no-clean:audit
  • app-medium: clean, lock-only, cache-only, cache-only:peer-deps, modules-only, no-lock, no-cache, no-modules, no-clean, no-clean:audit
timing results
app-largecleanlock-onlycache-onlycache-only
peer-deps
modules-onlyno-lockno-cacheno-modulesno-cleanno-clean
audit
npm@853.734 ±0.6032.257 ±0.2452.811 ±47.5322.225 ±1.033.316 ±0.043.308 ±0.012.777 ±0.1012.829 ±0.162.677 ±0.023.762 ±0.00
#44270.487 ±0.010.487 ±0.010.493 ±0.010.489 ±0.000.486 ±0.000.485 ±0.010.483 ±0.000.482 ±0.000.482 ±0.000.487 ±0.00
app-mediumcleanlock-onlycache-onlycache-only
peer-deps
modules-onlyno-lockno-cacheno-modulesno-cleanno-clean
audit
npm@839.059 ±1.4025.581 ±0.1014.313 ±0.1815.488 ±0.023.045 ±0.032.998 ±0.012.689 ±0.039.578 ±0.102.512 ±0.033.434 ±0.02
#44270.491 ±0.010.507 ±0.010.484 ±0.000.481 ±0.000.488 ±0.010.480 ±0.000.491 ±0.000.491 ±0.020.486 ±0.000.489 ±0.00

@lukekarrys
lukekarrysforce-pushed the lk/log-deps branch 2 times, most recently from 8b3bcf6 to b1cc530CompareFebruary 22, 2022 06:30
@lukekarrys
lukekarrys marked this pull request as ready for review February 22, 2022 06:43
@lukekarrys
lukekarrys requested a review from a team as a code ownerFebruary 22, 2022 06:43
@lukekarryslukekarrys changed the title lk/log depsupdate major versions for npm deps + remove log optionFeb 22, 2022
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: the log option is no longer passed to the updated deps
BREAKING CHANGE: this drops support for the `log` property and the
banner is shown using the silent option
BREAKING CHANGE: this drops support for the `log` property
BREAKING CHANGE: this drops support for the `log` property
nlf
nlf approved these changes Feb 23, 2022

@nlfnlf left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this one is a doozy lol

we looked at this together during our pairing session, i then checked out this branch and kicked the tires briefly and saw no issues. i think this is good to land!

@lukekarrys
lukekarrys merged commit ce1c2bf into release-nextFeb 23, 2022
@lukekarrys
lukekarrys deleted the lk/log-deps branch February 23, 2022 23:59
@XhmikosR

XhmikosR commented Feb 24, 2022

Copy link
Copy Markdown
Contributor

@lukekarrys I don't want to open a new issue, but happy to do it if you think it's worth it.

There are still some duplicate packages that in theory could be deduplicated by updating the deps where needed upstream:

C:\Users\xmr\Desktop\cli>git checkout release-next
Already on 'release-next'
Your branch is up to date with 'origin/release-next'.
C:\Users\xmr\Desktop\cli>find-duplicate-dependencies
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!
This package has the following duplicate dependencies:
lru-cache:
[
{
name: 'lru-cache',
version: '6.0.0',
from: 'lru-cache@6.0.0',
path: 'npm/cacache'
},
{
name: 'lru-cache',
version: '7.3.1',
from: 'lru-cache@7.3.1',
path: 'npm/make-fetch-happen'
}
]
make-fetch-happen:
[
{
name: 'make-fetch-happen',
version: '10.0.3',
from: 'make-fetch-happen@10.0.3',
path: 'npm'
},
{
name: 'make-fetch-happen',
version: '9.1.0',
from: 'make-fetch-happen@9.1.0',
path: 'npm/node-gyp'
}
]
ms:
[
{
name: 'ms',
version: '2.1.2',
from: 'ms@2.1.2',
path: 'npm/make-fetch-happen/agentkeepalive/debug'
},
{
name: 'ms',
version: '2.1.3',
from: 'ms@2.1.3',
path: 'npm/make-fetch-happen/agentkeepalive/humanize-ms'
}
]
http-proxy-agent:
[
{
name: 'http-proxy-agent',
version: '5.0.0',
from: 'http-proxy-agent@5.0.0',
path: 'npm/make-fetch-happen'
},
{
name: 'http-proxy-agent',
version: '4.0.1',
from: 'http-proxy-agent@4.0.1',
path: 'npm/node-gyp/make-fetch-happen'
}
]
@tootallnate/once:
[
{
name: '@tootallnate/once',
version: '2.0.0',
from: '@tootallnate/once@2.0.0',
path: 'npm/make-fetch-happen/http-proxy-agent'
},
{
name: '@tootallnate/once',
version: '1.1.2',
from: '@tootallnate/once@1.1.2',
path: 'npm/node-gyp/make-fetch-happen/http-proxy-agent'
}
]

Should save a few bytes/files if these are deduped :)

EDIT: these deps might be unused or used as devDependencies (needs a closer look):

  • chownr
  • write-file-atomic

@XhmikosR

XhmikosR commented Feb 24, 2022

Copy link
Copy Markdown
Contributor

It seems there are plenty of useless files still included too (untested):

Files that could possibly be removed
 node_modules/ansicolors/test/ansicolors.js | 71 --
node_modules/ansistyles/test/ansistyles.js | 15 -
node_modules/archy/examples/beep.js | 24 -
node_modules/archy/examples/multi_line.js | 25 -
node_modules/archy/test/beep.js | 40 -
node_modules/archy/test/multi_line.js | 45 -
node_modules/archy/test/non_unicode.js | 40 -
node_modules/colors/examples/normal-usage.js | 82 --
node_modules/colors/examples/safe-string.js | 79 --
node_modules/concat-map/example/map.js | 6 -
node_modules/concat-map/test/map.js | 39 -
node_modules/delegates/test/index.js | 94 --
node_modules/dezalgo/test/basic.js | 29 -
node_modules/encoding/test/test.js | 49 -
node_modules/err-code/test/test.js | 159 ---
node_modules/function-bind/test/index.js | 252 -----
node_modules/gauge/lib/demo.js | 45 -
node_modules/has/test/index.js | 10 -
node_modules/ip/test/api-test.js | 407 -------
node_modules/is-core-module/test/index.js | 130 ---
node_modules/isexe/test/basic.js | 221 ----
node_modules/jsonparse/examples/twitterfeed.js | 30 -
node_modules/jsonparse/test/big-token.js | 24 -
node_modules/jsonparse/test/boundary.js | 110 --
node_modules/jsonparse/test/offset.js | 67 --
node_modules/jsonparse/test/primitives.js | 57 -
node_modules/jsonparse/test/surrogate.js | 26 -
node_modules/jsonparse/test/unvalid.js | 15 -
node_modules/jsonparse/test/utf8.js | 38 -
node_modules/minipass-sized/test/basic.js | 83 --
.../node-gyp/gyp/tools/emacs/testdata/media.gyp | 1105 -------------------
.../gyp/tools/emacs/testdata/media.gyp.fontified | 1107 --------------------
node_modules/node-gyp/test/common.js | 3 -
.../test/fixtures/VS_2017_BuildTools_minimal.txt | 1 -
.../test/fixtures/VS_2017_Community_workload.txt | 1 -
.../node-gyp/test/fixtures/VS_2017_Express.txt | 1 -
.../node-gyp/test/fixtures/VS_2017_Unusable.txt | 1 -
.../test/fixtures/VS_2019_BuildTools_minimal.txt | 1 -
.../test/fixtures/VS_2019_Community_workload.txt | 1 -
.../node-gyp/test/fixtures/VS_2019_Preview.txt | 1 -
node_modules/node-gyp/test/fixtures/ca-bundle.crt | 40 -
node_modules/node-gyp/test/fixtures/ca.crt | 21 -
.../test/fixtures/nodedir/include/node/config.gypi | 6 -
node_modules/node-gyp/test/fixtures/server.crt | 21 -
node_modules/node-gyp/test/fixtures/server.key | 27 -
.../node-gyp/test/fixtures/test-charmap.py | 31 -
node_modules/node-gyp/test/process-exec-sync.js | 140 ---
node_modules/node-gyp/test/simple-proxy.js | 27 -
node_modules/node-gyp/test/test-addon.js | 150 ---
.../node-gyp/test/test-configure-python.js | 82 --
.../node-gyp/test/test-create-config-gypi.js | 70 --
node_modules/node-gyp/test/test-download.js | 207 ----
.../node-gyp/test/test-find-accessible-sync.js | 84 --
.../node-gyp/test/test-find-node-directory.js | 119 ---
node_modules/node-gyp/test/test-find-python.js | 226 ----
.../node-gyp/test/test-find-visualstudio.js | 676 ------------
node_modules/node-gyp/test/test-install.js | 46 -
node_modules/node-gyp/test/test-options.js | 31 -
node_modules/node-gyp/test/test-process-release.js | 434 --------
.../npm-normalize-package-bin/test/array.js | 37 -
.../npm-normalize-package-bin/test/nobin.js | 35 -
.../npm-normalize-package-bin/test/object.js | 141 ---
.../npm-normalize-package-bin/test/string.js | 37 -
node_modules/promise-all-reject-late/test/index.js | 88 --
node_modules/promise-retry/test/test.js | 263 -----
node_modules/promzard/example/buffer.js | 12 -
node_modules/promzard/example/index.js | 11 -
.../promzard/example/npm-init/init-input.js | 191 ----
node_modules/promzard/example/npm-init/init.js | 37 -
.../promzard/example/npm-init/package.json | 10 -
node_modules/promzard/example/substack-input.js | 61 --
node_modules/promzard/test/basic.js | 91 --
node_modules/promzard/test/buffer.js | 84 --
node_modules/promzard/test/exports.input | 5 -
node_modules/promzard/test/exports.js | 48 -
node_modules/promzard/test/fn.input | 18 -
node_modules/promzard/test/fn.js | 56 -
node_modules/promzard/test/simple.input | 8 -
node_modules/promzard/test/simple.js | 30 -
node_modules/promzard/test/validate.input | 8 -
node_modules/promzard/test/validate.js | 20 -
node_modules/qrcode-terminal/example/basic.js | 2 -
node_modules/qrcode-terminal/example/basic.png | Bin 46426 -> 0 bytes
node_modules/qrcode-terminal/example/callback.js | 4 -
.../qrcode-terminal/example/small-qrcode.js | 6 -
node_modules/qrcode-terminal/test/main.js | 63 --
node_modules/retry/example/dns.js | 31 -
node_modules/retry/example/stop.js | 40 -
node_modules/retry/test/common.js | 10 -
.../retry/test/integration/test-forever.js | 24 -
.../retry/test/integration/test-retry-operation.js | 258 -----
.../retry/test/integration/test-retry-wrap.js | 101 --
.../retry/test/integration/test-timeouts.js | 69 --
node_modules/socks/docs/examples/index.md | 17 -
.../docs/examples/javascript/associateExample.md | 90 --
.../socks/docs/examples/javascript/bindExample.md | 83 --
.../docs/examples/javascript/connectExample.md | 258 -----
.../docs/examples/typescript/associateExample.md | 93 --
.../socks/docs/examples/typescript/bindExample.md | 86 --
.../docs/examples/typescript/connectExample.md | 265 -----
node_modules/text-table/example/align.js | 8 -
node_modules/text-table/example/center.js | 8 -
node_modules/text-table/example/dotalign.js | 9 -
node_modules/text-table/example/doubledot.js | 11 -
node_modules/text-table/example/table.js | 6 -
node_modules/text-table/test/align.js | 18 -
node_modules/text-table/test/ansi-colors.js | 32 -
node_modules/text-table/test/center.js | 18 -
node_modules/text-table/test/dotalign.js | 20 -
node_modules/text-table/test/doubledot.js | 24 -
node_modules/text-table/test/table.js | 14 -
node_modules/unique-filename/test/index.js | 23 -
node_modules/unique-slug/test/index.js | 13 -
.../validate-npm-package-name/test/index.js | 109 --
node_modules/wcwidth/test/index.js | 64 --
115 files changed, 10140 deletions(-)

BTW, nice to see that some work is done already in regards to the file size/number of files! https://packagephobia.com/result?p=npm%406.14.16%2Cnpm%407.24.2%2Cnpm%408.5.1

@wraithgar

Copy link
Copy Markdown
Contributor

Most of those are because we're waiting on node-gyp to land its next semver major nodejs/node-gyp#2603

@XhmikosR

Copy link
Copy Markdown
Contributor

Both issues?

BTW when I do npm install I get thousands of modified files on my machine.

@lukekarrys

Copy link
Copy Markdown
ContributorAuthor

It seems there are plenty of useless files still included too (untested)

This is interesting, but I'd be concerned with removing files from any valid dependencies due to the nature of JavaScript, dynamic requires, etc. Not saying we would never do that, but it seems like not the lowest hanging fruit vs the effort/impact.

There are still some duplicate packages that in theory could be deduplicated by updating the deps where needed upstream:

  • lru-cache: This will be handled by the next cacache release (which is on our list).
  • make-fetch-happen: waiting on node-gyp@9
  • ms: These should get deduped somehow. I'd be open to a PR/issue about this.
  • http-proxy-agent: waiting on node-gyp@9
  • @tootallnate/once: waiting on node-gyp@9

EDIT: these deps might be unused or used as devDependencies (needs a closer look):

I just checked both of those and they are deduped in production deps but not dev/docs. We're not as concerned about those.

@lukekarrys

Copy link
Copy Markdown
ContributorAuthor

BTW when I do npm install I get thousands of modified files on my machine.

@XhmikosR That shouldn't be happening 😄 I just tested on my machine with a brand new clone of the repo and npm i and got nothing modified. It might be worth opening an issue with all the details so we can see what's going on.

@XhmikosR

Copy link
Copy Markdown
Contributor

Thanks for the replies!

It seems there are plenty of useless files still included too (untested)

This is interesting, but I'd be concerned with removing files from any valid dependencies due to the nature of JavaScript, dynamic requires, etc. Not saying we would never do that, but it seems like not the lowest hanging fruit vs the effort/impact.

There are still some duplicate packages that in theory could be deduplicated by updating the deps where needed upstream:

* `lru-cache`: This will be handled by the next cacache release (which is on our list).
* `make-fetch-happen`: waiting on `node-gyp@9`
* `ms`: These should get deduped somehow. I'd be open to a PR/issue about this.
* `http-proxy-agent`: waiting on `node-gyp@9`
* `@tootallnate/once`: waiting on `node-gyp@9`

EDIT: these deps might be unused or used as devDependencies (needs a closer look):

I just checked both of those and they are deduped in production deps but not dev/docs. We're not as concerned about those.

AFAICT you are already ignoring plenty of dev-related files from production deps hence why I suggested this. I'm not saying these are super important, I agree with you. I'm just saying it should be looked at later, because the gains should be significant :)

@XhmikosR That shouldn't be happening 😄 I just tested on my machine with a brand new clone of the repo and npm i and got nothing modified. It might be worth opening an issue with all the details so we can see what's going on.

I suspect it's something related to Windows and symlinks, so as long as you get a clean repo that's enough for me :)

@lukekarrys

Copy link
Copy Markdown
ContributorAuthor

AFAICT you are already ignoring plenty of dev-related files from production deps hence why I suggested this.

I think it's a good suggestion, but I'm not aware of anywhere we are already doing this. We try to do it in all our own modules via package.json#files so only the minimum necessary files are in the tarball. And we bundle 3rd party deps, but try to not ever change code inside node_modules/ outside of deduping. For most of the files you listed I think the best course of action would be PRs implementing package.json#files.

@XhmikosR

Copy link
Copy Markdown
Contributor

#3362 and https://github.com/npm/cli/blob/latest/node_modules/.gitignore

I do open upstream PRs when possible and I agree that is the optimal solution, but until then you could also leverage the current solution :)

@lukekarrys

Copy link
Copy Markdown
ContributorAuthor

Thank you for showing me that we have a current solution already. I must've missed that we are doing that! 😄

Sign up for freeto 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.

5 participants

@lukekarrys@npm-robot@XhmikosR@wraithgar@nlf