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

Dependency hygiene #1687

Open
feross opened this issue Aug 7, 2019 · 5 comments
Open

Dependency hygiene #1687

feross opened this issue Aug 7, 2019 · 5 comments
Assignees

Comments

@feross
Copy link
Member

@feross feross commented Aug 7, 2019

I want to go through the whole webtorrent dependency tree to:

  • De-duplicate dependencies
  • Ensure that we're using the latest version
  • Pruning dependencies that aren't needed in modern JS environments (to reduce risk and increase install speed)

This issue is a placeholder to track this task.

I'm tracking progress on this work in this issue: brave/brave-browser#5490

@feross

This comment has been minimized.

Copy link
Member Author

@feross feross commented Aug 7, 2019

One nice side effect of this effort. So far I've been able to reduce the bundle size by 10KB!

From 98338 bytes to 88915 bytes, so far.

Should get quite a bit smaller once browserify/browserify#1916 is merged.

@RecoX

This comment has been minimized.

Copy link

@RecoX RecoX commented Aug 7, 2019

One nice side effect of this effort. So far I've been able to reduce the bundle size by 10KB!

From 98338 bytes to 88915 bytes, so far.

Should get quite a bit smaller once browserify/browserify#1916 is merged.

Is it worth all the effort put it on this to just reduce the bundle by 10kb?

Just asking because my lack of knowledge.

@feross

This comment has been minimized.

Copy link
Member Author

@feross feross commented Aug 7, 2019

Is it worth all the effort put it on this to just reduce the bundle by 10kb?

Depends on your priorities. Small size has always been one of my priorities with WebTorrent. It's one of the best parts of WebTorrent – that it's small and carefully selects dependencies. Lots of others decentralized web projects require 2MB+ of JavaScript and don't work nearly as well as WebTorrent does. The fact that we can fit a whole torrent client into <100KB is amazing.

Also, updating dependencies gives us bug fixes, wards off potential security issues, and makes installation faster.

@ExE-Boss

This comment has been minimized.

Copy link

@ExE-Boss ExE-Boss commented Aug 17, 2019

I recommend using pnpm as the package manager, as it avoids “phantom dependency” and “npm doppelganger” problems by using symlinks, hardlinks and isolated trees.

“npm doppelgangers” in particular are a common‑ish cause of exploding bundle sizes.

@feross

This comment has been minimized.

Copy link
Member Author

@feross feross commented Aug 18, 2019

“phantom dependency”

This is a valid issue that can sometimes happen but I'll be adding a rule to standard to catch this in a future version and it doesn't seem to have anything to do with bundle size?

“npm doppelganger”

This is not a problem with browserify since it hashes every required file and never includes a duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

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