-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
💎 Rails 7.2 and YJIT #763
Comments
Ruby 3.3.5もきてるから、先にこっち上げちゃおう |
YJITはRuby3.3以上とRails7.2から |
RailsガイドのRailsアップデート手順わかりやすくて助かる。
|
Rubyのアップデートでcloudinary gemが警告出すようになった。 |
Rails 7.1.4に上げた。
|
Rails7.1でlisten gemがデフォルトで入らなくなってた。
使える・使えないがあると開発時に混乱しそう。 |
デフォルト設定あれこれしたときにspring削除しちゃった…。
Railsの起動を早くするし、入れた状態を復帰しておく。 |
とりあえず7.2にしてみてエラーが出たらまた考える。 |
うおー、7.2.1にするぞ! |
7.2.1の変更点 devcontainer、GitHub CI、Rubocop OMAKASE、YJIT、Brakemanあたりが気になるね。 |
Rails 7.2.1をインストールしてから、 |
devcontainer周り
ドキュメント |
GitHub CI周り
|
Rubocop Omakase
TODO:もう少し設定内容を精査する必要がある rubocop.ymlの現状
現状もOmakaseも最初に全Copsをオフにしている
やはり厳しく全部使っていこう!
デフォルトDisabledだけど有用そうなCopsLayout/FirstXXXBreak:
# bad
func(a,
b)
# good
func(
a,
b,
) Layout/MultilineAssignmentLayout
# bad
foo = if expression
'bar'
end
# good
foo =
if expression
'bar'
end Layout/RedundantLineBreak
Layout/SingleLineBlockChain
Style/ArrayCoercion
Style/ArrayFirstLast
Style/AutoResourceCleanup
Style/CollectionMethods
Style/ReturnNil
Copsの調整現状維持
現状のRSpecでのcontextで書ける文章のCops
RSpec/ContextWording:
Prefixes:
- when
- with
- without
- if
- unless
- for
- before
- after
- during rubocop-performance
|
YJIT
|
BrakemanBrakeman は、Ruby on Rails アプリケーションのセキュリティ脆弱性をチェックする静的解析ツールです。
設定とか
|
ひょっとしてSpringももういらないか。 実際、spring周りで複雑になって起動しないとかトラブルのも辛い。 |
|
Rails 7.2して
|
Rubocopの設定変えたら、ERBファイルがめっちゃLintに引っ掛かるようになった。 ERBファイルのLinter何やら新しいの見つけたので、比較してみる。 erb_lint
rubocop-erb
VS
inherit_mode:
merge:
- Exclude
inherit_from: .rubocop.yml
require:
- rubocop-erb
AllCops:
Include:
- "**/*.html.erb"
Style/MethodCallWithArgsParentheses:
IgnoreMacros: false チェック用ERBファイル<% page_title "Test" %>
<%= t "this.is.also.good" %>
<% n = 0 %>
<% b = if n == 0 then 1 else 2 end %>
<%
def hogehogehogehogehogehoge(str1, str2)
str1 + str2
end
%>
<% if n == 0 %>
<% a = 1 %>
<% else %>
<% a = hogehogehogehogehogehoge "012345678901234567890123456789012345678901234567890123456789",
"abcdefghijklmnopq" %>
<% end %>
<html>
<body>
<%= a %>
</body>
</html> できることとできないことあるし、併用するか…。 |
でかい変更になったので、baseブランチを作ってそこに各種変更を1個ずつマージPRにする方式にしよう |
Rails 7.2がきたぞ!
YJITを使ってローリスクハイリターンだ!
やること
参考になりそうなもの
The text was updated successfully, but these errors were encountered: