If you use a frontend framework you will see how much the code becomes polluted if you wanted to manipulate the DOM with jQuery since all framework rightfully pass native DOM elements. Not to mention that jQuery encourages writing spaghetti code. Some of the reasons behind it is the lack of structure standard associated with it and the ability to chain DOM selectors
That adds at least 82.54 KB of initial load required download to your website (for the minified version). Not to mentioned that jQuery sacrifices performance to be able to do its magic. The need to include it anyway lures developers to use it in their code anyway and the hole keeps getting deeper.
The web api difference between browsers has dropped significantly since the introduction of jQuery. Not to mention that browser use sparsity are much more concentrated nowadays in Chrome as the browser (not that I’m happy about it ¯\(ツ)/¯) and it is closer to the latest versions of whatever browser they are using since the update process is much easier today.
You might say that your users use some ancient IE version you need to support. Well luckily this argument does’t live anymore since you can use the Babel project to support any list of browsers and versions you like. Plus Babel is not a run-time dependency so no performance overhead are added.
Does it really need to be either or? :)
Another way is to support and use lightweight libraries that do not depend on jQuery. Rails removed jQuery as a dependency since 5.1. Github ditched jQuery last year. Bootstrap 5 will not depend on jQuery, and I listed many animation libraries above. You can also share here the libraries you like using which doesn’t depend on jQuery.
Do you have a reason why you personally use jQuery or do you think it has a place today? please share in the comment and I will be happy to discuss it.
If you are a solid software engineer already there is a good chance that you...