@@ -5,6 +5,21 @@ Ruby on Rails 7.2 Release Notes
5
5
6
6
Highlights in Rails 7.2:
7
7
8
+ * Development containers configuration for applications.
9
+ * Add browser version guard by default.
10
+ * Make Ruby 3.1 the new minimum version.
11
+ * Default Progressive Web Application (PWA) files.
12
+ * Add omakase RuboCop rules by default.
13
+ * Add GitHub CI workflow by default to new applications.
14
+ * Add Brakeman by default to new applications.
15
+ * Set a new default for the Puma thread count.
16
+ * Prevent jobs from being scheduled within transactions.
17
+ * Per transaction commit and rollback callbacks.
18
+ * Enable YJIT by default if running Ruby 3.3+.
19
+ * New design for the Rails guides.
20
+ * Setup jemalloc in default Dockerfile to optimize memory allocation.
21
+ * Suggest puma-dev configuration in bin/setup.
22
+
8
23
These release notes cover only the major changes. To learn about various bug
9
24
fixes and changes, please refer to the changelogs or check out the [ list of
10
25
commits] ( https://github.com/rails/rails/commits/7-2-stable ) in the main Rails
@@ -99,8 +114,7 @@ We are changing this policy because it causes us to keep compatibility with long
99
114
unsupported versions of Ruby or to bump the Rails major version more often, and to
100
115
drop multiple Ruby versions at once when we bump the major.
101
116
102
- Now we are going to drop Ruby versions on minor versions, following the recommendation
103
- from the Ruby team at the time of the release.
117
+ We will now drop Ruby versions that are end-of-life on minor Rails versions at the time of the release.
104
118
105
119
For Rails 7.2, Ruby 3.1 is the new minimum version.
106
120
@@ -135,23 +149,24 @@ start with automated scanning, linting, and testing. We find that a natural cont
135
149
we've done since the start with unit tests.
136
150
137
151
It's of course true that GitHub Actions are a commercial cloud product for private repositories after you've used the
138
- free tokens. But given the relationship with GitHub and Rails, the overwhelming default nature of the platform for
152
+ free tokens. But given the relationship between GitHub and Rails, the overwhelming default nature of the platform for
139
153
newcomers, and the value of teaching newcomers good CI habits, we find this to be an acceptable trade-off.
140
154
141
155
### Add Brakeman by default to new applications
142
156
143
157
[ Brakeman] ( https://brakemanscanner.org/ ) is a great way to prevent common security vulnerabilities in Rails from going
144
158
into production.
145
159
146
- New application come with Brakeman installed and combined with the GitHub CI workflow, it will run automatically on
160
+ New applications come with Brakeman installed and combined with the GitHub CI workflow, it will run automatically on
147
161
every push.
148
162
149
163
### Set a new default for the Puma thread count
150
164
151
165
Rails changed the default number of threads in Puma from 5 to 3.
152
166
153
167
Due to the nature of well-optimized Rails applications, with quick SQL queries and slow 3rd-party calls running via jobs,
154
- Ruby spends most of its time waiting for the Global VM Lock (GVL) to release when the thread count is too high.
168
+ Ruby can spend a significant amount of time waiting for the Global VM Lock (GVL) to release when the thread count is too
169
+ high, which is hurting latency (request response time).
155
170
156
171
After careful consideration, investigation, and based on battle-tested experience from applications running in
157
172
production, we decided that a default of 3 threads is a good balance between concurrency and performance.
185
200
186
201
### Per transaction commit and rollback callbacks
187
202
188
- This is now possible due to a new feature that allows to register transaction callbacks outside of a record.
203
+ This is now possible due to a new feature that allows registering transaction callbacks outside of a record.
189
204
190
- ` ActiveRecord::Base.transaction ` now yields an ` ActiveRecord::Transaction ` object, which allows to register callbacks
205
+ ` ActiveRecord::Base.transaction ` now yields an ` ActiveRecord::Transaction ` object, which allows registering callbacks
191
206
on it.
192
207
193
208
``` ruby
209
224
```
210
225
211
226
And finally, ` ActiveRecord.after_all_transactions_commit ` was added, for code that may run either inside or outside a
212
- transaction and need to perform works after the state changes have been properly persisted.
227
+ transaction and needs to perform work after the state changes have been properly persisted.
213
228
214
229
``` ruby
215
230
def publish_article (article )
0 commit comments