koin icon indicating copy to clipboard operation
koin copied to clipboard

Ktor 3.0 support

Open lexa-diky opened this issue 1 year ago • 24 comments

Is your feature request related to a problem? Please describe. JB recently released Ktor 3.0.0-betta1. Currently Ktor does not support it, JB changed API. In particular access to monitor now done via Application not Environment, maybe there is more incompatibilities.

Describe the solution you'd like Separate ktor-3 module to have both ktor 2.* and 3.*

Target Koin project ktor

lexa-diky avatar Nov 27 '23 05:11 lexa-diky

Can second this, but I would prefer a simple dependency upgrade instead of separate artifact

Nek-12 avatar Dec 03 '23 19:12 Nek-12

The workaround for now is to copy everything from the koin Ktor sources and fix the compile time error

Nek-12 avatar Dec 13 '23 08:12 Nek-12

If koin goes with single module approach, it will break comp with ktor-2, and I guess bunch of people will not update for a while

lexa-diky avatar Dec 13 '23 10:12 lexa-diky

The only updates for the past months have been dependency updates... The whole library is 2 files

Nek-12 avatar Dec 13 '23 19:12 Nek-12

Yes, great topic coming 👍

arnaudgiuliani avatar Dec 13 '23 21:12 arnaudgiuliani

Can you please add ktor 3.0 support first before you refactor, add new stuff, and break something with the update you described in your article? @arnaudgiuliani

Changing one line of code, that is, so that we don't wait till Q4 2024 for this to get fixed

Nek-12 avatar Dec 25 '23 08:12 Nek-12

something I can setup for 3.6.0 - Q1 Seems that we need to separate both ktor & ktor3

arnaudgiuliani avatar Jan 25 '24 09:01 arnaudgiuliani

Is there any solution now?

FlyingYu-Z avatar May 06 '24 06:05 FlyingYu-Z

@arnaudgiuliani I would appreciate a solution for this, as I am currently unable to use SSE (server sent events) in my application due to it only being supported in Ktor 3.0.0. Let me know if I can speed up the work, maybe by making a PR?

JoonasC avatar Jun 29 '24 13:06 JoonasC

I'm am interested in this as well and will be watching for updates.

fluxxion82 avatar Aug 02 '24 00:08 fluxxion82

@fluxxion82 Just copy all sources of the Ktor module to your project. This hasn't been addressed in almost a year and the author has no intention of doing so.

Nek-12 avatar Aug 02 '24 05:08 Nek-12

it would be nice to get support for this

KevinMeneses avatar Aug 03 '24 04:08 KevinMeneses

Still waiting for this. No solutions of as of yet?

hashir1296 avatar Aug 14 '24 16:08 hashir1296

Like I said, just copy and paste all sources of Koin-ktor module into your project and fix the breaking changes. Already using this approach in prod

Nek-12 avatar Aug 14 '24 16:08 Nek-12

Like I said, just copy and paste all sources of Koin-ktor module into your project and fix the breaking changes. Already using this approach in prod

Pardon but can you please briefly describe what do you mean by this? Earlier we were using koin as:

install(Koin) {
        slf4jLogger()
        modules(appModule)
    }

How do i migrate from this?

hashir1296 avatar Aug 14 '24 18:08 hashir1296

Like I said, just copy and paste all sources of Koin-ktor module into your project and fix the breaking changes. Already using this approach in prod

Pardon but can you please briefly describe what do you mean by this? Earlier we were using koin as:

install(Koin) {
        slf4jLogger()
        modules(appModule)
    }

How do i migrate from this?

Figured it out, basically

  1. Goto this link: https://github.com/InsertKoinIO/koin/tree/main/projects/ktor/koin-ktor
  2. Manually copy/paste all files under koin-ktor package (I copied only KoinPlugin)
  3. In your install block, use your koin plugin instead of ktor's

Warning: This is a workaround, with this:

  1. You will lose out on future Ktor or Koin updates
  2. You’ll need to keep an eye on both the Koin and Ktor projects for official updates that may render this workaround obsolete.

hashir1296 avatar Aug 14 '24 21:08 hashir1296