Live data from Hacker News

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

weblog.rubyonrails.org

21–30 of 143 posts

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

#21

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.

Although the comparison isn't perfect, you can think of jQuery as PHP in the late 90s and early 00s.

PHP made web development accessible to the masses. Because PHP is embedded in the HTML itself, it is way easier to work with than Perl or Java, especially in the context of The Web In 1999.

In the same vein, jQuery filled a very important niche when the web was just getting started. It made Javascript accessible, by smoothing out the differences between browsers, and by providing a useful set of abstractions over the mountain of quirks that is client-side Javascript.

Most importantly, jQuery made hard things that people wanted to do stupidly simple.

But in 2016, there are fewer differences between browsers, and more importantly, our knowledge of How To Build Software has massively improved through lots of trial, error, and iteration.

And things that used to be really hard in Javascript are now a lot easier, thanks to improvements in browsers, languages, and tooling... well, the tooling still needs work, but that's a different discussion.

The world that jQuery served no longer exists, and it has largely been replaced by more effective abstractions. It will never truly go away, but neither will it be the choice for most people that are looking to create something new.

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

#22

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.

Nikanj isn't wrong (and is funny), but I think the other (more justifiable) reason is that jQuery largely isn't necessary anymore: when it came out, there were an uncountable number of browser incompatibilities that needed painting over, and APIs for remote requests, DOM querying & manipulation and the like were very immature, so a library to make everything usable was extremely valuable.

Now, those APIs are mature & standardized & it's generally not too hard to write vanilla JS that works across all the major browsers.

I don't think jQuery has failed, but for the kind of baked-in functionality Rails wants it's not really needed, and there are good reasons not to pack another dependency into your framework if it will increase page download size & is increasingly unlikely to be used by the framework's users.

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

#25

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 is for adding behavior to web _pages_. It thrived in the era where most web development happened on the backend and frontend development was really about sprinkling interactivity and effects onto a page. jQuery does not supply powerful-enough abstractions for writing applications. Early attempts to layer MVC on top of jQuery did not meet with much success; Angular and other libraries used it initially for DOM manipulation but as time went on they mostly found ways to drop the dependency.

I still think that if you're building _pages_ instead of an application, you should consider it. Plus, it is a great tool for understanding and manipulating the DOM. I think it will continue to be popular with casual web developers for a long time, although frontend engineers have probably not been using it for years. I think the death of jQuery is exaggerated, but only time will really tell.

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

#26
post #24

Now they just need to replace coffeescript with es6/babel.

`--webpack` and `--yarn` are both coming, so they definitely seem to be headed that way.

[1]: https://github.com/rails/webpacker [2]: https://github.com/rails/rails/pull/26836#issuecomment-26424...

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

#27
post #23
post #20

jQuery made it super easy to write shitty code. I used to think it was incredible, then I stopped writing it, and now I realize how fucking useless it is.

Haha, maybe I should add that I'm 20% joking, and you guys will hate me less.

20% less

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

#28
Pour one out for jQuery!

jQuery was a major productivity boost when first released but it didn't scale well and encouraged creation of tightly coupled glue code. It's decline being the result of evergreen browsers maintaining good parity where "vanilla JS" is now a feasible option and from it no longer being needed in the premier JS SPA frameworks which scales better and allows for the creation of better componentized and modular code-bases.

In someways we've digressed significantly and made it ridiculously more complicated to build a modern web app in contrast to what jQuery gives you out-of-the-box with a simple script include. Now to create a basic Angular2 App you need to download 32k+ files from npm and become an Angular2 build master just to setup your development environment and configure your package/deploy scripts.

You can still go a long way with just Bootstrap + jQuery - which would still be my goto if I just need to spruce up a web page with some behavior. Although that's happening less and less and find myself reaching for VS.NET/TypeScript/JSPM/React as my choice SPA stack which scales well with a great ecosystem, minimal complexity and maximum utility.

Post reply on HN