Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
jdd
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
9 ms
·
31.
▲
by
jdd
10y ago
Many times folks understand that values can be nullish. Libs like Lodash treat them as empty collections to avoid repetitive nullish check scaffolding.
32.
▲
by
jdd
10y ago
;)
33.
▲
by
jdd
10y ago
I'm guessing after repeated use you'd abstract that into a function. Maybe even a collection of them.
34.
▲
by
jdd
10y ago
The language changes too. In ES5 `Object.keys` throws an error for `Object.keys('abc')` but in ES6 it returns an array.
35.
▲
by
jdd
10y ago
The kitchen sink size of Lodash is ~22kb gzipped, the core build is ~4kb gzipped, and it's modular so you can cherry-pick what you want https://github.com/lodash/babel-plugin-lodash https://github.com&#
36.
▲
by
jdd
10y ago
You might dig https://github.com/lodash/lodash/wiki/FP-Guide
37.
▲
by
jdd
10y ago
Lodash is helping with JavaScript language additions like https://github.com/leobalter/object-enumerables https://github.com/bterlson/proposal-flatMap
38.
▲
by
jdd
10y ago
You should check out https://github.com/lodash/babel-plugin-lodash https://github.com/lodash/lodash-webpack-plugin
39.
▲
by
jdd
10y ago
You might dig https://github.com/lodash/lodash-webpack-plugin
40.
▲
by
jdd
10y ago
Lodash v4 has support for FP syntax/modules – https://github.com/lodash/lodash/wiki/FP-Guide
41.
▲
by
jdd
10y ago
That's generally and edge case and totally supported under the proposal by being explicit about with respect to `export`. I think being explicit about the intent of your code is a good thing after all.
42.
▲
by
jdd
10y ago
Lodash source is available as a monolithic build or modules so you can take your pick. Lodash has plenty of comments (jsdoc, bug fix notes, and implementation explanations). Underscore has stripped many of these leading to devs making the s
43.
▲
by
jdd
10y ago
> LoDash is a better library, functionality-wise, but seems to have lost the quality somewhat Where do you see a loss in quality?
44.
▲
by
jdd
11y ago
Lodash is modular ( https://github.com/lodash/lodash/tree/4.7.0-npm ) and also provides per method packages ( https://www.npmjs.com/browse/keyword/lodash-modularized ) like padStart ( h
45.
▲
by
jdd
11y ago
Lodash introduces breaking changes in major version bumps (following semver). So upgrades are optional and not pulling the rug out from underneath the feet of devs. Major releases allows the project to make corrections and avoid carrying ar
46.
▲
by
jdd
11y ago
Lodash v4 has its FP module included with it: require('lodash/fp') for immutable, auto-curried, iteratee-first, data-last method modules.
47.
▲
by
jdd
11y ago
Lodash renamed padding on a major version bump (which requires opting into) to better align with the ES7 proposal. Nothing was done in a way to pull the rug out from underneath folks.
48.
▲
by
jdd
11y ago
Naw, I changed it on a major bump which requires opt-in and didn't pull the rug out from underneath people. As @sod pointed out the change is based on the newish ES7 proposal.
49.
▲
by
jdd
11y ago
If there was ever an issue I'd work with npm to come to a resolution that didn't break 25% of npm.
50.
▲
by
jdd
11y ago
Lodash has been modular since 2013.
51.
▲
by
jdd
11y ago
Webpack 2 and Rollup don't support tree-shaking with Lodash yet. You'll need to use https://www.npmjs.com/package/babel-plugin-lodash .
52.
▲
by
jdd
11y ago
Adoption is doing pretty well. In just over 2 weeks since its release lodash@^4.0.0 is in the top 50 most depended on npm packages.
53.
▲
by
jdd
11y ago
Lodash v1 was a drop-in Underscore replacement. Lodash v2 was not but offered an lodash.underscore.js build. Lodash v3 dropped the compat build in favor of using individual lodash modules until you're able to transition Lodash v4 conti
54.
▲
by
jdd
11y ago
It was removed because it added extra complexity for method implementations and was used very little. Folks now can use `_.bind`, or `Function#bind`, or arrow functions.
55.
▲
by
jdd
11y ago
¯\_(ツ)_/¯
56.
▲
by
jdd
11y ago
According to bower stats over the last 7 days lodash was installed 23 times compared to 4 million npm downloads & 181 new npm packages depending on it. http://bower.io/stats/ http://npm-stat.com/cha
57.
▲
by
jdd
11y ago
To be fair that's a sample app which is part of a tutorial demonstrating the capabilities of the web platform on Windows 10. https://github.com/MicrosoftEdge/JSBrowser
58.
▲
by
jdd
11y ago
JavaScript (lodash-fp): _.flow(_.range(0,10), _.map(_.add(2)), _.sum)(); //With slightly more magic let {flow, range, map, add, sum} = _; flow(range(0), map(add(2)), sum)(10);
59.
▲
by
jdd
11y ago
If the function is small enough, yes.
60.
▲
by
jdd
11y ago
For those interested lodash provides _.curry and _.curryRight methods with placeholder support as well. See https://lodash.com/docs#curry .
More ›