Upgrading from Koin 0.9.x
How to upgrade your code from older version
Changes in DSL
The following functions & keywords have been renamed:
module(declaring a module)
module(declaring a submodule)
single(unique instance definition)
controllerneed your class to be tagged as
Some core functions that have been renamed:
Now you have to specify that a definition or a module will override any existing definition of the same type: overriding definition or module
If you don”t give a name to your definition, Koin will give one, dependeing on class name & path:
you can resolve ComponentA with
From module release to Scope APi
Previous Scopeing API was very confusing. it was mixing namespace modules with scoping capability. In Koin 1.0 we have clearly seperated the 2 aspects: module for namepsace & scope for limited lifetime instances.
0.9.x, moduels also served as pseudo scope support.
Then you could do
release("B") to release instances from module “B”.
1.0, use the
scope definitions to define components that will be bound to a scope (Others that don”t have to be dropped, can stay with single).
Use the Scope APi with a scope to handle your scoped instances:
Injection parameters have been reviewed, check the following documentation: injection parameters
Moving from koin-android-architecture & koin-androidx
For a better readability of features projects, we have decided to deprecate
koin-androidx gradle artifacts. In Koin 1.0, you won’t find those projects but rather those new ones:
Gradle projects have been moved like follow:
You have to fix your imports on your source code with new packages: