From the start, Rails was praised for being the easiest way to get Ruby on the web. It was the easiest option, and the best. Since then, many other options have arrived, but Rails is still the industry leading framework for Ruby developers.
As is tradition, this April at RailsConf 2015 in Atlanta, the creator of Rails, David Heinemeier Hansson (aka DHH) took the stage to announce what was new in Rails and to mark the release of Rails 5. This fits with the schedule of a major release every two years. And of course, folks were excited to get in early and see what our BDFL had to say about the future of Rails.
Here’s a look at some of the highlights.
There were groans in the audience when DHH announced, again, his love for TurboLinks and their inclusion in Rails 5.
Turbolinks have been part of Rails since version 4, but version 5 is looking to take advantage of the more advanced TurboLinks 3. This streamlines the process and makes use of Rack middleware and HTML5 custom data attributes.
If you are familiar with the functionality of TurboLinks in your application, do not fret! Things are not changing significantly. TurboLinks 3 will be an evolutionary step towards better speed and better rendering.
The biggest news at RailsConf was the introduction of Action Cable. Action Cable is a feature used to extend Rails via WebSockets to add real-time message passing functionality.
While WebSockets are not a new concept, the integration with Rails has been fraught with difficulty. So this is a welcome addition for people who don’t want to mess with workarounds.
Action Cable is still in the early stages of development and there is likely to be more information on it before we see it’s release as part of Rails 5. But considering the amount of projects requiring real-time interaction (be it for chat, feeds, and so on) Action Cable looks to be an overall boon to Rails developers.
Two versions later, CoffeeScript is still the default and it would seem the decision has gained a wider acceptance. For some people, that’s because the “must use” fear didn’t pan out, and for others, it’s because they tried CoffeeScript and they liked it.
Ruby Version Support
Rails 5 will only support Ruby versions 2.2.1 and higher. As Ruby progresses as a language, backwards compatibility needs to be sacrificed for new features. Older versions can’t be supported indefinitely. Rails is no different. Though, Rails is making the sensible decision of only supporting the most widely used version, starting with 2.2.1 and including all stable releases after.
Because of this, it is unlikely that someone using Ruby 1.9.3 would want to move to Rails 5. It’s possible they will remain on a lower version until some other external factor forces an upgrade and a refactoring of the code. For some dev shops, that may not happen for years, which is perfectly understandable.
For some, this is a barrier to Rails 5. For others, it is an opportunity upgrade and improve an application that may be in need of some love.
Rails 5 is almost upon us.
It looks as if we have a lot to look forward to: Turbolinks upgrade for better rendering, Action Cable for better real-time message handling, more CoffeeScript (if you’re into that), and moving forward with the Ruby ecosystem.
If you can upgrade, upgrading is your best option. Though, depending on how much time you have, it may be a good idea to let the early adopters kick the tires.
P.S. What are your thoughts on Rails 5? Were you there for the announcement at RailsConf? Leave us a comment!