Hello!
I think this awesome project can easily get rid of unneeded "lodash" dependency and just implement "random" and "sortBy" functions by itself.
We don't use lodash in our project, but it still gets into codebase just because of this react-sortable-hoc.
We found out that lodash used from this component takes about:
Looks like custom functions could take order of magnitude less space.
What do you think? Would you like to receive a PR?
I think you can just import the lodash.random (https://www.npmjs.com/package/lodash.random) which is thinner, or lodash.sortBy.
You can actually chopped any modules from lodash and just import that. I think it will consumed less space.
You could also use babel-plugin-lodash to remove unneeded lodash modules since the build process is using babel already.
@iamrommel these builds will be deprecated soon, see: https://github.com/lodash/lodash/wiki/Roadmap
Normally you should just do
import random from 'lodash/random'
Then you only get the function you need and tree-shaking can eliminate the rest of the library.
At very least, don't use the shorthands functionality for orderBy so that we can shake out all of the extra lodash dependencies in our own projects.
See link for more details: https://github.com/lodash/lodash-webpack-plugin/issues/128
Removed lodash dependency in 0.7.0
Most helpful comment
I think you can just import the lodash.random (https://www.npmjs.com/package/lodash.random) which is thinner, or lodash.sortBy.
You can actually chopped any modules from lodash and just import that. I think it will consumed less space.