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
15 JSON serializers for Ruby
Search
Masafumi Okura
September 29, 2024
Technology
2
110
15 JSON serializers for Ruby
https://tokyurubykaigi.github.io/tokyu15/
での発表資料です。
Masafumi Okura
September 29, 2024
Tweet
Share
More Decks by Masafumi Okura
See All by Masafumi Okura
Why did my proposals get rejected?
okuramasafumi
1
440
A suggestion for the future of RDoc
okuramasafumi
1
66
Tech Events, Should We See Them from the Outside or the Inside?
okuramasafumi
1
39
Creating gems 101
okuramasafumi
1
82
How NOT to make your DSL terrible
okuramasafumi
0
280
オブジェクトしこう
okuramasafumi
2
210
Debugging Alba
okuramasafumi
1
190
Learning Ruby
okuramasafumi
5
560
How to build a conference for both newbies and seasoned devs
okuramasafumi
1
1.8k
Other Decks in Technology
See All in Technology
TypeScriptの次なる大進化なるか!? 条件型を返り値とする関数の型推論
uhyo
2
1.7k
オープンソースAIとは何か? --「オープンソースAIの定義 v1.0」詳細解説
shujisado
9
1k
OCI Security サービス 概要
oracle4engineer
PRO
0
6.5k
社内で最大の技術的負債のリファクタリングに取り組んだお話し
kidooonn
1
550
B2B SaaSから見た最近のC#/.NETの進化
sansantech
PRO
0
830
障害対応指揮の意思決定と情報共有における価値観 / Waroom Meetup #2
arthur1
5
480
初心者向けAWS Securityの勉強会mini Security-JAWSを9ヶ月ぐらい実施してきての近況
cmusudakeisuke
0
120
Lambda10周年!Lambdaは何をもたらしたか
smt7174
2
110
RubyのWebアプリケーションを50倍速くする方法 / How to Make a Ruby Web Application 50 Times Faster
hogelog
3
940
マルチモーダル / AI Agent / LLMOps 3つの技術トレンドで理解するLLMの今後の展望
hirosatogamo
37
12k
New Relicを活用したSREの最初のステップ / NRUG OKINAWA VOL.3
isaoshimizu
2
610
iOS/Androidで同じUI体験をネ イティブで作成する際に気をつ けたい落とし穴
fumiyasac0921
1
110
Featured
See All Featured
Optimising Largest Contentful Paint
csswizardry
33
2.9k
Building Adaptive Systems
keathley
38
2.3k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
Navigating Team Friction
lara
183
14k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
27
4.3k
Done Done
chrislema
181
16k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
33k
It's Worth the Effort
3n
183
27k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
4
370
Code Review Best Practice
trishagee
64
17k
Git: the NoSQL Database
bkeepers
PRO
427
64k
How to Ace a Technical Interview
jacobian
276
23k
Transcript
TokyuRubyձٞ15ه೦ɺ RubyͷJSONγϦΞϥΠβ 15ݸղઆ TokyuRubyձٞ15 2024-09-29 OKURA Masafumi
15ճ։࠵ɺ ͓ΊͰͱ͏ ͍͟͝·͢ʂʂʂ
15
15ʹؔ͢Δ ༗ӹͳΛ͠·͢
15
RubyͷJSON γϦΞϥΠβ * 15
self.pp • ໊લɿ͓͓͘Β·͞;Έ • ॴଐɿϑϦʔϥϯε • ՝֎׆ಈɿKaigi on RailsνʔϑΦʔΨφΠβʔɺOH! MY
RUBYISTS ϙουΩϟετओ࠻ͳͲ • ͦͯ͠ɿTokyuRubyձٞ14 LTԦ
None
1. ActiveModelSeri alizers https://github.com/rails-api/active_model_serializers
ActiveModelSerializers • ੲ͔Β͋ΔγϦΞϥΠβ • ྑ͍ॴɿΠϯλʔωοτ্ʹͨ͘͞Μใ͕͋Δ • ྑ͍ॴɿDSL͕͍͍͢ • ѱ͍ॴɿͱͯͭͳ͍͘ •
ѱ͍ॴɿΓ͍
૯ධɿ ࠓ࠾༻͍͔ͨ͠ͳ ͋ʁ
2. Blueprinter https://github.com/procore-oss/blueprinter
Blueprinter • ൺֱత৽͘͠ɺൺֱత༗໊ʢελʔ1000ʣ • ྑ͍ॴɿൺֱత͍ • ྑ͍ॴɿREADME͕ॆ࣮͍ͯ͠Δ • ѱ͍ॴɿಠಛͳΠϯλʔϑΣʔεʢviewͱ͍͏Έʣ •
ѱ͍ॴɿϝϯςφϯε͕ඍົ
૯ධɿ ͜ΕΛ͓͏͔ͳͱ ࢥ͍ͬͯͨ࣌ظ͕ࢲ ʹ͋Γ·ͨ͠
3. jbuilder https://github.com/rails/jbuilder
jbuilder • RailsͷϏϡʔʹಛԽͨ͠DSL • ྑ͍ॴɿ࠷ॳ͔Βೖ͍ͬͯΔ • ྑ͍ॴɿͬ͘͞ͱJSONΛฦ͢͜ͱ͕Ͱ͖Δ • ѱ͍ॴɿύʔγϟϧ͕͍ •
ѱ͍ॴɿͦͦDSL͕֮͑ΒΕͳ͍ʢ͘͠ͳ͍ʁʣ
૯ධɿ ͦͷDSLɺࢲ ͪΐͬͱ…
4. jb https://github.com/amatsuda/jb
jb • amatsuda wareɺRailsͷϏϡʔͰී௨ͷRuby͕ॻ͚Δ • ྑ͍ॴɿΦʔόʔϔου͕খ͍͞ • ྑ͍ॴɿRubyͦͷ··ͳͷͰֶशίετ͕খ͍͞ • ѱ͍ॴɿRubyͦͷ··ͳͷͰந͕͍
૯ධɿ ࣮݁ߏΘΕͯ ͍ΔͬΆ͍
5. jsonapi- serializer https://github.com/jsonapi-serializer/jsonapi- serializer
jsonapi-serializer • Net fl ix/fast_jsonapiͷϑΥʔΫ • ྑ͍ॴɿJSON:API༷ʹै͏ͳΒ͘ΘΕ͍ͯΔ • ѱ͍ॴɿJSON:API༷ʹै͍ͨ͘ͳ͍
૯ධɿ JSON:APIɺօ͞ ΜͲ͏Ͱ͔͢
6. panko_serializer https://github.com/yosiat/panko_serializer
panko_serializer • OjΛϕʔεʹC֦ுϝΠϯͰॻ͔ΕͨγϦΞϥΠβ • ྑ͍ॴɿ͢͞·͍͘͡ʢ࣍ͷ2ഒҎ্ߴʣ • ѱ͍ॴɿOj͕ඞਢ • ѱ͍ॴɿػೳ͋·Γଟ͘ͳ͍
૯ධɿ C֦ுͣΔ͍ ʢϕϯνϚʔΫతʹʣ
7. representable https://github.com/trailblazer/representable
representable • Trailblazerͱ͍͏Rails֦ுϑϨʔϜϫʔΫͷҰ෦ • ྑ͍ॴɿXMLYAMLग़ྗͰ͖Δ • ѱ͍ॴɿൺֱత • ѱ͍ॴɿJSONग़ྗʹmulti_json͕ඞཁ
૯ධɿ Trailblazer͖ʹ ͍͍ͷ͔ʁ
8. primalize https://github.com/jgaskins/primalize
primalize • ΦϒδΣΫτΛϓϦϛςΟϒܕʹม͢Δͱ͍͏Ξϓϩʔν • ྑ͍ॴɿܕνΣοΫ͕Ͱ͖Δ • ѱ͍ॴɿه๏͕ • ѱ͍ॴɿ͋·Γ͘ͳ͍
૯ධɿ ܕνΣοΫͰ͖Δ ͷྑ͍Ͱ͢Ͷ
9. SimpleAMS https://github.com/vasilakis fi l/SimpleAMS
SimpleAMS • ActiveModelSerializersͷγϯϓϧ൛…ͳͷ͔ʁ • ྑ͍ॴɿAMSΑΓߴ • ѱ͍ॴɿAMSΑΓϝϞϦফඅྔ͕ଟ͍
૯ධɿ γϯϓϧͱ
10. Rails https://github.com/rails/rails
Rails • ࣮Railsʹඪ४ͰγϦΞϥΠβػೳ͕ೖ͍ͬͯΔ • ྑ͍ॴɿRailsΞϓϦͳΒԿΠϯετʔϧ͠ͳͯ͘Α͍ • ྑ͍ॴɿOj.optimize_rails͢ΔͱΊͪΌ͘ͳΔ • ѱ͍ॴɿonly, except,
methodsΛͬͯγϦΞϥΠζ࣌Ͱमਖ਼Ͱ͖ ͯ͠·͏ʢγϦΞϥΠβ͚ͩΛݟͯ࠷ऴग़ྗ͕Θ͔Βͳ͍ʣ
૯ධɿ ͍ͭ͜ɺಈͧ͘ʂ
11. Alba https://github.com/okuramasafumi/alba
Alba • ࡞ • ྑ͍ॴɿPure Rubyʹͯ͠ͱ͍ͯ • ྑ͍ॴɿײతͳDSLʹՃ͑χονͳػೳଟࡌ • ѱ͍ॴɿಛʹͳ͠
૯ධɿ جຊతʹ͜ΕΛ ͓͚͍͍ͬͯ
12. Alba ʢclasslessʣ https://github.com/okuramasafumi/alba/blob/main/ README.md#inline-de fi nition-with-albaserialize
Albaʢclasslessʣ • AlbaΫϥεఆ͕ٛෆཁ • ྑ͍ॴɿίϯτϩʔϥʔͷதʹγϦΞϥΠβΛॻ͖Ͱ͖Δ • ྑ͍ॴɿϒϩοΫΛ͏ͷͰɺparamsͱ͔Λ͑Δ • ѱ͍ॴɿΘͳ͍΄͏͕͍͍
૯ධɿ ࣮ݸਓͰϝϯς͠ ͯΔΞϓϦͰ͜Ε Λ͍ͬͯΔ
13. Alba ʢܕఆ͖ٛͭʣ https://github.com/okuramasafumi/alba/blob/main/ README.md#types
Albaʢܕఆ͖ٛͭʣ • AlbaͰܕఆ͕ٛͰ͖Δ • ྑ͍ॴɿܕఆ͕ٛͰ͖ΔʢͰ͖Δʣ • ѱ͍ॴɿ͔ͤͬ͘ܕఆٛΛͯ͠ɺTypeScriptͷܕʹӨڹ͕ͳ͍
૯ධɿ TypeScriptͷܕ͕ ΄͍͠ΜͰ͢ΑͶ͑
14. Alba ʢw/ typelizerʣ https://github.com/skryukov/typelizer
Alba (w/ typelizer) • AlbaͷܕఆٛγϦΞϥΠβͷఆ͔ٛΒTypeScriptͷܕ͕ಘΒΕΔ • ྑ͍ॴɿސ٬͕ຊʹཉ͔ͬͨ͠ͷ • ྑ͍ॴɿݫີͳఆٛΛॻ͔ͳͯ͋͘ΔఔܕΛ࡞ͬͯ͘ΕΔ •
ѱ͍ॴɿunknown͕ଟ͘ͳΓ͕ͪ
૯ධɿ ଞͷਓ͕ࣗ࡞ϥΠϒ ϥϦΛ֦ுͯ͘͠Ε Δͷͱ͍͍ͯ
15. Alba https://github.com/okuramasafumi/alba
Alba • ΦνͰ͢ • ྑ͍ॴɿࣗ࡞ͳͷͰ৭ʑޠΔ͜ͱ͕͋Δ • ѱ͍ॴɿ͜ͷεϥΠυʹ༰͕ͳ͍
૯ධɿ ΈΜͳͬͯ͘ Εʂʂʂ
͝ਗ਼ௌ ͋Γ͕ͱ͏ ͍͟͝·ͨ͠ʂ