Hello! This is Greg bringing you latest news from the world of Rails. This is the last issue of the year, so we will look back at the interesting changes we had this year! I would like to take the chance and say thanks to my fellow editors for the work they put into the newsletter this year!
After a period of betas Rails 5.0 has been released this June. The headline features are Action Cable and a mode primed for API-only apps. For the new major release, DHH brought us an updated look at Rails in the form of a video tutorial.
Thanks to Jeremy Daer, Ryuta Kamizono, Vipul A M and Ian Gilfillan, Active Record is now fully compatible with MariaDB ❤️💛💚💜... click on our heroes' names to open the commits and see what went down behind the scenes!MariaDB is a community-developed open source fork of MySQL. Notable users include Wikipedia, Facebook, Google and, yes, Basecamp 3! Here is a good Wikipedia article about MariaDB and MySQL history. Game on!
The Rails javascript helpers has been rewritten in a new gem called rails-ujs and they use vanilla javascript, so jQuery is not a dependency of Rails anymore.
While we are talking about JavaScript, the asset bundling side of things is also getting some love. Rails 5.1 will gain first-class support for webpack via the --webpack option. This is still a pretty early spike, so definitely try it out and help improve it.
Before the the latest major release of Rails, we got a new website and logo and... doctrine? Yes! See, Rails has been going strong for over 10 years, the Rails Doctrine just captures that magic and spells it out. Thus Rails is ready to roll on for the next decade. The blog post dishes on the new design's backstory.
Do you remember the old Welcome aboard page? It's now replaced by Yay! You are on Rails! The welcome page got a big facelift in Rails 5, gone are the needless links and extra data. It's compact and mentions only relevant things.
“System tests have finally taken strong hold at @Basecamp. Can't wait for us to level-up @Rails with great defaults for it in 5.1!” The work being done is soon to be bundled into a new gem inside of Rails, that will hopefully be part of Rails 5.1!
Building on an implementation proposal by DHH, new syntactical sugar has been introduced for tag helpers that supports HTML5 markup by default and avoids positional parameters. See the PR for details and code examples as well as #25289 for the groundwork and discussion.
It is possible to specify comments for tables, columns, and indexes in the database itself now with this addition. It currently works for MySQL and PostgreSQL adapters.
New APIs retry_on and discard_on have been added to Active Job. These provide hooks for a job class to perform some additional functionality when exceptions occur. The PR for this feature has some nice discussion, check it out!
Ever find yourself writing cumbersome things like User.count.zero?? You can now use the terser User.none?, as well as User.one? and User.empty?, as these three methods just got added.
Rails session is now compatible with other Rack frameworks like Sinatra that are mounted in Rails. They can also use session tooling of Rails without any issues now.
The Rails test runner switched to using minitest's autorun across the board, as such it gained support for Minitest.after_run hooks. autorun also guards against running tests twice, which could happen in some cases. But that's now fixed too.
Friends don't let friends use INT as a primary key – your app might hit Webscale™ before you know it, resulting in much sadness when your primary key column overflows. To help put you on the right path, Rails 5.1 will default to using BIGINTs for primary key columns in MySQL and PostgreSQL.
Wrapping up
That's it from This Year in Rails! There were many other great contributions, so please feel free to check them out yourself!
As I already mentioned we had a great year with a lot of improvements and great new features!