Badges: [UPDATED]
, [FIXED]
, [ADDED]
, [DEPRECATED]
, [REMOVED]
, [BREAKING]
Android
[UPDATED]
- rework startking DSL to add extension in startKoin
Android-Scope
[UPDATED]
- rework according to new Scope API (manage compelte Scope Lifecycle)[ADDED]
- scope tied to current Activity or Fragment (getActivityScope, getFagmentScope)
Android-ViewModel
[ADDED]
- support for scopes[REMOVED]
koin-ext builder
Core
[UPDATED]
- startKoin replaced with startKoin DSL and koin in global context[UPDATED]
- complete internals rewritten for performances optimisation[ADDED]
- koinApplication function to help declare an instance for a local context, in ordoer to help isolated Koin instances[UPDATED]
- rework Scope API (DSL, multiple instances definitions, properties, release, callback ...)[ADDED]
- onClose, onRelease DSL on single/factory/scoped to execute code when releasing instance or stopping container[ADDED]
- getProperty with default value[UPDATED]
- Kotlin 1.3.21
Core-Ext
Test
[UPDATED]
- rework testing API, codebase detached from internal core tests
Ktor
[UPDATED]
- rework startking DSL to add extension in startKoin
Spark
[REMOVED]
project non supported anymore
Android
[FIXED]
Fixed bug with appCompat v26 InsertKoinIO#268[ADDED]
Android debug logs shut off InsertKoinIO#251
Android-Scope
[UPDATED]
Better scope management when associated to a lifecycle InsertKoinIO#235
Android-ViewModel
[FIXED]
Proguard Warning InsertKoinIO#267
Core
[UPDATED]
- Updated KoinComponent interface to allow easily add a custom Koin instance InsertKoinIO#224[UPDATED]
- Allow nullable injection params InsertKoinIO#242[UPDATED]
- Add instance for a dedicated scope InsertKoinIO#277[FIXED]
Documentation Typo fixed InsertKoinIO#263[FIXED]
Fixed Scope toString in debug InsertKoinIO#240
Core-Ext
[FIXED]
Add scopeId param in experimental API builder InsertKoinIO#252
Test
[UPDATED]
Review declareMock to add mock lambda expression InsertKoinIO#243[FIXED]
Fixed params injection with checkModules InsertKoinIO#274
Android
[FIXED]
-koin-android-viewmodel
&koin-androidx-viewmodel
parameter & factory review - InsertKoinIO#236
Core_
[UPDATED]
- compilation with Kotlin 1.2.70[ADDED]
- new Scope API[FIXED]
- fixed scope visibility resolution - InsertKoinIO#228[FIXED]
-koin-android-viewmodel
parameters leak
Core-Ext
[ADDED]
- Renamedkoin-reflect
tokoin-core-ext
Android
[FIXED]
-koin-android-viewmodel
parameters leak fixed - InsertKoinIO#220[ADDED]
-koin-android-viewmodel
addedviewModel
automatic builder keyword[FIXED]
-koin-android
added backandroidApplication()
[ADDED]
-koin-android-scope
updatedbindScope
function now bind aScope
Test
[FIXED]
-check()
renamed tocheckModules()
Scripts
[UPDATED]
- rework all gradle structure and scripts - #126[ADDED]
- asciidoc integration - #127[ADDED]
- CI integration with CircleCI
Core
[UPDATED]
- compilation with Kotlin 1.2.50[UPDATED]
- Update DSL keywords:module
&single
(replacesapplicationContext
,context
&bean
) - #131[FIXED]
- Fixed Scope API, aka module visibility resolution[ADDED]
- SLF4J Logger implementation (koin-logger-slf4j
), used bykoin-spark
&koin-ktor
- #130[FIXED]
- Resolution & error check/catch for display - #110[FIXED]
- BeanDefinition equals()[FIXED]
- Instance creation error display - #124[UPDATED]
- logging tree resolution (with debug data if needed)[ADDED]
- asciidoc doc updated - #121 - #100 - #102 - #103[UPDATED]
- Injection parameter API with destructured declaration - #133[ADDED]
- Preload instances withcreateAtStart
- #141[UPDATED]
- Explicit bean/module overide - #123[FIXED]
- bind operator check assignable types
Test
[ADDED]
- asciidoc doc[ADDED]
- check() feature to check all configuration (does not create instances like dryRun)[ADDED]
- declare mock or other definition out of the box withdeclareMock
&declare
- #151 - #119
Android
[BREAKING]
- Package & project renaming ->koin-android
,koin-android-scope
&koin-android-viewmodel
- #144[REMOVED]
- bindString(), bindBool() & bindInt()[ADDED]
- asciidoc doc[ADDED]
- support AndroidX packages withkoin-androidx-scope
&koin-androidx-viewmodel
- #138 - #122 - #154[ADDED]
- scoping feature with Android lifecycle withkoin-android-scope
- #142[UPDATED]
- Open startKoin() for other Android context & useContext
instead ofApplication
- #156[FIXED]
- ViewModel factory instance creation bugfix - #145[FIXED]
- ViewModel factory injection params leak - #149[UPDATED]
- androix version to2.0.0-beta01
Ktor
[ADDED]
- asciidoc doc[ADDED]
- usekoin-logger-slf4j
[UPDATED]
- ktor0.9.2
[ADDED]
- addRoute
&Routing
class extensions - #128
Spark
[ADDED]
- asciidoc doc[ADDED]
- usekoin-logger-slf4j
[UPDATED]
-controller
keyword now need your class to extendSparkController
Java
[ADDED]
- addkoin-java
project - #106[ADDED]
- asciidoc doc
Reflect
[ADDED]
- addkoin-reflect
project[ADDED]
- addbuild()
DSL function to allow smarter way of building definition[ADDED]
- asciidoc doc
Website
[ADDED]
- Doc integration[ADDED]
- Getting started integration[FIXED]
- Kotlin slack URL - #125
Samples
[ADDED]
- Addedexamples
folder, gathering examples application[ADDED]
- Thermosiphon example - #116
Gradle & Continuous Integration
version published with new build chain
Core
[UPDATED]
build updated to Kotlin 1.2.31[UPDATED]
dissociate overload with dynamic parameters onget()
andinject()
for better autocomplete suggestions[FIXED]
fixstartKoin()
property loading from booleanloadProperties
[FIXED]
inject by name take now care of injected type #92
Android
[FIXED]
startKoin()
doesn't break RestrictMode anymore and you can avoid properties load directly from koin.properties #96[UPDATED]
dissociate overload with dynamic parameters onget()
andinject()
for better autocomplete suggestions
Android Architecture
[UPDATED]
dissociate overload with dynamic parameters onviewModel(),
getViewModel()and
getSharedViewModel()` for better autocomplete suggestions[UPDATED]
now exclude gradle dependency againstLiveData
Samples
FIXED
Ktor hello appp sample
DSL
[FIXED]
Parameter propagation - You can now reuse params inget()
to propagate it #66
Core
[ADDED]
Parameters are now expressed via Kotlin function to allow lazy evaluation #67[UPDATED]
Parameter propagation #66[FIXED]
Stack resolution engine fixed #72[FIXED]
Better Logs, Error & Stacktraces[FIXED]
Properties loading from externalproperties
file can read values as String/Integer/Float
Android
[ADDED]
get()
direct dependency eager fetching function for Activity/Fragment/Service #78
Android Architecture
[ADDED]
To help misuse the Koin ViewModel API, we introduce thegetSharedViewModel()
andsharedViewModel()
from Fragment, to reuseViewModel
from parentActivity
.getViewModel()
andviewModel()
now createsViewModel
instance (noFromActivity
parameter anymore)[UPDATED]
ViewModel factory logs to see what Activity/Fragment is gettingViewModel
instance
DSL
[DEPRECATED]
-provide
- can be directly replace withbean
[UPDATED]
-bean
andfactory
can now usebind
[ADDED]
- defintion function insidebean
orfactory
can now have parameters
Core
[FIXED]
Context resolution and modulePath isolation reworked - now fully functionnal[FIXED]
Stack resolution[ADDED]
StandAloneContext
functionloadKoinModules
to load Koin modules wether Koin is already started[ADDED]
StandAloneContext
functionloadProperties
to load Koin properties wether Koin is already started[ADDED]
by inject()
function handle parameters to definition (#59)[FIXED]
Logging with class name need introspection[ADDED]
Context lifecycle notification callback - to allow a callback whenreleaseContext()
is called on a context. You can register withStandAloneContext.registerContextCallBack()
(#58)
Android
[FIXED]
StartKoin have alogger
parameter, with default as AndroidLogger(), to allow specify logging implementation to use with Koin (#50) - allow no logging at startKoin of logger is set toEmptyLogger()
[ADDED]
by inject()
function handle parameters to definition (#49)
Android Architecture
[FIXED]
fix viewModel extensions rewritten fromLifecycleOwner
interface[FIXED]
fixby viewModel()
API to allow use KClass object argument instead of type inference - offers nowgetViewModelByclass()
andviewModelByClass()
(#56)[ADDED]
by viewModel()
function handle parameters to definition (#49)[ADDED]
by viewModel()
function handle key instance for Android ViewModelFactory (#49)
Core
- fix internal instance registry due to compat error with Kolin
1.1.61
&1.2.21
- broke Koin API for app using jdk 7 under the hood - issue #43
Android Architecture
by viewModel()
lazy function call thegetViewModel()
function and allowval
attribute declaration of yourViewModel
(like withby inject()
) - (issue #37)- Better support to share
ViewModel
between Activity and Fragments android.arch.lifecycle:extensions
updated to1.1.0
Spark
startSpark {}
has been renamed tostart {}
and have amodules
arguments to list all of your modulesstart()
andstartKoin
has been merged tostart( modules = <List of modules>)
stopSpark{}
has been renamed tostop {}
and includecloseKoin()
Core
- Kotlin
1.2.21
- Internal fixes around Bean definition lookup / Duplicated defintion (issue #39)
- Fixed loading from koin.properties (for embedded jar)
Android Architecture
viewModel
DSL keyword (specializedprovide
alias for ViewModel), to declare an Architecture Components ViewModelgetViewModel()
function in Activities and Fragments, to get and bind ViewModel components
Spark
controller {}
DSL keyword (specializedprovide
alias), to declare Spark controllers classesstart() {}
function to start Spark server (optional port number) - lambda expression to allow the start of Koin and any controller instantiationrunControllers()
function to instantiate all spark controllers, declared withcontroller
keyword DSL
Core
- Better logging and error display
- Some fixes about internals resolution for bound types
Kotlin compilation has been updated to 1.1.61
Core
- Simplified DSL modules: no more need of
Module
class. Now use directly theapplicationContext
function - Default Koin Logger to
PrintLogger
instead ofEmptyLogger
- a definition can be overriden (with a definition same name and type)
- DSL
provide
aliases withbean
andfactory
- direct interface binding writing style (avoid to use
bind
keyword) - Koin instances resolution is now thread safe and compatible with coroutines
- starter chain reviewed to allow better extension of
startKoin()
- better logs to display how instance and reoslution are made
- Context isolation disabled by default. Can be activitaed later
Android
- Default Koin Logger to
AndroidLogger
instead ofEmptyLogger
- No need anymore of
AndroidModule
, just useapplicationContext
to declare a module - Android extensions have been reworked to avoid need of support Library
androidApplication()
is a DSL extension to provide AndroidApplication
resolution (can also be done withget<Application>()
)
Samples
- Updated Android weather app, with multiple Activity and better demo for property usage
- Simple Kotlin app sample added
## [0.6.1]()
Core
- Added context/sub-contexts visibility checks
startKoin()
is now part of standAloenContextcloseKoin()
now close actual Koin contextKoinComponent
hasget()
andgetProperty()
Android
- reworked
starKoin()
function - reviewed android base extensions to find high-level extension point
Samples
- added kotlin-simpleapp - sample application for pure Kotlin
- added ktor-starter - for demoing Koin for Ktor web app development
Ktor
- koin-ktor module has been started
The target of this release was to simplify and make clearer the syntax of Koin.
DSL
getProperties
can now have a default value
Core
-
Stand alone complex & KoinComponent have been reviewed
-
renamed startContext functions to
startKoin()
-
KoinComponent
- inject/property
- setProperty
- release context or properties
- startKoin
-
Koin can load properties from koin.properties file or system properties
-
startKoin()
have now aproperties
parameter to give additional properties at startup
KoinTest
- directly extends
KoinComponent
- context assert/test tools & extensions
dryRun()
is usable in a Kointest component, after astartKoin
Android
- fix/better extensions for Android
bindProperty()
renamed tosetProperty()
startAndroidContext()
has been renamed tostartKoin()
- ContextAware Components can be configured for drop stratgey (onDestroy or onPause). Default method is onPause
- load assets/koin.properties if present
Core
getProperty()
can provide a default value if key property is missingprovide()
can be use on a KoinContext directly, to declare on component
Android
applicationContext
has been renamedandroidApplication
Core
- property value set does not allow Any? value
- starters builder have been moved to [test] & [android]
- removed base starter
Android
- starter builder extension for Application class only
Tests
- starter builder extension for KoinTest class only
javadoc is now generated with Dokka
Core
- Koin now provide a stand alone context support to provide koin context in an agnostic way
startContext
function to start a Koin context- property injection/resolution is now strict. Property injection is not nullable anymore
koinContext.removeProperties()
remove properties by their keys- Simple logger to help logging/debugging
Android
startAndroidContext
function to start an Android Koin contextKoinContextAware
interfaces have been removed- Koin/Android extensions greatly simplified
- packages have been moved - need reimport for AndroidModule,
by inject
andby property
ContextAwareActivity
&ContextAwareFragment
are components to help you automatically release contexts - don't hesitate to do it manually
Tests
- Creation of 'org.koin:koin-test:' module, provide testing feature about Koin
Koin DSL has been reviewed to be more easy to understand, and allow easy writing of modules. No need anymore of several module classes, you can now include subcontexts in one module. You can now provide factory components, and bind is simpler to write.
The dry run feature, allows to run all of you modules in order to check if dependency graph is complete.
DSL
- replaced
declareContext{}
has been renamedapplicationContext{}
, and behind gives a better idea that you are describing your application context (the root context of your app) - Updated
modulePath(){}
has been dropped forcontext(){}
- context describes a sub context of your application, has a a name and can have also sub context itself (sub contexts are hierarchicals) - Updated
bind{}
doesn't need lambda anymore to declare your bound class, but just the class in argument:bind()
- Added
provideFactory
is a DSL keyword to provide a factory definition instead of singleton
Core
- Updated
KoinContext.release()
is now called with context's name, no owner class instance - Added
KoinContext.dryRun()
help to run your modules and check if every dependency can be injected
Sample App & Android
- updated for the new core update
Core
- Kotlin 1.1.51
- Removed all loggers - rethinking of better Log/API
Android
- KoinContext function builders : newKoinContext & lazyKoinContext
- KoinContextAware interface now has a property, instead of a getter - better to overload
Sample App
- moved to folder koin-sample-app
Core
- Kotlin 1.1.50
- KoinContext / Context - simplified operator injection (removed all nullable inject/get)
- KoinContext.get() can make Injection by name
- Koin.build() can now build a list of Module
DSL
- Context.get() can now provide a definition with a name
- Context.get() operator have a bind property, to specify list of compatible interfaces to bind - is an alternative to bind {} operator
Android
- Merge android & android-support modules
- inject() can't be null anymore
- inject() can inject component by its name
- property() can do property injection - can be nullable data
Sample App
- Sample app (Weather demo application) has been reviewed to be more complete : Full MVP example, RxJava Scheduling, Unit Tests with partial modules loading & mocks
Koin & Koin-Android project has meen merged
DSL
- Module/AndroiModule class must now give a
context()
function implementation, to return a Context object. ThedeclareContext
function unlock the Koin DSL to describe dependencies and injection:
class MykModule : Module() {
override fun context() = declareContext { ... }
}
- You can now bind additional types for provided definitions
class MykModule : Module() {
override fun context() = declareContext {
provide { Processor() } bind { ProcessorInterface::class}
}
}
Scope
- You can declare/reuse paths in your modules, with
modulePath {}
operator. See paths section - Release modulePath instances with
release()
on a KoinContext
class MainActivityModule : Module() {
override fun context() =
declareContext {
// Scope MainActivity
modulePath { MainActivity::class }
// provided WeatherService
provide { WeatherService(get()) }
}
}
Android
KoinAwareContext
interface used to setup Android application (KoinApplication & KoinMultidexApplication are removed)
class MainApplication : Application(), KoinContextAware {
/**
* Koin context
*/
lateinit var context: KoinContext
/**
* KoinContextAware - Retrieve Koin Context
*/
override fun getKoin(): KoinContext = context
override fun onCreate() {
super.onCreate()
// insert Koin !
context = Koin().init(this).build(MyModule())
// ...
}
}
by inject<>()
function operator to inject any dependency in any Activity or Fragment
class MainActivity : AppCompatActivity() {
// inject my WeatherService
val weatherService by inject<WeatherService>()
}
Koin
- Koin builder takes module instances (instead of module classes):
// fill applicationContext for Koin context
val ctx = Koin().init(applicationContext).build(Module1(),Module2()...)
Internal rework for simpler use with Scopes:
Koin().build()
return KoinContext- factory, stack operators have been removed, for the modulePath fatures
- delete/remove replcaed with
release()
Scope operation - import is replaced with module instances load
- All reflection & kotlin-reflect code have been removed