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

Update to Ktor 3 #6214

Merged
merged 12 commits into from
Oct 23, 2024
Merged

Update to Ktor 3 #6214

merged 12 commits into from
Oct 23, 2024

Conversation

martinbonnin
Copy link
Contributor

@martinbonnin martinbonnin commented Oct 22, 2024

This is a work in progress as it requires a release of:

  • apollo-kotlin-mockserver
  • apollo-kotlin-execution

Update to Ktor3

This is technically a breaking change but standard use cases shouldn't be affected so I'm suggesting we release this as a minor version.

If you are using Apollo Kotlin in an Android app, your are not affected.

You are affected if:

  1. You are using JS:
    You'll have to update your project to Ktor 3 when updating to Apollo Kotlin 4.1.0. Or you can start using the experimental websockets and exclude the Ktor transitive dependencies from apollo-runtime-js.
  2. You are using apollo-debug-server-jvm (Note: apollo-debug-server-android is not impacted):
    You'll have to update your project to Ktor 3 when updating to Apollo Kotlin 4.1.0.
  3. You are using com.apollographql.apollo:apollo-mockserver:
    MockServer has moved to new coordinates in v4. The old MockServer was only kept as a redirect marker and is now removed. Use com.apollographql.mockserver:apollo-mockserver instead and replace all the com.apollographql.apollo.mockserver with com.apollographql.mockserver in your project. Keep using versions 0.0.x for Ktor2 or update to 0.1.x for Ktor3.
  4. You are using deprecated MockServer helpers in apollo-testing-support:
    Those helpers were never meant to be public and are removed. Copy/paste them in your project if needed.

Technical details

apollo-mockserver is removed from this repo. I contemplated keeping it to avoid a breaking change but the Ktor3 update is a breaking change anyway so I figured we might as well accept our loss here and move on.

Both apollo-mockserver and apollo-ktor-engine are now Maven tombstones. They should publish a redirect marker on maven central. Never tried that but could be useful. Edit: ultimately, the tombstone were removed because there is very little tooling to work with them.

The execution algorithms should probably move to this repo. This is a logical place to be. Plus it'll allow removing the external dependency for apollo-debug-server-jvm.

More generally, apollo-debug-server should have been marked experimental given it includes pre-release dependencies.

More comments inline

@svc-apollo-docs
Copy link
Collaborator

svc-apollo-docs commented Oct 22, 2024

✅ Docs Preview Ready

No new or changed pages found.

Copy link

netlify bot commented Oct 22, 2024

Deploy Preview for apollo-android-docs canceled.

Name Link
🔨 Latest commit 42753a9
🔍 Latest deploy log https://app.netlify.com/sites/apollo-android-docs/deploys/6718c0367c62ad0008304e02

@martinbonnin martinbonnin mentioned this pull request Oct 22, 2024
Copy link
Contributor

@BoD BoD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -402,7 +402,6 @@ public final class com/apollographql/apollo/api/CompiledVariable {
public final class com/apollographql/apollo/api/CustomScalarAdapters : com/apollographql/apollo/api/ExecutionContext$Element {
public static final field Empty Lcom/apollographql/apollo/api/CustomScalarAdapters;
public static final field Key Lcom/apollographql/apollo/api/CustomScalarAdapters$Key;
public static final field PassThrough Lcom/apollographql/apollo/api/CustomScalarAdapters;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is due to a BCV update

final fun <get-entries>(): kotlin.enums/EnumEntries<com.apollographql.apollo.api.http/HttpMethod> // com.apollographql.apollo.api.http/HttpMethod.entries.<get-entries>|<get-entries>#static(){}[0]

final fun valueOf(kotlin/String): com.apollographql.apollo.api.http/HttpMethod // com.apollographql.apollo.api.http/HttpMethod.valueOf|valueOf#static(kotlin.String){}[0]
final fun values(): kotlin/Array<com.apollographql.apollo.api.http/HttpMethod> // com.apollographql.apollo.api.http/HttpMethod.values|values#static(){}[0]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Klib API dump changed a lot. Not reporting upstream because Klib support is still experimental and I guess this is to be expected.

@martinbonnin martinbonnin marked this pull request as ready for review October 23, 2024 09:39
@martinbonnin martinbonnin merged commit 88748d0 into main Oct 23, 2024
10 checks passed
@martinbonnin martinbonnin deleted the update-ktor branch October 23, 2024 09:39
@martinbonnin martinbonnin changed the title [WIP] Update to Ktor 3 Update to Ktor 3 Oct 23, 2024
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.

3 participants