It's time for Kodein 4!!! Or more specifically Kod...
# kodein
s
It's time for Kodein 4!!! Or more specifically Kodein
4.0.0-beta1
🙂 ========================================== - Kodein 4 is for Kotlin 1.1. Kodein 3.x will continue to be supported for bug & security fixes for those "stuck" in Kotlin. 1.0. Kodein 4 uses Kotlin 1.1 and is not tested with Kotlin 1.0 - Kodein core has been updated to be even more type safe. However, a lot of methods have been removed. Every
genericSomething
/
erasedSomething
couple of methods have been removed in favor of
Something
(note the majuscule) which first argument must be either
erased()
or
generic()
. This should not impact you if you were not using these explicit methods. - Kodein does not use
java.lang.Class
or
Java.reflect.Type
anymore. Every type is now represented by a
TypeToken<T>
object, which abstracts the typing system. This is because... - KODEIN IS NOW COMPATIBLE WITH JAVASCRIPT. Using Gradle or Maven, you can depend on the
kodein-js
&
kodein-js-conf
artifacts. Please note that this is my first attempt at my first Javascript library. THERE WILL BE BUGS. I have NOT tested it properly (hence the `-beta`suffix). - Note that javascript cannot work (at the moment) with generic types. In essence, it works as if you were using
kodein-erased
(you can bind a
List<String>
but you are effectively binding a
List<*>
). This is because Javascript does not support genericity in its reflexivity. For the same reason, you cannot bind primitives (
String
,
Int
, etc.), you need to wrap them in data classes. Also, if you are using factories, you need to specify the exact argument type upon retrieval as Kotlin's JS reflection does not support inheritance (in effect, the only thing it supports, is getting the simple name of the class). Of course, all these restrictions will be documented, but I'm telling you here because... - The documentation is NOT written yet. I want the API to be stable before documenting it. ========================================== PLEASE TEST IT 🙂 If you are using Kotlin on... - ...the JVM, there should not be major changes in the API, and there should not be a lot of breaking changes. I might, however, have broken some weird cases. I'd be greatful if you wold test it on your project. - ...Javascript, please, please, please test it. I desperately need feedback. Where Kotlin will go, Kodein will follow!
🎉 3
👍 5