jQuery: the king is dead

Believe it or not, I see new projects including jQuery in 2021, and, IMHO, it’s a shame. Here is a short post to explain why.

jQuery was the king

jQuery has been everywhere for quite a while, and there’s a good reason for that: it was handy…


This content originally appeared on DEV Community and was authored by Julien Maury

Believe it or not, I see new projects including jQuery in 2021, and, IMHO, it's a shame. Here is a short post to explain why.

jQuery was the king

jQuery has been everywhere for quite a while, and there's a good reason for that: it was handy, and it solved significant compatibility issues between browsers.

There was a time where people had to make websites for IE6 (Internet Explorer 6). It was an era of chaos ^^. Browser compatibility was a big part of the job.

I mean, there are still some minor incompatibilities, but now you can safely use helpful keywords such as querySelector that allow for quick DOM selections.

If you want to grab remote data, axios is your friend. Need some smooth animation? CSS3 animations rock.

Major frameworks and platforms run now without jQuery

See this PR. Bootstrap 5 won't use jQuery anymore!

GitHub said bye-bye to jQuery some times ago too.

They used it, so there's no doubt it was helpful. I'm not questioning that at all. May I add it was super dev-friendly? I mean the syntax and stuff.

However, we have much better tools now, and Vanilla js is an excellent choice in 2021.

You'll be able to use most of the trendy js frameworks and, above all, understand how they work, what are their weaknesses and strengths.

Good reasons to keep using jQuery

  • you use a framework such as WordPress that has jQuery in its core
  • you do maintenance for a legacy project that still uses it
  • your project needs particular plugins
  • you cannot use modern technologies, and ancient browsers are essential for your business

Vanilla js equivalents

Here is a cool gist that shows it's not so challenging to use vanilla js

Wrap up

Please don't waste your time learning jQuery in 2021 unless you need to handle a legacy project that still relies on that or if you have unusual constraints in your project.

Back in the days, it was a mistake to learn jQuery before JavaScript. It's even more hazardous in 2021.

It's best if you don't start new projects with it.

As the world is not black and white, there can be specific cases where jQuery might fit your needs, but don't use it only to make "quicker" DOM selections or essential operations. It's a lot of bytes to load.


This content originally appeared on DEV Community and was authored by Julien Maury


Print Share Comment Cite Upload Translate Updates
APA

Julien Maury | Sciencx (2021-04-23T10:37:37+00:00) jQuery: the king is dead. Retrieved from https://www.scien.cx/2021/04/23/jquery-the-king-is-dead/

MLA
" » jQuery: the king is dead." Julien Maury | Sciencx - Friday April 23, 2021, https://www.scien.cx/2021/04/23/jquery-the-king-is-dead/
HARVARD
Julien Maury | Sciencx Friday April 23, 2021 » jQuery: the king is dead., viewed ,<https://www.scien.cx/2021/04/23/jquery-the-king-is-dead/>
VANCOUVER
Julien Maury | Sciencx - » jQuery: the king is dead. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/04/23/jquery-the-king-is-dead/
CHICAGO
" » jQuery: the king is dead." Julien Maury | Sciencx - Accessed . https://www.scien.cx/2021/04/23/jquery-the-king-is-dead/
IEEE
" » jQuery: the king is dead." Julien Maury | Sciencx [Online]. Available: https://www.scien.cx/2021/04/23/jquery-the-king-is-dead/. [Accessed: ]
rf:citation
» jQuery: the king is dead | Julien Maury | Sciencx | https://www.scien.cx/2021/04/23/jquery-the-king-is-dead/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.