Summary:

  • Added Action Mailbox for mail processing
  • Added Action Text rich Text editor based on the Trix Editor
  • Multiple database support
  • Parallel test
  • Webpacker is used as the JS packaging tool by default
  • Proper Action Cable testing, Action Cable JavaScript rewritten in ES6
  • Rails 6.0 Beta1 requires Ruby 2.5.0 or higher
  • Beta2 is coming to Zeitwerk autoloader

The first beta version of Rails 6 is here! It’s definitely an amazing new thing that we’re very happy to share. There are two major new frameworks – Action Mailbox and Action Text – as well as two important default extension upgrades, multi-database support and parallel testing.

Action Mailbox routes new mail to a Mailbox like controller in Rails and supports Amazon SES, Mailgun, Mandrill, Postmark and SendGrid. You can also handle incoming mail directly through the built-in Exim, Postfix, and Qmail plug-ins. The groundwork for Action Mailbox was done by George Claghorn and you.

Action Text brings RichText to Rails and its editing capabilities. It includes a Trix editor that handles everything from formatting to links to lists to embedded images and galleries. The RichText content generated by the Trix editor is stored in its own RichText model. This model is associated with any existing Active Record model in the application. Any embedded images (or attachments) are automatically stored using Active Storage and are associated with the included RichText model. The groundwork for Action Text was done by Sam Stephenson, Javan Makhmali, and you.

New multi-database support makes it easy for a single application to connect to multiple databases simultaneously! You can do this because you want to segment some records into your own database for scaling or isolation, or because you are using a replica database for read/write splitting to improve performance. Either way, there is a new and simple API that does this without knowing the internals of Active Record. Eileen Uchitelle and Aaron Patterson completed the groundwork.

With parallel test support, you can eventually leverage all the cores on your computer to run large test suites faster. Each test task has its own database and runs in its own thread, so you don’t run one CPU at 100% while the other nine are idle (you all have a 10-core iMac Pro, right?). . Cheers! The groundwork for parallel test support was done by Eileen Uchitelle and Aaron Patterson.

Webpacker is now the default JavaScript packaging tool for Rails, in the new app/ JavaScript directory. However, we still use Sprockets Asset Pipeline to handle CSS and static resources. The two are perfectly integrated, providing the best trade-off between advanced JavaScript functionality and the appropriate handling of other resources.

These are just some of the brand additions, but Rails 6.0 also includes some subtle changes, including fixes and upgrades. I’ll mention just a few: Proper Action Cable testing, Action Cable JavaScript rewritten in ES6, protection from DNS Rebinding attacks, and per-environment credentials. In addition, Rails 6 now requires Ruby 2.5.0+ support. You can view the individual framework CHANGELOG files for details.

Finally, you should note Xavier Noria’s new Zeitwerk code loader for Ruby. It’s not integrated with beta1, but it will be the new auto-loader for Rails starting with beta2. Be prepared to say goodbye to any lingering require or require_dependency calls in your code!

We’re still pretty much on track with our schedule for the final Rails 6.0 release, so please refer to that plan for migration planning, but help us out by testing your application on beta1! I also encourage anyone with moderate Rails experience to start any new applications using beta1 instead of the Rails 5.2.x series. Basecamp is already running Rails 6.0.0.beta1 in production, and Shopify and GitHub, among others, are sure to follow suit. This should be the more stable version.

This release and all of the releases that lead to the final version of Rails 6.0 were made by Rafael Franca, the release manager, with support from Kasper Timm Hansen.

Thanks again to everyone who works to make Rails better! It’s incredible that we’ve been able to maintain this strong rate of improvement all these years. Rails has never been better suited to help the broadest range of Web developers build great applications the way they like them. Let happiness flourish!


Pay attention to <Ruby technology stack > WeChat official account, real-time access to Ruby dynamic!