Skip to content

Releases: Foso/Ktorfit

2.2.0

10 Nov 22:44
e8021b9
Compare
Choose a tag to compare

2.1.0

01 Sep 13:49
Compare
Choose a tag to compare

2.0.1

09 Aug 21:06
7a7d7dc
Compare
Choose a tag to compare

2.0.1 - 2024-08-08

See Changelog

New Contributors

Full Changelog: 2.0.0...2.0.1

2.0.0

27 May 21:20
962e438
Compare
Choose a tag to compare

2.0.0 - 2024-05-27

Changed

  • Build with KSP 1.0.21, Kotlin 2.0.0, Ktor 2.3.11
  • The needed dependencies for Ktorfit KSP processor are now included in the Ktorfit Gradle plugin. You can remove the ksp() block from your build.gradle.kts file. You still need to apply the KSP plugin.
plugins {
id("com.google.devtools.ksp") version "CURRENT_KSP_VERSION"
id("de.jensklingenberg.ktorfit") version "2.0.0"
}

See the installation guide for more information: https://foso.github.io/Ktorfit/installation/

  • The code that is generated by KSP is now accessible from the module where the interface is defined. That means code from commonMain can now find the generated code. Generated code from the platform specific code is still only available from the specific modules.
  • The create function is now deprecated. The reason for that is that it is relying on a compiler plugin to work. This can lead to compile errors when the class can't be found. The plan is to get rid of the plugin. When your project is configured correct, the autocompletion should show an extension function create followed by the name of the interface. This function will not trigger the compiler plugin
val api = ktorfit.create<ExampleApi>()

replace with:

val api = ktorfit.createExampleApi()

Breaking Changes

The deprecated code got removed.
This will simplify the codebase and make it easier to maintain.
When you haven't used the deprecated converters, there is not much you need to change.
The dependencies for the converters that were previously auto added now need to be added manually.
See the migration guide for more information: https://foso.github.io/Ktorfit/migration/#from-2-to-200

  • QualifiedTypeName in Ktorfit

In the previous versions of Ktorfit, the qualifiedTypename was always generated in the code. This was used in the TypeData.createTypeData() function to provide a fully qualified type name for the data type being used.

val _typeData = TypeData.createTypeData(
    typeInfo = typeInfo<Call<People>>(),
    qualifiedTypename = "de.jensklingenberg.ktorfit.Call<com.example.model.People>"
)

In the new version of Ktorfit, this behavior has been changed. Now, by default, Ktorfit will keep qualifiedTypename for TypeData in the generated code empty. This means that the qualifiedTypename will not be automatically generated.

val _typeData = TypeData.createTypeData(
    typeInfo = typeInfo<Call<People>>(),
)

However, if you want to keep the old behavior and generate qualifiedTypename, you can set it in the Ktorfit config generateQualifiedTypeName to true in your build.gradle.kts file.

ktorfit {
  generateQualifiedTypeName = true
}

This change was made to provide more flexibility and control to the developers over the generated code. Please update your code accordingly if you were relying on the automatic generation of qualifiedTypename.

Fixed

2.0.0-rc01

19 May 17:38
ee06b8a
Compare
Choose a tag to compare
2.0.0-rc01 Pre-release
Pre-release
  • Build with KSP 1.0.20, Kotlin 2.0.0-RC3, Ktor 2.3.11
  • Optimized code generation
  • Fixes #548

2.0.0-beta1

28 Apr 18:22
8e51a1d
Compare
Choose a tag to compare
2.0.0-beta1 Pre-release
Pre-release

2.0.0-beta1 - 2024-04-28

Breaking Changes

The deprecated code got removed.
This will simplify the codebase and make it easier to maintain.
When you haven't used the deprecated converters, there is not much you need to change.
Some converters that were previously auto applied now need to be added manually.
See the migration guide for more information: https://foso.github.io/Ktorfit/migration/#from-2-to-200

QualifiedTypeName in Ktorfit

In the previous versions of Ktorfit, the qualifiedTypename was always generated in the code. This was used in the TypeData.createTypeData() function to provide a fully qualified type name for the data type being used.

val _typeData = TypeData.createTypeData(
    typeInfo = typeInfo<Call<People>>(),
    qualifiedTypename = "de.jensklingenberg.ktorfit.Call<com.example.model.People>"
)

In the new version of Ktorfit, this behavior has been changed. Now, by default, Ktorfit will keep qualifiedTypename for TypeData in the generated code empty. This means that the qualifiedTypename will not be automatically generated.

val _typeData = TypeData.createTypeData(
    typeInfo = typeInfo<Call<People>>(),
)

However, if you want to keep the old behavior and generate qualifiedTypename, you can set a KSP argument Ktorfit_QualifiedTypeName to true in your build.gradle.kts file.

ksp {
    arg("Ktorfit_QualifiedTypeName", "true")
}

This change was made to provide more flexibility and control to the developers over the generated code. Please update your code accordingly if you were relying on the automatic generation of qualifiedTypename.

1.14.0

15 Apr 19:26
Compare
Choose a tag to compare
  • Build with KSP 1.0.20, Kotlin 2.0.0-RC1, Ktor 2.3.10

1.13.0

14 Apr 20:25
24e2b17
Compare
Choose a tag to compare
  • Build with KSP 1.0.20, Kotlin 1.9.23, Ktor 2.3.10

1.12.0

17 Jan 20:13
93aa71f
Compare
Choose a tag to compare

1.12.0 - 2024-01-16

  • Compatible with KSP 1.0.16 and Kotlin 1.9.22

1.11.1

21 Dec 15:40
f88f3e2
Compare
Choose a tag to compare

1.11.1 - 2023-12-21