Skip to content

Commit

Permalink
Merge main in dev-3.x (#2888)
Browse files Browse the repository at this point in the history
* fix binary compatibility (#2812)

* fix binary compatibility

Follow up from #2809

* update metalava signatures

* Ignore Android modules during Gradle sync. (#2811)

This improves autocomplete in IntelliJ/Android Studio

* Better UP-TO-DATE checks (#2817)

* remove the "Build-Timestamp" Manifest property

This makes the builds never up-to-date and compiling things over and
over again

* better up-to-date checks

* Fix broken url in docs (#2829)

## Summary

Easy navigation and easy reading for others

* Fix broken url in docs (#2828)

## Summary

Easy navigation and easy reading for others

* Fix broken url in docs (#2827)

* Fix broken url in docs

## Summary

Easy navigation and easy reading for others

* Update plugin-configuration.mdx

* Adding ApolloAndroidLogger to apollo-android-support.  (#2824)

* Adding ApolloAndroidLogger.

* Adding logger to KotlinSampleApp Http Cache.

* Adding note in README.md about apollo-android-support.

* Update README.md

Co-authored-by: Martin Bonnin <martin@mbonnin.net>

* update metalava signatures

Co-authored-by: Martin Bonnin <martin@mbonnin.net>

* Debugging renovate

* Update dependency gatsby to v2.29.3 (#2836)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* Update dependency gatsby-theme-apollo-docs to v4.5.12 (#2837)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* Update the ROADMAP ❄️❄️

* Update get-started-multiplatform.mdx

Multiplatform code is using NSUrlSession, not NSUrlConnection, thanks @dbaroncelli for reporting this!

* bump version to 2.5.0

* release 2.5.0

* version is now 2.5.1-SNAPSHOT

* update release documentation

* build tags

* release 2.5.1

* version is now 2.5.2-SNAPSHOT

* fix worflow file

* release 2.5.2

* version is now 2.5.3-SNAPSHOT

* Update gradle-wrapper.properties (#2852)

* Allow to store Json custom scalars in cache records (#2859)

* Do not sync android modules in the composite project

* Fix storing JsonScalars in Records

* Use Okio's base64 implementation (#2870)

java.util.Base64 is only available on API 26+ on Android while
Okio's implementation works on all API levels.

This fixes #2857

* Fix callback blocks (#2873)

* Fix potential case where the tests would wait forever (#2875)

* configure the Kotlin compiler option for multiplatform projects (#2877)

* Fix broken url in docs (#2829)

## Summary

Easy navigation and easy reading for others

* Fix broken url in docs (#2828)

## Summary

Easy navigation and easy reading for others

* Adding ApolloAndroidLogger to apollo-android-support.  (#2824)

* Adding ApolloAndroidLogger.

* Adding logger to KotlinSampleApp Http Cache.

* Adding note in README.md about apollo-android-support.

* Update README.md

Co-authored-by: Martin Bonnin <martin@mbonnin.net>

* update metalava signatures

Co-authored-by: Martin Bonnin <martin@mbonnin.net>

* Debugging renovate

* Update dependency gatsby to v2.29.3 (#2836)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* Update dependency gatsby-theme-apollo-docs to v4.5.12 (#2837)

Co-authored-by: Renovate Bot <bot@renovateapp.com>

* Update the ROADMAP ❄️❄️

* Update get-started-multiplatform.mdx

Multiplatform code is using NSUrlSession, not NSUrlConnection, thanks @dbaroncelli for reporting this!

* build tags

* fix worflow file

* Update gradle-wrapper.properties (#2852)

* Allow to store Json custom scalars in cache records (#2859)

* Do not sync android modules in the composite project

* Fix storing JsonScalars in Records

* Fix callback blocks (#2873)

* Fix potential case where the tests would wait forever (#2875)

* configure the Kotlin compiler option for multiplatform projects (#2877)

* cherry-pick of e64d34c

Use okio's base64

* fix integration tests

* fix integration-tests

Co-authored-by: SaintMalik <37118134+saintmalik@users.noreply.github.com>
Co-authored-by: Adam McNeilly <amcneilly331@gmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Nicklas Ansman Giertz <nicklas@ansman.se>
Co-authored-by: emmano <emmanuel.ortiguela@gmail.com>
  • Loading branch information
7 people committed Jan 20, 2021
1 parent 0f2a34d commit 80f660c
Show file tree
Hide file tree
Showing 26 changed files with 2,471 additions and 3,876 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Expand Up @@ -3,6 +3,8 @@ name: CI
on:
push:
branches: [ main, dev-3.x ]
tags:
- '*'
pull_request:
paths-ignore:
- 'docs/**'
Expand All @@ -11,7 +13,7 @@ on:
jobs:
build:

runs-on: macOS-latest
runs-on: macos-latest

steps:
- uses: actions/checkout@v2
Expand Down
3 changes: 2 additions & 1 deletion README.md
Expand Up @@ -69,6 +69,8 @@ dependencies {
implementation("com.apollographql.apollo:apollo-coroutines-support:x.y.z")
// optional: for RxJava3 support
implementation("com.apollographql.apollo:apollo-rx3-support:x.y.z")
// optional: Most of apollo-android does not depend on Android in practice and runs on any JVM or on Kotlin native. apollo-android-support contains a few Android-only helper classes. For an example to send logs to logcat or run callbacks on the main thread.
implementation("com.apollographql.apollo:apollo-android-support:x.y.z")
// optional: if you just want the generated models and parsers and write your own HTTP code/cache code, you can remove apollo-runtime
// and use apollo-api instead
implementation("com.apollographql.apollo:apollo-api:x.y.z")
Expand Down Expand Up @@ -112,4 +114,3 @@ If you'd like to contribute, please see [Contributing.md](https://github.com/apo
- [apollographql.com](http://www.apollographql.com/) to learn about Apollo open-source and commercial tools.
- [The Apollo blog](https://www.apollographql.com/blog/) for long-form articles about GraphQL, feature announcements for Apollo, and guest articles from the community.
- [The Apollo Twitter account](https://twitter.com/apollographql) for in-the-moment news.

25 changes: 12 additions & 13 deletions ROADMAP.md
Expand Up @@ -4,16 +4,11 @@ This document is meant to give the community some idea of where we're going with

Please open issues or comment/upvote the existing ones for items you'd like to see added here. Feedback is very welcome! We'd love to learn more about how you're using Apollo Android and what you'd like to see in the future.

This document was last updated on October 20th, 2020. For a more detailed and up-to-date view, you can check the project's [milestones](https://github.com/apollographql/apollo-android/milestones?direction=asc&sort=title&state=open).
This document was last updated on January 5th, 2021. For a more detailed and up-to-date view, you can check the project's [milestones](https://github.com/apollographql/apollo-android/milestones?direction=asc&sort=title&state=open).

## `main` branch (versions 2.x)

`main` is the stable branch. Non breaking improvements and bugfixes land here. This branch is actively maintained and battle-tested. Things that are coming in 2.4.2:

* SDL type extensions ([#2656](https://github.com/apollographql/apollo-android/issues/2656))
* Custom Fragments package names ([#2667](https://github.com/apollographql/apollo-android/issues/2667))
* HTTP cache key bypass ([#2659](https://github.com/apollographql/apollo-android/issues/2659))
* Bugfixes
`main` is the stable branch. Non breaking improvements and bugfixes land here. This branch is actively maintained and battle-tested.

While working on 2.x, we found a few limitations that could not be fixed without major breaking changes so we started developping `dev-3.x` in parallel. Once `dev-3.x` reaches alpha, it will be merged into `main`

Expand All @@ -25,14 +20,18 @@ While working on 2.x, we found a few limitations that could not be fixed without
* **Modular**, making it easy to change the transport, the cache implementation or using the generated models directly.
* **Fast**, with optimized json parsing speed to make your UIs even more reactive

The current target is to get a `3.0.0-alpha1` by the end of 2020. The full list of issues can be found in the [milestones](https://github.com/apollographql/apollo-android/milestones?direction=asc&sort=title&state=open). The most important ones are:
Generating Fragments as interfaces has proved to be quite challenging with a lot of edge cases so that's taking some time but we're hoping to release an alpha in Q1 2021. The `3.0.0-SNAPSHOTS` [are available on Sonatype snapshots](https://github.com/apollographql/apollo-android#snapshots) if you want to try it out. The reason it's not alpha yet is that it still misses a few features compared to 2.x. The full list of issues can be found in the [milestones](https://github.com/apollographql/apollo-android/milestones?direction=asc&sort=title&state=open). The most important ones are:

- **Fragments as interfaces** ([#1854](https://github.com/apollographql/apollo-android/issues/1854)): In 2.x, GraphQL fragments are generated as separate classes. While this works well, accessing fragments is verbose: hero.fragments.humanDetails?.homePlanet. Having fragments generated as interfaces will make the code more concise: `hero.humanDetails()?.homePlanet`. Code generation is now mostly working 🎉. It's a considerable change from 2.x so it will requires a lot of testing.

- **Streaming Json parser** ([#2523](https://github.com/apollographql/apollo-android/issues/2523)): Fragments as interfaces enable to stream the json response, i.e. read generating models directly from the Json parser instead of parsing to a Map and then to the generated models. This is now working in simple cases and showed a ~60% performance improvement in Json parsing. It still needs to be enabled in all cases, especially when normalization is involved.

- **Kotlin multiplatform normalized cache** ([#2636](https://github.com/apollographql/apollo-android/issues/2636)): The multiplatform cache infrastructure is now working with a Cache interceptor, SQLLite and in-memory cache. It's still missing watchers, custom fetchers, imperative store API and a few other things.

- **General API grooming**: As part of the major release, remove some deprecated APIs and streamline some complex APIs. Custom scalars (PR #2486) and the Android variants handling in the Gradle plugin (PR #2668) have been tweaked but new opportunities to cleanup the API will certainly show up.

- **Fragments as interfaces** ([#1854](https://github.com/apollographql/apollo-android/issues/1854)): As of today, GraphQL fragments are generated as separate classes. While this works well, accessing fragments is verbose: hero.fragments.humanDetails?.homePlanet. Having fragments generated as interfaces will make the code more concise: `hero.asHuman()?.homePlanet`, even `hero.homePlanet` if the type condition is always verified. Note that due to the massively complex nature of the changes, the Java codegen has been disabled in `dev-3.x` and will have to be mostly rewritten if needed.
- **Improved normalized cache APIs** ([#2331](https://github.com/apollographql/apollo-android/issues/2331)): It's been historically difficult to handle cases like pagination with the current normalized cache. We have also had a lot of questions around the usage of `CacheKeyResolver` and data expiration, garbage collection. Making the normalized cache multiplatform is a good opportunity to improve these APIs. This is the next big thing to tackle.

- **Streaming Json parser** ([#2523](https://github.com/apollographql/apollo-android/issues/2523)): Benchmarks have shown that parsing Json with Apollo Android is slower than with [Moshi](https://github.com/square/moshi). Part of the explanation is that, as of now, we parse in two steps. First from the json to a map and then from the map to the generated models. This is required with the current fragment's implementation. Reading fragment requires being able to "rewind" the stream to read fields that are defined multiple times. With fragments as interfaces, we could switch to a streaming parser and get some nice performance improvements.

- **Kotlin multiplatform normalized cache** ([#2636](https://github.com/apollographql/apollo-android/issues/2636)): The Kotlin multiplatform runtime is working but is still missing features compared to the JVM runtime. The normalized cache is one of them.

- **Improved normalized cache APIs** ([#2331](https://github.com/apollographql/apollo-android/issues/2331)): It's been historically difficult to handle cases like pagination with the current normalized cache. We have also had a lot of questions around the usage of `CacheKeyResolver` and data expiration, garbage collection. Making the normalized cache multiplatform is a good opportunity to improve these APIs.

- **General API grooming**: As part of the major release, remove some deprecated APIs and streamline some complex APIs such as the custom scalars ([PR #2486](https://github.com/apollographql/apollo-android/issues/2486)) and the Android variants handling in the Gradle plugin ([PR #2668](https://github.com/apollographql/apollo-android/pull/2668)).
@@ -0,0 +1,23 @@
package com.apollographql.apollo

import android.util.Log
import com.apollographql.apollo.Logger

/**
* This is an Android wrapper around [Logger] that will take any messages Apollo wants
* to print and log them in the Android logcat.
*/
class ApolloAndroidLogger : Logger {

override fun log(priority: Int, message: String, t: Throwable?, vararg args: Any) {
val formattedMessage = message.format(*args)
val tag = ApolloAndroidLogger::class.java.simpleName

when (priority) {
Logger.DEBUG -> Log.d(tag, formattedMessage)
Logger.WARN -> Log.w(tag, formattedMessage)
Logger.ERROR -> Log.e(tag, formattedMessage, t)
else -> Log.d(tag, formattedMessage)
}
}
}
@@ -0,0 +1,3 @@
query GetJsonScalar {
json
}

0 comments on commit 80f660c

Please sign in to comment.