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
580
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
10k
Autofill Framework
uzzu
0
88
アプリ内課金の最新事情 クライアントサイド編 / 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.3k
ブログ作り直した / My blog @ Othlo Tech
uzzu
0
120
新規アプリ開発を支えるユーザ・決済基盤
uzzu
2
2.6k
kotlin-mpp-library-tips
uzzu
1
6.2k
Coroutine Kyuin
uzzu
2
260
Other Decks in Technology
See All in Technology
AIを駆使したゲーム開発戦略: 新設AI組織の取り組み / sge-ai-strategy
cyberagentdevelopers
PRO
1
130
Autify Company Deck
autifyhq
1
39k
Forget efficiency – Become more productive without the stress
ufried
0
120
ユーザーの購買行動モデリングとその分析 / dsc-purchase-analysis
cyberagentdevelopers
PRO
2
100
Product Engineer Night #6プロダクトエンジニアを育む仕組み・施策
hacomono
PRO
1
470
Fargateを使った研修の話
takesection
0
110
オニオンアーキテクチャで実現した 本質課題を解決する インフラ移行の実例
hryushm
14
3k
プロダクトチームへのSystem Risk Records導入・運用事例の紹介/Introduction and Case Studies on Implementing and Operating System Risk Records for Product Teams
taddy_919
1
170
Shift-from-React-to-Vue
calm1205
3
1.3k
LeSSに潜む「隠れWF病」とその処方箋
lycorptech_jp
PRO
2
120
omakaseしないための.rubocop.yml のつくりかた / How to Build Your .rubocop.yml to Avoid Omakase #kaigionrails
linkers_tech
3
730
Figma Dev Modeで進化するデザインとエンジニアリングの協働 / figma-with-engineering
cyberagentdevelopers
PRO
1
430
Featured
See All Featured
What's in a price? How to price your products and services
michaelherold
243
12k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Done Done
chrislema
181
16k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
355
29k
Happy Clients
brianwarren
97
6.7k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
7.9k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
Being A Developer After 40
akosma
86
590k
Measuring & Analyzing Core Web Vitals
bluesmoon
1
40
Making the Leap to Tech Lead
cromwellryan
132
8.9k
Thoughts on Productivity
jonyablonski
67
4.3k
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