As IE11 becomes the trailing edge browser we need to support, the need for jQuery shrinks to zero.
Not true, because they can slim down jQuery (as you see with 3.0) which still allows you to turn what might be 20 lines of ECMA-compliant JavaScript into a one-liner that even assures you much better compatibility.
It's still useful, as long as it's not bloated, and fast.
It makes your own code more readable ... the whole "DRY principle".
This?
var d = document.getElementsByClassName("goodbye");
var i;
for (i = 0; i < d.length; i++) {
d[i].className = d[i].className + " selected";
}
And by "people" I mean "developers" which makes it even more frightening.
Sadly, as a senior developer I've had to lay people off after I asked them, politely, numerous times to please stop trying to squeeze out the extra 15 milliseconds of some function that runs once a day and focus on the real problems on the list.
And not "Lumberg" politely ... just trying to explain that it is not a priority and we have bigger problems. It sucked. But soooo many people do this.
Because if you can shave it from 30 ms to 15 ms ... that's twice as fast. To the one person who might run it, once a day.
"But you have to pull in the whole library!".
Yes, well your logo in the top left corner is twice the size of jQuery and could be 100 times smaller and look the same.
Oh, and jQuery wasn't actually downloaded as you can see in the developer tools network panel ... it's cached on almost everyone's machine.
You can benchmark it yourself in the dev tools of whatever browser you want. This is not a hard number because it depends on the client browser, that browser's JS engine, and the client specs.
However, from the release notes, they are reducing this even further.
For the record, I think this is stupid too. Because now we're saving 7k for a version that might not be cached. Why not just stick with the regular 30k one which will likely transfer 0 bytes?
If you switch to the "Slim Build" then your server is going to be sending out 23.6k instead of 0k because it may not be cached.
Slim Build - Finally, we’ve added something new to this release.
Sometimes you don’t need ajax, or you prefer to use one of the many standalone libraries that focus on ajax requests.
And often it is simpler to use a combination of CSS and class manipulation for all your web animations.
Along with the regular version of jQuery that includes the ajax and effects modules, we’re releasing a “slim” version that excludes these modules.
All in all, it excludes ajax, effects, and currently deprecated code.
The size of jQuery is very rarely a load performance concern these days, but the slim build is about 6k gzipped bytes smaller than the regular version – 23.6k vs 30k.
Why not just stick with the regular 30k one which will likely transfer 0 bytes?
Did someone measured the actual cache hit rate when browsing many websites? Because if the deployed versions are too various or not using the same CDN, then the caching argument would be overestimated.
Because now we're saving 7k for a version that might not be cached.
Why would it be not cached compared to the previous releases?
Did someone measured the actual cache hit rate when browsing many websites? Because if the deployed versions are too various or not using the same CDN, then the caching argument would be overestimated.
Yes if you want all versions of IE dropped as well as Safari.
Or bring in jQuery, small and fast and almost guaranteed to be cached locally anyway, and get it fully compatible in 1 (shorter) line without the lambda "arrow function".
So, in your case, we'd have (works on some browsers):
jQuery, small and fast and almost guaranteed to be cached locally
That you keep claiming this in every comment does not make it any more true. There is a huge fragmentation in jQuery versions, so even if 100% of all jQuery sources were served from the same CDN the chance of them having your particular version cached is not great. See https://www.stevesouders.com/blog/2013/03/18/http-archive-jquery/
That you keep claiming this in every comment does not make it any more true.
Where's that little emoticon with the smiley smashing his head against the wall? :)
Ok, no problem.
There's only one real way to answer this question, and since I don't work in your office ....
What percentage of your bandwidth utilization from the server is currently being taken up by serving jQuery?
Almost no one can answer that, and that is the problem. I can answer it, I know down to a single byte how much the server is sending out jQuery as opposed to the thousands of other things in a given request.
People spend all day worrying about "all these bytes being sent" when they are not looking at the numbers.
If you have the numbers, then you don't even need to be posting this, because you understand what you're doing, as do I.
128
u/EternalNY1 Jun 10 '16 edited Jun 10 '16
Not true, because they can slim down jQuery (as you see with 3.0) which still allows you to turn what might be 20 lines of ECMA-compliant JavaScript into a one-liner that even assures you much better compatibility.
It's still useful, as long as it's not bloated, and fast.
It makes your own code more readable ... the whole "DRY principle".
This?
Or?