If you are 1. *Not* using libraries that themselve...
# kotlinx-datetime
d
If you are 1. Not using libraries that themselves depend on
kotlinx-datetime
0.6.2 or earlier, and are also 2. Planning on upgrading to
kotlinx-datetime
0.7.0, but haven't yet, then you are advised to wait until 0.7.1 comes out in the next few days. 0.7.0 is missing some migration assistance, namely the deprecated-with-warning type aliases
kotlinx.datetime.Instant = kotlin.time.Instant
and
kotlinx.datetime.Clock = kotlin.time.Clock
(https://github.com/Kotlin/kotlinx-datetime/pull/540/commits/f829958a1bcbe7b24a11a91519cf57aaf3daa74b). Without them, your client code will not compile until you replace the usages manually, whereas with them, you will be able to proceed at your own pace (if you are not using libraries that themselves depend on
kotlinx.datetime.Instant
) or even perform automatic replacement with the help of an IDE. This is a glaring omission that I made when publishing the release, and I am sorry about that. The type aliases in 0.7.0 were planned from the beginning, but due to my oversight, were missing from the release.
👍🏽 1
thank you color 3
👍 7
j
I did the migration already but I'm glad to hear a nicer update path was intended and will be available 🙂 Thanks for the update
❤️ 1
e
I became aware of the 0.7 release when CI broke. I tried fixing it with the @ExperimentalTime tag, but bumped against this serialization problem: > Serializer has not been found for type 'Instant?'. To use context serializer as fallback, explicitly annotate type or property with @Contextual The kotlinx Instant was compatible with @Serializable, through kotlinx.datetime.serializers.InstantSerializer. My understanding is that 0.7.1 is going to fix this.
😯 1
d
This issue can be fixed by using kotlinx.serialization 1.9.0 with Kotlin 2.2.0. The IDE will incorrectly highlight some code as red, but the code should still compile: https://github.com/Kotlin/kotlinx.serialization/issues/3026#issuecomment-3018712811