Guillermo Iguaran

Hasta la vista, jQuery

Some of you might remember how excited we were back in 2010 when Rails 3 introduced the option to use JavaScript libraries as alternative to Prototype/Scriptaculus (someone else is feeling old?) like Mootools (do you remember Mootools, right?) and jQuery, some others might remember how “hacky” was using jQuery with Rails helpers in Rails 2.3), and others might remember also how excited we were with the introduction of Unobstrusive JavaScript (we had AJAX without writing one single line of code!!)

Back in 2010 (and before) avoiding writing vanilla JavaScript and using frameworks for DOM manipulation, AJAX, events, etc was totally reasonable. Today the panorama is totally different: do you event listeners? AJAX? bind? query selector? You’re totally covered by plain ES5 (and hey ES7 is the new kid on the block nowadays!!), do you need $(document).ready? DOMContentLoaded from HTML5 is your new best friend.

The times changed, Arnold Schwarzenegger (ex. Gov of CA) is old, Terminator 2 was released 25 years ago, Emilia Clark is the new Sarah Connor and you might not need jQuery anymore.

Ok well, maybe there are plenty of other reasons for using jQuery in many applications, that’s totally fine but many would agree that it is not a standard or default for the new applications today and that’s why we have decided to move it out from default Rails stack to RoR Retirement Home (remember TRL Retirement Home?).

UJS is now supported using rails-ujs library (that doesn’t use any framework underhood) created by Dangyi Liu as part of Google Summer of Code and you can still use jQuery in your new apps with the -j option (e.g rails new blog -j jquery)… or (protip!) you can use that option to get React instead (rails new instagram -j react) ;-).

Too much nostalgia for one day, hasta la vista, jQuery.