diff --git a/README.md b/README.md index e7813cee..b8f18054 100644 --- a/README.md +++ b/README.md @@ -1,36 +1,32 @@ -KODEIN - -[![Kotlin](https://img.shields.io/badge/Kotlin-1.8.20-blue.svg?style=flat&logo=kotlin)](https://kotlinlang.org) +[![Kotlin](https://img.shields.io/badge/Kotlin-1.9.21-blue.svg?style=flat&logo=kotlin)](https://kotlinlang.org) [![Maven Central](https://img.shields.io/maven-central/v/org.kodein.di/kodein-di)](https://mvnrepository.com/artifact/org.kodein.di/kodein-di) -![Github Actions](https://github.com/kosi-libs/Kodein/workflows/build%20and%20publish%20a%20snapshot/badge.svg) +![Github Actions](https://github.com/kosi-libs/Kodein/actions/workflows/snapshot.yml/badge.svg) [![MIT License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/kosi-libs/Kodein/blob/master/LICENSE.txt) [![Slack channel](https://img.shields.io/badge/Chat-Slack-green.svg?style=flat&logo=slack)](https://kotlinlang.slack.com/messages/kodein/) KOtlin DEpendency INjection =========================== -**_KODEIN_** is a very simple and yet very useful dependency retrieval container. it is very easy to use and configure. +**_KODEIN_** is a straightforward and yet very useful dependency retrieval container. it is effortless to use and configure. -**_KODEIN_** works: +**_KODEIN_** works on all Kotlin Multiplatform targets: -- On the JVM. -- On Android. -- On Javascript (both in the browser and on Node.js). -- On Native platforms (such as iOS). +- JVM / Android. +- all Native platforms (iOS, macOS, Linux, Windows, WebAssembly). +- Javascript / WasmJs **_KODEIN_** allows you to: - Lazily instantiate your dependencies when needed - Stop caring about dependency initialization order -- Easily bind classes or interfaces to their instance or provider -- Easily debug your dependency bindings and recursions +- Bind classes or interfaces to their instance or provider +- Debug your dependency bindings and recursions **_KODEIN_** provides extensions to be integrable into: - [Android](https://developer.android.com/) -- [Compose (Android / Desktop)](https://kosi-libs.org/kodein/7.19/framework/compose.html) +- [Compose (Android / Desktop / Web)](https://kosi-libs.org/kodein/7.21/framework/compose.html) - [Ktor](https://ktor.io/) -- [TornadoFX](https://tornadofx.io/) An example is always better than a thousand words: @@ -54,95 +50,121 @@ class Controller(private di: DI) { - It is fast and optimized (makes extensive use of `inline`) - It can be used in plain Java -Kotlin & JVM compatibility +Installation --------- -| Kodein | Kotlin | JDK | Compose | -|:-----------:|:------:|:-------:|:------------------:| -| 7.21.0 | 1.8.20 | min 17 | Compatible | -| 7.20.1 | 1.8.10 | min 1.8 | Compatible | -| 7.19.0 | 1.8.10 | min 1.8 | Compatible | -| 7.18.0 | 1.8.0 | min 1.8 | Compatible | -| 7.17.1 | 1.8.0 | min 1.8 | Compatible | -| 7.17.0 | 1.8.0 | min 1.8 | No | -| 7.16.0 | 1.7.20 | min 1.8 | Compatible | -| 7.15.1 | 1.7.20 | min 1.8 | Compatible (no JS) | -| 7.15.0 | 1.7.20 | min 1.8 | No | -| 7.14.0 | 1.7.10 | min 1.8 | Compatible | -| 7.13.1 | 1.7.0 | min 1.8 | Compatible | -| 7.13.0 | 1.7.0 | min 1.8 | No | -| 7.12.0 | 1.6.21 | min 1.8 | Compatible | -| 7.10.0 | 1.6.10 | min 1.8 | Compatible | -| 7.7+ | 1.5+ | min 1.8 | Compatible | -| 7.6+ | 1.5+ | min 1.8 | - | -| 7.1+ | 1.4+ | min 1.8 | - | -| 7.0+ | 1.3.72 | min 1.8 | - | -| 6.5.5 | 1.3.72 | min 1.8 | - | -| 6.5.4 | 1.3.71 | min 1.8 | - | -| 6.5.3 | 1.3.70 | min 1.8 | - | -| 6.5.0 | 1.3.61 | min 1.8 | - | -| 6.4.1 | 1.3.50 | min 1.8 | - | -| 6.3+ | 1.3.40 | min 1.8 | - | -| 6.2+ | 1.3.30 | 1.6 | - | -| 6.1+ | 1.3.20 | 1.6 | - | -| 6.0+ | 1.3.0 | 1.6 | - | -| 5.0+ | 1.2.30 | 1.6 | - | -| 4.1+ | 1.1.3 | 1.6 | - | -| 4.0.0-beta2 | 1.1.0 | 1.6 | - | - -Read more ---------- +Kodein is available on Maven Central. + +```kotlin +repositories { + mavenCentral() +} +``` + +```kotlin +kotlin { + sourceSets { + commonMain { + dependencies { + implementation("org.kodein.di:kodein-di:{version}") + } + } + } +} +``` **_KODEIN_** 7+ is the current major version, but documentation is available for previous versions. **[Kodein documentation](https://kosi-libs.org/kodein/)** + +Kotlin & JVM compatibility +--------- + +| Kodein | Kotlin | JDK | +|:-----------:|:------:|:-------:| +| 7.21.+ | 1.9.+ | min 1.8 | +| 7.20.1 | 1.8.10 | min 1.8 | +| 7.19.0 | 1.8.10 | min 1.8 | +| 7.18.0 | 1.8.0 | min 1.8 | +| 7.17.1 | 1.8.0 | min 1.8 | +| 7.17.0 | 1.8.0 | min 1.8 | + +> Full table can be found [here](https://kosi-libs.org/kodein/7.21/core/platform-and-genericity.html) + Support ------- Support is held in the [Kodein Slack channel](https://kotlinlang.slack.com/messages/kodein/) (you can get an invitation to the Kotlin Slack [here](https://slack.kotlinlang.org/)). -Testimonies ------------ +[//]: # (Testimonies) + +[//]: # (-----------) + +[//]: # () +[//]: # ( ) + +[//]: # () +[//]: # (> At [Collokia](https://www.collokia.com/) we use Kodein in all of our backend service infrastructure and all modules in those services are loosely coupled through injection with Kodein.) + +[//]: # (> It allows us to have nice module independence, and to opt-out of injection during testing or build separate modules in support of testing. ) + +[//]: # (> It is a key component and building block in our architecture. ) + +[//]: # (> -- [Jayson Minard](https://github.com/apatrida)) + +[//]: # () +[//]: # ( ) + +[//]: # () +[//]: # (> At [Moovel Group GmbH](https://www.moovel.com/de/en), we have successfully used the wonderful Kodein library into in [this Android app](https://play.google.com/store/apps/details?id=com.daimler.moovel.android).) + +[//]: # (> As we improved it, we found Kodein to be much more useful than Dagger2 as it simplified our code throughout. ) + +[//]: # (> Kodein is in my view, much easier to understand, doesn't have that nasty ceremony, and has really nice debug messages. ) + +[//]: # (> We are also working now on other projects where we are using Kodein as well. ) + +[//]: # (> -- [Sorin Albu-Irimies](https://github.com/sorinirimies)) + +[//]: # () +[//]: # ( ) + +[//]: # () +[//]: # (> Kodein has been instrumental in moving our entire production application to Kotlin at [InSite Applications](https://insiteapplications.com). It uses standard Kotlin idioms and features for ultimate clarity and simplicity. It was clear to us from the beginning that Kodein would be our DI solution. Our devs love it so much that they've transitioned to using it in their personal apps, both Java and Kotlin! ) -  +[//]: # (> -- [Eliezer Graber](https://github.com/eygraber)) -> At [Collokia](https://www.collokia.com/) we use Kodein in all of our backend service infrastructure and all modules in those services are loosely coupled through injection with Kodein. -> It allows us to have nice module independence, and to opt-out of injection during testing or build separate modules in support of testing. -> It is a key component and building block in our architecture. -> -- [Jayson Minard](https://github.com/apatrida) +[//]: # () +[//]: # ( ) -  +[//]: # () +[//]: # (> At [Compsoft Creative](https://www.compsoft.co.uk), Kodein is central our new Kotlin based app architecture, giving us a solid underpinning to all apps we develop and allowing a simple yet powerful way to de-couple our services with a library that is lightweight and perfect for mobile apps. ) -> At [Moovel Group GmbH](https://www.moovel.com/de/en), we have successfully used the wonderful Kodein library into in [this Android app](https://play.google.com/store/apps/details?id=com.daimler.moovel.android). -> As we improved it, we found Kodein to be much more useful than Dagger2 as it simplified our code throughout. -> Kodein is in my view, much easier to understand, doesn't have that nasty ceremony, and has really nice debug messages. -> We are also working now on other projects where we are using Kodein as well. -> -- [Sorin Albu-Irimies](https://github.com/sorinirimies) +[//]: # (> -- [Daniel Payne](https://github.com/CompsoftCreative)) -  +[//]: # () +[//]: # ( ) -> Kodein has been instrumental in moving our entire production application to Kotlin at [InSite Applications](https://insiteapplications.com). It uses standard Kotlin idioms and features for ultimate clarity and simplicity. It was clear to us from the beginning that Kodein would be our DI solution. Our devs love it so much that they've transitioned to using it in their personal apps, both Java and Kotlin! -> -- [Eliezer Graber](https://github.com/eygraber) +[//]: # () +[//]: # (> Kodein is used in [the android app of the OhelShem school](https://github.com/OhelShem/android). ) -  +[//]: # (> -- [Yoav Sternberg](https://github.com/yoavst) ) -> At [Compsoft Creative](https://www.compsoft.co.uk), Kodein is central our new Kotlin based app architecture, giving us a solid underpinning to all apps we develop and allowing a simple yet powerful way to de-couple our services with a library that is lightweight and perfect for mobile apps. -> -- [Daniel Payne](https://github.com/CompsoftCreative) +[//]: # () +[//]: # ( ) -  +[//]: # () +[//]: # (> Kodein was created at [Dental Monitoring](https://dental-monitoring.com/) with the opinion that Dagger2 is way too verbose and complex.) -> Kodein is used in [the android app of the OhelShem school](https://github.com/OhelShem/android). -> -- [Yoav Sternberg](https://github.com/yoavst)  +[//]: # (> It is now used in almost all our projects: the server, the internal production software & the Android application. ) -  +[//]: # (> Kodein is very easy to use and set up: it allows our team to easily share code and patterns, as well as quickly bootstrapping new ideas. ) -> Kodein was created at [Dental Monitoring](https://dental-monitoring.com/) with the opinion that Dagger2 is way too verbose and complex. -> It is now used in almost all our projects: the server, the internal production software & the Android application. -> Kodein is very easy to use and set up: it allows our team to easily share code and patterns, as well as quickly bootstrapping new ideas. -> -- [Salomon Brys](https://github.com/SalomonBrys) +[//]: # (> -- [Salomon Brys](https://github.com/SalomonBrys)) -  +[//]: # () +[//]: # ( ) If you are using KODEIN, please [let us know](mailto:contact@kodein.net)! diff --git a/doc/antora.yml b/doc/antora.yml index 78ff5b00..44bc37d5 100644 --- a/doc/antora.yml +++ b/doc/antora.yml @@ -1,7 +1,7 @@ name: kodein title: Kodein version: '7.21' -display_version: '7.21.0' +display_version: '7.21.1' nav: - modules/ROOT/nav.adoc - modules/core/nav.adoc @@ -11,6 +11,6 @@ nav: asciidoc: attributes: branch: '7.21' - version: '7.21.0' - kotlin: '1.8.20' + version: '7.21.1' + kotlin: '1.9.21' jdk: '1.8' \ No newline at end of file diff --git a/doc/modules/ROOT/pages/platform-and-genericity.adoc b/doc/modules/ROOT/pages/platform-and-genericity.adoc index 4b522362..a520d600 100644 --- a/doc/modules/ROOT/pages/platform-and-genericity.adoc +++ b/doc/modules/ROOT/pages/platform-and-genericity.adoc @@ -9,6 +9,86 @@ Also, it requires at least JDK {jdk}, for JVM projects. _Kodein-DI_ is compatible with all platforms that the Kotlin language compiles to: JVM & compatible (Android), Javascript and all the Kotlin/Native targets. +Here is a table containing the version compatibility: + +[%header,cols=3*] +|=== +|Kodein +|Kotlin + +|7.21.2 +|Compose 1.6.0-alpha01 +|1.9.21 + +|7.21.1 +|Compose 1.5.10-dev-wasm03 +|1.9.21 + +|7.21.0 +|Compose 1.5.10-dev-wasm02 +|1.9.20 + +|7.20.0 +|Compose 1.3.1 +|1.8.10 + +|7.19.0 +|Compose 1.3.1 +|1.8.10 + +|7.18.0 +|Compose 1.3.0-rc2 +|1.8.0 + +|7.17.1 +|Compose 1.3.0-rc2 +|1.8.0 + +|7.16.0 +|Compose 1.2.0 +|1.7.20 + +|7.15.1 +|Compose 1.2.0 +|1.7.20 + +|7.15.0 +|NOT COMPATIBLE +|1.7.20 + +|7.15.0-kotlin-1.7.20-RC +|NOT COMPATIBLE +|1.7.20 + +|7.14.0 +|1.2.0-alpha01-dev745 +|1.7.10 + +|7.13.1 +|1.2.0-alpha01-dev745 +|1.7.0 + +|7.10.0 +|1.0.1-rc2 +|1.6.10 + +|7.7.0 +|1.0.0-alpha1 +|1.5.30 + +|7.6.0 +|1.0.0-beta08 +|1.5.21 + +|7.5.1 +|1.0.0-beta07 +|1.4.32 + +|7.5.0 +|1.0.0-beta06 +|1.4.31 +|=== + Since `7.0.0`, a new https://github.com/Kodein-Framework/Kodein-Type[type system] has been designed and included to _Kodein-DI_. Thus, it appears to the developer that there is no more _obvious_ differences between platforms, you no longer have to choose between `erased` or `generic` dependencies. Starting from `7.0.0`, _Kodein-DI_ is using the `generic` version of the type system, meaning you should be able to bind generics easily for _Kotlin/Multiplatform_ projects. diff --git a/doc/modules/framework/pages/compose.adoc b/doc/modules/framework/pages/compose.adoc index 42e7eb08..ab4dbbaf 100644 --- a/doc/modules/framework/pages/compose.adoc +++ b/doc/modules/framework/pages/compose.adoc @@ -16,6 +16,22 @@ Here is a table containing the version compatibility: |Compose compiler |Kotlin +|7.21.2 +|Compose 1.6.0-alpha01 +|1.9.21 + +|7.21.1 +|Compose 1.5.10-dev-wasm03 +|1.9.21 + +|7.21.0 +|Compose 1.5.10-dev-wasm02 +|1.9.20 + +|7.20.0 +|Compose 1.3.1 +|1.8.10 + |7.19.0 |Compose 1.3.1 |1.8.10