moving forward to Kotlin 2.0 #80
atsushieno
started this conversation in
General
Replies: 1 comment
-
In case anyone is curious about it:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As Kotlin 2.0 went stable last week, I will be migrating ktmidi to K2.
This should not affect "most" of existing apps. ABI is compatible with K1. However some of you might experience build issues.
Here is what I have experienced - I have migrated ktmidi locally to build with K2 (KMP plugin which means stdlib is also migrated, new compose compiler plugin, etc.) and referenced it from my text-to-midi compiler project which did not migrate to K2 but bumped my K2-based ktmidi. It failed to build due to a compiler crash caused by some type resolution in its wasmJs build.
Now I have to make a decision:
Fortunately I have no reason to not to migrate so it is not a real problem. I don't expect the Kotlin team to fix wasmJs build issue in K1 as wasmJs target has been at "alpha" or "preview" state.
If I could not migrate to K1 for some reason e.g. some dependencies cause build failure with K2 (especially when they depend on Gradle plugins), it would have been problematic, so I take it as non-realistic.
I wondered, should I stay with kotlin 1.9.2x? But ktmidi also references Compose Multiplatform, and its future versions will require K2 compiler plugin. The build model has changed. Compose Multiplatform itself is stable and JetBrains may keep it compatible with K1 for a while, but I guess it would not be likely a stable combination.
So, I think while K2 is designed to be ABI compatible and offer smooth migration, but I assume that it will bring in a bit of diverge in K1 and K2 world. To make things worse, the Gradle dependency solution is awkward and could bring in mysterious failures. In the worst case scenario, I may have to build and ship ktmidi (and all the relevant libraries) for both K1 and K2, but that's a hypothetical story.
Beta Was this translation helpful? Give feedback.
All reactions