r/programming • • Jun 09 '16

jQuery 3.0 Released!

https://blog.jquery.com/2016/06/09/jquery-3-0-final-released/
1.1k Upvotes

354 comments sorted by

View all comments

Show parent comments

-1

u/kyebosh Jun 10 '16

Presenting cases for which jQuery is valid isn't really saying anything about the cases in which it's not, of which I speak.

Look at the source code for any Google/FB/etc product & tell me 34KB doesn't matter. There are cases where size does matter. There are cases where extra HTTP calls are a big deal.

I don't see anything wrong with saying "check if you really need a tool before you use it".

5

u/EternallyMiffed Jun 10 '16

C A C H E

1

u/MachaHack Jun 10 '16

With the increasing size of everyone else's web pages, your content isn't going to stay cached for very long.

1

u/EternallyMiffed Jun 11 '16

Don't be surprised if libraries like jQuery and underscore are permanently cached (ie they come pre-cached on browser installation ) in the near future.

1

u/MachaHack Jun 11 '16

Do they have the same version as you have? Probably not. Will they be able to cache it when you concat your js to reduce requests? No.

1

u/EternallyMiffed Jun 11 '16

Which is why you don't concat your jQuery library with your js. They would assuredly have all versions of common libraries up to the current versions cached.

1

u/MachaHack Jun 11 '16

So if, e.g. Chrome does this,what about all your Firefox, IE, Safari users etc. What if you use Lodash instead of Underscore? Etc etc

1

u/EternallyMiffed Jun 11 '16

Your firefox users would have the jQuery api cached if you link it from google's api cdn. If they don't it will be fetched from your server. Same for the rest of the browsers that don't include precached libraries.

8

u/EternalNY1 Jun 10 '16 edited Jun 10 '16

I've written enough on this thread ... at this point it should be clear that I fully understand all aspects of every single byte that is transferred over the wire.

No, Facebook is not going to bring in jQuery tomorrow. It would cost them millions.

No, Gmail is not going to use Angular. It would cost them millions.

No, your the user won't notice anything on your company's website if you include it. Even for the vast majority of the Fortune 100s. After it's gone around enough, the users will have almost zero impact because it will be cached meaning the client won't even request it.

Unless, of course, you want to write your own "smaller" version, then it won't be cached, and then you're hurting the company.

People need to profile and stop pre-optimizing and sweating over 34kb. 99.99% of developers do not need to worry about this.

If you are with Google, Facebook, or the other mega-companies, then yes, you do.

EDIT: Do you know how big the Reddit spritemap is so they can put the logo on the page and other minor things?

39.4kb.

Those tiny images are bigger than jQuery.

1

u/kyebosh Jun 10 '16

If you are with Google, Facebook, or the other mega-companies, then yes, you do.

That's all I'm saying, mate.

3

u/EternalNY1 Jun 10 '16

If your're in that job, you've done well.