The train for the Rails 7.2 release is leaving the station and we’re excited to announce the first beta release of Rails 7.2! There has been close to 2,500 commits made by over 400 contributors since Rails 7.1, so this release is packed with new features and improvements.
Please help us test all this new stuff, so we can ensure a solid final release of Rails 7.2.
Rails 7.2 comes with better productions defaults to help you build more efficient applications.
Starting with YJIT. YJIT is Ruby’s JIT compiler that is available in CRuby since Ruby 3.1. It can provide significant performance improvements for Rails applications, offering 15-25% latency improvements.
In Rails 7.2, YJIT is enabled by default if running Ruby 3.3 or newer.
After careful consideration, investigation, and based on battle-tested experience from applications running in production, we decided to change the default number of threads in Puma from 5 to 3. This change is to improve latency (request response time) by reducing the time Ruby spends waiting for the Global VM Lock (GVL) to release when the thread count is too high.
And the default Dockerfile generated by Rails now includes jemalloc to optimize memory allocation.
A development container (or dev container for short) allows you to use a container as a full-featured development environment.
Rails 7.2 adds the ability to generate a development container configuration for your application. This configuration
includes a .devcontainer
folder with a Dockerfile
, a docker-compose.yml
file, and a devcontainer.json
file.
By default, the dev container contains the following:
To generate a new application with a development container, you can run:
rails new myapp --devcontainer
For existing applications, a devcontainer
command is now available:
rails devcontainer
For more information, see the Getting Started with Dev Containers guide.
When Rails 7.0 landed in December 2021, it came with a fresh new homepage and a new boot screen. The design of the guides, however, has remained largely untouched since 2009 - a point which hasn’t gone unnoticed (we heard your feedback).
With all of the work right now going into removing complexity from the Rails framework and making the documentation consistent, clear, and up-to-date, it was time to tackle the design of the guides and make them equally modern, simple, and fresh.
We worked with UX designer John Athayde to take the look and feel of the homepage and transfer that over to the Rails guides to make them clean, sleek, and up-to-date.
The layout will remain the same, but from today you will see the following changes reflected in the guides:
See the announcement blog post for some before/after images.
Rails 7.2 also includes many other improvements and new features. Here are a few highlights:
Please check the Rails 7.2 release notes for more details.
Final release of Rails 7.2 is expected in a few weeks. In the meantime, please give a try to Rails 7.2.0.beta1, and let us know what you think.