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

Reduce browser bundle size #91

Closed
feross opened this issue Sep 15, 2014 · 7 comments
Closed

Reduce browser bundle size #91

feross opened this issue Sep 15, 2014 · 7 comments

Comments

@feross
Copy link
Member

@feross feross commented Sep 15, 2014

We can exclude a bunch of npm dependencies that are used in node, but not in the browser.

  • Use git-sha1 instead of crypto (6kb vs 86kb uncompressed)
  • readable-stream and stream are both included. Exclude one of them (~100kb uncompressed)
  • Exclude http-https (189kb uncompressed)
  • Exclude concat-stream (189kb uncompressed)
  • Exclude load-ip-set (404kb uncompressed)
  • Remove lodash.* modules. They include many "private" modules which may be a source of bloat (test this out)
  • Omit mime-component from filestream (35kb uncompressed, see DamonOehlman/filestream#7, sent PR DamonOehlman/filestream#8)
@feross

This comment has been minimized.

Copy link
Member Author

@feross feross commented Sep 15, 2014

Okay -- after excluding many deps, the bundle size is down to less than 55KB (minified and gzipped), which is totally acceptable. Still, I'll leave this issue open because we can still do better.

@feross

This comment has been minimized.

Copy link
Member Author

@feross feross commented Sep 17, 2014

After removing all the lodash modules and replacing with simpler modules, size is down to 42KB.

@feross

This comment has been minimized.

Copy link
Member Author

@feross feross commented Sep 17, 2014

Okay -- all the low-hanging fruit that I could find is now fixed. Current size: 42kb. Pretty small for an entire torrent client actually!

@feross feross closed this Sep 17, 2014
@kyledrake

This comment has been minimized.

Copy link

@kyledrake kyledrake commented Sep 17, 2014

Amazingly small. Kudos, sir.

@notpushkin

This comment has been minimized.

Copy link

@notpushkin notpushkin commented Sep 17, 2014

Nice!

@thammin

This comment has been minimized.

Copy link
Contributor

@thammin thammin commented Sep 17, 2014

Wow Nice!

@srdjan

This comment has been minimized.

Copy link

@srdjan srdjan commented Sep 17, 2014

kudos!

@lock lock bot locked as resolved and limited conversation to collaborators May 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.