Performant Multiplatform Kotlin Serialization
summary
Kotlinx.serialization targets multiplatform code sharing across JVM and JavaScript (native not ready), uses a compiler plugin that generates bytecode rather than reflection so you add a Gradle/Maven plugin and install an IntelliJ plugin to avoid IDE errors. Core formats shipped are JSON and Protobuf (also CBOR), serializers handle generics (companion-generated Pair serializer works) but custom KSerializer implementation is complex, relies on a global registry so keep instances to avoid recreation, and notable gaps are no streaming API and limited polymorphic support. There is a Retrofit converter adapter usable today.
AI-written summary · about
chapters (13)
- 0:00Introduction to Kotlin X Serialization
- 1:56Why consider Kotlin X Serialization
- 2:59Getting started with setup
- 4:23Basic usage and annotations
- 8:01Custom serialization with KSerializer
- 10:51Handling platform types and nullability
- 13:22Implementing KSerializer interface
- 17:19KInput, KOutput and generics
- 21:31Complex cases and factory limitations
- 25:16Supported serialization formats
- 26:44Streaming and polymorphic serialization
- 28:55Future improvements and abstractions
- 31:30Multiplatform potential and conclusion
related talks
42mPerformant Multiplatform Kotlin Serialization
27mkotlinx.serialization 1.0
31mDesign of Kotlin Serialization
24mWhat is Kotlin Serialization, and should I use it?
34mKotlin Multiplatform: code sharing without compromise
01h 07mDevelop Multiplatform Projects in Kotlin
33mUsing Kotlin for JS Client and JVM Server
26mKotlin Multiplatform in an MVVM World
