Live data from Hacker News

This Week in Rails: jQuery no longer part of Rails, and more

weblog.rubyonrails.org

11–20 of 143 posts

Re: This Week in Rails: jQuery no longer part of Rails, and more

#12

Can anyone explain when did jQuery start to fall back in the tech era? What were its failures? It is a bit sad to say goodbye to such an old friend.

I don't think there are any failures in it - it could have grown outwards to become what React is today, or something, but it always kept to the principle of doing one thing and doing it well: unifying browser APIs across vendors and simplifying them. (yes, I realise that's two things, but...)

These days there are many fewer differences between vendors, and things like the Fetch API are making the kind of simplifications jQuery pioneered a core part of the browser experience.

Re: This Week in Rails: jQuery no longer part of Rails, and more

#13

Can anyone explain when did jQuery start to fall back in the tech era? What were its failures? It is a bit sad to say goodbye to such an old friend.

jQuery to me was always meant as a DOM manipulation library. It didn't fall behind per se, it's just that browsers became good enough and standard enough that you no longer needed this type of tool. I think it would have been a huge mistake for jQUery to have attempted to become a Backbone, Angular or React, because it really was never meant for building web apps (of course you could still use jQuery in Backbone and Angular, and in fact those projects kind of assumed you were using it, or at least something that was API compatible).

Re: This Week in Rails: jQuery no longer part of Rails, and more

#14

Can anyone explain when did jQuery start to fall back in the tech era? What were its failures? It is a bit sad to say goodbye to such an old friend.

I can't answer that, but I'll say that I still include it in most projects without a second thought. Maybe I'm not aware of some existing superior replacement, but since I don't care much for the popular modern JS frameworks JQuery + vanilla JS is still my goto choice. Following good coding principles, I haven't yet had any project grow to be too messy, but maybe I'm just not working on extremely complex front-ends.

Re: This Week in Rails: jQuery no longer part of Rails, and more

#15

Can anyone explain when did jQuery start to fall back in the tech era? What were its failures? It is a bit sad to say goodbye to such an old friend.

It didn't have any failures, the browser APIs have just finally caught up with it. I would guess that 99% of jQuery usage was for ajax, event normalization, and CSS selector queries, which are now trivial and cross platform in vanilla JS (with a little help from the fetch polyfill for ajax). I personally haven't used jQuery in a project for at least two years, and I doubt I'm in the minority of front end developers in that regard.

Re: This Week in Rails: jQuery no longer part of Rails, and more

#16

Never used RoR, was this just used in the scaffolding system?

No, ujs is used to automaticslly implement RoR functions declared in your rails templates. Eg, you can add a confirm attribute to a link, which is then implemented by ujs in the browser, causing a confirm dialog when clicking the link

Re: This Week in Rails: jQuery no longer part of Rails, and more

#17
I misread it as "Ruby on Rails removed from the planet" and almost jumped for joy.

Jokes aside, good riddance! jQuery had a good run, and now it's obsolete (maybe a strong word, and debatable).

You don't bring an entire toolbox to pound in a loose nail. You don't import underscore to write "Hello, World". You shouldn't bring in jQuery to write client-side ES6.

The one good thing that came from jQuery (maybe) is the DOM lookup syntax. Even then, the vanilla query-style isn't even that bad, and as a beginner, I'm not sure why I let the YouTube videos on the internet convince me that vanilla DOM querying was evil and that I should "always use jQuery". Pro Tip: A software engineer that says "always use X" is a fucking retard, and you should probably punch them in the face and then pull their pants down.

Re: This Week in Rails: jQuery no longer part of Rails, and more

#18

Can anyone explain when did jQuery start to fall back in the tech era? What were its failures? It is a bit sad to say goodbye to such an old friend.

Jquery did two things well: it provided a terse, sane syntax for many common tasks, and it provided robust cross browser support.

Modern browsers have partially solved both these issues. (The former with .querySelector() and the latter with the deprecation of MSIE 6/7/8.)

Post reply on HN