Simple.... You just shouldn't... Its not wrong, but its overkill and at the same time you are under-powering all the features that your Framework has. Okay... Lets, go back in history and try to understand why JQuery was even invented. Back in the old days like the OLD days around 2006 - 2012... JavaScript was not yet a standard and it doesn't support cross browser DOM manipulation. Therefor someone had an Idea to make a JS library to band aid that wound in the world of web development. However, years later that wound would be healed.
JavaScript has become a norm for web browsers and is now standardized across all platforms making JQuery no longer relevant. But hey! I'm not saying developers should stop using JQuery... But I'll warn you. Once you rely on JQuery you will have a harder time adjusting to new frameworks as it doesn't use the common syntax, and it has a rather distinct DOM implementations, after all JQuery is just another JavaScript library...
Back to the topic at hand on Why You shouldn't use JQuery in a framework?
Because it'll just make your app heavy.
Everything JQuery can do, VanillaJS/JS/TypeScript can do better and faster.
It results to a terribly large amount of JavaScript code written.
Frameworks already has its OWN LIBRARY. JUST READ THE DOCS!!!
And finally... JQuery is no longer relevant as mentioned above. It was a band aid solution on a wound that's already healed. It served its purpose...DONE
Alright! Little disclaimer... I'm not telling developers or aspiring developers to not use JQuery at all... But at the same time decide for yourselves whether its still relevant.
Top comments (5)
I was wondering after reading your post, why not use it? Since I still use frameworks like Bootstrap that make compulsory use of JQuery, so I won't waste my code with another library, and my development has always been agile with Bootstrap, so it won't be in 2019 that I will pause, perhaps outright, with jQuery. Ty dev.
Jquery is simple, and it makes easy to learn and make complex things, frameworks like React and Angular don't think as much as dev experience as Svelte, and that's why people tend to avoid learning React/Angular and try to find something else.
Backend >>>>>>>>>>>>>>>
Frontend is a pain in the ass to develop.
Yeah... Some frameworks still use jquery as part of their library.
Using jQuery to get to the DOM would be as if using Javascript to get to the DOM. 1. Security Risk. 2. Not using Angular mechanisms already in place, i.e - nativeElement. @ViewChild, etc.
see here: indepth.dev/posts/1052/exploring-a...
Yes exactly, VanillaJS already made built-in methods that are faster than jquerys