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

Remove README.md from bundle #2056

Closed
H4ad opened this issue Nov 1, 2023 · 4 comments
Closed

Remove README.md from bundle #2056

H4ad opened this issue Nov 1, 2023 · 4 comments

Comments

@H4ad
Copy link

H4ad commented Nov 1, 2023

By NPM itself is impossible to remove, pack command will always include the Readme.md in the bundle, but maybe we can use another tool to pack or just try to reduce the size of the Readme by splitting the documentation in another file.

This change can save 25% of the bundle size, from 177kb to 134,7kb, saving up to 4,3TB/week of bandwidth.

@shadowspawn
Copy link
Collaborator

I have wondered about this sometimes, but the size is reasonably small in the overall scheme of things, and caching can eliminate the download entirely as a global approach. And no one has complained recently. :-)

npm decided long ago to always include the README, I am guessing so available offline, or so always available on the npm package page (or both).

Have you seen other packages that deliberately have a placeholder README for their npm packages?

@H4ad
Copy link
Author

H4ad commented Nov 1, 2023

but the size is reasonably small in the overall scheme of things

Looking for the size alone is small, but this library has so many downloads that even a tiny change can have a huge impact.

caching can eliminate the download entirely as a global approach

Caching helps but doesn't eliminate the bandwidth spent on the user side to download the package.

Have you seen other packages that deliberately have a placeholder README for their npm packages?

To be honest, I never saw it, I was just looking for the top download libs on NPM and seeing what I could do to optimize the bandwidth, the easiest approach was to look at the heaviest files, and README.md is one of them.

I think for this library a placeholder could be worthy since the README is really heavy (25% of the lib), but I'm not sure about what should go on the placeholder, I added a proposal on #2058.

@shadowspawn
Copy link
Collaborator

shadowspawn commented Nov 1, 2023

Related discussion about npm treatment of README with some higher level approaches proposed: npm/rfcs#744

@shadowspawn
Copy link
Collaborator

There wasn't concern expressed by npm folks about README bandwidth in npm/rfcs#744 and the README does get displayed in a number of other contexts. I am subscribed to that issue for updates.

There hasn't been further activity in a month. Closing this as resolved.

Feel free to open a new issue if it comes up again, with new information and renewed interest.

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 a pull request may close this issue.

2 participants