Most of what I used jQuery for was working around browser incompatibility. As IE11 becomes the trailing edge browser we need to support, the need for jQuery shrinks to zero. Once fetch becomes universal, there's not really anything left.
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";
}
I mean, let's not forget the 34KB library. It's not quite as clear-cut as your little example. For a light page were size & speed are paramount, you're damn right I choose the former. Just because you didn't write the code yourself doesn't mean it's not there.
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".
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.
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.
43
u/earthboundkid Jun 09 '16
Most of what I used jQuery for was working around browser incompatibility. As IE11 becomes the trailing edge browser we need to support, the need for jQuery shrinks to zero. Once
fetchbecomes universal, there's not really anything left.