Categories
Uncategorized

You Might Not Need jQuery

The first stable version of jQuery was released in August 2006 ( 1.0 ), more than 13 years ago. I am happy to say that the world of web browsers has changed significantly since then.

In 2020, You Might Not Need jQuery any more. I’m being completely serious here, writing plain JavaScript without jQuery is a totally viable option for many sites.

There is a great resource at youmightnotneedjquery.com for vanilla JavaScript versions of common jQuery calls, that vary depending on the version of Internet Explorer that you want to support.

When it was released jQuery was super helpful as a compatibility layer to make writing JavaScript that worked across browsers. Today, for many people and sites, that compatibility layer is no longer needed. But it continues to get used in those cases out of habit and convenience in continuing to carry around old code.

Including jQuery comes with a cost. The current version, 3.4.1, is 88,145 bytes minified. Even with Brotli that is more than 29 KB over the wire. If updating the JavaScript on your site would require fewer bytes than that, start making the switch.