Hello! I created two issues with some proposals to Koin. Can you provide some feedback, please. <Iss...
a
Hello! I created two issues with some proposals to Koin. Can you provide some feedback, please. Issue one and issue two.
a
yes, can be good to make
bind
DSL stronger ๐Ÿ‘
a
Making
bind
overload with
KClass
parameter type safe is not backward-compatible, so it can be done in 3.x release
But
bind
overload without
KClass
parameter can't be made type-safe without extra verbocity in its usage ๐Ÿ˜Ÿ
๐Ÿ‘ 1
a
letโ€™s check that
a
After some investigation I found, that checking
KClass
of
BeanDefinition
can be done to ensure type safety, but kotlin's reflection is not available in
commonMain
module.
a
yeah, I would avoid kotlin-reflection in main
๐Ÿ‘ 1
a
I created MR to make all other
bind
methods safe. IMHO,
bind
without params may be deprecated, until checking supertype of
KClass
will be available without reflection
a
yep, thanks
a
I have added type check for
BeanDefinition.secondaryTypes
in
checkModules
, so types of
bind
without params now may be checked at compile time by
CheckModulesTest
.
a
checkModules is not covering enough. I believe the key will be around plugin compiler analysis
๐Ÿ‘ 1
a
yes, but such
checkModules
is useful now, when plugin compiler is not available yet
a
for now yes
f
@Alexander Zhdanov hey, I just had a look at your
@inject
ticket. I've been keen on having that too. I'm thirsty to use ksp (as in #ksp channel) to enhance
checkModules
first though, through code generation. I see them as related because one of the ways to do @inject would be generate the graph and code at compile time. Not a small change though.
a
letโ€™s open a thread on #koin-dev ๐Ÿ‘ would be great to start this topic