Go on a Diet
Underscore is getting a little chunky around the edges...
We're up to 5.8k, minified and gzipped. It would be lovely to get that back down under 5...
Theres better ways to do this than deleting methods. omit and pick, max and min and several others are nearly duplicates of each other. It would not be hard to generate those functions
~~Maybe if we dropped support for older browsers we could cut down on the size..~~
Oh didn't see this one:
- [x] https://github.com/jashkenas/underscore/issues/2062 Drop support for older browsers
I'd be happy to spend a few hours looking for places to trim down (I'm sure others would too). However, no one was given the opportunity.
I know what the answer is going to be to this, but please mark 1.7 as latest on npm and revert 1.8 before people start using it.
Also ping https://github.com/jashkenas/underscore/issues/1594
Could we look for some features in underscore that could be moved to underscore-contrib?
FYI Underscore is now 6kb gzipped, which is up from 5.8kb for v1.8.3 (site says 5.7kb).
Im sure there is an excellent reason for this, and id love to hear it but wouldn't it save quite a bit of size if Underscore used more of its own functions internally? such as _.each, _.filter, _.map ect...
At quick glance it seems there a quite a few more places that Underscore could "Dog Food" itself.
One of the things I love about Underscore is how it decreases the amount of Javascript I write in my projects. Seems Underscore itself could take more advantage of that.
@dperrymorrow
Im sure there is an excellent reason for this, and id love to hear it but wouldn't it save quite a bit of size if Underscore used more of its own functions internally? such as
_.each, _.filter, _.mapect...
My guess is it's a concern over performance. That said I'm sure there are plenty of methods where performance isn't a concern for their common usage scenarios. It would be worth reviewing areas where dog fooding can be improved, nixing those areas where perf flags are raised.