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 lodash as an entire dependency #1494

Closed
ORESoftware opened this issue Nov 8, 2017 · 5 comments
Closed

Remove lodash as an entire dependency #1494

ORESoftware opened this issue Nov 8, 2017 · 5 comments

Comments

@ORESoftware
Copy link
Contributor

I just ran

npm la lodash in my project and I see this

suman-utils@0.0.73121
│ /Users/alexamil/WebstormProjects/oresoftware/sumanjs/suman-utils
│ Shared module within the Suman test runner ecosystem
│ git+https://github.com/sumanjs/suman-utils.git
│ https://github.com/sumanjs/suman-utils#readme
└─┬ async@2.5.0
  │ Higher-order functions and common patterns for asynchronous code
  │ git+https://github.com/caolan/async.git
  │ https://github.com/caolan/async#readme
  └── lodash@4.17.4 
      Lodash modular utilities.
      git+https://github.com/lodash/lodash.git
      https://lodash.com/

so it looks like async depends on lodash, but when I look at the async v2.6.0 package.json, I don't see lodash as a dependency.

I was simply wondering if async could depend on:

lodash.x // import only the functions from lodash that async needs

instead of importing all of lodash.

let me know how async does it, thanks

@ORESoftware
Copy link
Contributor Author

ORESoftware commented Nov 8, 2017

Just kidding, my bad, I was looking at devDependencies, not dependencies, I see lodash here:

https://github.com/caolan/async/blob/master/package.json#L21

would it reasonable for async to depend on the 10 functions that async needs instead all of lodash..?

or is that not really an option? It might not even be beneficial, I just would like to avoid including all of lodash in some of my projects, if possible

@aearly
Copy link
Collaborator

aearly commented Nov 8, 2017

See #1283

We also found the requiring a handful of lodash.foo modules is a false economy -- it's actually slower to download/install.

@aearly aearly closed this as completed Nov 8, 2017
@ORESoftware
Copy link
Contributor Author

yeah personally I am more concerned about footprint on disk than install speed, but yeah

@fmntf
Copy link

fmntf commented May 9, 2018

I also have the disk footprint issue. async is 840k, lodash 5.1M!

@ORESoftware
Copy link
Contributor Author

ORESoftware commented May 9, 2018

Yeah, there must be a way to just copy the functionality that we need from lodash without importing the whole lib. Webpack will trim stuff down when deploying to browser, but as far as Node.js/diskspace, that currently is suffering a lot.

I realize this is an issue with lodash, but if async and others can tell the lodash author about the problem that'd be great.

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

No branches or pull requests

3 participants