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
590
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
90
アプリ内課金の最新事情 クライアントサイド編 / 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
270
Other Decks in Technology
See All in Technology
CysharpのOSS群から見るModern C#の現在地
neuecc
2
3.5k
FlutterアプリにおけるSLI/SLOを用いたユーザー体験の可視化と計測基盤構築
ostk0069
0
110
OCI 運用監視サービス 概要
oracle4engineer
PRO
0
4.8k
テストコード品質を高めるためにMutation Testingライブラリ・Strykerを実戦導入してみた話
ysknsid25
7
2.7k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
0
110
ExaDB-D dbaascli で出来ること
oracle4engineer
PRO
0
3.9k
安心してください、日本語使えますよ―Ubuntu日本語Remix提供休止に寄せて― 2024-11-17
nobutomurata
1
1k
ISUCONに強くなるかもしれない日々の過ごしかた/Findy ISUCON 2024-11-14
fujiwara3
8
880
強いチームと開発生産性
onk
PRO
35
11k
Lexical Analysis
shigashiyama
1
150
障害対応指揮の意思決定と情報共有における価値観 / Waroom Meetup #2
arthur1
5
490
TanStack Routerに移行するのかい しないのかい、どっちなんだい! / Are you going to migrate to TanStack Router or not? Which one is it?
kaminashi
0
600
Featured
See All Featured
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.8k
Raft: Consensus for Rubyists
vanstee
136
6.6k
The Cult of Friendly URLs
andyhume
78
6k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Six Lessons from altMBA
skipperchong
27
3.5k
Embracing the Ebb and Flow
colly
84
4.5k
Thoughts on Productivity
jonyablonski
67
4.3k
Faster Mobile Websites
deanohume
305
30k
Building a Scalable Design System with Sketch
lauravandoore
459
33k
Site-Speed That Sticks
csswizardry
0
31
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