-
-
Notifications
You must be signed in to change notification settings - Fork 700
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Team] Testing Koin 2.0.0 #298
Comments
why do I have to start it in a separate step? Or phrased another way: when would one not want to start it? DSL style:
You are mixing imperative and declarative styles. It think DSLs read nicest when they stick to declarative. i.e. Compare to:
|
ok, yep :) |
Hi! I updated my performance test project with the new alpha: https://github.com/Sloy/android-dependency-injection-performance/compare/koin2 Here are some results in a low end device: Samsung j5nlte with Android 6.0.1 The improvement is huge. There might be room for improvement still, but at least it feels production-ready in terms of performance.
|
Cool. Thanks for your benchmark. |
Hi, here is a new perfs improvments with Here some new perfs, done with the sloy app on my LG G4 (helped me fixed some perfs again):
(seems that Dagger's resolution is already done - should be at least need the time to create all graph object) -- Starting DSL is now like more declarative:
I've have a now introduced the Let's add the Androidx Fragment factory next! I need to make some doc now :) |
@arnaudgiuliani thanks for the tip! I just changed the code an the stats. Nice improvement on alpha-3 👍 👏 |
So far so good. Tested on an app woth (so far) ~350 definitions. Minor changes were required only. |
I've tried 2.0.0 and seems that there is something broken with the scopes. I have a With Koin 2.0.0, when I keep popping the stack by pressing back to return to launcher it crashes with this exception.
I believe that is because Koin has already closed this scope when fragment With Koin |
Scope API is still in progress 👍 |
For Java, can there be @Inject annotation support instead of needing to do this? |
no annotation processing in Koin's target for now. |
One of the reasons I use Koin is to avoid annotation processing. Will it be optional in the planned future releases? |
There is nothing to be made optional, because there is no annotation processing at all. And indeed there should not be (imho). Any such thing could, if one wants it, be made as a seperate library. |
For some reaason the None of the following functions can be called with the arguments supplied. |
I am using the latest Koin version 2.0.0-rc-1 and have a simple test case in my androidTest folder.
I get "A Koin Application has already been started". Is this because my main application class also has a startKoin over there?. |
in our tests, I always call stopKoin before startKoin...don't do it in the @after |
Yes, it is the most relevant reason in case you use instrumented tests (they are executed on android device and thus android application class is instantiated => it causes Koin initialization as a side effect. In unit tests you should initialize Koin by yourself. |
No tests found for given includes: HelloAppTest when I want to run sample test. Can you help please |
java.lang.IllegalStateException: No Koin Context configured. Please use startKoin or koinApplication DSL.`@ExperimentalCoroutinesApi
}` I am getting the below while executing the above test class `java.lang.IllegalStateException: No Koin Context configured. Please use startKoin or koinApplication DSL.
|
try checking that have you registered the Application in manifest file and use androidLogger(Level.ERROR) |
Hello all :)
Koin
2.0.0-alpha-2
has been published in jcenter 👍 Here is how you can test it.Same API But changes import: inject(), get(), getViewModel(), viewModel() ... Also note that you can request by KClass with get() (check function signature)
Scope group declaration
checkModules()
is available on a KoinApplicationKoinApplication.create() .useLogger() .loadModules(koinModule) .start();
Feel free to give your feedback!
Cheers.
The text was updated successfully, but these errors were encountered: