Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace npmlog with consola #829

Merged
merged 14 commits into from
Nov 27, 2024
Merged

Replace npmlog with consola #829

merged 14 commits into from
Nov 27, 2024

Conversation

br0p0p
Copy link
Contributor

@br0p0p br0p0p commented Jul 1, 2024

This PR replaces the deprecated and dependency-laden npmlog with a smaller, modern alternative: consola.

Module + Dependencies Size on Disk (Unpacked Size) Bundle size (minified)
npmlog 15 401 KB 65 KB
consola 1 222 KB 6 KB
𝛥 -14 (-93.3%) -179 KB (−44.63%) -59 KB (-90.7%)

This data was gathered from https://npmgraph.js.org/

Extrapolating based on the download stats for @mapbox/node-pre-gyp (5,730,435 downloads per week), this migration will have the following effects on the ecosystem as a whole:

  • 80,226,090 fewer dependencies downloaded per week
  • Reduced network traffic by ~1 TB per week
package-size-calculator output
Package size report
===================

Package info for "@mapbox/node-pre-gyp@1.0.11": 2.0 MB
  Released: 2023-07-14 13:09:45.532 +0000 UTC (52w6d ago)
  Downloads last week: 4,706,924 (80.46%)
  Estimated traffic last week: 9.3 TB
  Subdependencies: 57

Removed dependencies:
  - npmlog@5.0.1: 401 kB (20.27%)
    Downloads last week: 7,502,133 (N/A% from 5.0.1)
    Downloads last week from "@mapbox/node-pre-gyp@1.0.11": 4,706,924 (N/A%)
    Traffic last week: N/A
    Traffic from "@mapbox/node-pre-gyp@1.0.11": 9.3 TB (N/A%)
    Subdependencies: 22 (38.59%)

Added dependencies:
  + consola@3.2.3: 228 kB (14.47%)
    Downloads last week: 4,630,250 (N/A% from 3.2.3)
    Estimated traffic last week: N/A
    Subdependencies: 1 (1.75%)

Estimated package size: 2.0 MB → 1.8 MB (91.26%)
Estimated traffic over a week: 9.3 TB → 8.5 TB (813 GB saved)
Estimated traffic over a week @ 100% downloads: 12 TB → 11 TB (1.0 TB saved)
Subdependencies: 57 → 36 (-21)

I will note that the output looks slightly different with these changes. Happy to update if the new format is not great

Before

Screenshot 2024-07-02 at 9 15 09 AM

After

Screenshot 2024-07-02 at 9 15 39 AM

@br0p0p br0p0p marked this pull request as ready for review July 2, 2024 03:08
Copy link
Collaborator

@benmccann benmccann left a comment

Choose a reason for hiding this comment

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

Amazing! Thank you!!

@benmccann
Copy link
Collaborator

@br0p0p would you be able to fix the merge conflict?

@br0p0p
Copy link
Contributor Author

br0p0p commented Jul 5, 2024

@benmccann done

@br0p0p br0p0p requested a review from benmccann July 5, 2024 01:46
lib/install.js Outdated Show resolved Hide resolved
Copy link
Collaborator

@benmccann benmccann left a comment

Choose a reason for hiding this comment

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

lgtm except that it looks like the appveyor tests might be failing

@cclauss could you kick off the github actions tests on this PR?

@benmccann
Copy link
Collaborator

@br0p0p I'm afraid all the CI jobs are failing with this PR. would you be able to take a look?

benmccann
benmccann previously approved these changes Jul 9, 2024
Copy link
Collaborator

@benmccann benmccann left a comment

Choose a reason for hiding this comment

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

Thank you @br0p0p !

@cclauss this one is now ready to go. It would be great to merge before the next preview release as it fixes a few deprecation warnings (I believe all the remaining).

@br0p0p br0p0p requested a review from a team as a code owner September 10, 2024 21:41
@HummingMind
Copy link

Hoping this gets merged soon. Thank you for your work! 🍻

benmccann
benmccann previously approved these changes Nov 26, 2024
@benmccann benmccann merged commit 1159038 into mapbox:master Nov 27, 2024
12 checks passed
@benmccann
Copy link
Collaborator

THANK YOU @br0p0p!

appreciate you sticking with it during this long wait to get it merged. now hopefully we can get it released too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants