Saturday, August 21, 2021

Good-bye classic mode, --skip-puma, --skip-gemfile.. hello weekday_options_for_select!

Posted by zzak

Hello, zzak again with the latest changes in Rails this week!

DHH previews modern web apps without JavaScript bundling or transpiling

In this YouTube, DHH goes through the latest changes planned for Rails 7 and how the face of front-end development has evolved.

Rails and have been released

A reminder to upgrade to the latest stable versions of Rails which includes a critical security fix for Action Pack.

Dropping support for classic mode

There’s an ongoing epic to delete the classic autoloader that started months ago. Let’s do a checkpoint in this newsletter.

You can no longer opt-in to classic mode using config.autoloader=, this setter has been deleted, Rails 7 has only one autoloading backend: Zeitwerk.

During application initialization, you can autoload classes and modules from config.autoload_once_paths, but autoloading reloadable constants doesn’t work anymore. That has been deprecated and issuing warnings since Rails 6.0. Check the documentation for valid ways to do that.

Additionally, a lot of private APIs and orphan code fall in cascade. Check for example #43048 and #43058, and there’s more to come.

Add new form builder “weekday_options_for_select”

This PR adds a helper for weekday select which even includes i18n!

Support for byte ranges in Active Storage

This PR allows serving uploads in chunks in order to stream buffered files as is required e.g. audio podcasts from S3 to an iphone.

Add database config option to turn off tasks like db:migrate

In a multidb configuration you may have a database that you want to connect to, such as a replica, but don’t want to accidentally run any db tasks on it.

The “database_task: false” config flag ensures you don’t accidentally “rails db:drop” your backup database.

Remove legacy –skip-gemfile option

“Don’t have to keep all the monuments to old skirmishes around forever.”

Remove –skip-puma option

Since puma is the only option available for the web server, it doesn’t make sense to allow removing it as a configuration option.

15 people contributed to Rails since last time. All the changes can be checked here. Until next week!