0.6.0
Update dependencies
Removed
- Remove now-unsupported targets:
iosArm32
,watchosX86
.
viewmodel
-
MutableCreationExtras
has been renamed toMutableCreationExtrasBuilder
,
and it does not inherit fromCreationExtras
anymore.
Because of this, a new method
MutableCreationExtrasBuilder.asCreationExtras()
has been introduced can be used to convert
a builder back toCreationExtras
as needed.NOTE:
buildCreationExtras
andCreationExtras.edit
methods are still the same as before.// Old version (0.5.0) val creationExtras: CreationExtras = MutableCreationExtras().apply { // ... } // New version (0.6.0): `MutableCreationExtras` does not inherit from `CreationExtras` anymore. val creationExtras: CreationExtras = MutableCreationExtrasBuilder().apply { // ... }.asCreationExtras() // <--- asCreationExtras: convert a builder back to `CreationExtras` as needed.
More details: with Kotlin 1.9.20, an expect with default arguments are no longer
permitted when an actual is a typealias
(see KT-57614),
we cannot
useactual typealias MutableCreationExtras = androidx.lifecycle.viewmodel.MutableCreationExtras
.
So we have to use wrapper class instead. -
Update the docs of
ViewModel.viewModelScope
to clarify that the scope is thread-safe
on both Android and non-Android targets. -
On non-Android targets
ViewModel.clear()
method has been refactored to improve the performance.- Any
Exception
thrown fromCloseable.close()
will be re-thrown asRuntimeException
.