top of page
Fine-Grained Composable Scoping: Tying UI and Data Lifecycles at the Compilation Stage
26. Juni 2025 um 14:35:00
Stage 3
Jetpack Compose separates UI into small parts, yet it ties ViewModel lifecycles only to Activities or Fragments. This causes data to outlive its associated UI or be reused inappropriately. We present a fine-grained scoping solution that attaches a dedicated Lifecycle and ViewModelStore to a composable level. By the use of a custom Kotlin Compiler Plugin, generate the necessary code to create and clear the scope automatically. This approach cuts boilerplate code and ensures that data is managed exactly when a composable appears or disappears, offering precise control over UI state in Compose apps.

Pengwen Jiao
Tech Lead, Mobile Infrastructure @ TikTok
He's now work as the leader of TikTok global Android efficiency & US Mobile Infrastructure team, aim's to improve TikTok's engineering architecture design and development efficiency.
With 5 years experience on optimizing Gradle/AGP build process, IDE productivity enhancement. Also play the role as major maintainer of the private folk of the compilation toolchain and moving forward to MonoRepo based on high performance compiler, the build speed and local dev experience of the TikTok has been greatly improved.
Love contribute to open source and free programming, former administrator and contributor to the arch linux cn official forums. Contributor to Android Gradle plugin and Gradle.
Signature Productivity Products: 「Baseline Gradle cache」「static DSL for super-scale project」「Instant IDE Sync」「Advanced AGP opt」「TT Native Buildpack」etc.
bottom of page