The Journey to Compose Hot Reload 1.0.0
Article Summary
Sebastian Sellmair and Azat Abdullin from JetBrains reveal how they built Compose Hot Reload 1.0.0—a zero-config tool that lets you update Kotlin UI code instantly while preserving app state. The engineering behind it is wild.
Compose Hot Reload 1.0.0 just shipped with Compose Multiplatform 1.10, enabling developers to see code changes reflected in running apps without restarts. This deep dive from the JetBrains team unpacks the technical architecture: DCEVM for dynamic code reloading, bytecode analysis for UI invalidation, and a custom orchestration protocol connecting IDE, build system, and runtime.
Key Takeaways
- DCEVM in JetBrains Runtime enables unrestricted class redefinition beyond standard JVM limits
- Custom Java agent analyzes Compose bytecode to track UI groups and invalidate only changed code
- Zero configuration: Gradle plugin auto generates hot reload tasks and manages incremental compilation
- Orchestration protocol coordinates IDE, build system, and app without external dependencies
- Team fixed compiler lambda naming issues causing reload failures across Kotlin versions
Compose Hot Reload combines JetBrains Runtime's DCEVM, bytecode analysis, and build system integration to deliver instant UI updates with state preservation and zero developer configuration.
About This Article
Lambda functions in Kotlin bytecode became unstable during hot reload. The compiler generated names using depth-first search counters, so adding a single new lambda anywhere in the file caused all lambda classes to rename.
JetBrains engineers updated the Compose compiler in version 2.1.20 to use stable group keys instead of counters for composable singleton lambda names. They also updated the Kotlin compiler in version 2.2.20 to make indy lambda indices unique per scope rather than file-wide.
These compiler changes stopped cascading bytecode invalidations and interface mismatches that had blocked valid user code from reloading. Developers can now make arbitrary code changes without triggering reload failures.