Skip to content

Commit f3b19af

Browse files
committed
Prepare release 0.6.0
1 parent 21fbd53 commit f3b19af

File tree

3 files changed

+32
-4
lines changed

3 files changed

+32
-4
lines changed

CHANGELOG.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,34 @@ 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.0] 2202-12-21
9+
10+
### Changed
11+
12+
- Added the ability to explicitly mark assisted injection parameters with an `@Assisted` annotation. Not providing them
13+
will currently warn which will become an error in the future. This allows better documentation on which params are
14+
injected and which ones are provided by the caller. It also allows more flexibility for parameter ordering, you can
15+
put the assisted params at the start instead of at the end if you so choose.
16+
17+
For example, if you have:
18+
19+
```kotlin
20+
@Inject class AssistedClass(arg1: One , arg2: Two, arg3: Three)
21+
@Inject Usage(createAssistedClass: (Two, Three) -> AssistedClass)
22+
```
23+
24+
you should update it to:
25+
```kotlin
26+
@Inject class AssistedClass(arg1: One , @Assisted arg2: Two, @Assisted arg3: Three)
27+
```
28+
29+
### Fixed
30+
- `@Inject` annotations being ignored if used through a typealias, ex:
31+
```kotlin
32+
typealias MyInject = Inject
33+
@MyInject class MyClassToInject
34+
```
35+
836
## [0.5.1] 2022-07-05
937

1038
### Fixed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -387,12 +387,12 @@ class MyClass(fooCreator: () -> Foo) {
387387
}
388388
```
389389

390-
If you define args, you can use these to assist the creation of the dependency. These are passed in as the _last_
391-
arguments to the dependency.
390+
If you define args, you can use these to assist the creation of the dependency. To do so, mark these args with the
391+
`@Assisted` annotation. The function should take the same number of assisted args in the same order.
392392

393393
```kotlin
394394
@Inject
395-
class Foo(bar: Bar, arg1: String, arg2: String)
395+
class Foo(bar: Bar, @Assisted arg1: String, @Assisted arg2: String)
396396

397397
@Inject
398398
class MyClass(fooCreator: (arg1: String, arg2: String) -> Foo) {

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[versions]
2-
kotlin-inject = "0.5.2-SNAPSHOT"
2+
kotlin-inject = "0.6.0"
33
kotlin = "1.5.31"
44
ksp = "1.5.31-1.0.1"
55
kotlinpoet = "1.10.1"

0 commit comments

Comments
 (0)