Poko: A Kotlin Compiler Plugin for Multiplatform Development
The article discusses Poko, a Kotlin compiler plugin that generates equals, hashCode, and toString functions for annotated classes based on their properties. Inspired by Jake Wharton's blog post on maintaining compatibility in public APIs, Poko mimics the behavior of Kotlin data classes while leaving out the copy and componentN functions. The plugin is used by Cash App's Paraphrase and Redwood runtimes. Recently, Poko added support for native and JS targets, making it compatible with all multiplatform platforms. It generates functions that behave the same on all platforms, implementing the same behavior as data classes. Additionally, Poko now supports array content comparison through the @ArrayContentBased annotation. This allows library authors to maintain API compatibility across releases, making it easier to ship public data models without breaking APIs. The article concludes Cash App's Summer of Kotlin Multiplatform series.