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
Kotlin 2.0.20 から標準ライブラリで UUID が使えるようになりました
Search
KAWASHIMA Yoshiyuki
September 24, 2024
1
190
Kotlin 2.0.20 から標準ライブラリで UUID が使えるようになりました
KAWASHIMA Yoshiyuki
September 24, 2024
Tweet
Share
More Decks by KAWASHIMA Yoshiyuki
See All by KAWASHIMA Yoshiyuki
SwiftUI Drag & Drop で困った話
ykws
0
9
GitHub PR Milestone Check を使ってみた
ykws
0
10
コードの作者がいるうちに聞こう
ykws
2
440
アラートを効果的に扱おう
ykws
1
310
visionOS に備える
ykws
0
190
モバイルアプリの操作方法を疑ってみる
ykws
0
1.5k
Featured
See All Featured
Adopting Sorbet at Scale
ufuk
73
9.1k
Building Your Own Lightsaber
phodgson
103
6.1k
It's Worth the Effort
3n
183
27k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
Making Projects Easy
brettharned
115
5.9k
Agile that works and the tools we love
rasmusluckow
327
21k
Designing for humans not robots
tammielis
250
25k
YesSQL, Process and Tooling at Scale
rocio
169
14k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
410
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
Being A Developer After 40
akosma
86
590k
BBQ
matthewcrist
85
9.3k
Transcript
YUMEMI.grow DroidKaigi.onCompletion { 2024@Online } 2024.09.25 Kotlin 2.0.20 ͔Β ඪ४ϥΠϒϥϦͰ
UUID ͕ ͑ΔΑ͏ʹͳΓ·ͨ͠ KAWASHIMA Yoshiyuki
͍͑ͨ͜ͱ • Kotlin 2.0.20 ͔Βඪ४ϥΠϒϥϦͰ UUID ͕͑ΔΑ͏ʹ ͳͬͨ͜ͱ • UUID
Λඪ४ϥΠϒϥϦʹΓସ͑Δʹ͋ͨͬͯͷҙ • ґଘؔͱͲ͏͖ͬͯ߹͍͔ͬͯ͘
ґଘؔͱͲ͏ͬͯ ͖߹͍ͬͯ·͔͢ʁ
ґଘؔ • OS • ݴޠ • SDK • ϥΠϒϥϦ
ґଘؔͱͷ͖߹͍ํ • Dependabot Ͱि࣍Ͱߋ৽ • େ͖ͳมߋ͕͋ͬͨ࣌ʹ·ͱΊͯߋ৽ • ͳΔ͘ߋ৽͠ͳ͍ • ͦͷଞʢ͓͢͢Ίͷߋ৽ϑϩʔπʔϧ͕͋Εੋඇ
νϟοτཝʹʣ
dependabot ͔Βͷ PR • dependabot Ͱि࣍Ͱߋ৽ • Kotlin Multiplatform ΞϓϦέʔγϣϯ։ൃ
• kotlinx-serialization-json 1.7.1 -> 1.7.2 https://github.com/Kotlin/kotlinx.serialization/releases/tag/v1.7.2
Ϛʔδͨ͠ΒΫϥογϡͨ͠ • Ϗϧυύε͢Δ͕ىಈͨ͠ޙʹΫϥογϡͨ͠ • kotlin.native.internal.IrLinkageError: Reference to class 'Uuid' can
not be evaluated: No class found for symbol ‘kotlin.uuid/Uuid|null[0]'
kotlin.uuid/UUID?
ڞ௨ͷ Kotlin ඪ४ϥΠϒϥϦʹ͓͚Δ UUID ͷ αϙʔτ Kotlin 2.0.20 ͔Βಋೖ͞Ε·ͨ͠ https://kotlinlang.org/docs/whatsnew2020.html#standard-library
ϦϦʔεϊʔτΛվΊͯݟΔͱ Kotlin 2.0.20 ͕σϑΥϧτʹͳͬͯͨ https://github.com/Kotlin/kotlinx.serialization/releases/tag/v1.7.2
͞ΒʹϦϦʔεϊʔτΛεΫϩʔϧ͢Δͱɺ kotlin.uuid.Uuid ʹରԠͯͨ͠ https://github.com/Kotlin/kotlinx.serialization/releases/tag/v1.7.2
͜Ε·ͰͲ͏͍͔ͯͨ͠ • Java ͷ UUID Ϋϥε͔͠ͳ͔ͬͨ • JVM ϓϥοτϑΥʔϜͰ͋Εͳ͍ •
Kotlin Multiplatform Ͱ Java ͷϥΠϒϥϦΛར༻Ͱ͖ͳ ͍ • Kotlin Multiplatform ରԠͷαʔυύʔςΟͷ UUID ϥΠϒ ϥϦΛར༻͍ͯͨ͠
Ϋϥογϡαϯϓϧίʔυ • https://github.com/ykws/uuid- runtime-exception-sample
Json.encodeToString Ͱ αʔυύʔςΟͷ Uuid Λ Serialize ͢Δ෦ͰΫϥογϡ͠·͢
ΫϥογϡͷݪҼ • kotlinx-serialization-json 1.7.2 Ҏ߱ɺඪ४ϥΠϒϥϦͷ kotlin.uuid ʹґଘ͍ͯ͠Δ • αʔυύʔςΟͷ uuid
Λ༻͍ͯͨͨ͠Ίɺ kotlinx- serialization-json ଆͰ kotlin.uuid/Uuid ͷΫϥεղܾ͕Ͱ ͖ͳ͔ͬͨ
ճආ͢Δʹ • kotlinx-serialization-json 1.7.1 Λ༻͠ଓ͚Δ • αʔυύʔςΟͷ UUID Λඪ४ϥΠϒϥϦʹΓସ͑Δ
ؒతʹར༻͍ͯ͠Δέʔε • KableʢKotlin Asynchronous Bluetooth Low Energy) Ͱ αʔυύʔςΟͷ UUID
ϥΠϒϥϦʹґଘ͍ͯ͠Δ https://github.com/JuulLabs/kable • 0.36.0 ͷϚΠϧετʔϯͰରԠ༧ఆ https://github.com/ JuulLabs/kable/pull/758
ରԠ͍͚ͨ͠ͲͰ͖ͳ͍ • SKIE 0.8.4 ·ͩ Kotlin 2.0.20 ʹରԠ͍ͯ͠ͳ͍ • 0.9.0
ͰରԠ༧ఆ https://github.com/touchlab/SKIE/ issues/95 • ٸ͙ͳΒ 0.9.0-RC.3 Ҏ࣮߱͋Γʢcurcuit ͕࠾༻ͯ͠ ͍Δʣ https://github.com/slackhq/circuit/pull/1605
·ͱΊ • UUID ͘ීٴ͍ͯ͠ΔͨΊɺΞϓϦέʔγϣϯͰ తʹɺ·ͨؒతʹར༻͞ΕΔ • ඪ४ϥΠϒϥϦͷΓସ͑ଞͷґଘؔͱͷ݉Ͷ߹ ͍Λߟྀͯ͠ܭը͕ඞཁ • ඪ४ϥΠϒϥϦͷΓସ͕͍͑͠߹͋ͬͯɺґଘ
͢ΔϥΠϒϥϦ͕ߋ৽͞Εͨ߹ɺ༧ظͤͣΓସ͕͑ ඞཁʹͳΔՄೳੑ͋Δ
UUID ·ͩ Experimental ಋೖͷλΠϛϯά৻ॏʹஅ͢Δඞཁ͕͋ΓͭͭଞͷґଘؔͰ Γସ͑Λڧ੍͞ΕΔՄೳੑ͋ΓґଘϥΠϒϥϦͷಈʹࢹ͕ඞཁ https://kotlinlang.org/docs/whatsnew2020.html#standard-library
ґଘؔͱͲ͏ͬͯ ͖߹͍͖ͬͯ·͔͢ʁ
ΏΊΈͷ Android ٻਓ࠶։ • DroidKaigi ͷظؒதʹ Android ΤϯδχΞͷٻਓ͕Φʔϓ ϯʹͳ͍ͬͯ·͢ https://hrmos.co/pages/yumemi/jobs?category=1507125045053476864