The case against jQuery
- GZIP has multiple compression levels. While sizes are usually given from level 9, this is not economical for web servers as it adds significant CPU usage to every request. Web servers will typically opt for compression levels from 3-6 for a better cost tradeoff, creating a slightly larger file to be downloaded in production than claimed by the library's marketing.
While on the surface your own code will be slightly shorter using jQuery, adding the library often adds much more weight to your application that you save in your own code by using it.Every feature jQuery contains is downloaded and executed - even if you don't use it. And chances are, you aren't using even half of jQuery's functions.
jQuery to vanilla js cheat sheet
But jQuery makes you more productive
So, should you ditch jQuery? The answer is: maybe. If you value productivity and speed during development, jQuery is still hard to beat. Code written using it tends to be easier to read and and the included workarounds for bugs in specific browser versions enable faster prototyping and lead to less debugging.