-
Notifications
You must be signed in to change notification settings - Fork 43
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
Use lodash per-method packages #7
Conversation
3 similar comments
Thanks a lot @Zirro ! Quick question: Is it safe to replace |
Yes, that should be okay. |
hey all, currently fighting to shave down the size of a node.js docker image and this would help a bit.. any update on this PR? |
What's the latest on this? Could we please get this merged in? |
What is the hold up on merging this? Why was #14 merged instead of this one? |
Note that lodash intends to not support the per-method packages in lodash v5 https://github.com/lodash/lodash/wiki/Roadmap |
hey just checking in on this, based on the latest info from @realityking are you still planning on merging this in? |
If you are using a package bundler like Webpack then you will be able to reduce the code size even more than if this library would use the per method packages. Splitting the |
That doesn't really work no. I'm trying to reduce the size of our build artifacts we have for a few node servers. We don't want to run webpack on the servers for many reasons. But doing it because a dependency of a dependency chooses to drag in the whole of lodash is a bit weird. This is the only package still having a full lodash import. |
Just a note that Lodash discourages the use of the per method packages and is planing on removing them in the next major. |
Yeah sure. The best thing is to stop using lodash for super basic stuff as this project is doing :) Indeed at work we've removed all of lodash, with our own small specialized helpers for stuff like debounce etc that does what's needed. Most other stuff we've just rewritten to regular js. Now with optional chaining |
The complete lodash package weighs in at about 5.1 MB, making it a very large production dependency. By using lodash's per-method packages instead, you can reduce the size of many node_modules folders out there.
I replaced
._isArray
withArray.isArray()
as the former has been deprecated in favour of the latter.