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
Why did my proposals get rejected?
okuramasafumi
1
480
A suggestion for the future of RDoc
okuramasafumi
1
69
15 JSON serializers for Ruby
okuramasafumi
2
130
Tech Events, Should We See Them from the Outside or the Inside?
okuramasafumi
1
45
Creating gems 101
okuramasafumi
1
85
How NOT to make your DSL terrible
okuramasafumi
0
310
オブジェクトしこう
okuramasafumi
2
220
Debugging Alba
okuramasafumi
1
200
Learning Ruby
okuramasafumi
5
570
Other Decks in Programming
See All in Programming
Cloudflare MCP ServerでClaude Desktop からWeb APIを構築
kutakutat
1
570
採用事例の少ないSvelteを選んだ理由と それを正解にするためにやっていること
oekazuma
2
1.1k
Androidアプリのモジュール分割における:x:commonを考える
okuzawats
1
190
rails statsで大解剖 🔍 “B/43流” のRailsの育て方を歴史とともに振り返ります
shoheimitani
2
960
Haze - Real time background blurring
chrisbanes
1
520
SymfonyCon Vienna 2025: Twig, still relevant in 2025?
fabpot
3
1.2k
Effective Signals in Angular 19+: Rules and Helpers
manfredsteyer
PRO
0
130
103 Early Hints
sugi_0000
1
260
[JAWS-UG横浜 #76] イケてるアップデートを宇宙いち早く紹介するよ!
maroon1st
0
510
17年周年のWebアプリケーションにTanStack Queryを導入する / Implementing TanStack Query in a 17th Anniversary Web Application
saitolume
0
250
今年のアップデートで振り返るCDKセキュリティのシフトレフト/2024-cdk-security-shift-left
tomoki10
0
230
ある日突然あなたが管理しているサーバーにDDoSが来たらどうなるでしょう?知ってるようで何も知らなかったDDoS攻撃と対策 #phpcon.2024
akase244
2
410
Featured
See All Featured
KATA
mclloyd
29
14k
The Pragmatic Product Professional
lauravandoore
32
6.3k
Automating Front-end Workflow
addyosmani
1366
200k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
66k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
6
450
The Language of Interfaces
destraynor
154
24k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
26
1.9k
A Tale of Four Properties
chriscoyier
157
23k
BBQ
matthewcrist
85
9.4k
Product Roadmaps are Hard
iamctodd
PRO
50
11k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
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ͬΆ͍ΞϓϦΛ࣮ݱ͢ΔͨΊ ͷπʔϧ • ࠓޙɺ྆ํ͕ྲྀߦΔͷ͔ɺͲͪΒ͔͕γΣΞΛऔΔͷ͔ɺͲͪΒ ΘΕͳ͍ͷ͔ɺ·ͩ୭ʹΘ͔Βͳ͍ • ؾʹͳΔਓཁνΣοΫͩʂ