Repository navigation
0.14.0
Upgrading
This release requires Kotlin 2.4.20, and every project must run ./gradlew stabilityDump once after upgrading and commit the result. Unlike 0.13.0, where refreshing the baseline only mattered for multi-module projects, this one affects everyone.
skippable and restartable verdicts change for real code. With the default failOnStabilityChange = true, stabilityCheck will otherwise fail on the corrected values: skippable: false → true wherever strong skipping applies, and restartable: true → false for open, interface, abstract and local composables. Those restartable transitions are reported as regressions even under ignoreNonRegressiveChanges, because a composable losing its restart group normally is one; here it means the previous value was wrong.
Changed
-
Bumped Kotlin to 2.4.20 (from 2.4.10). Use the same Kotlin version as this library. The compiler plugin, runtime, Gradle plugin, Lint rules and IntelliJ plugin all build against 2.4.20, and all twelve published runtime targets still compile. No stability verdicts change:
stabilityDumpon the sample app produces no diff andstabilityCheckpasses against the committed baselines, so.stabilityfiles do not need refreshing for this bump alone.Unlike the 2.4.10 bump, the Compose compiler's
analysis/Stability.ktis not byte-identical this time. Its one semantic addition is a branch for KEEP-0454 "full value classes" (avalue classwithout@JvmInline), which now reportStablewhen marked@Stable/@Immutable,Unstablewhen abstract, and otherwise the combined stability of their underlying properties. The language feature behind them,FullValueClasses(KT-84904), is not enabled in any released language version and forces pre-release binaries when switched on, and-Xvalue-classeswas removed from the JVM compiler in 2.4.20 — so no code you can ship today reaches that branch. -
The compiler plugin no longer reads
IrAnnotation.symbol, which 2.4.20 deprecates in favour ofclassSymbol+argumentMapping(KT-74200).@TraceRecomposition's arguments and@StabilityInferred(parameters = ...)are now looked up by name throughargumentMappingrather than by position in the annotation constructor — the same move the Compose compiler made for its own@StabilityInferredread in this release. The annotation itself is found withIrAnnotationContainer.getAnnotation, which is the predicate the surroundinghasAnnotationguards already used, so a guard and its reader can no longer disagree about which annotation matched.
Fixed
skippablenow follows Compose's strong skipping semantics. The Compose compiler enables itsStrongSkippingfeature flag by default, and with it on an unstable parameter no longer prevents a restartable composable from skipping (Compose compares such parameters by instance identity). The compiler plugin and the Gradle tasks were still reporting the strong-skipping-off rule, while the IDE already modelled the on rule, so gutter icons and the generated.stabilityfile disagreed about the same function. Measured against the Compose compiler's own metrics on the sample app, 14 of 37 composables (38%) reported the wrongskippablevalue; that is now 0 of 45. A newcomposeStabilityAnalyzer { strongSkipping }option (defaulttrue) mirrors the compiler flag for projects that turn it off.restartablenow matchesshouldBeRestartable(). Added the clauses this plugin was missing:openmembers of non-final classes (including interface methods with a body), abstract declarations, local composables, and composable delegated property accessors. Removed@ReadOnlyComposable, which the Compose compiler does not consult here: aUnit-returning read-only composable is restartable, and the familiar read-only composables are non-restartable because they return a value.- Recomposition durations are no longer lost on comma-decimal locales. The Android and JVM runtimes formatted the duration with the default locale, so on a
de,fr,pt-BR,ru,troriddevice the log line read(1,20ms). The IDE's parser expects a dot, so every duration silently parsed back as0.0: heatmap tooltips lost their timing line and the Stability Doctor's measured waste collapsed to its 1ms floor. Durations now format withLocale.ROOT, matching what the native, JS and Wasm runtimes already emitted, and the parser still accepts the old comma form. - Generic type arguments are honoured for known-stable types.
Pair,Triple,Comparator,ClosedRange, the Guava and kotlinx immutable collections anddagger.Lazycarry a bitmask saying which type arguments must themselves be stable. Ignoring it reportedPair<String, MutableUser>asSTABLE. @StableMarkeris resolved as a rule rather than hardcoded. Any annotation whose own class carries@StableMarkernow marks a type stable, walking supertypes, so a project's own marker annotation works as it does in the Compose compiler.com.google.errorprone.annotations.Immutableis recognised too.- The IDE plugin no longer uses
KaTypeNullability, which the Kotlin 2.5 Analysis API deprecates atHIDDENlevel (an unresolved reference that@Suppresscannot reach). - A blanket fallback no longer overrides the generic-argument masks.
isKnownStableTypecorrectly rejectedPersistentList<MutableUser>, but akotlinx.collections.immutable.*rule further down the chain then reported itSTABLEanyway. The fallback now skips names the mask table already owns. - Boolean compiler options are parsed strictly.
String.toBoolean()maps every value that is nottruetofalse, sostrongSkipping=treusilently inverted the option and produced verdicts that disagree with the compiler.enabledandtraceAllhad the same hole; all three now fail on anything other thantrueorfalse.
Note for contributors
The compiler-tests golden IR dumps moved from <name>.fir.kt.txt to <name>.kt.txt. Kotlin's test framework used to prefix fir. to tell K1 dumps apart from K2 ones; K1 is gone in 2.4.20, so the qualifier went with it. The file contents are unchanged, which is the evidence that the IR this plugin generates is identical between 2.4.10 and 2.4.20.
kotlin-js-store/yarn.lock was regenerated with ./gradlew kotlinUpgradeYarnLock, since a Kotlin bump moves the JS toolchain's npm dependencies and :stability-runtime:build fails on :kotlinStoreYarnLock otherwise.