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
220
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
30
GitHub PR Milestone Check を使ってみた
ykws
0
26
コードの作者がいるうちに聞こう
ykws
2
500
アラートを効果的に扱おう
ykws
1
350
visionOS に備える
ykws
0
220
モバイルアプリの操作方法を疑ってみる
ykws
0
1.5k
Featured
See All Featured
Building Adaptive Systems
keathley
41
2.5k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
177
52k
Building Flexible Design Systems
yeseniaperezcruz
328
38k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3.1k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
2.1k
Done Done
chrislema
183
16k
How to Think Like a Performance Engineer
csswizardry
22
1.5k
4 Signs Your Business is Dying
shpigford
183
22k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
31
4.7k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
The Cost Of JavaScript in 2023
addyosmani
48
7.6k
Mobile First: as difficult as doing things right
swwweet
223
9.5k
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