"What's next? Now more than ever ever ever you might not need JQuery?" - some Reddit comment
It's that time again!
Thought these articles were done for? No sir! Much like JQuery itself, they refuse to die.
It's almost the year 2019–the future–but instead of flying cars and moon colonies we have..... jQuery. Bummer.
The (in)famous You Might Not Need jQuery says
Some developers believe that jQuery is protecting us from a great demon of browser incompatibility
And it's this misconception - about what jQuery actually does for you - that this article will explore in depth.
JQuery was born (2005-2006) into a web environment where people still talked about
getElementById. For instance, this blog post from late 2003 implores developers to stop using
document.all and switch to the standardized
getElementById supported by both IE5 (1998) and Netscape 6 (2000). Of course, developers were reluctant to move entirely to the standardized method, choosing instead to feature-detect for each option for fear they might alienate a small percen--- oh my god this sounds so familiar when will the madness end.
addEventListener which had various quirks, most notably the competing bubbling and capturing models of event propagation.
XMLHttpRequest was going through similar growing pains, requiring different code paths for different browsers
JQuery was one of many "AJAX libraries" at the time, and not the first to allow DOM manipulation through CSS syntax.
We all have different clients with different requirements. As we all know, the one browser that's done the most to single-handedly hold back the progress of the web is Microsoft Internet Explorer. We web developers live in constant fear of the mythical legacy enterprise application, hiding deep in a cave somewhere, where one corporation is running IE6 on their UNIVAC and you can't afford not to support them.
At least, we used to. This is no longer a valid objection.
If your client - yes yours - wants IE 9 or 10 support, then your client is wrong (and by the end of this article you'll be armed with knowledge, prepared to break the news to them about their wrongness)
For comparison, jQuery 3.x supports...
But jQuery is being overly conservative. Of these, which do we need to be concerened with, and how many weird quirks do they have?
Who matters? Let's look at the stats. To start with, there's the Android OS version stats. These statistics show 11% of Android users on Android 4.x, but this is based on Google Play store stats, not web browsing habits, and Android users on 4.1+ are able to download Chrome or Firefox.
Depending on whose web stats you believe, Android 4.x actually accounts for about 0.5% of web visits, iOS < 11 for ~1%, and IE11 anywhere from 2-10%
IE10 and lower were obsoleted - completely abandoned - almost three years ago (January 2016). Windows XP was kicked to the curb in 2014. That means that anything older than IE11 on Windows 7 is a security risk. For government agencies and some businesses, they may be violating compliance requirements.
But what about average users for public-facing websites? By any measure, IE <11 appears to have less than 1% of market share. IE 7, 8, 9, 10 are each a fraction of a percent of users.
"But what if a stray IE8 user wanders into my website and it's all broken and I look like a fool"
Those users just don't matter. Let it go.