arkivanov / Essenty

The most essential libraries for Kotlin Multiplatform development
Apache License 2.0
465 stars 15 forks source link

Use KMP androidx lifecycle #157

Open b95505017 opened 4 months ago

b95505017 commented 4 months ago

It looks like androidx lifecycle supports KMP now. https://developer.android.com/jetpack/androidx/releases/lifecycle#2.8.0-alpha02

The core Lifecycle APIs in Lifecycle, LifecycleOwner, LifecycleObserver, Lifecycle.State, Lifecycle.Event, and LifecycleRegistry are now shipped in artifacts compatible with Kotlin Multiplatform.

arkivanov commented 4 months ago

We need to wait until all targets are supported. Also I need check some details like how it will work with Decompose. And what are the actual benefits compared to the current solution. Might not get to the 2.0 release.

b95505017 commented 4 months ago

Sure. Maybe related to this discussion: https://github.com/JetBrains/compose-multiplatform-core/pull/1043

arkivanov commented 3 months ago

We'll also need to wait for an official announcement, and appearance in the Multiplatform Jetpack libraries list.

b95505017 commented 3 months ago

It seems that the page you mentioned lacks of maintenance. KMP libraries such as Paging, Lifecycle, ViewModel aren't listed.

arkivanov commented 3 months ago

I've checked with folks already, the page is up to date. I think those libraries are intentionally not listed yet.

PMARZV commented 3 months ago

any guesses why??

arkivanov commented 3 months ago

Nope. I think we just need to wait.

arkivanov commented 2 months ago

The KMP version of AndroidX Lifecycle with additional targets is now published by JetBrains. However, some targets required by Essenty are still not supported. Currently missing targets are: watchos and tvos.

Filed: https://github.com/JetBrains/compose-multiplatform/issues/4645.

arkivanov commented 2 months ago

All required targets are now supported in the KMP version of AndroidX Lifecycle. Will try soon-ish.