Skip to content

Commit 00d0429

Browse files
martinbonninBoD
andauthored
Deprecate apollo-cli (#5983)
* Deprecate Apollo CLI * update migration guide * Update docs/source/migration/4.0.mdx Co-authored-by: Benoit 'BoD' Lubek <[email protected]> --------- Co-authored-by: Benoit 'BoD' Lubek <[email protected]>
1 parent f88f188 commit 00d0429

File tree

2 files changed

+40
-31
lines changed
  • docs/source/migration
  • libraries/apollo-cli-incubating/src/main/kotlin/com/apollographql/apollo3/cli

2 files changed

+40
-31
lines changed

docs/source/migration/4.0.mdx

Lines changed: 37 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,43 @@ val call = client.query(MyQuery())
196196

197197
`HttpEngine` now implements `Closeable` and has its `dispose` method renamed to `close`. If you have a custom `HttpEngine`, you need to implement `close` instead of `dispose`.
198198

199-
## Apollo Gradle Plugin
199+
200+
## Maven artifacts reorganization
201+
202+
Over the years, a lot of support functionality was added alongside `apollo-api` and `apollo-runtime`. While useful, most of this functionality doesn't share the same level of stability and maturity as the main artifacts and bundling them did not make much sense.
203+
204+
Moving forward, some artifacts are released separately and have new Maven coordinates, GitHub repositories and package names. Others are deprecated.
205+
206+
For the initial v4 release, all the artifacts are kept with deprecation warnings. They will be removed in the future.
207+
208+
The artifacts are:
209+
210+
* apollo-mockserver
211+
* MockServer was born out of our own internal needs for a KMP-ready mockserver. Most of its public API is subject to change, and it has been moved to a separate repository.
212+
* apollo-cli-incubating
213+
* The Apollo CLI contract is subject to change and it has been moved to a separate repository.
214+
* apollo-rx-support
215+
* The RxJava{2-3} artifacts are very thin wrappers around kotlinx-coroutines-rx{2-3} and we recommend using those instead.
216+
* apollo-idling-resource
217+
* ApolloIdlingResource is deprecated. We recommend using reactive patterns to test your UI instead. See [this article about ways to do so](https://medium.com/androiddevelopers/alternatives-to-idling-resources-in-compose-tests-8ae71f9fc473) for more details.
218+
219+
### Summary
220+
221+
| Old coordinates | New coordinates | New Repository |
222+
|--------------------------------------------------|------------------------------------------------|:----------------------------------------------------------|
223+
| com.apollographql.apollo3:apollo-mockserver | com.apollographql.mockserver:apollo-mockserver | https://github.com/apollographql/apollo-kotlin-mockserver |
224+
| com.apollographql.apollo3:apollo-cli-incubating | com.apollographql.mockserver:apollo-cli | https://github.com/apollographql/apollo-kotlin-cli |
225+
| com.apollographql.apollo3:apollo-idling-resource | Deprecated | Deprecated |
226+
| com.apollographql.apollo3:apollo-rx2-support | Deprecated | Deprecated |
227+
| com.apollographql.apollo3:apollo-rx3-support | Deprecated | Deprecated |
228+
229+
230+
| Old package name | New package name |
231+
|--------------------------------------|------------------------------|
232+
| com.apollographql.apollo3.mockserver | com.apollographql.mockserver |
233+
| com.apollographql.apollo3.cli | com.apollographql.cli |
234+
235+
## Gradle Plugin
200236

201237
### Multi-module `dependsOn`
202238

@@ -617,37 +653,7 @@ apolloClient.query().rxSingle()
617653
apolloClient.query().toFlow().asFlowable().firstOrError()
618654
```
619655

620-
## New Maven coordinates for some artifacts
621-
622-
Over the years, a lot of support functionality was added alongside `apollo-runtime`. While useful, most of this functionality doesn't share the same level of stability and bundling the release does not make much sense.
623-
624-
Moving forward, `apollo-mockserver` is released separately.
625-
626-
Replace maven coordinates:
627-
628-
```kotlin
629-
dependencies {
630-
// Replace
631-
testImplementation("com.apollographql.apollo3:apollo-mockserver:$apolloVersion")
632-
633-
// With
634-
testImplementation("com.apollographql.mockserver:apollo-mockserver:$mockServerVersion")
635-
}
636-
```
637-
638-
And the package names:
639-
640-
```kotlin
641-
// Replace
642-
import com.apollographql.apollo3.mockserver
643-
644-
// With
645-
import com.apollographql.mockserver
646-
```
647-
648-
## ApolloIdlingResource is deprecated
649656

650-
We recommend using reactive patterns to test your UI instead. See [this article about ways to do so](https://medium.com/androiddevelopers/alternatives-to-idling-resources-in-compose-tests-8ae71f9fc473).
651657

652658
## Example of a migration
653659

libraries/apollo-cli-incubating/src/main/kotlin/com/apollographql/apollo3/cli/Main.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.apollographql.apollo3.cli
22

3+
import com.apollographql.apollo3.annotations.ApolloDeprecatedSince
34
import com.github.ajalt.clikt.core.CliktCommand
45
import com.github.ajalt.clikt.core.PrintCompletionMessage
56
import com.github.ajalt.clikt.core.subcommands
@@ -50,6 +51,8 @@ private class PlaceHolderCommand : CliktCommand(name = "placeholder") {
5051
}
5152
}
5253

54+
@Deprecated("The Apollo CLI has new maven coordinates at 'com.apollographql.cli:apollo-cli. See https://go.apollo.dev/ak-4-migration-guide for more details.")
55+
@ApolloDeprecatedSince(ApolloDeprecatedSince.Version.v4_0_0)
5356
fun main(args: Array<String>) {
5457
MainCommand("apollo-cli")
5558
.subcommands(MyCompletionCommand())

0 commit comments

Comments
 (0)