Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update ktorfit to v2 (major) #318

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented May 27, 2024

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
de.jensklingenberg.ktorfit 1.14.0 -> 2.0.0 age adoption passing confidence
de.jensklingenberg.ktorfit:ktorfit-ksp 1.14.0 -> 2.0.0-1.0.22 age adoption passing confidence
de.jensklingenberg.ktorfit:ktorfit-lib-light 1.14.0 -> 2.0.0 age adoption passing confidence
de.jensklingenberg.ktorfit:ktorfit-lib 1.14.0 -> 2.0.0 age adoption passing confidence

Release Notes

Foso/Ktorfit (de.jensklingenberg.ktorfit)

v2.0.0

Compare Source

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

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about these updates again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot requested a review from skydoves as a code owner May 27, 2024 22:55
@renovate renovate bot force-pushed the renovate/major-ktorfit branch from 53edf37 to 884a300 Compare June 6, 2024 08:17
@renovate renovate bot force-pushed the renovate/major-ktorfit branch 2 times, most recently from 4f4ada4 to a0b2bf7 Compare June 20, 2024 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

0 participants