Fields pull in all of lodash
See original GitHub issuevar _ = require('lodash');
Lodash is huge (520k), and we’re only using a tiny part of it. The field types shouldn’t be pulling in the entire lodash library. (Its smaller if its minified, but we aren’t minifying it - see #2825).
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:12 (9 by maintainers)
Top Results From Across the Web
Lodash Documentation
Creates a new array concatenating array with any additional arrays and/or values. Since. 4.0.0. Arguments. array (Array): The array to concatenate. [values] ...
Read more >How to remove fields from collection with Lodash?
Simply do: var filteredCollection = _.map(characters, function (c) { return _.omit(c, ['name']); });. Now, filteredCollection no longer have ...
Read more >Lodash | _.pullAll() Method - GeeksforGeeks
The _.pullAll() method is used to remove all the values from the first given array that are given in the second array. ......
Read more >Array - GitHub
Help make them better at https://github.com/jfmengels/lodash-fp-docs ... Creates an array of unique values that are included in all given arrays using ...
Read more >10 Important Lodash Functions for JavaScript Developers
The pull() method removes all instances, even if there are duplicates. There's another related method called pullAll() that accepts an array as ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
(to be clear, that means I’m closing this because it should be fixed!)
It also speeds up our runtime bundle build too 😃
We’ve spent enough effort keeping 0.4 compatible with 0.12 that at this point, I don’t see it as being relatively much of an issue to leave things as they are for that release. As soon as that happens and it’s stable, we’ll be doing a big round cleanup w/ some breaking changes for 0.5, and I’m all for going to Node 4+ then.
Realistically Keystone should have been called 1.0.0 when 0.3 was released, my bad that we didn’t do that but we should think of it as having that level of stability. Let’s use the next few minors to get through some big stuff we’ve got queued quickly, and hit 1.0.0 as soon as we’ve actually thought through and published APIs for stuff we’d like to support for the next year (or whatever time period makes sense)
I’ve added
lodash
to our common scripts bundle, which means it’ll now be excluded from all the other client side builds (I thought it was there, but must have missed it)That has the effect of removing the complete package from any bundle, unless we use explicit imports like
require('lodash/mapValues')
(that will actually currently have the effect of bundling more client side code if we do that, because it won’t be recognised as a package to exclude)