Ruby on Rails 8.0 Release Notes
Highlights in Rails 8.0:
- Kamal 2.
- Thruster.
- Solid Cable.
- Solid Cache.
- Propshaft is used by default.
- Authentication system generator.
These release notes cover only the major changes. To learn about various bugfixes and changes, please refer to the changelogs or check out thelist ofcommits in the main Railsrepository on GitHub.
1. Upgrading to Rails 8.0
If you're upgrading an existing application, it's a great idea to have good testcoverage before going in. You should also first upgrade to Rails 7.2 in case youhaven't and make sure your application still runs as expected before attemptingan update to Rails 8.0. A list of things to watch out for when upgrading isavailable in theUpgrading Ruby on Railsguide.
2. Major Features
2.1. Kamal 2
Rails now comes preconfigured withKamal 2 fordeploying your application. Kamal takes a fresh Linux box and turns it into anapplication or accessory server with just a single “kamal setup” command.
Kamal 2 also includes a proxy calledKamal Proxyto replace the generic Traefik option it used at launch.
2.2. Thruster
The Dockerfile has been upgraded to include a new proxy calledThruster, which sits in front of thePuma web server to provide X-Sendfile acceleration, asset caching, and assetcompression.
2.3. Solid Cable
Solid Cable replaces Redis to act asthe pubsub server to relay WebSocket messages from the application to clientsconnected to different processes. Solid Cable retains the messages sent inthe database for a day by default.
2.4. Solid Cache
Solid Cache replaces eitherRedis or Memcached for storing HTML fragment caches in particular.
2.5. Solid Queue
Solid Queue replaces the need forRedis, also a separate job-running framework, like Resque, Delayed Job, orSidekiq.
For high-performance installations, it’s built on the newFOR UPDATE SKIP LOCKEDmechanism first introduced in PostgreSQL 9.5, but now also available in MySQL 8.0and beyond. It also works with SQLite.
2.6. Propshaft
Propshaft is now the default assetpipeline, replacing the old Sprockets system.
2.7. Authentication
Authentication system generator,creates a starting point for a session-based, password-resettable,metadata-tracking authentication system.
3. Railties
Please refer to theChangelog for detailed changes.
3.1. Removals
Remove deprecated
config.read_encrypted_secrets.Remove deprecated file
rails/console/app.Remove deprecated file
rails/console/helpers.Remove deprecated support to extend Rails console through
Rails::ConsoleMethods.
3.2. Deprecations
Deprecate requiring
"rails/console/methods".Deprecate modifying
STATS_DIRECTORIESin favor ofRails::CodeStatistics.register_directory.Deprecate
bin/rake statsin favor ofbin/rails stats.
3.3. Notable changes
- Set
Regexp.timeoutto1s by default to improve security over Regexp Denial-of-Service attacks.
4. Action Cable
Please refer to theChangelog for detailed changes.
4.1. Removals
4.2. Deprecations
4.3. Notable changes
5. Action Pack
Please refer to theChangelog for detailed changes.
5.1. Removals
- Remove
Rails.application.config.action_controller.allow_deprecated_parameters_hash_equality.
5.2. Deprecations
- Deprecate drawing routes with multiple paths to make routing faster.
5.3. Notable changes
- Introduce safer, more explicit params handling method with
params#expectsuch thatparams.expect(table: [ :attr ])replacesparams.require(:table).permit(:attr).
6. Action View
Please refer to theChangelog for detailed changes.
6.1. Removals
Remove deprecated support to passing
nilto themodel:argument ofform_with.Remove deprecated support to passing a content to void tag elements on the
tagbuilder.
6.2. Deprecations
6.3. Notable changes
7. Action Mailer
Please refer to theChangelog for detailed changes.
7.1. Removals
7.2. Deprecations
7.3. Notable changes
8. Active Record
Please refer to theChangelog for detailed changes.
8.1. Removals
Remove deprecated
config.active_record.commit_transaction_on_non_local_return.Remove deprecated
config.active_record.allow_deprecated_singular_associations_name.Remove deprecated support to finding database adapters that aren't registered to Active Record.
Remove deprecated support for defining
enumwith keyword arguments.Remove deprecated
config.active_record.warn_on_records_fetched_greater_than.Remove deprecated
config.active_record.sqlite3_deprecated_warning.Remove deprecated
ActiveRecord::ConnectionAdapters::ConnectionPool#connection.Remove deprecated support to passing a database name to
cache_dump_filename.Remove deprecated support to setting
ENV["SCHEMA_CACHE"].
8.2. Deprecations
- Deprecate the
retriesoption for theSQLite3Adapterin favor oftimeout.
8.3. Notable changes
- Running
db:migrateon a fresh database now loads the schema before runningmigrations. Subsequent calls will run pending migrations.(If you need the previous behavior of running migrations from scratch instead of loading theschema file, this can be done by runningdb:migrate:resetwhichwill drop and recreate the database before running migrations)
9. Active Storage
Please refer to theChangelog for detailed changes.
9.1. Removals
9.2. Deprecations
- Deprecate the Azure backend for Active Storage.
9.3. Notable changes
10. Active Model
Please refer to theChangelog for detailed changes.
10.1. Removals
10.2. Deprecations
10.3. Notable changes
11. Active Support
Please refer to theChangelog for detailed changes.
11.1. Removals
Remove deprecated
ActiveSupport::ProxyObject.Remove deprecated support to setting
attr_internal_naming_formatwith a@prefix.Remove deprecated support to passing an array of strings to
ActiveSupport::Deprecation#warn.
11.2. Deprecations
Deprecate
Benchmark.ms.Deprecate addition and
sincebetween twoTimeandActiveSupport::TimeWithZone.
11.3. Notable changes
12. Active Job
Please refer to theChangelog for detailed changes.
12.1. Removals
- Remove deprecated
config.active_job.use_big_decimal_serializer.
12.2. Deprecations
Deprecate
enqueue_after_transaction_commit.Deprecate internal
SuckerPunchadapter in favor of the adapter includedwith thesucker_punchgem.
12.3. Notable changes
13. Action Text
Please refer to theChangelog for detailed changes.
13.1. Removals
13.2. Deprecations
13.3. Notable changes
14. Action Mailbox
Please refer to theChangelog for detailed changes.
14.1. Removals
14.2. Deprecations
14.3. Notable changes
15. Ruby on Rails Guides
Please refer to theChangelog for detailed changes.
15.1. Notable changes
16. Credits
See thefull list of contributors to Railsfor the many people who spent many hours making Rails, the stable and robustframework it is. Kudos to all of them.