なるようになるブログ

読書感想文かrailsについてかrubyについてか

rails commit log流し読み(2021/09/20)

2021/09/20分のコミットです。

CHANGELOGにのったコミットは以下の通りです。

actionpack/CHANGELOG.md


Fix app generator tests

railties/test/generators/api_app_generator_test.rbrailties/test/generators/shared_generator_tests.rbの修正です。

kredis gemをデフォルトのGemfileに追加したSuggest Kredis + bcrypt as long as we're not minimalの影響でテストがコケてしまっていたのを修正しています。


Suggest a CSP that's compatible with Turbo + import map (#43227)

railties/lib/rails/generators/rails/app/templates/config/initializers/content_security_policy.rb.ttの修正です。

rails newで生成されるCSPの設定で、content_security_policy_nonce_generatorの設定をランダムな値からセッションIDを使用するよう修正しています。ランダムな値だとデフォルトのetagが毎回変わってしまい(etagはレスポンスのHTMLに依存しており、nonceの値はHTMLに含まれる為)、これだとTurboの利点が減ってしまう(Turboはetagを元にページのキャッシュを行っている)為。


Only call wrap_parameters if it's defined (#43259)

actionpack/lib/action_controller/railtie.rbの修正です。

parameter wrapperのコードを移動した、Move the parameter wrapper code to the ActionController::Railtie classの影響でテストがコケてしまっていたのを修正しています。


Don't overwrite default opts in rich_text_area_tag (#43156)

actiontext/app/helpers/action_text/tag_helper.rbの修正です。

rich_text_area_tagメソッドで使用するdirect_upload_urlblob_url_templateを引数で指定出来るよう修正しています。


Add Server Timing middleware (#36289)

Action Pack、railtiesの修正です。

Server-Timingヘッダーを返す為のミドルウェアを追加しています。 デフォルトではdevelopment envでのみヘッダーを返すようになっています。ミドルウェアの有効 / 無効はconfig.server_timingで出来るようになっています。


Add CHANGELOG entry for ServerTiming middleware [ci skip]

actionpack/CHANGELOG.mdの修正です。

先のServer-Timingミドルウェアの対応について、CHANGELOGにエントリーを追加しています。


Add ActionDispatch::ServerTiming to the list of middlewares in test

railties/test/application/middleware_test.rbの修正です。

デフォルトでロードされるmiddlewareの一覧にActionDispatch::ServerTimingを追加しています。


Add missing configuration to middleware test

railties/test/application/middleware_test.rbの修正です。

テストでconfig.server_timing = trueの指定が不足していたのを修正しています。


[ci skip] Add Bootstrap and Bulma to the CSS processors' list (#43254)

railties/lib/rails/generators/rails/app/app_generator.rbの修正です。

CSS processorがサポートしているオプションのリストにBootstrap、Bulmaを追加しています。


Use debug 1.1+ for the debugger + log quieting

Gemfileの修正です。。

debug gemのバージョンを1.1.0に更新しています。