Hey Composers! I'm a little confused with the comp...
# compose
Hey Composers! I'm a little confused with the compatibility between Kotlin, Compose Compiler and Compose Libraries. There is a table of compatibility: https://developer.android.com/jetpack/androidx/releases/compose-kotlin Is this an exact compatibility requirement? For instance, do I have to use exactly Compose Compiler 1.3.2 with Kotlin 1.7.20? I obviously can't use the newer Compose Compiler 1.5.1 with Kotlin 1.7.20, that much is clear. But can I use Compose Compiler 1.3.2 with newer versions of Kotlin? Is there some kind of backward compatibility? Also, I think I can use newer Compose Compiler with older Compose Library versions - is that correct?
As far as i tested it must be an exact match. In my opinion this is also one of the biggest downsides of compose.
but the compiler plugin API is supposed to be stable to allow backward compatibility, is it not yet?
it would be interesting to know if it is planned that this exact match will be removed at any time. Because it prevents you from using newest kotlin version when no matching compose compiler is available.
Well, it's probably not such a major downside, because according to this https://android-developers.googleblog.com/2022/06/independent-versioning-of-Jetpack-Compose-libraries.html the Compose Compiler can be upgraded independently of runtime libraries, so I can "stay" on Compose 1.3.2 libraries even with a new version of Compose Compiler
You can use newer compiler with older compose library versions I’m pretty sure that’s correct. Kotlin version <-> compose compiler is the thing that you want to have the correct 1:1 mapping on. And since you can bump the compose compiler pretty freely considering it’s not tied to the compose libraries, the thing you should do is just bump Kotlin as you would, and have your compose compiler go along with it. With the only stop there being if a new kotlin version exists but a compose compiler isn’t out yet
👍 1
Afaik this happens because compose compiler is a kotlin compiler plugin, which does not expose a stable API, therefore on each Kotlin update, the compose compiler needs to explicitly catch up to the changes to continue working. If any compiler version works with a different Kotlin version than advertised, it would be out of luck and not by design.
Is this expected to change after K2? I (maybe mis-) understand that K2 compiler plugin API will be stabilized so this 1:1 match necessity may be relaxed