question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fields pull in all of lodash

See original GitHub issue
var _ = 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:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:12 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
JedWatsoncommented, May 13, 2016

(to be clear, that means I’m closing this because it should be fixed!)

It also speeds up our runtime bundle build too 😃

1reaction
JedWatsoncommented, May 13, 2016

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)

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found