Beyond Detekt: Building a Kotlin Compiler Plugin for Compose Insights
Starts:
25. Juni 2025 um 15:15:00
Ends:
25. Juni 2025 um 15:55:00
Status:
Accepted
While Jetpack Compose simplifies UI development with its declarative paradigm, mastering its reactive nature, particularly optimizing recompositions and managing state hoisting, presents costly challenges for developers transitioning from imperative approaches. Subtle mistakes can lead to performance issues, and verifying efficient composition through testing remains challenging at scale.
This session tackles these challenges head-on by diving into the world of Kotlin Compiler Plugins. We'll demonstrate how to build a custom plugin that hooks directly into the compilation process. Learn how to analyze Kotlin's Intermediate Representation (IR) to identify Composable functions and automatically inject instrumentation and recomposition tracking code before your app even runs.
We will construct a practical compiler plugin designed to:
>Track and visualize recomposition frequency using a heatmap, instantly highlighting performance hotspots.
>Enhance unit tests by enabling assertions on specific recomposition counts, ensuring stability and efficiency.
Attendees will leave understanding:
>The core concepts and power of Kotlin compiler plugins.
>Setting up a plugin project and integrating it via Gradle.
>Analyzing Kotlin IR to target specific code structures like Composables.
Join this session to unlock a powerful technique for building custom developer tooling, improving your Compose development experience, and shipping higher-quality, performant UIs to your users.