Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Recent Rails movements in 15 minutes
Search
Masafumi Okura
February 24, 2021
Programming
0
110
Recent Rails movements in 15 minutes
Ruby on Rails及びその周辺技術は2021年になっても進化を続けています。特に近年は複数DB周りとフロントエンド関係で変化が顕著です。この発表ではそれらをまとめてご紹介します。
Masafumi Okura
February 24, 2021
Tweet
Share
More Decks by Masafumi Okura
See All by Masafumi Okura
RDoc meets YARD
okuramasafumi
2
120
Why doesn't Ruby have Boolean class?
okuramasafumi
0
10
My KaigiEffect at RubyKaigi 2025, part 1
okuramasafumi
1
49
Writing documentation can be fun with plugin system
okuramasafumi
0
200
Alba: Why, How and What's So Interesting
okuramasafumi
0
400
Why did my proposals get rejected?
okuramasafumi
1
710
A suggestion for the future of RDoc
okuramasafumi
1
390
15 JSON serializers for Ruby
okuramasafumi
2
450
Tech Events, Should We See Them from the Outside or the Inside?
okuramasafumi
1
75
Other Decks in Programming
See All in Programming
Constant integer division faster than compiler-generated code
herumi
2
700
Rancher と Terraform
fufuhu
0
110
20250808_AIAgent勉強会_ClaudeCodeデータ分析の実運用〜競馬を題材に回収率100%の先を目指すメソッドとは〜
kkakeru
0
210
ソフトウェアテスト徹底指南書の紹介
goyoki
1
110
AIエージェント開発、DevOps and LLMOps
ymd65536
1
350
Kiroの仕様駆動開発から見えてきたAIコーディングとの正しい付き合い方
clshinji
1
150
Laravel Boost 超入門
fire_arlo
1
130
【第4回】関東Kaggler会「Kaggleは執筆に役立つ」
mipypf
0
830
Honoアップデート 2025年夏
yusukebe
1
860
私の後悔をAWS DMSで解決した話
hiramax
4
140
DockerからECSへ 〜 AWSの海に出る前に知っておきたいこと 〜
ota1022
5
1.8k
TDD 実践ミニトーク
contour_gara
0
150
Featured
See All Featured
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
183
54k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.4k
Build your cross-platform service in a week with App Engine
jlugia
231
18k
Rebuilding a faster, lazier Slack
samanthasiow
83
9.1k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.6k
Product Roadmaps are Hard
iamctodd
PRO
54
11k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.8k
StorybookのUI Testing Handbookを読んだ
zakiyama
30
6k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Optimizing for Happiness
mojombo
379
70k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
26k
What’s in a name? Adding method to the madness
productmarketing
PRO
23
3.6k
Transcript
࠷ۙͷRailsࣄΛ15Ͱ͓͞ Β͍ ୈ28ճΏΔͪ.it OKURA Masafumi, 2021-02-24
ࣗݾհ • ໊લɿେխ࢙ʢ͓͓͘Β·͞;Έʣ • ॴଐɿϑϦʔϥϯε • ಘҙɿRubyͱRuby on Railsɺͪΐͬ͜ͱVim •
՝֎׆ಈɿ֤छొஃɺίϛϡχςΟӡӦʢܭ4ͭʣɺΧϯϑΝϨϯε ӡӦʢKaigi on RailsʣɺOSSʢgemΛܭ8ͭʣ
15
ࠓ͢͜ͱ • Rails 6.1Ͱೖͬͨػೳ • ߋʹਐΜͩෳDBରԠ • ActiveModel::ErrorͷΦϒδΣΫτԽ • etc.
• HotwireͱTurbo • StimulusReflexपล
ࠓͷτʔΫ୭͚ʁ • ࠷ۙRailsΛ͋·Γ৮͍ͬͯͳ͍ਓ • RailsΛ৽نҊ݅Ͱ࠾༻͠Α͏͔໎͍ͬͯΔਓ • RailsͱϑϩϯτΤϯυͷؔੑʹ͍ͭͯΓ͍ͨਓ
Rails 6.1
Rails 6.1 • 202012݄ϦϦʔε • ۄػೳਫฏγϟʔσΟϯάͳͲͷෳDBରԠ • ActiveModel::Errorؔͷඇޓͳมߋ • ࡉ͔ͳվྑ
Rails 6.1ʹ͓͚ΔෳDBରԠ • 6.0ͰύʔςΟγϣχϯά͕αϙʔτ͞Εͨ • 6.1ͰਫฏγϟʔσΟϯάαϙʔτ͞Εɺ͞Βʹศརʹ • Ϟσϧ͝ͱʹҟͳΔDBʹଓ͢Δ͜ͱՄೳʹ
ActiveModel::ErrorͷՃ • ैདྷ@model.errorsϝιουΤϥʔใؚ͕·ΕͨϋογϡΛฦ ͍͕ͯͨ͠ɺϋογϡͩͱѻ͍ͮΒ͞σʔλഁଛͷݒ೦͋ͬͨ • 6.1͔Βɺ@model.errorsϝιουActiveModel::ErrorΦϒδΣΫ τͷྻΛฦ͢Α͏ʹͳͬͨ • ৄࡉ https://youtu.be/FGhZR4ns_tc
ʢKaigi on RailsͰͷ࣮ऀͷ ൃදʣΛࢀর
࣍7.0ʹͳͬͨ • https://github.com/rails/rails/commit/ 1b455e2e9d6937d4107e19cb32e2f98aa08886b9 • ͳΜ͔Ͱ͔͍มߋ͕ೖΔΒ͍͠ʂ
Hotwire
Hotwire • https://hotwire.dev/ • RailsͷΦϦδφϧαʔϏεͰ͋ΔBasecampͷਓ͕ͨͪ࡞ͬͨɺ HTML Over The WireͷΦʔϓϯιʔε࣮ •
Heyͱ͍͏ϝʔϧαʔϏεͰ࣮ઓೖࡁΈ • TurboɺStimulusɺStradaͷ3ͭͷίϯϙʔωϯτͰߏ͞ΕΔ • ଞݴޠͩͱLivewireLiveviewͱݺΕΔͷ͕ࣅ͍ͯΔΒ͍͠
Turbo • JavaScriptͷهड़ྔΛ࠷খݶʹͭͭ͠ϢʔβʔମݧΛ্ͤ͞ΔͨΊ ͷϥΠϒϥϦ • DriveɺFramesɺStreamsɺNativeͷ4ͭͷίϯϙʔωϯτͰߏ͞Ε Δ • ͋Μ·ΓͪΌΜͱ৮Εͯͳ͍ͷͰղઆͰ͖ͳ͍…
Stimulus • ܰྔͳJavaScriptϑϨʔϜϫʔΫ • TurboͰΓͳ͍ͱ͖ʹStimulusͰJSΛॻ͘ɺͱ͍͏ΠϝʔδΒ͠ ͍ • CoCʢઃఆΑΓنʣͷΑ͏ͳRailsͬΆ͍Ξϓϩʔν͕ಛ
Strada • ະϦϦʔε • ϞόΠϧΞϓϦʹؔΘΔͷΒ͍͠
StimulusReflex
StimulusReflexʢҎԼ”SR”ʣ • https://docs.stimulusreflex.com/ • Hopsoftͱ͍͏ਓ͕ϝΠϯͰ։ൃ͍ͯ͠ΔΦʔϓϯιʔεͷRails͚ ϥΠϒϥϦ • WebSocketΛ׆༻ͯ͠HTMLΛॻ͖͑Δ • SPAͬΆ͍ΞϓϦΛJSΛॻ͔ͣʹ࡞ΕΔ͕ɺStimulusʹґଘ͍ͯ͠Δ
• Djangoͱ͔Ͱಈ͔͍ͯ͠Δਓ͍ΔΒ͍͠…ʁ
༨ஊ • SRΛ͍20ͰTwitterͬΆ͍ΞϓϦΛ࡞ΔϥΠϒίʔσΟϯά͕ۜ ࠲Rails#27ͰߦΘΕͨʢhttps://ginza-rails.connpass.com/event/ 193008/ʣ • ؆୯ͳը໘ಉظΛ࣮͍͚ͨͩ͠ͳΒ͜ΕͰेͰͱ͍͏࣮ײ • SRίϛϡχςΟ͕׆ൃʢDiscord1000ਓ͑ʂʣ •
࡞ऀ͔Βαϙʔτͯ͠Β͑Δ͔ʁ
पลٕज़ • CableReadyɿSRͷج൫ɺWebSocketʹσʔλΛྲྀ͠ࠐΉ • FuturismɿRailsͷύʔγϟϧΛActionCableͰඇಉظͰϨϯμʔ͢Δ • OptimismɿRailsͷόϦσʔγϣϯͱΤϥʔͷϨϯμϦϯάΛϦΞϧ λΠϜͰߦ͏ • ViewComponentReflexɿViewComponentͱ͍͏GitHubࣾʹΑΔ
ϏϡʔίϯϙʔωϯτϑϨʔϜϫʔΫͱSRΛΈ߹ΘͤͨϥΠϒϥϦ
HotwireͱSR͔Ϳͬͯͳ͍ʁ
͔ͿͬͯΔʂ
HotwireͱSRͷকདྷͲ͏ͳΔͷ͔ • Θ͔ΒΜʂ • HotwireActiveRecordͷCRUDίʔϧόοΫͱͷ૬ੑ͕ྑ͍ͷͱγ ϯϓϧͳͷ͕ڧΈͬΆ͍ • SRMorphͱ͍͏֓೦ʹΑΓԠ༻ൣғΛ͍͛ͯΔҹ • ͕ͬͭΓ͍ൺͯΈͨΘ͚Ͱͳ͍ͷͰݟ͕΄͍͠ͱ͜Ζ
·ͱΊ
Rails 6.1 • ෳDBରԠ͔ͳΓਐΜͩ • ErrorपΓͷඇޓʹҙ • ࣍Rails 7!
HotwireͱSR • ͲͪΒRailsϝΠϯʢগͳ͍JSʣͰSPAͬΆ͍ΞϓϦΛ࣮ݱ͢ΔͨΊ ͷπʔϧ • ࠓޙɺ྆ํ͕ྲྀߦΔͷ͔ɺͲͪΒ͔͕γΣΞΛऔΔͷ͔ɺͲͪΒ ΘΕͳ͍ͷ͔ɺ·ͩ୭ʹΘ͔Βͳ͍ • ؾʹͳΔਓཁνΣοΫͩʂ