turansky
10/04/2019, 2:26 PM6.4.0
from 6.3.3
doesn't work following JS tests
JS lib (target browser) -> MPP lib (jvm { target 1.8 }, js { browser {} })
If JS lib contains test, than:
Caused by: java.lang.NullPointerException
at org.jetbrains.kotlin.gradle.targets.js.yarn.YarnImportedPackagesVersionResolver.updateVersionsMap(YarnImportedPackagesVersionResolver.kt:79)
at org.jetbrains.kotlin.gradle.targets.js.yarn.YarnImportedPackagesVersionResolver.updatePackageJson(YarnImportedPackagesVersionResolver.kt:71)
at org.jetbrains.kotlin.gradle.targets.js.yarn.YarnImportedPackagesVersionResolver.updatePackages(YarnImportedPackagesVersionResolver.kt:63)
at org.jetbrains.kotlin.gradle.targets.js.yarn.YarnImportedPackagesVersionResolver.resolveAndUpdatePackages(YarnImportedPackagesVersionResolver.kt:29)
at org.jetbrains.kotlin.gradle.targets.js.yarn.YarnWorkspaces.saveRootProjectWorkspacesPackageJson(YarnWorkspaces.kt:51)
at org.jetbrains.kotlin.gradle.targets.js.yarn.YarnWorkspaces.resolveWorkspaces(YarnWorkspaces.kt:35)
at org.jetbrains.kotlin.gradle.targets.js.yarn.YarnWorkspaces.resolveRootProject(YarnWorkspaces.kt:24)
at org.jetbrains.kotlin.gradle.targets.js.yarn.Yarn.resolveRootProject(Yarn.kt:27)
Kotlin 1.3.50
Ola Gawell
10/17/2019, 10:22 AM5.3.1
and kodein 6.3.0
kotlin 1.3.40
Kevin Janvier Chinabalire
10/17/2019, 3:58 PMApplication class
bind() from provider { MyInterface }
and when i use it inside my reposition NextRepository(prival val view:MyInterface) .
I got the below error :
org.kodein.di.Kodein$NotFoundException: No binding found for bind<MyInterface>() with ?<MyMainClass>().? { ? }
Registered in this Kodein container:
Inside my Main Class i have the following :
val view:MyInterface by instance()
What am i doing wrong ?Joan Colmenero
10/18/2019, 2:50 PMbind<MyService>() with singleton {
instance<Retrofit>().create(MyService::class.java)
}
and now I'm wondering if there's a way to avoid doing this
bind<LogniService>() with singleton {
instance<Retrofit>().create(LoginService::class.java)
}
bind<AuthenticationService>() with singleton {
instance<Retrofit>().create(AuthenticationService::class.java)
}
bind<DetailService>() with singleton {
instance<Retrofit>().create(DetailService::class.java)
}
---
Joan Colmenero
10/19/2019, 9:49 AM@Provides
fun provideLoginApi(api: LoginRetrofitApi): LoginApi = api
Joan Colmenero
10/19/2019, 11:02 AMAdrianTodt
10/23/2019, 1:31 PMstreetsofboston
10/25/2019, 5:36 AMjames
10/30/2019, 12:53 AMmust not override an existing binding
error? I am seeing Binding bind<MyRepository>() with ? { ? } must not override an existing binding.
, however there's only one place in a single kodein module where this binding is declared.
is it possible I'm seeing this because this module is somehow being added twice?Joan Colmenero
11/15/2019, 11:14 AMromainbsl
12/04/2019, 12:27 PM1.3.61
- Multi-args factory deprecation, we now recommand to use data class
instead, as one argument. checkout the documentation for examples https://kodein.org/Kodein-DI/?6.5/core#multi-argument-factoriesturansky
12/05/2019, 11:49 PM6.4.1
to 6.5.0
:
1. Kotlin see both versions.
2. Compilation broken - NPE on yarn dependency merge.
Single known WA - remove Gradle caches.krest.mike
12/06/2019, 1:24 PMYardenavirav
12/24/2019, 4:33 PMjames
01/06/2020, 1:07 AMagta1991
01/14/2020, 9:13 PMnrobi
01/22/2020, 9:35 AMAntoine Gagnon
02/12/2020, 2:43 PMFilipe Uva
02/18/2020, 7:26 PMjames
02/24/2020, 4:47 AMbind<Retrofit.Builder>(tag = AuthType.OAUTH) with provider {
Retrofit.Builder()
.client(instance<OkHttpClient>(tag = /* How do I access the tag used above on provider line? */))
.addConverterFactory(JsonConverterFactory())
}
the use case here is that for some cases, the provider block might be many lines, and I don't want to have to repeat the code for each new AuthType
, so I was wondering can I just pass that through, rather than repeat the code each time.
is something like this possible?Marc Knaup
03/13/2020, 6:59 AMinterface A
object B : A
fun main() {
val dkodein = Kodein.direct {
bind<B>() with instance(B)
}
println(dkodein.instance<A>()) // prints object B() <-- this should not resolve!
}
Marc Knaup
03/13/2020, 7:41 AMoverrides = null
and overrides = false
are not documented.
From testing, it looks like that
• true
requires an override
• false
disallows an override
• null
disallows an override
So this doesn’t seem correct:
@param overrides Whether this bind **must**, **may** or **must not** override an existing binding.
I suggest using an enum here for clarity 🙂Marc Knaup
03/13/2020, 11:56 AMval kodein = Kodein.scoped(myScope) {
bind() from singleton { context.createFoo() }
}
If there is already a way that would be great!
If you think it’s worth adding I’ll open an issue.Marc Knaup
03/14/2020, 9:56 AMnull
/ something nullable? 🤔Marc Knaup
03/14/2020, 11:28 AMauthentication
.
But it looks like that the result is cached in the delegate (AuthenticationHolder.authentication
can change).
Is there any way to tell the delegate to always ask for the current instance from the provider?
I don’t want to use .provider()
on the retrieval side to make it a function. That’s supposed to be transparent.Marc Knaup
03/25/2020, 4:41 PMConversationPresenter
singleton per ConversationActivity
instance.Marc Knaup
03/26/2020, 10:45 AMval kodein by kodein()
can be nasty on Android if you forget to import the extension function 😄
https://youtrack.jetbrains.com/issue/KT-37796Nick
04/11/2020, 4:36 AMallInstances
for Javascript at some point?
val instances: List<Foo> = dkodein.allInstances() // not available in JS
If not, what are the limitations w/ Kotlin JS that prevent it? Also, is there a good recommended work-around to get similar functionality by using the container directly?Alex
04/14/2020, 1:05 PMconfigModule
has a bind<Config>() with instance { Config(…) }
binding.
I want to be able to use the instance of Config
in the databaseModule
which was set in the configModule
.
val kodein = Kodein {
import(configModule())
import(databaseModule(instance())
}
The instance()
has a compiler-level warning because it can’t use the KodeinAware.instance()
function - is there a different function to use here? cc: @salomonbrysTobias
04/14/2020, 8:20 PMNot enough information to infer type variable T
when we use val foo: Bar by instance()
. 1.3.71 worked fine for usTobias
04/14/2020, 8:20 PMNot enough information to infer type variable T
when we use val foo: Bar by instance()
. 1.3.71 worked fine for usval foo by instance<Bar>()
works for us in 1.3.72 thoughromainbsl
04/15/2020, 12:29 PMTobias
04/15/2020, 1:25 PMromainbsl
04/15/2020, 1:27 PMTobias
04/16/2020, 4:52 AM