Skip to content

ZacSweers/CatchUp

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[com.apollographql.apollo3](https://togithub.com/apollographql/apollo-kotlin)
| `3.7.5` -> `3.8.0` |
[![age](https://badges.renovateapi.com/packages/maven/com.apollographql.apollo3/3.8.0/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/maven/com.apollographql.apollo3/3.8.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/maven/com.apollographql.apollo3/3.8.0/compatibility-slim/3.7.5)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/maven/com.apollographql.apollo3/3.8.0/confidence-slim/3.7.5)](https://docs.renovatebot.com/merge-confidence/)
|
|
[com.apollographql.apollo3:apollo-runtime](https://togithub.com/apollographql/apollo-kotlin)
| `3.7.5` -> `3.8.0` |
[![age](https://badges.renovateapi.com/packages/maven/com.apollographql.apollo3:apollo-runtime/3.8.0/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/maven/com.apollographql.apollo3:apollo-runtime/3.8.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/maven/com.apollographql.apollo3:apollo-runtime/3.8.0/compatibility-slim/3.7.5)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/maven/com.apollographql.apollo3:apollo-runtime/3.8.0/confidence-slim/3.7.5)](https://docs.renovatebot.com/merge-confidence/)
|
|
[com.apollographql.apollo3:apollo-normalized-cache](https://togithub.com/apollographql/apollo-kotlin)
| `3.7.5` -> `3.8.0` |
[![age](https://badges.renovateapi.com/packages/maven/com.apollographql.apollo3:apollo-normalized-cache/3.8.0/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/maven/com.apollographql.apollo3:apollo-normalized-cache/3.8.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/maven/com.apollographql.apollo3:apollo-normalized-cache/3.8.0/compatibility-slim/3.7.5)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/maven/com.apollographql.apollo3:apollo-normalized-cache/3.8.0/confidence-slim/3.7.5)](https://docs.renovatebot.com/merge-confidence/)
|
|
[com.apollographql.apollo3:apollo-http-cache](https://togithub.com/apollographql/apollo-kotlin)
| `3.7.5` -> `3.8.0` |
[![age](https://badges.renovateapi.com/packages/maven/com.apollographql.apollo3:apollo-http-cache/3.8.0/age-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://badges.renovateapi.com/packages/maven/com.apollographql.apollo3:apollo-http-cache/3.8.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://badges.renovateapi.com/packages/maven/com.apollographql.apollo3:apollo-http-cache/3.8.0/compatibility-slim/3.7.5)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://badges.renovateapi.com/packages/maven/com.apollographql.apollo3:apollo-http-cache/3.8.0/confidence-slim/3.7.5)](https://docs.renovatebot.com/merge-confidence/)
|

---

### âš  Dependency Lookup Warnings âš 

Warnings were logged while processing this repo. Please check the
Dependency Dashboard for more information.

---

### Release Notes

<details>
<summary>apollographql/apollo-kotlin</summary>

###
[`v3.8.0`](https://togithub.com/apollographql/apollo-kotlin/blob/HEAD/CHANGELOG.md#Version-380)

*2023-03-28*

This release adds two new artifacts that contain Jetpack compose
extensions amongst other fixes.

#### 💙️ External contributors

Many thanks to [@&#8203;slinstacart](https://togithub.com/slinstacart)
and [@&#8203;hbmartin](https://togithub.com/hbmartin) for their
contributions to this release!

#### ✨ \[New] Jetpack compose extension
([#&#8203;4802](https://togithub.com/apollographql/apollo-kotlin/issues/4802))

You can now use the `apollo-compose-support` artifact:

```kotlin
// build.gradle.kts
dependencies {
  implementation("com.apollographql.apollo3:apollo-compose-support")
}
```

This artifact contains the `toState()` and `watchAsState()` extensions:

```kotlin
/**
 * A stateful composable that retrieves your data
 */
@&#8203;OptIn(ApolloExperimental::class)
@&#8203;Composable
fun LaunchDetails(launchId: String) {
    val response by apolloClient.query(LaunchDetailsQuery(launchId)).toState()
    val r = response
    when {
        r == null -> Loading() // no response yet
        r.exception != null -> ErrorMessage("Oh no... A network error happened: ${r.exception!!.message}")
        r.hasErrors() -> ErrorMessage("Oh no... A GraphQL error happened ${r.errors[0].message}.")
        else -> LaunchDetails(r.data!!, navigateToLogin)
    }
}

/**
 * A stateless composable that displays your data
 */
@&#8203;Composable
private fun LaunchDetails(
        data: LaunchDetailsQuery.Data,
) {
  // Your UI code goes here
}
```

If you are working with paginated data, you can also add
`apollo-compose-paging-support` to your dependencies:

```kotlin
// build.gradle.kts
dependencies {
  implementation("com.apollographql.apollo3:apollo-compose-paging-support")
}
```

This artifact contains a helper function to create
`androidx.pagin.Pager` instances ([androix
documentation](https://developer.android.com/reference/androidx/paging/Pager)):

```kotlin
@&#8203;OptIn(ApolloExperimental::class)
@&#8203;Composable
fun LaunchList(onLaunchClick: (launchId: String) -> Unit) {
  val lazyPagingItems = rememberAndCollectPager<LaunchListQuery.Data, LaunchListQuery.Launch>(
          config = PagingConfig(pageSize = 10),
          appendCall = { response, loadSize ->
            if (response?.data?.launches?.hasMore == false) {
              // No more pages
              null
            } else {
              // Compute the next call from the current response
              apolloClient.query(
                      LaunchListQuery(
                              cursor = Optional.present(response?.data?.launches?.cursor),
                              pageSize = Optional.present(loadSize)
                      )
              )
            }
          },
          getItems = { response ->
            // Compute the items to be added to the page from the current response
            if (response.hasErrors()) {
              Result.failure(ApolloException(response.errors!![0].message))
            } else {
              Result.success(response.data!!.launches.launches.filterNotNull())
            }
          },
  )
  
  // Use your paging items:
  if (lazyPagingItems.loadState.refresh is LoadState.Loading) {
    Loading()
  } else {
    LazyColumn {
      items(lazyPagingItems) { launch ->
        // Your UI code goes here
      }
      item {
        when (val append = lazyPagingItems.loadState.append) {
          is LoadState.Error -> // Add error indicator here 
          LoadState.Loading -> // Add loading indicator here
        }
      }
    }
  }
}
```

As always, feedback is very welcome. Let us know what you think of the
feature by
either [opening an issue on our GitHub
repo](https://togithub.com/apollographql/apollo-android/issues)
, [joining the
community](http://community.apollographql.com/new-topic?category=Help\&tags=mobile,client)
or [stopping by our channel in the KotlinLang
Slack](https://app.slack.com/client/T09229ZC6/C01A6KM1SBZ)(get your
invite [here](https://slack.kotl.in/)).

#### ✨ \[New] Gradle plugin: run codegen after gradle sync

If you import a new project or run a Gradle sync, your GraphQL models
are now automatically generated so that the IDE can find the symbols and
your files do not show red underlines. This takes into account Gradle
up-to-date checks and it should be pretty fast. If you want to opt-out,
you can do so with `generateSourcesDuringGradleSync.set(false)`:

```kotlin
apollo {
  // Enable automatic generation of models during Gradle sync (default)
  generateSourcesDuringGradleSync.set(true)

  // Or disable automatic generation of models to save on your Gradle sync times
  generateSourcesDuringGradleSync.set(false)

  service("api") {
    // Your  GraphQL configuration
  }
}
```

#### 👷‍ All changes

- Allow to add HTTP headers on top of ApolloClient ones
([#&#8203;4754](https://togithub.com/apollographql/apollo-kotlin/issues/4754))
- Kotlin 1.8
([#&#8203;4776](https://togithub.com/apollographql/apollo-kotlin/issues/4776))
- Move cache creation outside the main thread
([#&#8203;4781](https://togithub.com/apollographql/apollo-kotlin/issues/4781))
- Cache: ignore hardcoded
[@&#8203;include](https://togithub.com/include)(if: false) directives
([#&#8203;4795](https://togithub.com/apollographql/apollo-kotlin/issues/4795))
- Add % to reserved characters to encode in URL
([#&#8203;4804](https://togithub.com/apollographql/apollo-kotlin/issues/4804))
- First drop of experimental Compose support libraries
([#&#8203;4783](https://togithub.com/apollographql/apollo-kotlin/issues/4783))
- Consider variable default values with
@&#8203;skip/@&#8203;include/[@&#8203;defer](https://togithub.com/defer)
([#&#8203;4785](https://togithub.com/apollographql/apollo-kotlin/issues/4785))
- Gradle plugin: run codegen after gradle sync
([#&#8203;4796](https://togithub.com/apollographql/apollo-kotlin/issues/4796))
- Allow custom SqlDriver
([#&#8203;4806](https://togithub.com/apollographql/apollo-kotlin/issues/4806))
- Multipart subscriptions
([#&#8203;4768](https://togithub.com/apollographql/apollo-kotlin/issues/4768),
[#&#8203;4807](https://togithub.com/apollographql/apollo-kotlin/issues/4807),
[#&#8203;4738](https://togithub.com/apollographql/apollo-kotlin/issues/4738))
- GQLNode.print for type extensions
([#&#8203;4814](https://togithub.com/apollographql/apollo-kotlin/issues/4814))

</details>

---

### 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.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://app.renovatebot.com/dashboard#github/ZacSweers/CatchUp).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNS4zMS40IiwidXBkYXRlZEluVmVyIjoiMzUuMzEuNCJ9-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Zac Sweers <pandanomic@gmail.com>
8d2b43c

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
app
 
 
art
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

CatchUp

An app for catching up on things.

https://www.zacsweers.dev/catching-up-on-catchup-introduction/

Motivations

There's a lot of services I like reading up on throughout the day. Most of these services have dedicated apps for consuming them, but often times I just want to skim the front page and only deep dive occasionally. Enter CatchUp: a high level presentation of the "front page" of several services in short form, and intelligent deeplinking into dedicated apps if you want to go further.

CatchUp is not an all-purpose client for each of these services, just the concierge for at-a-glance details and router for getting on your way. It does not support login for any service, it does not support customization/filtering of their feed. CatchUp is dumb, and you should use one of the many great dedicated apps for this if you want more integration features.

CatchUp is also very much a testing ground for things I personally dive into, from architecture, libraries, patterns, API quirks, and more. It's been a very fun project to spike test new things.

Features

  • Multiple services
  • Hacker News
  • Reddit
  • Medium
  • Product Hunt
  • Slashdot
  • Designer News
  • Dribbble
  • GitHub
  • Infinite scrolling on supported services
  • Pleasant, simple, consistent UI for across services
  • Night mode
  • Smart deeplinking into dedicated apps

Technologies

  • Kotlin
  • RxJava 3/AutoDispose
  • Debugging tooling as a first class citizen in the debug build
  • Leak Canary, Scalpel, debug drawer, Flipper, bug reporting, the works
  • AndroidX/Jetpack
  • Dagger 2 + Anvil
  • One of the more interesting parts of CatchUp is that its service architecture is a Dagger-powered plugin system
  • Room
  • Firebase
  • Coil
  • Apollo GraphQL
  • Standard Square buffet of Okio/OkHttp 3/Retrofit 2/Moshi
  • Inspector
  • KSP

There's a lot of neat/interesting little tidbits in the CatchUp source code that I plan to write a mini blog series about. Each service has its own nuances that make them unique to work with in code.

Testing

While this is a personal pet project, extensive tests can be found here.

Influences

This app owes a lot of its inspiration, implementation details, and general inner workings to the work of others. Particularly:

Development

If you'd like to build CatchUp locally, you should be able to just clone and build with no issues. The project requires whatever JDK version is currently defined libs.versions.toml.

CatchUp tends to keep up with Android Studio canaries, so you may have to use a canary version. Check the AGP version in libs.versions.toml.

If you want to build with working services, some require API keys. See the wiki for more details on which services require keys.

Bug fixes are always welcome. Tests are too if you're into that kinda thing, but I'm not actively trying to make this project a shining icon of TDD. For new features or otherwise significant work, please discuss in an issue first.

License

Copyright (C) 2017 Zac Sweers

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.