Kamel-Media / Kamel

Kotlin asynchronous media loading and caching library for Compose.
Apache License 2.0
637 stars 24 forks source link

Remove unused dependencies from classpath #19

Closed Syer10 closed 2 years ago

Syer10 commented 2 years ago

I noticed that some weird/oudated dependencies were showing up in my classpath like Ktor CIO and Ktor Android clients. I use OkHttp as my ktor backend. Since Kamel is a library its not supposed to implement things like Ktor Logging and CIO or other ktor client backends and leave that to the user.

I cleaned up any other unneeded depencencies I found in the files.

alialbaali commented 2 years ago

While I agree with you, don't you think there should be some default clients added? So, the user can only add the dependency for the library and can immediately use it, without having to look for other dependencies.

Syer10 commented 2 years ago

Nope, libraries that use ktor are meant to only include the dependencies it needs. Adding engines only make Ktor confused.

When using Ktor in a muliplatform way, the default HttpClient constructor(with no engine specified) uses whatever engine is implemented on the current platform, but this is broken when libraries start including thier own engines. You could add this link(https://ktor.io/docs/http-client-engines.html) to the readme to make up for this.

alialbaali commented 2 years ago

Okay, no problem then. Could you update the README by adding a link to the Ktor page containing the engines?

Thanks.

Syer10 commented 2 years ago

Done 👍

alialbaali commented 2 years ago

Thanks!