1 Star 0 Fork 6

风中传说 / koin

forked from Gitee 极速下载 / koin 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
CHANGELOG.md 36.92 KB
一键复制 编辑 原始数据 按行查看 历史

Change Log

Badges: [UPDATED], [FIXED], [ADDED], [DEPRECATED], [REMOVED], [BREAKING]

2.2.0

2.2.0-rc-3

  • [FIXED] Fix Scoped Components (ScopeActivity, ScopeFragment & ScopeService) to keep scope lazy and avoid forced initialisation

2.2.0-rc-2

  • [FIXED] AndroidX ViewModel API merge for stateViewModel. No need anymore to pass Bundle as injected parameters, jsut use get()
  • [FIXED] Resolution API to precise generic type to Any

2.2.0-rc-1

  • [ADDED] JetNews Compose app example

2.2.0-beta-2

Updated to kotlin 1.4.10

koin-androidx-scope

  • [FIXED] added scopeActivity & requireScopeActivity() API on ScopeFragment

koin-androidx-compose

  • [ADDED] New API to inject Jetpack Compose: get(), by inject(), getKoin()
  • [ADDED] New API to inject Jetpack Compose with ViewModel: getViewModel(), by viewModel()

koin-androidx-workmanager

  • [ADDED] New API to declare your ListenableWorker with worker { } DSL
  • [ADDED] KoinWorkerFactory wired to the standard WorkManagerFactory, to let build declared component. Use workManagerFactory() in your KoinApplication DSL to setup the WorkManagerFactory. (nb: tedious to checkModules - as it depends on android internals)

koin-core

  • [ADDED] KoinExtensionAPI: annotation for tagging Koin API usage. i.e: KoinComponent requires OptIn, as it's part of Koin API extension
  • [FIXED] turn all API to internal as possible

koin-test

  • [FIXED] revert AutoCloseKoinTest to class, add ClosingKoinTest interface

2.2.0-beta-1

koin-androidx-scope

  • [ADDED] New ScopeActivity. ScopeFragment, ScopeService to enable Scope API direclty into Android components. Offers injection directly from tied Scope.
  • [BREAKING] Old Scope API extensions are deprecated: scope, lifecycleScope

koin-android-scope

  • [ADDED] New ScopeActivity. ScopeFragment, ScopeService to enable Scope API direclty into Android components. Offers injection directly from tied Scope.
  • [BREAKING] Old Scope API extensions are deprecated: scope, lifecycleScope

koin-androidx-viewmodel

  • [ADDED] New ViewModelOwnerDefinition API definition for lazy define ViewModelStore & SavedStateRegistryOwner
  • [BREAKING] rewrite ViewModel API to better use StateViewModel factory and allow to use ViewModelOwnerDefinition = () -> ViewModelOwner ViewModelOwner lazy definition. Bundle is now used as state lazy attributes, BundleDefinition = () -> Bundle
  • [ADDED] verification to help check parameter injection for SavedStateRegistryOwner, as the right argument (misplaced injection param)
  • [ADDED] New ViewModelOwnerDefinition API definition for lazy define ViewModelStore & SavedStateRegistryOwner
  • [BREAKING] rewrite ViewModel API to better use StateViewModel factory and allow to use ViewModelOwnerDefinition = () -> ViewModelOwner ViewModelOwner lazy definition. Bundle is now used as state lazy attributes, BundleDefinition = () -> Bundle
  • [ADDED] verification to help check parameter injection for SavedStateRegistryOwner, as the right argument (misplaced injection param)

koin-android-viewmodel

  • [ADDED] New ViewModelOwnerDefinition API definition for lazy define ViewModelStore
  • [BREAKING] rewrite ViewModel API and allow to use ViewModelOwnerDefinition = () -> ViewModelOwner ViewModelOwner lazy definition
  • [ADDED] New ViewModelOwnerDefinition API definition for lazy define ViewModelStore
  • [BREAKING] rewrite ViewModel API and allow to use ViewModelOwnerDefinition = () -> ViewModelOwner ViewModelOwner lazy definition

koin-core

  • [FIXED] fixed time API - Kotlin 1.4
  • [ADDED] New KoinScopeComponent to help build component with Koin scopes
  • [REMOVED] removed generic Scope API extensions, was preivously on any class. Please use now KoinScopeComponent
  • [DEPRECATED] KoinContextHandler in favor of GlobalContext
  • [ADDED] Better Definition to help further Kotlin Compiler Plugin, simplify Module loading process (API to help declare definition without DSL)
  • [REMOVED] ScopeDefinition internal from module, and prefer qualifier to avoid create stucture outside of registry
  • [REMOVED] removed inconsistent synchronized calls
  • [ADDED] cleaned synchronized API - better call from GlobalContext to ensure synced call
  • [BREAKING] empty scope is not taken in account anymore, a scope definition is created only if there is at least one scoped definition
  • [ADDED] Injection parameters can be used directly as a dependency and can be resolved as get() or directly with builder API
  • [FIXED] fixed starting context effect (deprecating KoinContextHanlder for GlobalContext)

