Hey there! Has anyone got Koin to work with script...
# scripting
t
Hey there! Has anyone got Koin to work with scripting? I can't seem to figure out how to make the scripts use Global Context visible to the compiler. Any suggestion on how I could achieve that?
a
Why do you need DI in scripting?!!
t
I'm trying to make dynamic modules for my app as currently I have to load stuff manually and modules can't be unloaded or loaded again at runtime
And my modules require DI to get their dependencies
a
OK, but why do you need to acces everethung from script? It is not meant for those types of activities. You can define anything in mother application, which runs a script.
t
My intent is so provide a module definition scope with which I can define my dynamic modules and use DI to get only the components I need for that specific module. I could expose all components to the DSL but that would kinda defeat the purpose of having DI
t
Well, my intention is to be able to inject stuff onto the module I'm dynamically evaluating and not actually defining beans and stuff in the script
c
I'm not super familiar with Koin, but it seems that to be processed by it components have to be in a module. I may be mistaken, but in that case the loadModules stuff is still relevant, you could maybe follow the code and see how stuff works under the hood and if there is a way for you to get what you need.
t
Ye, modules are being loaded, but the scripts are not able to fetch the registered components
😕 1