-
Notifications
You must be signed in to change notification settings - Fork 39
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
Upgrade to lodash4 #50
Conversation
@jdalton I'm wanting to upgrade to lodash 4, but it adds 36k (8k minified), is this to be expected? Are there webpack hacks I could be applying to help? |
webpack stats.json after |
See redux/webpack.config.base.js. You can use the |
new webpack.NormalModuleReplacementPlugin(/\blodash\/internal\/baseIteratee\.js$/, './toFunction.js'), That certainly helps:
But, given that I expose a wrapped version of reject, it's nice to still support the shorthand syntax. tbh, I was hoping that lodash 4 would expose fp functions in such a way that they could be imported in a one off basis instead of having to get the whole she-bang. That would allow me to drop many of the functions in updeep and point to using lodash instead. |
Good news, that landed by way of lodash/lodash#1779. It'll be in the next release. |
@aaronjensen lodash 4.1.0 has been released. I'm excited for lodash 4 with updeep! |
@mark-rushakoff I don't think it has yet: https://www.npmjs.com/package/lodash |
My bad. Their readme was updated a couple hours ago for 4.1.0, but you're right, it hasn't been tagged or pushed to npm yet. I was so excited for it I couldn't even be bothered to make sure the release was all finished and proper! ;) |
@aaronjensen When can we expect the next release of updeep that includes lodash 4? |
@mark-rushakoff 0.13.0 is out, thanks for the reminder. I had looked into deprecating some of the functions first but ran into snags with the way lodash/fp works 😞 |
Next lodash bump the fp behavior will be configurable :) |
@jdalton sweet, i'm curious to see how that looks in practice |
It'll look like var convert = require('lodash/fp/convert');
/*
* @param {Object} [options] The options object.
* @param {boolean} [options.cap=true] Specify capping iteratee arguments.
* @param {boolean} [options.curry=true] Specify currying.
* @param {boolean} [options.fixed=true] Specify fixed arity.
* @param {boolean} [options.immutable=true] Specify immutable operations.
* @param {boolean} [options.rearg=true] Specify rearranging arguments.
*/
var remove = convert('remove', _.remove, {
'cap': false,
'curry': false,
'fixed': false,
'immutable': false,
'rearg': false
}); |
@jdalton Which argument is it in particular that would enable |
Yep
Feel free to make suggestions. |
Well, my suggestion is to make FWIW I think using |
Before:
After: