Compose Compiler — Feature Flags
Sep 16, 2024
Optimization strategies
Hello everyone 👋🏻
This is a brief news update.
…Do you use Compose Compiler?
There’s a new deprecation.
Since Kotlin version 2.0.20, *enableStrongSkippingMode is deprecated. You can now use the Compose Compiler featureFlags.
⁉️
Through the gradle.kts file, we can set the type of optimization strategy in Compose. There are three types:
- IntrinsicRemember:
Optimizes how remember handles state within compositions. - OptimizeNonSkippingGroups:
Improves efficiency for composition groups that cannot be skipped. - StrongSkipping:
Enables more aggressive optimizations for recomposition, enhancing performance when certain parts of the UI do not need to be updated.
.
.
.
}
}
kotlin {
jvmToolchain(17)
}
composeCompiler {
featureFlags = setOf(
ComposeFeatureFlag.StrongSkipping
)
}
dependencies {
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.lifecycle.runtime.ktx)
.
.
.