Rails 4.0 is finally ready after a thorough process of betas and release candidates. It's an amazing new version packed with new goodies and farewells to old features past their expiration date.
A big focus has been on making it dead simple to build modern web applications that are screaming fast without needing to go the client-side JS/JSON server route. Much of this work was pioneered for Rails in the new version of Basecamp and focuses on three aspects:
- Make it super easy to do Russian Doll-caching through key-based expiration with automatic dependency management of nested templates (explored first in the cache_digests plugin).
- Declarative etags makes it even easier to ensure you're taking advantage of HTTP freshness.
Rails is of course still a great JSON server for people who want to build client-side JS views with Ember.js, Backbone.js or Angular.js, but with the progress we've made for Rails 4.0, you certainly won't need to go down that route just to have a super fast application.
We've also added live streaming for persistent connections and Rails 4.0 is now safe for threaded servers out of the box (no more need for config.threadsafe!).
Active Record has received a ton of love as well to make everything related to scoping and the query structure more consistent. We've also locked down the general security defaults even tighter with this version.
On top of these new features and fixes, we have hundreds more of all sorts. Everything has been combed over, streamlined, simplified, and we've extracted out lots of old APIs and things that just don't fit "most people most of the time".
We encourage you to peruse the CHANGELOGs for all the Rails frameworks and delight over the hundreds of improvements we've made to Rails 4.0: Action Pack, Active Model, Active Record, Active Support, Rails.
If you're upgrading an existing application to Rails 4, have a look at the upgrade guide or the Railscast screencast. As always, install the latest with
gem install rails --version 4.0.0 --no-ri --no-rdoc or depend on the v4.0.0 tag. If you haven't already, now is a good time to upgrade to Ruby 2.0 as well. Rails 5+ will require Ruby 2.0, so you might as well get a head start.
If you'd like to learn more about developing Rails 4 applications, the final version of Agile Web Development with Rails 4 was released today as well. The more advanced Crafting Rails 4 Applications is also out in late-stage beta. For screencasts, checkout the new Rails 4: Zombie Outlaws and Mike Clark's Rails 4 class. There's new material and books coming out all the time from a variety of other authors and broadcasters, so we're really in good shape with training material timed for the release this time.
Finally, thanks to everyone who contributed to this release. There has been some 10,000 commits between the latest 3.2 release and Rails 4.0 and ~500 people have contributed in 2013 alone. We have a bigger and more engaged community than ever before and it shows: Rails 4 is an incredibly polished release. It's a real milestone and something for everyone in the community to be proud of.