Hi, it’s Claudio Baccigalupo. Let’s explore this week’s changes in the Rails codebase.
Optimize String#squish
A RegExp improvement in the Rails codebase makes squishing a string twice as fast.
Render stream errors are reported to Rails.error
Now that Rails has a dedicated API to report errors we can call it also when an error is raised during streaming.
reload! will reset the console’s executor when present
The Rails console is wrapped with an executor which can have side effects such as implicitly enabling the Query Cache.
After this PR, calling reload! will not just reload the console, but reset the executor too.
Detect JS package manager from lockfiles in generators
Generators can now use the lockfiles to detect the package manager, whether it’s bun (bun.lockb or bun.lock), pnpm (pnpm-lock.yaml), npm (package-lock.json), or yarn (yarn.lock or default).
Skip unique index lookup for insert_all!
insert_all! uses on_duplicate: :raise which performs a plain INSERT without any ON CONFLICT clause.
Previously, find_unique_index_for was called unconditionally which caused unnecessary failures for tables with composite primary keys.
Add &block params to ActionController methods using yield
Several methods in Action Controller used block_given? or yield without explicitly declaring a &block parameter.
While this is valid Ruby, it created issues for static analysis tools like Sorbet that check for blocks being passed to methods.
Load minitest server plugin to run minitest with –bisect option
Before this, minitest_bisect with --bisect option raised the invalid option: --server.
Upgrade from bundler 2.7.2 to 4.0.4
The bundler version in the Gemfile.lock is now the latest: bundler 4.0.4.
Explicitly use Marshal serializer for MemCacheStore Dalli client
There are no options to change the serializer for MemCacheStore Dalli so it’s safe to assume Marshal will be used.
Deprecate queue_classic Active Job adapter
This is the last Active Job adapter to be ejected.
The queue_classic gem gem has not seen any activity in two years.
Handle Ruby 4.1 stabby lambda in Proc#source_location start_column
Adjusts the code for a recent change in Ruby to include the full syntax definition in the source, even when using stabby lambdas
You can view the whole list of changes here.
We had 22 contributors to the Rails codebase this past week!
Until next time!
Subscribe to get these updates mailed to you.