Ruby on Rails 8.1.0 Beta 1
The latest release of Ruby on Rails, version 8.1.0 Beta 1, brings significant updates and improvements across its core components: Active Support, Active Record, Action View, Action Pack, and Active Job.
Active Support Updates
Active Support has seen numerous enhancements to improve performance, reliability, and developer experience:
- Introduced ActiveSupport::Cache::Store#namespace= for managing cache namespaces, ideal for parallel testing.
- Added parallel_worker_id helper to identify test workers in parallel test runs.
- Improved cache update mechanisms for middleware and introduced assert_events_reported for testing event emissions.
- Added ActiveSupport::TimeZone#standard_name for retrieving time zone standard names.
- Introduced a Structured Event Reporter (Rails.event) for unified event production with tagging and context capabilities.
- Made ActiveSupport::Logger freeze-friendly and ActiveSupport::Gzip.compress deterministic.
- Enhanced ActiveSupport::BacktraceCleaner with clean_locations, first_clean_location, and first_clean_frame for better backtrace analysis.
Other notable improvements include:
- File update checkers now ignore changes in Gem.path.
- Improved state management for CurrentAttributes and ExecutionContext in test cases.
- CurrentAttributes instances are now abandoned at the end of requests, preventing state leaks.
- Added public APIs for before_fork_hook in parallel testing.
Active Model Updates
Active Model has received updates to enhance validation and attribute handling:
- Added except_on: option for validation callbacks.
- Backported ActiveRecord::Normalization to ActiveModel::Attributes::Normalization for attribute value normalization.
Active Record Updates
Active Record has seen numerous enhancements, including:
- Removed deprecated :unsigned_float and :unsigned_decimal column methods for MySQL.
- Removed deprecated :retries option for the SQLite3 adapter.
- Introduced new database configuration options: keepalive, max_age, min_connections, and renamed pool to max_connections.
- Moved LIMIT validation from query generation to the limit() call.
Other notable improvements include:
- Added ActiveRecord::CheckViolation and ActiveRecord::ExclusionViolation error classes for constraint violations.
- Attributes filtered by filter_attributes are now also filtered by filter_parameters.
Action View Updates
Action View has seen updates to enhance performance, security, and developer experience:
- Added current_page? to match against specific HTTP method(s) with a method: option.
- Removed autocomplete="off" on hidden inputs generated by form helpers.
- Enabled configuring the strategy for tracking dependencies between Action View templates.
- Introduced the relative_time_in_words helper.
Other notable improvements include:
- Added nonce: false option to javascript_tag, javascript_include_tag, and stylesheet_link_tag.
- Added dom_target helper for creating dom_id-like strings.
Action Pack Updates
Action Pack has seen updates to enhance performance, security, and developer experience:
- Removed deprecated support for routes to multiple paths, semicolons as query string separators, and skipping leading brackets in parameter names.
- Deprecated Rails.application.config.action_dispatch.ignore_leading_brackets.
- Requests exceeding rate limits now raise ActionController::TooManyRequests.
Other notable improvements include:
- Added .md/.markdown as Markdown extensions and a default markdown: renderer.
- Added headers to engine routes inspection command.
Active Job Updates
Active Job has seen updates to enhance performance, security, and developer experience:
- Deprecated built-in Sidekiq adapter; users should upgrade to Sidekiq 7.3.3+.
- Removed deprecated internal SuckerPunch adapter.
- Removed support for ActiveJob::Base.enqueue_after_transaction_commit with :never, :always, and :default.
- ActiveJob::Serializers::ObjectSerializers#klass method is now public, requiring serializers to have a public #klass method for faster serialization.
Rails 8.1.0.beta1
Active Support Add ActiveSupport::Cache::Store#namespace= and #namespace. Can be used as an alternative to Store#clear in some situations such as parallel testing. Nick Schwaderer Create parall...
