Live data from Hacker News

Lodash 4.0.0 is out

github.com

31–40 of 102 posts

Re: Lodash 4.0.0 is out

#31

Earlier quoted context omitted.

I'll put this here just in case no one comments. https://lodash.com/docs#forEach http://underscorejs.org/#each

If 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?

underscore.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.

Re: Lodash 4.0.0 is out

#32

I 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?

There are some small incompatibilities: https://github.com/lodash/lodash/wiki/Migrating

They're still mostly drop in though, most lodash differences are extras rather than modifications.

Re: Lodash 4.0.0 is out

#33
post #30

I 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.

I'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

It'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.

Re: Lodash 4.0.0 is out

#34
post #8
post #5

Earlier quoted context omitted.

[deleted]

No, 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.

Ha whoops! Thanks

Re: Lodash 4.0.0 is out

#35
post #8
post #5

Earlier quoted context omitted.

[deleted]

No, 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.

bower is not just js, but rather lots of various front-end libraries.

Re: Lodash 4.0.0 is out

#36

I 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.

look at

https://github.com/finom/bala

(or balalaika by same author)

also sprint.js and cash.js

Re: Lodash 4.0.0 is out

#37

Earlier quoted context omitted.

If more major libraries drop support for bower, it might (hopefully) die soon. What does bower do better than NPM?

Well, I haven't used npm for css packages yet, but presumably it's okay with webpack/brunch etc.

Its 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.

Re: Lodash 4.0.0 is out

#38
post #8

Earlier quoted context omitted.

No, 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.

bower is not just js, but rather lots of various front-end libraries.

Bower 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.

Re: Lodash 4.0.0 is out

#39

why drop bower support damn it!

If more major libraries drop support for bower, it might (hopefully) die soon. What does bower do better than NPM?

JSPM!

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/

Lodash is already included in the registry: http://kasperlewau.github.io/registry/#/?q=lodash

Re: Lodash 4.0.0 is out

#40

I 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.

Not to be forgotten is d3, which in addition to selectors allows you to very easily bind data to the DOM. And with the big 4.0 refactor that is underway, you can very easily pull in the selection[1] stuff only.

[1] https://github.com/d3/d3-selection

Post reply on HN