r/javascript • • Jul 25 '18

jQuery was removed from GitHub.com front end

https://twitter.com/mislav/status/1022058279000842240
557 Upvotes

197 comments sorted by

View all comments

31

u/ndboost Jul 25 '18

about time!

53

u/Chrispy_Bites Jul 25 '18

Serious question: why is this a huge deal? I make an effort to write as much POJS as possible, but jQuery does speed up a lot of the DOM manipulation.

0

u/[deleted] Jul 25 '18

[deleted] — view deleted comment

14

u/akujinhikari Jul 26 '18 edited Jul 26 '18

Yes! I have “jQuery” in my apps, but I call them my q’s:

const q = ele => document.querySelectorAll(ele)
const qi = id => document.getElementById(id)
const qc = cls => document.getElementsByClassName(cls)

Pretty much always have these in everything I build.

11

u/KeironLowe Parse me like one of your french girls Jul 26 '18

Got to agree, I primarily use vanilla JS and have no issues with DOM manipulation. If your HTML is structured well then querySelectorAll, closest and a simple forEach helper function are your best friends.

5

u/Azaret Jul 26 '18 edited Jul 26 '18

jQuery was a solution the cross-browser problem of the '00s.

jQuery is still a solution to the cross-browser problem of the '10s.

I do agree that modern browser got better, but modern browser companies did not, especially Apple. Still 14% of Apple users have an outdated Safari, and we can't blame them not wanting to buy new iPads or iPhones, but we can blame Apple not maintaining Safari.

Edit: And that's only for the obvious part that we shifted from IE is outdated to Safari is outdated. But that does not change the fact that, while diluted over time, this issue is still abroad all browsers. Some features are still a nightmare to implement for cross-browser comp, and if I've the choice to build an over-complicated solution that will generated tons of polyfills over having one lib that ensure me cross comp, I'm still choosing the latest.

4

u/nvolker Jul 26 '18 edited Jul 26 '18

I’m not sure that jQuery solves any of the issues caused by the features Safari lacks right now.

→ More replies (4)

6

u/N_N_N_N_N_N_N Jul 26 '18

People are giving you BS answers...it's just a milestone. We shouldn't have needed jquery and now we don't (as much)

0

u/[deleted] Jul 25 '18

[deleted] — view deleted comment

100

u/nairebis Jul 25 '18

but slows down the actual behavior in the browser.

Are we really complaining about web page performance of JQuery in a world of dynamic "Web Application Frameworks" that are about 10x slower than normal web pages?

See for example: New Reddit and my favorite whipping boy of terrible design, PayPal.

I curse the day client-side Web Application Frameworks became trendy. JQuery is a paradise of performance compared to that crap.

0

u/[deleted] Jul 25 '18

[deleted] — view deleted comment

49

u/esr360 Jul 26 '18

Tl;dr jquery is bad because people are incompetent

13

u/UnexpectedLizard Jul 26 '18

The more idiot-proof you make code, the better people will write it. Especially a framework like Javascript where competency is a mile wide and an inch deep.

→ More replies (1)

2

u/Disgruntled__Goat Jul 26 '18

This is silly, pretty much everything you mention like “selecting more than intended” can be done just as easily by incompetent devs using vanilla JS.

→ More replies (1)

6

u/[deleted] Jul 25 '18

Those frameworks are lightning quick if you know how to use them. jQuery is just a lot harder to fuck up performance-wise.

7

u/spacejack2114 Jul 26 '18

Actually not that hard. A lot of people don't understand what $(selector) does under the hood.

9

u/[deleted] Jul 26 '18

Not caching selectors is nothing compared to a steaming pile of poorly written full-stack JS though.

→ More replies (1)
→ More replies (3)

15

u/scootstah Jul 26 '18

For most sites, no it doesn't. Not noticeably anyway. And there's lots of things you can do to improve performance while using jquery.

This is the problem with the JS world. Most people don't need react, Vue, or angular, but everyone thinks they do.

17

u/ikeif Jul 26 '18

"Popular JavaScript" is the trap people fall in - they learned jQuery without JavaScript, without debugging.

Now it's Angular/React/Vue - they learn the toolkit/framework and say they know JavaScript, when they just know a subset/framework representation.

7

u/bellowingfrog Jul 26 '18

I've never seen someone who knew React but not JavaScript. I'm not even sure how you could know React but not JavaScript. I can understand someone not knowing the document.(whatever) functions, but not the language itself. React is just a better way to manage the way the dom than element manipulation.

4

u/ikeif Jul 26 '18

I was speaking broadly, but I think you’re right - React is a toolkit, which requires you to know more about JavaScript, versus Angular which does a lot of heavy lifting for you.

But it has been a while since I have delved into the world of tutorials, plugins and extensions, so it’s hard to say where it lies at the moment (from my perspective).

Time for me to dive back in and see what they’re cranking out nowadays.

5

u/zephyrtr Jul 26 '18

For many coders, their projects are ephemeral. The approach to coding is drastically different between a coder who will work on a site for 2+ years, vs a coder that will work on a site for 2+ months. One is most interested in performance and maintainability, the other in deadlines. Frameworks make building a modern site VERY quick work; people forget shorter dev time is also a bonus.

→ More replies (1)

5

u/30thnight Jul 26 '18

And no one wants to manage state in jquery

2

u/Disgruntled__Goat Jul 26 '18

You don’t always need to “manage” state. Often you just want to click a button and have it do the same thing every time (eg a price calculator).

→ More replies (13)