InsertKoinIO / koin

Koin - a pragmatic lightweight dependency injection framework for Kotlin & Kotlin Multiplatform
https://insert-koin.io
Apache License 2.0
8.94k stars 713 forks source link

Make compose artifact accessible for Desktop #1208

Closed malachid closed 1 year ago

malachid commented 2 years ago

Is your feature request related to a problem? Please describe. As the current compose artifact is published as an AAR, it will not work with Jetpack Compose for Desktop. (see https://github.com/JetBrains/compose-jb )

Describe the solution you'd like I have verified that using the ComposeExt.kt within the compose-jb/templates/desktop-template works. I think as a short term solution, we could just publish that class as an additional JAR artifact to enable it's use.

Describe alternatives you've considered I have temporarily copied that file into my project to get past this, but I assume others will run into it as well.

Target Koin project android-compose

egorikftp commented 2 years ago

@arnaudgiuliani do you have plans to publish this in 3.2.0?

arnaudgiuliani commented 2 years ago

Hi there,

yes, the plan is to bring more Compose API for koin, and a dedicated project: https://github.com/InsertKoinIO/koin-compose

The koin-compose project will gather related projects about Compose world.

arnaudgiuliani commented 2 years ago

From Koin 3.2, Compose projects are on their own track

xsveda commented 2 years ago

Anyway, there is no need to ship koin-android dependency as Android AAR, it could be a simple JAR.

We have many modules in our Android project that could be JVM modules that are much faster to compile, but as they have dependency on koin-android they must be declared as "full" Android modules.

arnaudgiuliani commented 2 years ago

Interesting 🤔

arnaudgiuliani commented 2 years ago

Is it a new ticket then?

xsveda commented 2 years ago

Sorry, I was wrong. I have looked through the code in the koin-android module and its dependencies and unfortunately I have to admit that the current AAR format is necessary. Even the androidx.viewmodel itself is shared as AAR and although the koin-android module contains only Kotlin code, because of its dependencies it is not worth trying to isolate it into a JAR library.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Hronom commented 2 years ago

Need koin artifact accessible for Desktop in order to use voyager on desktop https://voyager.adriel.cafe/screenmodel/koin-integration Voyager mention this issue as blocker for desktop support https://voyager.adriel.cafe/setup#platform-compatibility

Please provide solution, since this very needed

kazemcodes commented 1 year ago

it would be great if koin support desktop as well

arnaudgiuliani commented 1 year ago

sure, it's in the pipeline of new features to come 👍

hoc081098 commented 1 year ago

+1 point. Koin should support Jetbrains Multiplatform Compose

arnaudgiuliani commented 1 year ago

koin-compose 1.0 is coming ...

arnaudgiuliani commented 1 year ago

Stay tuned for maven central 👍

joreilly commented 1 year ago

Looks like https://voyager.adriel.cafe/setup van be updated now to remove "missing support" entry?

Screenshot 2023-05-05 at 17 37 06