From the very beginning, Rails has been praised as the productive way to get the Ruby on the web. It has always been considered as the easiest, fastest and the superior in so many ways. Ever since then, so many other alternatives have arrived, however Rails is still the industry leading framework for the Ruby developers.
Just like the tradition, this April at RailsConf 2015 in Atlanta,the founder of Ruby on Rails, David Heinemeier Hansson (aka DHH) took the stage to pronounce what was new in Rails and to draw the attention on the release of Rails 5. This suits with the schedule for a major release every two years. So, let’s have a look what BDFL had to say about the future of Rails.
Here’s a look at some of the significant highlights
TurboLinks 3
Here, DHH again reaffirmed his love for TurboLinks and their inclusion in Rails 5.
TurboLinks is a process for making an application even faster by making use of JavaScript to replace portions of content instead of again reloading an entire page. However, TurboLinks may also make an application a bit heavier on client side JavaScript that could sometimes results in slowdowns and unresponsiveness. This is an actual reason, why some of the developers have actually struggled to get the performance improves as promised by the TurboLinks.
TurboLinks have always been an essential part, since version 4; however version 5 is looking to take advantage of the more advanced TurboLinks 3. This simplifies the process and makes advanced use of middleware and HTML5 custom data attributes.
If you are somewhat familiar with the functionality of TurboLinks in your application, no need to fret at all! Usually, things are not changing considerably. TurboLinks 3 is going to be a good evolutionary step towards better speed and superior rendering.
Action Cable
The most significant news at Rails Conf was the introduction of premier Action Cable. Action Cable is a significant feature used to extend Rails with the use of WebSockets to include realtime messages passing functionality.
However, WebSockets is not a completely new concept and after lots of difficulties Rails has been finally fraught. Thus, it’s a welcome addition for people who clearly not want to mess with the workarounds.
Action Cable is still in the very beginning of development and there is likely to be more information on it is expected as a part of Rails 5. However, considering the amount of projects required in real time interaction, Action Cable seems to a standard advantage to Rails developers.
CoffeeScript
Love for CoffeeScript by DHH has also been reaffirmed here. Baked into Rails in version 3, CoffeeScript is designed as the default JavaScript while using the Rails. Thus, CoffeeScript has become “must use” for Rails developers, specifically for devs that work on a large number of projects.
It’s been two versions; CoffeeScript has come into existence, still is the default and it has got a wider acceptance. For many, the fear of “MustUse” has not been panned out and for others, tried CoffeeScript and enjoyed it.
One essential thing that can be sure of is: CoffeeScript is the default JavaScript flavour in Rails; this won’t possibly be going away.
Ruby Version Support
Rails 5 only supports the version 2.2.1 and higher. As Ruby is progressing as a language, backwards compatibility is required to be sacrificed regarding new functions. The older version of Rails won’t be supported indefinitely. Ruby on Rails is no different. However, Rails is actually making the sensible decision of only encouraging the most preferred version, starting with 2. 2. 1 and including all stable releases after.
As a result, it won’t be possible that someone making use of Ruby1.9.3 would want to move to Rails 5. There are also possibilities that they will stick to a lower version until some other external factors force an upgrade along with the refactoring of the code. However, for some dev shops this won’t be going to be happening for years, which is perfectly understandable.
For a lot, this is somewhat a barrier to Rails 5. With regard to other people, it is an opportunity to improve an application which may be in need of some love.
Due to latest version of Ruby in Rails 5, now Rails applications will have less memory consumption
Rails 5 will only support Ruby 2.2.2 or better
MySQL ActiveRecord adapter gets JSON support
If you happen to run your Rails application on top of MySQL 5.7.8 then your database have a new native JSON data type.
Example:
Or method in ActiveRecord::Relation
Finally ActiveRecord::Relation is getting #or method, this will allow us to write queries with ActiveRecord DSL as follows:
Example:
Summary
Ruby on Rails is completely upon us.
It seems as though we have a lot to look forward: Turbolinks update for improved rendering, Action Cable for improved real-time message handling, more CoffeeScript as well as moving forward with the Ruby ecosystem.
========================================================================
Here at Bacancy Technology, we have in-depth knowledge and extensive experience of RoR developers. Being active RoR community members, we are always there to provide Rails Upgrade Service.
If you are looking to hire Ruby on Rails developer, you can mail us your requirement at [email protected] .