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
Context Receiversに思いを馳せる / Context Receivers
Search
uzzu
October 05, 2022
Technology
0
610
Context Receiversに思いを馳せる / Context Receivers
DroidKaigi2022 Dialogs - 2022/10/05 14:20-14:45
https://droidkaigi.jp/2022/timetable/363729
uzzu
October 05, 2022
Tweet
Share
More Decks by uzzu
See All by uzzu
StoreKitのこれまでとこれから / StoreKit 2 from 1
uzzu
5
11k
Autofill Framework
uzzu
0
95
アプリ内課金の最新事情 クライアントサイド編 / In-app Purchase in Cookpad 2019
uzzu
3
4.3k
Billing Client 2.0 acknowledgement
uzzu
0
16k
Promoting IAP対応から学ぶ外部アプリ内課金実装 / Promoting IAP and others
uzzu
2
1.4k
ブログ作り直した / My blog @ Othlo Tech
uzzu
0
120
新規アプリ開発を支えるユーザ・決済基盤
uzzu
2
2.6k
kotlin-mpp-library-tips
uzzu
1
6.2k
Coroutine Kyuin
uzzu
2
270
Other Decks in Technology
See All in Technology
オプトインカメラ:UWB測位を応用したオプトイン型のカメラ計測
matthewlujp
0
180
ブラックフライデーで購入したPixel9で、Gemini Nanoを動かしてみた
marchin1989
1
540
社外コミュニティで学び社内に活かす共に学ぶプロジェクトの実践/backlogworld2024
nishiuma
0
270
AI時代のデータセンターネットワーク
lycorptech_jp
PRO
1
290
ゼロから創る横断SREチーム 挑戦と進化の軌跡
rvirus0817
2
270
スタートアップで取り組んでいるAzureとMicrosoft 365のセキュリティ対策/How to Improve Azure and Microsoft 365 Security at Startup
yuj1osm
0
230
How to be an AWS Community Builder | 君もAWS Community Builderになろう!〜2024 冬 CB募集直前対策編?!〜
coosuke
PRO
2
2.8k
KnowledgeBaseDocuments APIでベクトルインデックス管理を自動化する
iidaxs
1
270
マルチプロダクト開発の現場でAWS Security Hubを1年以上運用して得た教訓
muziyoshiz
3
2.4k
Turing × atmaCup #18 - 1st Place Solution
hakubishin3
0
490
宇宙ベンチャーにおける最近の情シス取り組みについて
axelmizu
0
110
生成AIのガバナンスの全体像と現実解
fnifni
1
190
Featured
See All Featured
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
45
2.2k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Building Adaptive Systems
keathley
38
2.3k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
17
2.3k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
5
450
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
Testing 201, or: Great Expectations
jmmastey
40
7.1k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
32
2.7k
Statistics for Hackers
jakevdp
796
220k
Raft: Consensus for Rubyists
vanstee
137
6.7k
Transcript
Context Receiversʹ ࢥ͍ΛͤΔ uzzu @ 2022/10/05 DroidKaigi 2022 DAY.01
Cluster, Inc. All Rights Reserved. 2 ҙ 2022/09࣌Ͱͷ ใΛݩʹൃද͓ͯ͠Γ·͢ ࢥ͍ΛͤΔ༰ͳͷͰओ؍ؚ·Ε͓ͯΓ·͢
Context Receiversݱࡏprototypeஈ֊Ͱ͢ ྃ͝ঝ͍ͩ͘͞
Cluster, Inc. All Rights Reserved. 3 ࣗݾհ @uzzu Cluster, Inc.
ιϑτΣΞΤϯδχΞ झຯ: VR, ࡶଟͳٕज़ݕূ, ಡॻ, DTM, ֨ήʔ, εϓϥ
Cluster, Inc. All Rights Reserved. 4 ClusterͷAndroidΞϓϦʹ͍ͭͯ AndroidΞϓϦ ࠾༻ใ AndroidΞϓϦΤϯδχΞืू
⬆ inroom (Unity as a Library) ⬅︎ outroom (Native App)ɹɹɹ
Cluster, Inc. All Rights Reserved. 5 ΞδΣϯμ ɾContext Receivers͕དྷΔ·Ͱͷ͓͞Β͍ ɾContext
Receiversͱɺ༻ྫ ɾContext Receiversͷ՝ɺࢥ͍ ɾ·ͱΊ
Cluster, Inc. All Rights Reserved. 6 ContextReceivers͕དྷΔ·Ͱͷ͓͞Β͍ KEEP(https://github.com/Kotlin/KEEP) YouTrack(https://youtrack.jetbrains.com/) Kotlin
Slack(https://kotlinlang.slack.com/) ͍͔ͭ͋͘Δ͕ͦͷதͰ2ͭͷissueΛൈਮ
Cluster, Inc. All Rights Reserved. 7 Compile-time Extension Interfaces https://github.com/Kotlin/KEEP/pull/87
2017/10ࠒ ɾ࠷ॳظʮType Classesʯͱ͍͏λΠτϧͰproposal͕ॻ͔Ε͍ͯͨ ɾʮ͍ͭʹKotlinʹܕΫϥε͕དྷΔ…?!ʯͱ͍͏ࣄͰք۾Γ্͕Δ
Cluster, Inc. All Rights Reserved. 8 Compile-time Extension Interfaces https://github.com/Kotlin/KEEP/pull/87
Cluster, Inc. All Rights Reserved. 9 Compile-time Extension Interfaces https://github.com/Kotlin/KEEP/pull/87
ɾcompanion objectͱͷׂͷॏෳ ɾJVMͱͷ૬ޓӡ༻ ɾෳͷϨγʔόʹର͢Δ֦ுߏจ͕ඞཁ ɾimplicit parameterͷ͠͞ ɾetc…
Cluster, Inc. All Rights Reserved. 10 Multiple receivers on extension
functions/properties https://youtrack.jetbrains.com/issue/KT-10468 https://youtrack.jetbrains.com/issue/KT-42435
Cluster, Inc. All Rights Reserved. 11 ͦͯ͠Context Receivers https://github.com/Kotlin/KEEP/issues/259 https://github.com/Kotlin/KEEP/blob/master/proposals/context-
receivers.md ឯ༨ۂંʹ͍ͭͯProposalʹॻ͔Ε͍ͯΔ (Alternative approaches and design tradeoffs) 1.6.20-M1 ʹͯPrototypeͱͯ͠ϦϦʔε https://blog.jetbrains.com/kotlin/2022/02/kotlin-1-6-20-m1- released/ freeCompilerArgs = listOf("-Xcontext-receivers")
Cluster, Inc. All Rights Reserved. 12 Context ReceiversͷGoal (ͷ͏ͪ2͚ͭͩհ) ɾίϯςΩετநԽΛهड़͢ΔͨΊͷ
ɹmember extension(ϝϯόʔ֦ு)ΛऔΓআ͘
Cluster, Inc. All Rights Reserved. 13 Context ReceiversͷGoal (ͷ͏ͪ2͚ͭͩհ)
Cluster, Inc. All Rights Reserved. 14 Context ReceiversͷGoal (ͷ͏ͪ2͚ͭͩհ)
Cluster, Inc. All Rights Reserved. 15 Context ReceiversͷGoal (ͷ͏ͪ2͚ͭͩհ)
Cluster, Inc. All Rights Reserved. 16 Context ReceiversͷGoal (ͷ͏ͪ2͚ͭͩհ) ɾKotlinͷܕγεςϜͰෳͷϨγʔόΛ࣋ͭ
ɹίʔυϒϩοΫΛදݱͰ͖ΔΑ͏ʹ͢Δ
Cluster, Inc. All Rights Reserved. 17 Context Receiversͷͦͷଞͷྫ ɾίϯετϥΫλͷӅṭ +
Contextࢀর
Cluster, Inc. All Rights Reserved. 18 Context Receiversͷͦͷଞͷྫ ɾOverloading(※ҙ͋Γ) ͜͏͍͏ίʔυॻ͔ͳ͍Ͱɺͳ༰Proposalʹهࡌ͞Ε͍ͯΔ
(contexts-and-coding-style)
Cluster, Inc. All Rights Reserved. 19 ɾContext Functionͷείʔϓ֊ͷਂ͞(ݕ౼த) ɾReflectionະରԠ(Prototypeஈ֊ͰΒͳͦ͏ͳؾ͕) ɾΤοδέʔεͷରԠ
(Kotlin 1.8.0ͰҰ෦मਖ਼ࡁ) ɾSyntax Highlighting(Τϥʔు͘ͷͰےͰ) ɾetc… Context Receiversͷ՝(Future Work)
Cluster, Inc. All Rights Reserved. 20 (ϓϩτλΠϓஈ֊Ͱͱ͔͍͘͏͖ Ͱͳ͍ͷঝͰ) ɾهड़ͷબࢶ͕ଟͯ͋͘Μ·Γࠓ·ͰͷKotlinΒ͘͠ͳ͍Α͏ͳؾ͕͢Δͷ͕ ɹݸਓతʹٯʹ໘ന͍
ɾCompile-time extensionํ໘Ͱ্͕ͬͨ՝͔ΒݟΔʹՄೳͳهड़ ɹ͜Ε͔ΒߜΒΕ͍ͯͬͯཉ͍͠ͳʔͱࢥ͍ͬͯΔ ɹ(ཞ༻͕ාͯ͘ਂ͘৮Εͳ͍ਓʑ͕͍ͦ͏ͳͷ͍ͬͨͳ͍ɺͱ͍͏ҙຯͰ) ɾݱঢ়Ͱᙱ͍ͱ͜Ζʹख͕ಧ͘ͷͰݸਓతʹॿ͔Δ Context Receiversͷࢥ͍
Cluster, Inc. All Rights Reserved. 21 Context Receiversͷࢥ͍ ɾͦͦͳͥ ”Context”
ʹͳͬͨͷ͔…ʁ ɹ=> Multiple receiversͷϓϩτλΠϓͷஈ֊Ͱ ɹɹύϥϝʔλΛஔ͖͑ΔͨΊʹ͋ΔΘ͚Ͱͳ͘ ɹɹؔݺͼग़͠ͷͨΊͷίϯςΩετΛՃ͢Δҝͷ ɹɹઃܭ͕ඞཁͩͱؾ͍ͮͨҝ ɹɹ=> ύϥϝʔλͷΘΓʹ༻͢Δ߹ʹ ɹɹɹهड़͕ʹͳΔΑ͏͍͑ͯͯ͠Δ ɹɹɹ=> ཞ༻͞Εͳ͍Α͏ʹ https://youtrack.jetbrains.com/issue/KT-10468/Multiple-receivers-on-extension-functionsproperties#focus=Comments-27-4608759.0-0
Cluster, Inc. All Rights Reserved. 22 Context Receiversͷࢥ͍ ɾͦͦͳͥ ”Context”
ʹͳͬͨͷ͔…ʁ ɹ=> Multiple receiversͷϓϩτλΠϓͷஈ֊Ͱ ɹɹύϥϝʔλΛஔ͖͑ΔͨΊʹ͋ΔΘ͚Ͱͳ͘ ɹɹؔݺͼग़͠ͷͨΊͷίϯςΩετΛՃ͢Δҝͷ ɹɹઃܭ͕ඞཁͩͱؾ͍ͮͨҝ ɹɹ=> ύϥϝʔλͷΘΓʹ༻͢Δ߹ʹ ɹɹɹهड़͕ʹͳΔΑ͏͍͑ͯͯ͠Δ ɹɹɹ=> ཞ༻͞Εͳ͍Α͏ʹ https://youtrack.jetbrains.com/issue/KT-10468/Multiple-receivers-on-extension-functionsproperties#focus=Comments-27-4608759.0-0 ͻΐͬͱͯ͠ਅ໘ʹimplicit parameterʹcode generationͳΓͰ ͪΌΜͱରԠͰ͖ΔΑ͏ʹɺ༨നͱ͍ͯͯ͠͠ΔͷͩΖ͏͔…ʁ ؾʹͳΔ…ͦΘͦΘ…ৄ͍͠ਓڭ͍͑ͯͩ͘͞
Cluster, Inc. All Rights Reserved. 23 ·ͱΊ ɾContext ReceiversܕΫϥεͷProposal͔Β
ɹෳͷϨγʔόʹର͢Δ֦ுߏจ͕ඞཁͱ͍͏ ɹྲྀΕͰ࡞ΒΕͨ ɾKotlinʹͯࣗ͘͠͠༝ͷߴ͍Proposal ɾָ͍͠ͷࠓ͚͔ͩ…ʁ ɹProposalΛಡΜͰָ͘͠ɹ ʂ
Context Receiversʹ ࢥ͍ΛͤΔ uzzu @ 2022/10/05 DroidKaigi 2022 DAY.01