Skip to content

Commit 134622d

Browse files
committed
Update CHANGELOG, prepare release v0.6.2
1 parent b5c9d99 commit 134622d

File tree

3 files changed

+74
-13
lines changed

3 files changed

+74
-13
lines changed

CHANGELOG.md

+65-4
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,68 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
66
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
77

8+
## [0.6.2] 2023-08-28
9+
10+
### Changed
11+
12+
- Updated kotlin to 1.9.0
13+
- If a dependency's scope is not found on the component providing it, a better error message is given.
14+
- Adding a `@Provides` annotation on an abstract `fun` or `val` will now warn that it has no effect.
15+
- When overriding a method the parent is checked to see if it has a `@Provides` annotation. This makes the example in
16+
the README actually work:
17+
```kotlin
18+
@NetworkScope abstract class NetworkComponent {
19+
@NetworkScope @Provides abstract fun api(): Api
20+
}
21+
@Component abstract class RealNetworkComponent : NetworkComponent() {
22+
// This is now treated as a @Provides even if not annotated directly
23+
override fun api(): Api = RealApi()
24+
}
25+
```
26+
27+
### Fixed
28+
29+
- Typealiases are treated as separate types in multibinding. This is consistent with other
30+
uses of typealiases.
31+
32+
For example:
33+
```kotlin
34+
typealias MyString = String
35+
36+
@Component abstract class MyComponent {
37+
abstract val stringItems: Set<String>
38+
abstract val myStringItems: Set<MyString>
39+
40+
@Provides @IntoSet fun stringValue1(): String = "string"
41+
42+
@Provides @IntoSet fun stringValue2(): MyString = "myString"
43+
}
44+
```
45+
`stringItems` will contain `{"string"}` and `myStringItems` will contain `{"myString"}`.
46+
- Lambda types now work in set multibindings.
47+
```kotlin
48+
@Component abstract class MyComponent {
49+
abstract val lambdaSet: Set<() -> String>
50+
51+
@Provides @IntoSet fun lambda1(): () -> String = { "one" }
52+
53+
@Provides @IntoSet fun lambda2(): () -> String = { "two" }
54+
}
55+
```
56+
- Assisted injection no longer works with scopes or cycles. These two cases would over-cache the instance, ignoring the
57+
assisted arguments. They now throw an error instead.
58+
```kotlin
59+
// now throws cycle error when providing
60+
@Inject class AssistedCycle(val factory: (Int) -> AssistedCycle, @Assisted val arg: Int)
61+
// now throws error when providing
62+
@MyScope @Inject class AssistedScoped(@Assisted val arg: Int)
63+
```
64+
- Fixed edge case where accessing a parent scoped dependency from a lazy cycle generated invalid code.
65+
866
## [0.6.1] 2023-02-11
967

1068
### Fixed
69+
1170
- Fixed code generation issues with assisted injection.
1271

1372
## [0.6.0] 2022-12-21
@@ -32,6 +91,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
3291
```
3392

3493
### Fixed
94+
3595
- `@Inject` annotations being ignored if used through a typealias, ex:
3696
```kotlin
3797
typealias MyInject = Inject
@@ -78,7 +138,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
78138
```
79139
Cannot find an @Inject constructor or provider for: Bar
80140
```
81-
In other words a parent component can no longer depend on a dependency provided by a child component. Not only does
141+
In other words a parent component can no longer depend on a dependency provided by a child component. Not only does
82142
this lead to confusing graphs, but it can lead to memory leaks if the parent component lives longer than the child and
83143
ends holding on to that child dependency.
84144

@@ -102,7 +162,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
102162
arg would shadow the outer arg that was attempted to be used.
103163
- Improved the error message for scoped provides in unscoped component.
104164
- Fixed printing of an inner type to include the outer class. i.e. You will now get `Parent.Child` in error messages
105-
instead of just `Child` which can make it easier to find the location of the error.
165+
instead of just `Child` which can make it easier to find the location of the error.
106166

107167
## [0.4.1] 2022-01-01
108168

@@ -114,7 +174,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
114174
### Fixed
115175

116176
- Fixes conflicting declarations when scoped `@Provides` functions returned the same type with different generic args.
117-
- Fixes default parameter handling with lambda or lazy values.
177+
- Fixes default parameter handling with lambda or lazy values.
118178
- Fixes to kotlin native implementation that should make it more usable across threads.
119179
Note: the new memory model limitation is still present, but you can use https://github.com/touchlab/Stately to wrap
120180
the access when using the legacy memory model.
@@ -135,7 +195,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
135195
the [sample project](https://github.com/evant/kotlin-inject-samples/tree/main/multiplatform/echo).
136196

137197
Note: components are thread-safe, however you will run into issues actually using them from other threads unless you
138-
enable the [new memory model](https://blog.jetbrains.com/kotlin/2021/08/try-the-new-kotlin-native-memory-manager-development-preview/).
198+
enable
199+
the [new memory model](https://blog.jetbrains.com/kotlin/2021/08/try-the-new-kotlin-native-memory-manager-development-preview/).
139200
- Added support for default args when injecting. If the type is present in the graph, it'll be injected, otherwise the
140201
default will be used.
141202

README.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ pluginManagement {
5454

5555
```groovy
5656
plugins {
57-
id("org.jetbrains.kotlin.jvm") version "1.7.0"
58-
id("com.google.devtools.ksp") version "1.7.0-1.0.6"
57+
id("org.jetbrains.kotlin.jvm") version "1.9.0"
58+
id("com.google.devtools.ksp") version "1.9.0-1.0.13"
5959
}
6060
6161
repositories {
@@ -64,22 +64,22 @@ repositories {
6464
}
6565
6666
dependencies {
67-
ksp("me.tatarka.inject:kotlin-inject-compiler-ksp:0.6.1")
68-
implementation("me.tatarka.inject:kotlin-inject-runtime:0.6.1")
67+
ksp("me.tatarka.inject:kotlin-inject-compiler-ksp:0.6.2")
68+
implementation("me.tatarka.inject:kotlin-inject-runtime:0.6.2")
6969
}
7070
```
7171

7272
### or with KAPT (deprecated)
7373

7474
```groovy
7575
plugins {
76-
id("org.jetbrains.kotlin.jvm") version "1.7.0"
77-
id("org.jetbrains.kotlin.kapt") version "1.7.0"
76+
id("org.jetbrains.kotlin.jvm") version "1.9.0"
77+
id("org.jetbrains.kotlin.kapt") version "1.9.0"
7878
}
7979
8080
dependencies {
81-
kapt("me.tatarka.inject:kotlin-inject-compiler-kapt:0.6.1")
82-
implementation("me.tatarka.inject:kotlin-inject-runtime:0.6.1")
81+
kapt("me.tatarka.inject:kotlin-inject-compiler-kapt:0.6.2")
82+
implementation("me.tatarka.inject:kotlin-inject-runtime:0.6.2")
8383
}
8484
```
8585

gradle/libs.versions.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[versions]
2-
kotlin-inject = "0.6.2-SNAPSHOT"
2+
kotlin-inject = "0.6.2"
33
kotlin = "1.9.0"
44
ksp = "1.9.0-1.0.11"
55
kotlinpoet = "1.14.2"

0 commit comments

Comments
 (0)