KotlinX Libraries
summary
A multi‑platform chat app is built with Ktor websockets and Compose Multiplatform to demo concrete libraries: kotlinx.serialization compiler plugin generates no‑reflection serializers, polymorphism requires explicit tags or sealed hierarchies, and coroutines use MutableSharedFlow with replay on server to broadcast events while client code uses cold flow and StateFlow (state updates dedupe by reference). Date/time uses use Instant not LocalDateTime for moments and rendering by zone, and Immutable persistent lists reduce recomposition in UI; the sample works and is on GitHub.
AI-written summary · about
chapters (18)
- 0:00Start
- 5:58Serialization library components
- 6:50Start small: serialize one event
- 8:19Why doesn't it work with supertype?
- 9:44Solution: sealed hierarchy
- 10:40KotlinX.Serialization: Summary
- 12:43Underlying mechanics: Flows
- 14:57Client network layer: sending event
- 16:22Server: broadcasting event
- 17:58Handling new connection
- 22:50Client network layer: observing flow of events
- 24:11Client UI layer: building state flow of all events
- 29:01The main types
- 31:37Grouping messages by time intervals
- 35:31The same puzzler
- 38:01Benefits of using Immutable Collections
- 39:15Composable State Change Example
- 44:21Check the Chat Application!
related talks
41mKotlin for the JVM and beyond
45mThe Adventures of Kotlin And Compose Through the Multiplatform World
42mEmbracing the Future in a Multiplatform World: A Kotlin Story
46mExploring the Kotlin Multiplatform Ecosystem
34mHitchhiker’s Guide to Kotlin Multiplatform Libraries
32mHitchhiker's Guide to Kotlin/Compose Multiplatform samples and libraries
22mArchitecting a Kotlin Multiplatform App
27mAn Android Dev start to Kotlin Multiplatform
