Live data from Hacker News

“Discuss latest changes to master before releasing”

github.com

11–20 of 30 posts

Re: “Discuss latest changes to master before releasing”

#11
post #10

Earlier quoted context omitted.

If you're using CommonJS you can do require('lodash/category/method'), and when it gets built on the frontend it'll only include the method and its dependencies. So if you're using only 5% of lodash, you'll only get that 5%.

Right. If on node, you can also use modules via NPM ( https://www.npmjs.com/browse/keyword/lodash-modularized ). But as I said, this is common in many frameworks. Hell, you can even do with JQuery ( http://projects.jga.me/jquery-builder/ ). So having this ability doesn't make Lodash special. This is not presented as the preferred method to use the framework on the project page either. You just get a link on the front…

If you care about filesize, you'll probably optimize as much as possible. You can do this with Lodash using modular imports.

There's little upside in hosting a light version, and fragmenting the docs. Min/max'ing on filesize lets you save 15 kB, or 0 kB. Creating a light build that saves 5 kB is a maintenance cost with a poor ratio relative to reward.

Re: “Discuss latest changes to master before releasing”

#12
post #2

If you find yourself annoyed by some aspects of Underscore, you might want to check out Lodash[1]. Lodash's API is a superset of Underscore, though you can create custom builds with only the parts you need. In general, Lodash performs better and has fewer bugs than Underscore. Unlike Underscore, Lodash has 100% test coverage. Also, Lodash has some handy things like _.cloneDeep(), and semantic versioning. That means y…

[deleted]

Re: “Discuss latest changes to master before releasing”

#15
post #10

Earlier quoted context omitted.

Right. If on node, you can also use modules via NPM ( https://www.npmjs.com/browse/keyword/lodash-modularized ). But as I said, this is common in many frameworks. Hell, you can even do with JQuery ( http://projects.jga.me/jquery-builder/ ). So having this ability doesn't make Lodash special. This is not presented as the preferred method to use the framework on the project page either. You just get a link on the front…

If you care about filesize, you'll probably optimize as much as possible. You can do this with Lodash using modular imports. There's little upside in hosting a light version, and fragmenting the docs. Min/max'ing on filesize lets you save 15 kB, or 0 kB. Creating a light build that saves 5 kB is a maintenance cost with a poor ratio relative to reward.

> If you care about filesize

I don't care about filesize. I care about code complexity. The more crap you add to a page, the slower it will run. You also get a higher probability of conflicts and problems in the long run.

If you need something, you need something. But if you don't and you just throw it in there, you're asking for problems down the road.

Re: “Discuss latest changes to master before releasing”

#16
I don't follow Underscore but whoever wrote this title (currently "Underscore 1.8 makes last minute breaking changes to master without discussion") must really have an axe to grind, and it seems inappropriate for HN. Doesn't really set the tone for any constructive discussion.

Re: “Discuss latest changes to master before releasing”

#17

I don't follow Underscore but whoever wrote this title (currently "Underscore 1.8 makes last minute breaking changes to master without discussion") must really have an axe to grind, and it seems inappropriate for HN. Doesn't really set the tone for any constructive discussion.

There have been previous events in underscore's history that lead to sudden breaking changes without following semver. That's probably why.

Re: “Discuss latest changes to master before releasing”

#18
post #5

Earlier quoted context omitted.

Lodash is also several times larger than Underscore. The point of Underscore is to keep it light. And yes, you can pick and choose what modules you want. But you could do that with Mootools and it was released a decade ago. If you want a heavy framework with lots of modules, there are plenty to choose from. Maybe if it offered a light version on the front page? The file linked from the front page is 372KB. By compari…

If you're using CommonJS you can do require('lodash/category/method'), and when it gets built on the frontend it'll only include the method and its dependencies. So if you're using only 5% of lodash, you'll only get that 5%.

Just noting that CommonJS has nothing to do with this capability, it will work in any format.

Re: “Discuss latest changes to master before releasing”

#19
post #5

Earlier quoted context omitted.

Lodash is also several times larger than Underscore. The point of Underscore is to keep it light. And yes, you can pick and choose what modules you want. But you could do that with Mootools and it was released a decade ago. If you want a heavy framework with lots of modules, there are plenty to choose from. Maybe if it offered a light version on the front page? The file linked from the front page is 372KB. By compari…

A couple things: - The actual difference (minified and gzipped) is 17.6 KB vs. 5.7KB. - Lodash is written modularly so you can import only the methods you actually need. - In order to "lose some weight" (as Jeremy Ashkenas called it), underscore dropped several methods that people really wanted (including other contributors). - Also to cut down the size, several major pieces of functionality is not broken in older ve…

With regard to size, the gzipped size isn't the whole story - more code results in more processing time and memory usage.
Post reply on HN