apollo-kotlin icon indicating copy to clipboard operation
apollo-kotlin copied to clipboard

🧹 4.0 cleanups

Open martinbonnin opened this issue 3 years ago • 4 comments

This is a list of changes that we can't do right now but should do in the next major release. This list is mostly a braindump and is missing a lot of context. This is not about new features but rather a list of small cleanups to do.

If you see anything that doesn't make any sense, it's probably because it doesn't. Feel free to comment and we'll dive into it.

Potential Breaking Changes/cleanups

  • [x] ~Remove suspend from the ApolloStore APIs~ Offer a non-suspend version
  • [x] Validation of operation directives #4518
  • [x] Switch jvm-defaults to "all" (thus requiring Java8, which we require already anyways)
  • [x] Remove antlr
  • [x] move deferredMergedFragments and variables outside of CustomScalarAdapter
  • [x] Make apollo-ast's com.apollographql.apollo3.ast.introspection.* classes non public to reduce the API surface (including the json serializers) as they are probably not useful to end-users
  • [x] Enable KDoc again
  • [x] Add schemaPackageName/packageName to the Gradle configuration.
  • [x] ApolloCall execute / toFlow / exception handling improvements
  • [x] introduce HasDirective interface
  • [x] Rename dispose to close and implement okio.Closeable on NetworkTransport, HttpEngine, ApolloStore - That makes it difficult as it is a breaking change to add methods on interfaces.
  • [x] Remove Fragment.readDataFromCache
  • [x] Capitalize the generated class name for enums, to be consistent with other generated types
  • [x] Validate operation directives https://github.com/apollographql/apollo-kotlin/issues/2673
  • [x] Deprecate ApolloCompositeException with Error level and use suppressed exceptions instead
  • [x] ~Make ApolloMetadata internal~ (it's ultimately not internal because needed by plugins)
  • [ ] Enforce opt-in the kotlin_labs linking
  • [ ] Rename Foo.type to Foo.__type to avoid nameclashes (or just leave it like this because we can detect the case. See https://github.com/apollographql/apollo-kotlin/issues/4293)
  • [ ] Rewrite the buffered adapters to not use JsonReader anymore
  • [ ] Cleanup the JsonReader API and distinguish between the buffer/non buffered case.
  • [ ] Generate the customScalarAdapters?
  • [ ] Make the field merging validation more strict (see https://github.com/apollographql/apollo-kotlin/pull/4342#pullrequestreview-1083903524)
  • [ ] Use scalar instead of customScalar https://github.com/apollographql/apollo-kotlin/issues/3815
  • [ ] Refactor shapes()
  • [ ] Move httpInfo and others outside of executionContext
  • [ ] Improve the Java ergonomics of HttpKt
  • [ ] (To be considered): pass the variant name to the lambda for createAllAndroidVariantServices (see this comment) (or deprecate the function?)
  • [ ] Rename WsProtocol.Factory to WsProtocol.Builder
  • [ ] Remove IdlingResource. See this comment from OkHttp for instance, and this article about how to avoid them with Compose.
  • [ ] Remove circular dependencies between Gradle projects
  • [ ] extract HttpEngine and WebSocketEngine to a common module
  • [x] Remove our own runTest
  • [ ] Remove Gradle defaultService

martinbonnin avatar Jun 06 '22 12:06 martinbonnin

Just saw this, and "Remove Fragment.readDataFromCache" from the list grabbed my attention. Would this also imply removing ApolloStore.readFragment()? I am interested in this because our app relies heavily on being able to query for fragments from the store (and watch them, but that's its own can of worms 😁). Thanks!

eduardb avatar Oct 04 '22 16:10 eduardb

It's a technicality mostly. Fragment.readDataFromCache will be removed but all the functionality will be exposed as Executable.readDataFromCache. If you take a look at the source, both of them are present already, but one is deprecated because not really needed. AFAIK, it should be source compatible so you shouldn't need to change anything.

martinbonnin avatar Oct 04 '22 17:10 martinbonnin