google / horologist

Horologist is a group of libraries that aim to supplement Wear OS developers with features that are commonly required by developers but not yet available.
https://google.github.io/horologist/
Apache License 2.0
561 stars 90 forks source link

[0.5.x] Remove unused non-Wear navigation dependencies #2215

Closed cbeyls closed 5 months ago

cbeyls commented 5 months ago

WHAT

The compose-layout library in the 0.5.x branch depends on androidx.navigation:navigation-compose and androidx.navigation:navigation-ui-ktx, two unused phone libraries. This pull request removes these dependencies.

WHY

These libraries are designed for Android phones and not Wear devices, which should use androidx.wear.compose.* libraries instead. In particular, androidx.navigation:navigation-ui-ktx depends on both AppCompat and Material Components, which bring along a lot of unwanted resources and dependencies that the shrinker is unable to discard. As a result, a Wear application apk file grows by about 1MB of unnecessary code.

The horologist code does not reference these libraries so the removal has no impact on it.

HOW

Remove implementation declarations in buid.gradle.kts.

yschimke commented 5 months ago

Thanks

I'll make the same change on main on monday, unless you want to. And cut a 0.5.x release as I assume you want that.

cbeyls commented 5 months ago

Thanks

I'll make the same change on main on monday, unless you want to. And cut a 0.5.x release as I assume you want that.

I didn't notice the same issue on the main branch. The library is still present in libs.version.toml, but it's not used as a dependency in any module.

And yes, a new release would be nice :)

yschimke commented 5 months ago

Released in https://github.com/google/horologist/releases/tag/v0.5.27