Hacker News new | ask | show | jobs
by nobleach 1988 days ago
jQuery, minified and Gzipped is 30.4kb. That's completely unacceptable for my needs. This is why folks complain about bloat.
1 comments

Are you being sarcastic?

But, either way, it really depends. If you are writing a large application and jQuery saves thousands of lines of boilerplate, then it's totally worth it. For a tiny library (which is what this page is targeted at), then it's probably overkill and you should learn how to do it manually with pure JS. Both can be true at the same time.

May or may not be. I deal with a not small amount of customers that are on extremely slow connections where 30k less makes a big difference. You can do a lot in 30k. jQuery makes life a heck of a lot easier though.
I think this is a fair point if you genuinely want to keep your bundle size as small as possible. Many times, the people complaining about jQuery's size are serving 2 MB bundles. 30K is immaterial in that scenario.
Like I mentioned in another response, my bundle was 200k. 30k would have been significant bloat.
I'm absolutely NOT being sarcastic. In my time at Overstock, I prided myself on a mobile-first bundle that was 200k... for the ENTIRE app. The time to first meaningful paint and time to interactivity were fantastic. This was especially true for 3G and emerging markets. There is NO WAY, I'd add 30k so I could select/iterate DOM elements. I simply see that library (as well as a few other common ones) as part of the problem we see in JS development.
He might not be being sarcastic, servers are expensive and every little slice helps, though I think the cdn aspect changes this question somewhat.
It's a serious hurdle when pReact is only 10kb unzipped (13kb with hooks) while jQuery is 89kb.

Accounting for 70% average minification and 40 characters per line on average, that's around 6,500 lines of normal code shipped "for free" by using pReact instead where there's both no wire cost and no extra parse time.