All Versions
12
Latest Version
Avg Release Cycle
43 days
Latest Release
991 days ago

Changelog History
Page 1

  • v0.4.1 Changes

    January 01, 2022

    ๐Ÿ”„ Changed

    • ๐Ÿ‘Œ Improved generated code formatting.
    • โœ‚ Removed explicit retention annotation to get rid of kotlin js warnings.

    ๐Ÿ›  Fixed

    • ๐Ÿ›  Fixes conflicting declarations when scoped @Provides functions returned the same type with different generic args.
    • ๐Ÿ›  Fixes default parameter handling with lambda or lazy values.
    • ๐Ÿ›  Fixes to kotlin native implementation that should make it more usable across threads. Note: the new memory model limitation is still present, but you can use https://github.com/touchlab/Stately to wrap the access when using the legacy memory model.
  • v0.4.0 Changes

    November 12, 2021

    ๐Ÿ”„ Changed

    • โšก๏ธ Updated kotlin to 1.5.31
    • โšก๏ธ Updated ksp to 1.5.31-1.0.1
    • Several improvements to code generation which often means less code is generated.

    โž• Added

    • ๐Ÿ‘ Multiple rounds handling: This includes support for using types generated by other ksp processors. As a side effect there is better error reporting for unresolved types.
    • ๐Ÿ‘Œ Support for multiplatform/native. Check out the sample project.

    Note: components are thread-safe, however you will run into issues actually using them from other threads unless you enable the new memory model.

    • โž• Added support for default args when injecting. If the type is present in the graph, it'll be injected, otherwise the default will be used.
      @Inject class MyClass(val dep: Dep = Dep("default"))
    
      @Component abstract ComponentWithDep {
          abstract val myClass: MyClass
          @Provides fun dep(): Dep = Dep("injected")
      }
      @Component abstract ComponentWithoutDep {
          abstract val myClass: MyClass
      }
    
      ComponentWithDep::class.create().myClass.dep // Dep("injected")
      ComponentWithoutDep::class.create().myClass.dep // Dep("default")
    
  • v0.3.7-RC Changes

    October 29, 2021

    ๐Ÿ”„ Changed

    • โšก๏ธ Updated kotlin to 1.6.0-RC
    • โšก๏ธ Updated ksp to 1.6.0-RC-1.0.1-RC
    • Several improvements to code generation which often means less code is generated.

    โž• Added

    • ๐Ÿ‘ Multiple rounds handling: This includes support for using types generated by other ksp processors. As a side effect there is better error reporting for unresolved types.
    • ๐Ÿ‘Œ Support for multiplatform/native. Check out the sample project.
  • v0.3.6 Changes

    July 16, 2021

    ๐Ÿ”„ Changed

    • โšก๏ธ Updated kotlin to 1.5.20
    • ๐Ÿ‘ Experimental kotlin js support

    ๐Ÿ›  Fixed

    • ๐Ÿ›  Fix generated code for @Inject functions with a receiver ex: @Inject fun Foo.bar() = ...
    • ๐Ÿ›  Fix not using the typealias for function return types
  • v0.3.5 Changes

    June 02, 2021

    ๐Ÿ”„ Changed

    • โšก๏ธ Updated kotlin to 1.5.10
    • โšก๏ธ Updated ksp to beta01
  • v0.3.4 Changes

    May 30, 2021

    ๐Ÿ›  Fixed

    • ๐Ÿ›  Fix metata parsing issue with kapt on kotlin 1.5.0
    • ๐Ÿ›  Fix declaring function injection in another module in ksp

    ๐Ÿ”„ Changed

    • โšก๏ธ Updated kotlin to 1.5.0
    • โšก๏ธ Updated ksp to alpha10
  • v0.3.3 Changes

    April 20, 2021

    โž• Added

    • ๐Ÿ‘ Allow cycles when there is delayed construction

    You can now break cycles by using Lazy or a function. For example,

      @Inject class Foo(bar: Bar)
      @Inject class Bar(foo: Foo)
    

    will fail with a cycle error, but you can fix it by doing

      @Inject class Foo(bar: Lazy<Bar>)
      @Inject class Bar(foo: Foo)
    

    or

      @Inject class Foo(bar: () -> Bar)
      @Inject class Bar(foo: Foo)
    

    This uses lateinit under the hood. You will get a runtime exception if you try to use the dependency before construction completes.

    • Added option me.tatarka.inject.dumpGraph to print the dependency graph while building. This can be useful for debugging issues.
      • ๐Ÿ‘ Allow type-alias usage with @IntoMap.

    You can now do

      typealias Entry = Pair<String, MyValue>
    
      @Component {
          @Provides @IntoMap
          fun entry1(): Entry = "1" to MyValue(1)
          @Provides @IntoMap
          fun entry2(): Entry = "2" to MyValue(2)
      }
    

    ๐Ÿ”„ Changed

    • Code-gen optimization to reduce code size
    • ๐ŸŽ ksp performance improvements
    • Made handling of nullable and platform types consistent on the different backends.

    It is now an error to return a platform type from a @Provides methods, you must declare the return type explicitly.

    ๐Ÿ›  Fixed

    • ๐Ÿ›  Fix using @Qualifier on scoped dependencies
    • ๐Ÿ›  Fix declaring components as an inner class
    • ๐Ÿ›  Fix annotating java class constructors with @Inject
    • ๐Ÿ›  Fix @Inject on a companion object
  • v0.3.2 Changes

    April 05, 2021

    ๐Ÿ”„ Changed

  • v0.3.1 Changes

    February 25, 2021

    ๐Ÿ”„ Changed

    • ๐Ÿš€ Updated ksp to 1.4.30-1.0.0-alpha03
    • ๐Ÿ‘ Minimum supported kotlin version is now 1.4.30
  • v0.3.0 Changes

    January 14, 2021

    ๐Ÿ”„ Changed

    Key changes: - You no longer have to define resolutionStrategy in your settings.gradle. - The plugin id has changed from symbol-processing to com.google.devtools.ksp.

    • ๐Ÿ‘ Minimum supported kotlin version is now 1.4.20

    โž• Added

    • ๐Ÿ‘Œ Support injecting suspend functions

    You can now define suspend component and provides methods

      @Component abstract class MyComponent {
        abstract val foo: suspend () -> IFoo
    
        val providesFoo: suspend () -> IFoo
            @Provides get() = { Foo() }
      }
    
    • ๐Ÿ‘Œ Support default args in component constructors

    If you define any default args, you will get an overload create function that provides default values. Due to processor limitations, you only get a single overload (i.e. you cannot pass defaults from some args but not other). This can be useful for more conveniently defining parent components.

      @Component abstract class MyComponent(@Component val parent: ParentComponent = ParentComponent()) {
        ...
      }
      val component = MyComponent::class.create()
    
    • ๐Ÿ‘Œ Support annotating constructors with @Inject

    Sometimes you don't want to use the primary constructor to construct an object. You can now annotate a more specific constructor instead.

      class MyClass {
        @Inject constructor(arg: String) // use this one for injection
        constructor(arg: Int)
      }
    
    • ๐Ÿ‘Œ Support injecting objects

    While you can use an object directly, it may be useful to inject it so that you can switch it to an instance at a later point without updating the consuming code.

      @Inject object Foo { ... }
      @Inject MyClass(dep: Foo) { ... }
    

    ๐Ÿ›  Fixed

    • Respect component's class visibility
    • ๐Ÿ›  Fix generating incorrect code for fun providers