Saturday, September 17, 2022
Dealing with reconnects in Motion Cable, no extra Coffeescript and a brand new information.
Posted by four54
Hello, that is Petrik with this week’s Rails updates and a few Hotwire information.
Add exclude? technique to ActionController::Parameters
exclude? returns true if the given key just isn’t current within the parameters. It’s the inverse of embrace?.
Including this technique retains issues a bit extra in line with a Hash.
params = ActionController::Parameters.new(id: 1)
params.exclude?(:title) # => true
params.exclude?(:id) # => false
Add skill to deal with reconnects with the related callback
If a subscriber misses some messages when the connection is misplaced, this permits them to deal with reconnects with the related() callback.
shopper.subscriptions.create("ExampleChannel", {
related({reconnected}) {
if (reconnected) {
...
}
else {
...
}
}
});
Add Puma to an engine’s Gemfile
With the removingof WEBrick from the Ruby commonplace library, the dummy utility in an engine wouldn’t begin. Including Puma to the Gemfile makes certain it really works out-of-the-box.
Add ssl-mode choice to dbconsole command and MySQLDatabaseTasks
For MySQL, verifying the id of the database server requires setting the ssl-mode choice to VERIFY_CA or VERIFY_IDENTITY. This selection was beforehand ignored for the dbconsole command and database duties like making a database.
Convert rails-ujs to ES2015 modules
The rails-ujs code base was the one Coffeescript left within the Rails code base. It has now been migrated to make use of ES2015 modules and Rollup as an alternative.
Add the Error Reporter Information
In Rails 7.0 an error reporter interface was launched. It offers a generic interface to report errors, with an adapter API to permit utilizing the service of your alternative.
It now has its personal information!
Rails had 23 contributors since final week.
Within the Hotwire world there was a brand new launch for Turbo this week: v7.2.0-rc.2.
That’s it for this week!
Subscribe to get these updates mailed to you.