koin-test

  • [FIXED] fixed checkModules to use Mock for injected parameters or default origin value of a Scope
  • [ADDED] setup detault values for injected parameters, for checkModules
  • [BREAKING] AutoCloseKoinTest is now an interface, please remove any constructor
  • [UPDATED] fixed DefinitionParameters to add the ability to know the injected type value

koin-test-junit5

  • [ADDED] JUnit5 test module

2.1.6

koin-core

koin-androidx-viewmodel

koin-androidx-fragment

koin-test

koin-gradle-plugin

2.1.5

Core

  • [FIXED] - declare to use reified type
  • [FIXED] - Qualifier type as pure string
  • [FIXED] - docs contribution
  • [UPDATED] - Kotlin 1.3.71

Ktor

  • [ADDED] - Contributions about modules and events

AndroidX-Fragment

  • [FIXED] - contribution to help fallback on empty constructor instance for FragmentFactory

2.1.4

Core

  • [ADDED] - Scope's source value to return the object instance, source of the scope

2.1.3

  • [FIXED] - maven metadata config :(

2.1.2

  • [UPDATED] - maven metadata config

Core

  • [FIXED] - fixed integration for kotlin.time.* API with 1.3.70

2.1.1

alpha-1

AndroidX-ViewModel

  • [FIXED] - shared ViewModel API to get instance from Activity's ViewModelStore + clean of API to use directly ViewModelStoreOwner instead of LifecycleOwner

Android-ViewModel

  • [FIXED] - shared ViewModel API to get instance from Activity's ViewModelStore + clean of API to use directly ViewModelStoreOwner instead of LifecycleOwner

2.1.0

Core

  • [UPDATED] - introduce the KoinContextHandler component that is responsible to manage GlobalContext from startKoin. This will allow us to unlock new kind of context for Koin MP & better isolation (not directly a object that we pass around). To get your Koin instance, now use KoinContextHandler.get(), once you have started it. koinApplication { } users have to register manually to KoinContextHandler if needed

beta-3

  • doc updates

Test

  • [ADDED] - CheckModule category

Gradle_PLugin

  • [ADDED] - CheckModule Gradle Plugin

beta-1

Core

  • [ADDED] - Enum class can be used as Qualifier: named(MyEnum.MyValue)

alpha-11

Core

  • [FIXED] - stopKoin closes scopes #702

AndroidX-ViewModel

  • [FIXED] - added/fixed for better State ViewModel getStateViewModel and by stateViewModel() API

Android

  • [ADDED] - KoinAndroidApplication to let you create a KoinApplication instance with Android context, and let you use KoinApplication DSL

alpha-10

Core

  • [UPDATED] - updated + oprator for modules
  • [ADDED] - Scope Links, to link scope to another and help resolve shared instances

alpha-8

Docs

  • [UPDATED] - updated koin-core Scope section
  • [ADDED] - inject on a setter property with inject()

Android-Scope

  • [UPDATED] - updated currentScope to use lifecycleScope instead
  • [FIXED] - ScopeCompat for Java compat function

AndroidX-Scope

  • [UPDATED] - updated currentScope to use lifecycleScope instead
  • [FIXED] - ScopeCompat for Java compat function

AndroidX-Factory

  • [FIXED] - Fragment declaration in a scope

Core

  • [ADDED] - DSL declare a scope with type directly with scope<MyType> { ... }
  • [ADDED] - smarter better API to use scope from an object instance (getOrCreateScope ...)
  • [ADDED] - scope property to any instance, to get tied declared scope
  • [ADDED] - inject on a setter property with inject()

Core-Ext

  • [ADDED] - inject all setter property with inject() on an instance

alpha-7

Android-ViewModel

  • [UPDATED] - updated ViewModelParameter API around to help integrate it more easily with 3rd party access

AndroidX-ViewModel

  • [UPDATED] - updated ViewModelParameter API around to help integrate it more easily with 3rd party access

AndroidX-Factory

  • [ADDED] - KoinFragmentFactory API to setup Fragment injection

Core

  • [UPDATED] - Reworked all resolution engine to use immutable BeanDefinition & base the resolution on Scope & ScopeDefinition
  • [UPDATED] - Locking Strategy to avoid usage of ConcurrentHashMap
  • [UPDATED] - Replace BeanRegistry with InstanceRegistry & ScopeRegistry
  • [UPDATED] - added closed status to Scope
  • [FIXED] - Fixed bugs related to closed scopes
  • [FIXED] - Can now allow to resolve different types with same Qualifer
  • [ADDED] - Module loaded property in order to allow later "reloading"
  • [ADDED] - Java helpers are now part of the koin-core project
  • [ADDED] - bind() oeprator on a definition, that use reified Type
  • [ADDED] - q() operator to declare a String or a Type

Java

  • [REMOVED] - project is now part of koin-core

Test

  • [UPDATED] - Check modules with checkModules { } that open an KoinApplication declaration
  • [ADDED] - MockProviderRule & MockProvider to manually provide mocking capacity, absed of the desired mocing framework
  • [REMOVED] - Link to Mockito library

Documentation

  • [UPDATED] - New documentation system based on docisfy, to help deploy easily markdown doc. Documentation is now in /docs folder

2.0.1

Android-ViewModel

  • [ADDED] - debug logging for VM provider

AndroidX-ViewModel

  • [ADDED] - debug logging for VM provider

Core

  • [FIXED] - performances update - modules list loading & class naming
  • [BREAKING] - modules(vararg modules: Module) in KoinApplication has been removed for performance reasons. Please use modules(modules: List<Module>)
  • [BREAKING] - modules(modules: Iterable<Module>) in KoinApplication has been removed for performance reasons. Please use modules(modules: List<Module>)
  • [BREAKING] - loadKoinModules(vararg modules: Module) in GlobalContext has been removed for performance reasons. Please use loadKoinModules(module: Module) or loadKoinModules(modules: List<Module>)
  • [BREAKING] - unloadKoinModules(vararg modules: Module) in GlobalContext has been removed for performance reasons. Please use unloadKoinModules(module: Module)

2.0.0

Android

  • [UPDATED] - rework startking DSL to add extension in startKoin (androidContext, androidLogger)

Android-Scope

  • [UPDATED] - rework according to new Scope API (manage complete Scope Lifecycle)
  • [ADDED] - currentScope property scope tied to current Activity or Fragment
  • [ADDED] - currentScope is aware of any KoinComponent & currentScope override
  • [UPDATED] - ScopeID generation

Android-ViewModel

  • [ADDED] - support for new Scope API
  • [REMOVED] - removed koin-ext builder API
  • [UPDATED] - make the API open to Koin instance isolation
  • [FIXED] - https://github.com/InsertKoinIO/koin/issues/452 - Named qualifier does not work with view models - Now take qualifier as ViewModel's Tag
  • [FIXED] - by viewModel & getViewModel with clazz version
  • [FIXED] - ViewModel definition in scope

AndroidX-Scope

  • [UPDATED] - update API regarding the changes in koin-android-scope
  • [UPDATED] - ScopeID generation

AndroidX-ViewModel

  • [UPDATED] - update API regarding the changes in koin-android-viewmodel
  • [FIXED] - https://github.com/InsertKoinIO/koin/issues/452 - Named qualifier does not work with view models - Now take qualifier as ViewModel's Tag
  • [FIXED] - by viewModel & getViewModel with clazz version
  • [FIXED] - ViewModel definition in scope

Core

  • [UPDATED] - startKoin replaced with startKoin DSL and koin in global context
  • [UPDATED] - complete internals rewritten for performances optimisation (startup & injection)
  • [UPDATED] - KoinComponent now can override getKoin() to target a custom Koin instance & currentScope() to target a Scope that is used for all injections
  • [ADDED] - koinApplication function to help declare an instance for a local context, in order to help isolated Koin instances
  • [UPDATED] - rework Scope API (multiple instances definitions, properties, release, callback ...)
  • [UPDATED] - rework Scope DSL (scope/scoped) & lock single/factory
  • [UPDATED] - rework internals to use root Scope & separate Scope instances, with different bean registry
  • [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
  • [ADDED] - Qualifiers with named() function to replace old string names. Allow to use Types
  • [ADDED] - getOrNull() and injectOrNull() to safely resolve potential components and get null of not present
  • [UPDATED] - additional binding API, with getAll<S>() & bind<P,S>() operator to look for instances regarding secondary type definition
  • [ADDED] - declare() on Koin & Scope, to help declare an instance on the fly
  • [FIXED] - Factory declaration in scope

Test

  • [UPDATED] - rework testing API, codebase detached from internal core tests
  • [UPDATED] - checkModules now rely on pure Kotlin & with create parameters DSL

Java

  • [UPDATED] - updated KoinJavaComponent for the new API
  • [FIXED] - https://github.com/InsertKoinIO/koin/issues/451 - No longer possible to get objects from a scope in Java code - scope parameter to allow resolve a dependency from this scope instance
  • [FIXED] - Get access to scope instance

Ktor

  • [UPDATED] - rework startking DSL to add extension in startKoin
  • [ADDED] - Koin as a Ktor feature

Spark

  • [REMOVED] project non ported to Koin 2.0

1.0.2

Android

Android-Scope

Android-ViewModel

Core

Core-Ext

Test

1.0.1

Android

1.0.0

Core_

Core-Ext

  • [ADDED] - Renamed koin-reflect to koin-core-ext

Android

  • [FIXED] - koin-android-viewmodel parameters leak fixed - https://github.com/InsertKoinIO/koin/issues/220
  • [ADDED] - koin-android-viewmodel added viewModel automatic builder keyword
  • [FIXED] - koin-android added back androidApplication()
  • [ADDED] - koin-android-scope updated bindScope function now bind a Scope

Test

  • [FIXED] - check() renamed to checkModules()

1.0.0-beta3

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 (replaces applicationContext, context & bean) - #131
  • [FIXED] - Fixed Scope API, aka module visibility resolution
  • [ADDED] - SLF4J Logger implementation (koin-logger-slf4j), used by koin-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 with createAtStart - #141
  • [UPDATED] - Explicit bean/module override - #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 with declareMock & 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 with koin-androidx-scope & koin-androidx-viewmodel - #138 - #122 - #154
  • [ADDED] - scoping feature with Android lifecycle with koin-android-scope - #142
  • [UPDATED]- Open startKoin() for other Android context & use Context instead of Application - #156
  • [FIXED] - ViewModel factory instance creation bugfix - #145
  • [FIXED] - ViewModel factory injection params leak - #149
  • [UPDATED]- androix version to 2.0.0-beta01

Ktor

  • [ADDED] - asciidoc doc
  • [ADDED] - use koin-logger-slf4j
  • [UPDATED] - ktor 0.9.2
  • [ADDED]- add Route & Routing class extensions - #128

Spark

  • [ADDED] - asciidoc doc
  • [ADDED] - use koin-logger-slf4j
  • [UPDATED] - controller keyword now need your class to extend SparkController

Java

  • [ADDED] - add koin-java project - #106
  • [ADDED] - asciidoc doc

Reflect

  • [ADDED] - add koin-reflect project
  • [ADDED] - add build() 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] - Added examples folder, gathering examples application
  • [ADDED] - Thermosiphon example - #116

0.9.3

Gradle & Continuous Integration

version published with new build chain

0.9.2

Core

  • [UPDATED] build updated to Kotlin 1.2.31
  • [UPDATED] dissociate overload with dynamic parameters on get() and inject() for better autocomplete suggestions
  • [FIXED] fix startKoin() property loading from boolean loadProperties
  • [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 on get() and inject() for better autocomplete suggestions

Android Architecture

  • [UPDATED] dissociate overload with dynamic parameters on viewModel(), getViewModel()andgetSharedViewModel()` for better autocomplete suggestions
  • [UPDATED] now exclude gradle dependency against LiveData

Samples

  • FIXED Ktor hello appp sample

0.9.1

DSL

  • [FIXED] Parameter propagation - You can now reuse params in get() 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 external properties 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 the getSharedViewModel() and sharedViewModel() from Fragment, to reuse ViewModel from parent Activity. getViewModel() and viewModel() now creates ViewModel instance (no FromActivity parameter anymore)
  • [UPDATED] ViewModel factory logs to see what Activity/Fragment is getting ViewModel instance

0.9.0

DSL

  • [DEPRECATED] - provide - can be directly replace with bean
  • [UPDATED] - bean and factory can now use bind
  • [ADDED] - defintion function inside bean or factory can now have parameters

Core

  • [FIXED] Context resolution and modulePath isolation reworked - now fully functionnal
  • [FIXED] Stack resolution
  • [ADDED] StandAloneContext function loadKoinModules to load Koin modules whether Koin is already started
  • [ADDED] StandAloneContext function loadProperties to load Koin properties whether 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 when releaseContext() is called on a context. You can register with StandAloneContext.registerContextCallBack() (#58)

Android

  • [FIXED] StartKoin have a logger parameter, with default as AndroidLogger(), to allow specify logging implementation to use with Koin (#50) - allow no logging at startKoin of logger is set to EmptyLogger()
  • [ADDED] by inject() function handle parameters to definition (#49)

Android Architecture

  • [FIXED] fix viewModel extensions rewritten from LifecycleOwner interface
  • [FIXED] fix by viewModel() API to allow use KClass object argument instead of type inference - offers now getViewModelByclass() and viewModelByClass() (#56)
  • [ADDED] by viewModel() function handle parameters to definition (#49)
  • [ADDED] by viewModel() function handle key instance for Android ViewModelFactory (#49)

0.8.2

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

0.8.1

Android Architecture

Now declare your ViewModel lazily in attributes, with by viewModel() like by inject()
  • by viewModel() lazy function call the getViewModel() function and allow val attribute declaration of your ViewModel (like with by inject()) - (issue #37)
  • Better support to share ViewModel between Activity and Fragments
  • android.arch.lifecycle:extensions updated to 1.1.0

Spark

start and startKoin functions have been merged
  • startSpark {} has been renamed to start {} and have a modules arguments to list all of your modules
  • start() and startKoin has been merged to start( modules = <List of modules>)
  • stopSpark{} has been renamed to stop {} and include closeKoin()

Core

  • Kotlin 1.2.21
  • Internal fixes around Bean definition lookup / Duplicated defintion (issue #39)
  • Fixed loading from koin.properties (for embedded jar)

0.8.0

Introducing new modules: koin-spark and koin-android-architecture

Android Architecture

  • viewModel DSL keyword (specialized provide alias for ViewModel), to declare an Architecture Components ViewModel
  • getViewModel() function in Activities and Fragments, to get and bind ViewModel components

Spark

  • controller {} DSL keyword (specialized provide alias), to declare Spark controllers classes
  • start() {} function to start Spark server (optional port number) - lambda expression to allow the start of Koin and any controller instantiation
  • runControllers() function to instantiate all spark controllers, declared with controller keyword DSL

Core

  • Better logging and error display
  • Some fixes about internals resolution for bound types

0.7.1

This 0.7.x branch brings great simplifications in DSL and API. Users from Koin 0.6.x may check the What's new in 0.7.x guide 👍

Kotlin compilation has been updated to 1.1.61

Core

  • Simplified DSL modules: no more need of Module class. Now use directly the applicationContextfunction
  • Default Koin Logger to PrintLogger instead of EmptyLogger
  • a definition can be overridden (with a definition same name and type)
  • DSL provide aliases with bean and factory
  • 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 resolution are made
  • Context isolation disabled by default. Can be activated later

Android

Android ContextAware components have been dropped. Please, check the migration guide
  • Default Koin Logger to AndroidLogger instead of EmptyLogger
  • No need anymore of AndroidModule, just use applicationContext to declare a module
  • Android extensions have been reworked to avoid need of support Library
  • androidApplication() is a DSL extension to provide Android Application resolution (can also be done with get<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 standAloenContext
  • closeKoin() now close actual Koin context
  • KoinComponent has get() and getProperty()

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

0.6.0

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 a properties parameter to give additional properties at startup

No more getKoin() !

KoinTest

  • directly extends KoinComponent
  • context assert/test tools & extensions
  • dryRun() is usable in a Kointest component, after a startKoin

Android

  • fix/better extensions for Android
  • bindProperty() renamed to setProperty()
  • startAndroidContext() has been renamed to startKoin()
  • ContextAware Components can be configured for drop strategy (onDestroy or onPause). Default method is onPause
  • load assets/koin.properties if present

0.5.2

Core

  • getProperty() can provide a default value if key property is missing
  • provide() can be use on a KoinContext directly, to declare on component

Android

  • applicationContext has been renamed androidApplication

0.5.1

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

0.5.0

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 context
  • KoinContextAware interfaces have been removed
  • Koin/Android extensions greatly simplified
  • packages have been moved - need reimport for AndroidModule, by inject and by 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

0.4.0

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 renamed applicationContext{}, and behind gives a better idea that you are describing your application context (the root context of your app)
  • Updated modulePath(){}has been dropped for context(){} - context describes a sub context of your application, has a a name and can have also sub context itself (sub contexts are hierarchical)
  • 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

0.3.1

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

0.3.0

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

0.2.x

Koin & Koin-Android project has meen merged

DSL

  • Module/AndroidModule class must now give a context() function implementation, to return a Context object. The declareContext 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 replaced with release() Scope operation
  • import is replaced with module instances load
  • All reflection & kotlin-reflect code have been removed
1
https://gitee.com/fzcs/koin.git
git@gitee.com:fzcs/koin.git
fzcs
koin
koin
master

搜索帮助