10 ms·
Lodash 4.0.0 is out
- possibleNoob 11y agoHow does this compare to lazy.js?
- painisRelative 11y agowhy drop bower support damn it!
- deleted 11y ago[deleted]
- theodorton 11y agoI think he actually talks about the bower package registry (not browser).
- jewel 11y agoNo, he has an objection to them dropping support for "bower", which is a package manager for javascript files. It does seem like a typo of "browser", so I can see where the confusion would come from.
- xxpor 11y agoHa whoops! Thanks
- brianzelip 11y agobower is not just js, but rather lots of various front-end libraries.
- Killswitch 11y agoBower doesn't do anything npm doesn't already do, except horrible version management. bower install lodash => bower_components/lodash/dist/lodash.min.js npm install lodash => node_modules/lodash/dist/lodash.min.js Only difference there is you use `node_modules` instead of `bower_components` for root directory.
- endemic 11y agoEasier to import as a module if you use Browserify or suchlike: `var _ = require('lodash');`
- mrharrison 11y agoYeah there is no need to drop bower support. I prefer bower over NPM. I don't understand this. Great work by the way.
- mkoryak 11y agoI think the thinking behind dropping the support is something like this: I use browserify/webpack/node and npm is great. I wish more libs that I use were also on npm so that I wouldnt have to fork/shim them. How can I force other people to use npm? Maybe if I drop bower support for my awesome lib that everyone uses, other libs will follow suit, or perhaps the users will see the light and stop using bower because it sucks.
- dannynemer 11y agoLodash dropped bower support in favor of npm because "16% use bower vs. 76% npm for AMD packages": https://twitter.com/jdalton/status/677323442488672257 https://twitter.com/jdalton/status/677323442488672257
- magicalist 11y ago...according to a twitter poll on a personal account :P I avoid bower wherever possible, but removing support does smell a bit like an activist move. There may be more to the story, though.
- cwyers 11y agoThe poll was, should it be dropped, given that fact. The fact was not the poll result.
- bryanlarsen 11y agoGiven that there were 14825158 downloads of lodash from npm last month, that implies that there were over 3M downloads from bower. That's a lot of people to throw under the bus.
- andrewchilds 11y agoFor what was a single 19 line JSON file: https://github.com/lodash/lodash/commit/3b86574b4da0828f6afb4d07b8320c27c56a98f9 https://github.com/lodash/lodash/commit/3b86574b4da0828f6afb...
- jdd 11y agoAccording 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://bower.io/stats/ http://npm-stat.com/charts.html?package=lodash http://npm-stat.com/charts.html?package=lodash https://gist.github.com/anvaka/8e8fa57c7ee1350e3491/revisions https://gist.github.com/anvaka/8e8fa57c7ee1350e3491/revision...
- hyperhopper 11y agoIf more major libraries drop support for bower, it might (hopefully) die soon. What does bower do better than NPM?
- javajosh 11y agoWell, I haven't used npm for css packages yet, but presumably it's okay with webpack/brunch etc.
- cnp 11y agoIts great with everything. Frontend / backend, etc. When I removed bower from our app last year, adopted Webpack and migrated everything over to NPM it dramatically simplified things.
- RobertKerans 11y agoFor Brunch, looks like [initial, probably v buggy] NPM stuff went into master about 10 days ago.
- javajosh 11y agoI've been using npm support in Brunch and so far so good.
- RobertKerans 11y agoAh, that's good to know; I'd been sticking to Bower for Phoenix' front end stuff, might start looking at migrating them to NPM if Brunch support is stable now.
- EvanPlaice 11y agoJSPM! It works a lot like NPM but is specifically intended for use with front-end modules. Features: - uses System.js (a polyfill for the future ES6-module-loader spec - supports CommonJS, AMD, and UMD formats - has plugins for importing other types (ex css) - support Typescript/Traceur/Babel out of the box - uses a flat dependency structure (ie like NPM v3) - can generate bundles and self-executing bundles (incl tree shaking and minify) - tracks specific versions of dependencies Unlike NPM, module installation doesn't depend on packages published to a central registry. It can install versioned modules directly from GitHub and NPM. The registry it uses is nothing but GitHub repo with module-to-repo mappings and compatibility shims. Here's the link: http://jspm.io/ http://jspm.io/ Lodash is already included in the registry: http://kasperlewau.github.io/registry/#/?q=lodash http://kasperlewau.github.io/registry/#/?q=lodash
- timdorr 11y agoBower is no longer actively maintained: https://github.com/bower/bower/pull/1748 https://github.com/bower/bower/pull/1748
- janpieterz 11y agoBower is very actively being maintained: http://bower.io/blog/2015/bower-alive-looking-contributors/ http://bower.io/blog/2015/bower-alive-looking-contributors/ and just read https://twitter.com/bower https://twitter.com/bower or check https://github.com/bower/bower https://github.com/bower/bower
- paulojreis 11y agoAlthough there is a rationale for converging to npm, the tl;dr regarding bower is that it's not cool any more.
- juriansluiman 11y agoI loved bower and really preferred it in regard with npm for frontend modules. However more and more packages went to npm-only and we completely switched to npm for all. Looking back, I am glad since it's just a nightmare to deal with dozens of package managers. Because bower was installed via npm, we had npm installed already and just skipped the bower part.
- HNcow 11y agoNot sure if this is a dumb question but I haven't been able to find an answer anywhere. I currently use underscore 1.8.3. Can I just swap lodash in, or is refactoring involved? I know it's a fork, and I want to move over, but was curious if anyone know off the top of their heads if a lot of work as involved.
- kevindeasis 11y agoI'll put this here just in case no one comments. https://lodash.com/docs#forEach https://lodash.com/docs#forEach http://underscorejs.org/#each http://underscorejs.org/#each
- johnhenry 11y agoIf I'm correct, you're showing this as a counter example to prove that the two have incompatible APIs and are thus LoDash can't be used ad a drop in replacement. However, Lodash does alias it's 'forEach' function with 'each', so this wouldn't be an issue?
- tdumitrescu 11y agoYeah, each and forEach are aliases in both lodash and underscore.
- ksherlock 11y agounderscore.each has an optional 3rd parameter (context). lodash.each does not. If you depend on that 3rd parameter, you will be in a world of pain if you drop-in lodash. In fact you'd be better off if there was no alias because you would catch the problem sooner and have to think about the API differences when fixing it.
- 9point6 11y agoTo be fair, that context parameter has only just been removed as part of 4.0.0. Instead they recommend you change your code to be of the form: _.each(collection, _.bind(function, context)) Which actually seems a lot more correct than some arbitrary context parameter
- krat0sprakhar 11y agoKudos to John-David Dalton for making such an awesome lib and being such a positive force behind it for so long! I've reached out to him multiple times on Twitter and he's always been quick to help! He should definitely write a post on how he stays productive and motivated to work day-in and day-out on one project. Really inspiring!
- jamesrom 11y agoCould not agree more. I have opened multiple issues on GitHub and he is always quick to reply. It takes a lot of diligence to maintain an almost always empty issues list on GitHub.
- VeejayRampay 11y agoThanks to him indeed. Thanks for his work (and research) on sandboxed natives, FuseJS, NWMatcher, LoDash and so many more awesome projects. He never stopped pushing that envelope and we're reaping the benefits now.
- hccampos 11y agoIndeed, John-David Dalton, together with Dan Abramov and others have been great in the JS community. Kudos!
- kentcdodds 11y agoYou'll be interested to know that Dan Abramov is on the JavaScript Air panel. This is relevant because of this: https://news.ycombinator.com/item?id=10909199 https://news.ycombinator.com/item?id=10909199 :-)
- kentcdodds 11y agoAgreed. That's why I invited him on the JavaScript Air show. The live video broadcast podcast all about JavaScript and the web platform. He'll be on live on March 2nd: http://jsair.io/lodash http://jsair.io/lodash
- overcast 11y agoI think it's time to check out a jquery alternative. My recent projects are basically only using deep copies and some semi-complex selectors. lodash + querySelector should cover pretty much everything at this point.
- krat0sprakhar 11y agoHave you checked out Lea Verou's Bliss.js? http://blissfuljs.com/ http://blissfuljs.com/ It's super minimal and basically relies on querySelector. Give it a whirl and see if it fits your needs.
- overcast 11y agoCool! I'll check it out thanks. Deep Clone is required though, I'll poke around.
- pygy_ 11y agolodash.cloneDeep is available as a standalone npm module (as are all lodash functions). It clocks at 2.5KB mingzipped, after browserification. There are probably lighter implementations.
- cubano 11y agoVery cool...been looking for something like that for a project I am working on right now, as a matter of fact.
- _RPM 11y agoI've seen projects that use jQuery just for the selector part, nothing else is used. Selectors are a core strength of jQuery. With document.querySelector, I wouldn't even include jQuery in a new project. `window.addEventListener` isn't much different than .on
- overcast 11y agoIt's used out of convenience, and avoiding errors. jQuery selectors are stupidly simple to do complex stuff with. I just wish they had a jQuery.selector distribution.
- mkoryak 11y agooh nice, they dropped ie9 support! oh no, so many breaking changes that I cant use it!
- julbaxter 11y agoFrom my understanding "dropping support for IE < 9" means dropping IE8 not IE9.
- rev_bird 11y ago> so many breaking changes that I cant use it! Isn't that the point of a major version bump? It's not like being mad at 3.11.0 wrecking everything.
- esailija 11y agoMajors, especially majors that are coming often with no lts for older versions, should make minimal breaking changes.
- 9point6 11y agoThe whole point of major version bumps (in semver) is to allow of these kinds of breaking changes. When should these changes be made if not during a major version bump?
- mkoryak 11y agoi wasnt trying to complain about breaking changes, i was saying that i am sad that i have a cod base which cannot use this. I am sure many people are in the same boat
- jdd 11y agoAdoption 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.
- 11y ago
- johnhenry 11y agoI remember reading sometime ago that the creators of LoDash strived to maintain drop-in compatibility with Underscore, and that if breaking changes between the two libraries were to occur, an announcement would be made. I can't find the initial statement, so I wonder if the developers are still attempting to maintain this?
- ben336 11y agoThere are some small incompatibilities: https://github.com/lodash/lodash/wiki/Migrating https://github.com/lodash/lodash/wiki/Migrating They're still mostly drop in though, most lodash differences are extras rather than modifications.
- dararith009 11y agoHello
- Aandre 11y agoUnexplained Mysteries....Must read http://goo.gl/1VBTyy http://goo.gl/1VBTyy
- insulanian 11y agoWhatever happened to underdash (https://github.com/underdash/underdash https://github.com/underdash/underdash)?
- laughinghan 11y agoThe second paragraph mentions/links to underdash: "The year was also one of collaboration as discussions began on merging Lodash & Underscore."
- insulanian 11y agoExactly, "began" - I expected next major version to actually be a merge. Hopefully they can now focus on that...
- conradk 11y agoFeels good to see a JS lib last that long and still be actively maintained, deprecating obsolete features and adapting to the new ways we use our browsers without breaking BC (or else explaining how to migrate). Coming from Symfony (PHP), this just feels right: keep moving but make it easy to follow along.
- patates 11y agoIs this a Symphony thing or are external dependencies significantly more reliable in the PHP ecosystem in general? Last time I wrote PHP was 9 years ago and those times everyone I knew just copy-pasted all the external code they found. I know that package managers are the thing now and I'm using nuget for my .NET projects (and npm, which is a must if you do any front-end dev), however, I feel like I'm having more dependency management issues than the good ol'days in spite of using a language with static type checking. I'm not saying "vendor everything" but maybe some vendoring helps, especially when every package author seems like they've taken the philosophy of "doing one thing, doing it well and breaking everything on every update".
- dchesterton 11y agoI find external dependencies much more reliable in the PHP world than JS. Most packages try to follow semver. Composer is one of the best dependency manager tools I've used and you can easily lock down dependency versions so you can install from a state which you know works. People hate on PHP but there are a lot of quality packages out there and Composer is definitely considered best practice by most developers now.
- noir_lord 11y agoThe Symphony team are extremely good at moving forwards while not breaking everything behind them, they also have (frankly compared to nearly everyone) insanely good documentation. I'm primarily a Laravel user (it's a better fit for the stuff we do) but I have huge respect for the Symfony guys as their components make PHP much nicer to work in.
- conradk 11y ago
- techterrier 11y agoThe FP stuff is huge. I've been using Ramda which is great, but often feel like I'm out on a limb with it.
- jgord 11y agoupvote for Ramda, which I happily use everyday ( be it on server or front end)
- stared 11y agoAs I see, lodash is a big fan of renaming functions. (In any case, this library saves me a lot of manual labour, headache + can write in a functional way without poor performance.)
- vkjv 11y agoI'm curious why the `thisArg` parameters were removed? I dug through some of the PRs and commmits but was unable to find any specific conversation. It seems odd since the `Array.prototype` methods include it. https://github.com/lodash/lodash/commit/454aca7003e14994e7b9f6ebc5ab436142690eda https://github.com/lodash/lodash/commit/454aca7003e14994e7b9...
- reaktivo 11y agoWas wondering the same, and I can't think of a better reason than the popular adoption of ES6 arrow functions, since the thisArg was mostly used to pass in 'this' as a value.
- jdd 11y agoIt 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.