News for hackers. Stuff that matters.
Re:Cash: An absurdly small jQuery alternative for modern bro... by random_rr on Friday April 01, 2016 @06:39PM (#11409091)
Hey guys, if the selling point of this framework is the size, I would suggest adding the library size to the readme, preferably in the first paragraph or so. That's what I looked for when I loaded the page, and I didn't see it.

cash.min.js is 7.8kb once downloaded, for anyone coming to this thread after me.

Nice work all around, is this comparable with Zepto? What features are missing from Cash that you guys hope to add?

Re:Cash: An absurdly small jQuery alternative for modern bro... by twolfson on Friday April 01, 2016 @07:04PM (#11409193)
Strange my numbers vary from yours. In their latest commit the minified content in their dist is 9.3kb as is and 3.2kb after gzip

https://github.com/kenwheeler/cash/blob/3cb498ca7c5776b8cadc...

curl https://rawgit.com/kenwheeler/cash/3cb498ca7c5776b8cadcce588... | wc -c # 9282

curl https://rawgit.com/kenwheeler/cash/3cb498ca7c5776b8cadcce588... | gzip | wc -c # 3225

Re:Cash: An absurdly small jQuery alternative for modern bro... by random_rr on Friday April 01, 2016 @07:10PM (#11409226)
I downloaded their cdn version: https://cdn.jsdelivr.net/cash/1.0.0/cash.min.js
Re:Cash: An absurdly small jQuery alternative for modern bro... by ryptophan on Friday April 01, 2016 @08:06PM (#11409491)
Re:Cash: An absurdly small jQuery alternative for modern bro... by tekromancr on Saturday April 02, 2016 @01:34PM (#11412373)
I did not know you could pipe to gzip... That's awesome!
Re:Cash: An absurdly small jQuery alternative for modern bro... by nathancahill on Friday April 01, 2016 @08:30PM (#11409579)
Indeed. I've been very happy with this badge service: https://github.com/ngryman/badge-size
Re:Cash: An absurdly small jQuery alternative for modern bro... by haywirez on Saturday April 02, 2016 @09:16AM (#11411392)
Yesterday I found a good, extremely lightweight (986 bytes uncompressed) alternative, extends Array.prototype:

https://github.com/finom/balalaika/

If that's too much, there's an even more extreme version (379 chars):

https://github.com/finom/bala

Re:Cash: An absurdly small jQuery alternative for modern bro... by Kequc on Saturday April 02, 2016 @11:30AM (#11411851)
I have an even smaller one.

> document.querySelectorAll('.my-selector')

Re:Cash: An absurdly small jQuery alternative for modern bro... by tyingq on Saturday April 02, 2016 @08:32AM (#11411293)
>> is this comparable with Zepto?

Jquery functions Zepto has that Cash does not: ajax, contents, hide/show, map, offset, offsetParent, replaceWith, scrollLeft, scrollTop, size, slice, submit, toggle, unwrap, wrap, wrapAll, wrapInner

Zepto also has some optional plugins that aren't in the default build.