なるようになるブログ

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

rails commit log流し読み(2021/08/26)

2021/08/26分のコミットです。

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

activesupport/CHANGELOG.md

actionview/CHANGELOG.md


Merge pull request #43086 from nstuart-at-salesforce/nas_addRaiseErrorsParam

activesupport/lib/active_support/cache/redis_cache_store.rbの修正です。

ActiveSupport::Cache::RedisCacheStore#handle_exception内のrescue blockを削除しています。rescue block内ではログの出力だけを行って、エラーの再throwは行われてなかったのですが、これだとエラーが発生した際にそれに気付けずよくないだろう、という事で単純に削除されています。


Avoid returning a constant in ActionDispatch::ShowExceptions

actionpack/lib/action_dispatch/middleware/show_exceptions.rbの修正です。

ActionDispatch::ShowExceptions#failsafe_responseでエラーレスポンスを返すのにconstantを使用していたのを、使用しないよ修正しています。レスポンスを動的に変更されてしまった場合にメッセージやHTTP statusが変わってしまう可能性がある為。


Iterates docs about autoloading during boot

rails guideのAutoloading and Reloading Constantsの修正です。

guide全体の言い回しの修正や、説明の追加等を行っています。


Replace webpack with importmapped Hotwire as default js (#42999)

railtiesの修正です。

RailsのデフォルトのJS設定がwebpackerからHotwire + Importmapに変更されました。webpackは--webpackerオプションを指定すれば引き続き使用出来る状態です。

諸々の詳細はModern web apps without JavaScript bundling or transpilingを参照。


Remove default reliance on Sass and CSS generators (#43110)

railtiesの修正です。

デフォルトではSass、及び、CSSに関するファイルの生成を行わないよう修正しています。今のWeb開発において手作業でmodel毎のCSSの開発は行わない事の方が多いだろう、というのと、Sassがdart-sassに移行してしまい、これをRailsで使用しようすると色々な依存が必要になってしまう為、デフォルトでは有効化しない事になりました。


Document that @rails/ujs is deprecated (#43112)

actionview/lib/action_view/helpers/form_tag_helper.rbactionview/lib/action_view/helpers/url_helper.rbのdocの修正です。

@rails/ujsはdeprecated(今後はTurbo + Stimulusが推奨)である旨ドキュメントに説明を追加しています。


Missed a generator assets spot

rails guideのThe Asset Pipelineの修正です。

デフォルトでは不要になったassetsの生成を無効化する方法についての説明を削除しています。


Merge pull request #43106 from flavorjones/flavorjones-activesupport-number-converter-valid-float

Action View、Active Supportの修正です。

ActionView::Helpers::NumberHelperActiveSupport::NumberHelperでFloatへの変換処理時にexception: false`オプションを指定するようにして、例外処理を行わないでよいよう修正しています。パフォーマンス改善の為。


Merge pull request #43098 from flavorjones/flavorjones-number-to-currency-detect-parse-failures

activesupport/lib/active_support/number_helper/number_to_currency_converter.rbの修正です。

Fix number_to_currency to avoid negative format when displaying zero.の対応により、number_to_currency-0.0の戻り値が変わってしまっていたのを、修正前と同じ値を返すよう修正しています。