|
| 1 | +--- |
| 2 | +layout: post |
| 3 | +title: "Deferred routes drawing, connect route helper and more" |
| 4 | +categories: news |
| 5 | +author: Wojtek |
| 6 | +og_image: assets/images/this-week-in-rails.png |
| 7 | +published: true |
| 8 | +date: 2024-08-16 |
| 9 | +--- |
| 10 | + |
| 11 | +Hi, [Wojtek](https://x.com/morgoth85) from this side. Let's explore this week's changes in the Rails codebase. |
| 12 | + |
| 13 | +[Defer route drawing](https://github.com/rails/rails/pull/52353) |
| 14 | +This change triggers the initial reload of routes either through middleware or when a *url_helpers* method is used. |
| 15 | +Previously, this was executed unconditionally on boot, which could slow down boot time unnecessarily for larger apps with lots of routes. |
| 16 | +Environments like production that have `config.eager_load = true` will continue to eagerly load routes on boot. |
| 17 | + |
| 18 | +[Add connect route helper](https://github.com/rails/rails/pull/52169) |
| 19 | +Defines a route that recognizes HTTP CONNECT (and GET) requests. |
| 20 | +More specifically this recognizes HTTP/1 protocol upgrade requests and HTTP/2 CONNECT requests with the protocol pseudo header. |
| 21 | + |
| 22 | +[Bulk insert fixtures on SQLite](https://github.com/rails/rails/pull/52562) |
| 23 | +Previously one insert command was executed for each fixture, now they are aggregated in a single bulk insert command. |
| 24 | + |
| 25 | +[Update PostgreSQL adapter extensions to include schema name](https://github.com/rails/rails/pull/52313) |
| 26 | +The schema dumper will now include the schema name in generated `enable_extension` statements if they differ from the current schema. |
| 27 | + |
| 28 | +[Add escape_html_entities option to JSON encoder](https://github.com/rails/rails/pull/51272) |
| 29 | +This allows for overriding the global configuration found at `ActiveSupport.escape_html_entities_in_json` for specific calls to `to_json`. |
| 30 | +This can be used from controllers in the following manner: |
| 31 | +```ruby |
| 32 | +class MyController < ApplicationController |
| 33 | + def index |
| 34 | + render json: { hello: "world" }, escape_html_entities: false |
| 35 | + end |
| 36 | +end |
| 37 | +``` |
| 38 | + |
| 39 | +[Remove racc gem dependency](https://github.com/rails/rails/pull/52610) |
| 40 | +`ActionDispatch::Journey::Parser` does not need to be generated by *racc*. This will open the possibility to optimize it in the future. |
| 41 | + |
| 42 | +[Support minitest 5.25+](https://github.com/rails/rails/pull/52609) |
| 43 | +Minitest 5.25 changed the signature of one of the internal methods that was used by Rails. |
| 44 | + |
| 45 | +[Enable query log tags by default on development env](https://github.com/rails/rails/pull/51342) |
| 46 | +This can be used to trace troublesome SQL statements back to the application code that generated these statements. |
| 47 | +It is also useful when using multiple databases because the query logs can identify which database is being used. |
| 48 | + |
| 49 | +[Fix returning type from encrypted attribute](https://github.com/rails/rails/pull/52247) |
| 50 | +Previously it always returned *:text* type. |
| 51 | + |
| 52 | +[Raise when using key which can't respond to #to_sym in encrypted configuration](https://github.com/rails/rails/pull/51950) |
| 53 | +As is the case when trying to use an Integer or Float as a key, which is unsupported. |
| 54 | + |
| 55 | +_You can view the whole list of changes [here](https://github.com/rails/rails/compare/@%7B2024-08-09%7D...main@%7B2024-08-16%7D)._ |
| 56 | +_We had [31 contributors](https://contributors.rubyonrails.org/contributors/in-time-window/20240809-20240816) to the Rails codebase this past week!_ |
| 57 | + |
| 58 | +Until next time! |
| 59 | + |
| 60 | +_[Subscribe](https://world.hey.com/this.week.in.rails) to get these updates mailed to you._ |
0 commit comments