Advertisement ยท 728 ร— 90

Posts by Ralf

Joel and Jacob are two of the most talented (and most pleasant!) people I have ever worked with.

3 days ago 10 3 0 0
Preview
Metro Migration at Square Android How Square Android migrated its monorepo from Dagger 2 and Anvil to Metro over nine months and saved thousands of hours of build time.

We're wrapping up our migration to Metro internally for Square Android. I summarized some of our challenges and steps we took in a blog post. If you use Dagger 2 for a Kotlin project, then you should migrate to Metro sooner rather than later.

engineering.block.xyz/blog/metro-m...

3 days ago 28 8 0 2
Preview
Release 1.0.0-RC1 ยท ZacSweers/metro This is the first release candidate for Metro 1.0! This means that its runtime APIs (runtime, metrox artifacts, Gradle plugin, etc) will be API stable unless annotated with an experimental annotati...

Metro 1.0.0-RC1 is out now! Last call for feedback on the public, non-experimental runtime/metrox/gradle APIs!

github.com/ZacSweers/metro/re...

5 days ago 42 9 2 0

I enjoyed this episode a lot too!

1 week ago 0 0 0 0

This is one of the best podcast episodes I have listened to in a while. Highly recommend

podcastaddict.com/the-peterman...

1 week ago 3 0 1 0

I'm more excited about this than I should be.

1 week ago 1 0 0 0
Preview
Release 2.3.0 ยท square/kotlinpoet Thanks to @haruue, @hfhbd, @yz4230, @mina-jaff, @BoD, @RaoPrashanth for contributing to this release. New: Kotlin 2.3.20. New: KSP 2.3.6. New: Support for defining type aliases inside other types....

KotlinPoet 2.3.0 supports typealias declarations inside types, has new convenience API for adding annotations and ships with a healthy dose of bug fixes. Time for a version bump! ๐Ÿคœ๐Ÿค›

github.com/square/kotli...

3 weeks ago 13 3 0 0
Preview
Release 0.12.0 ยท ZacSweers/metro [MEEP-2014] Implicit class (map) keys MapKey.implicitClassKey is a new API to allow for class-based map keys to have their class parameters inferred on classes and @Binds declarations. This means t...

Metro 0.12.0 introduces implicit class keys, raises some min JVM/Gradle versions, drops some deprecated targets, and the usual host of other improvements and bug fixes!

github.com/ZacSweers/metro/re...

3 weeks ago 21 3 0 0

I literally implemented this in my toy project with Claude. The prompt was very dumb with something like "integrate the Metro dependency injection framework" and it did all the right things except for creating its own AppScope class instead of using the built-in class. It worked for me.

2 months ago 1 0 1 0
Advertisement
Post image

One underrated improvement Metro brings is its easy setup. No more configuring KAPT, runtime modules, keeping versions in sync, etc. You apply the Gradle plugin, setup a tiny graph and the rest is driven through constructor injection, @ContributesBinding and its other features. This was all I needed

2 months ago 17 3 1 0
Bazel on Android: The Good, The Bad and The Ugly - Valera & Erik | droidcon London 2025
Bazel on Android: The Good, The Bad and The Ugly - Valera & Erik | droidcon London 2025 YouTube video by nextapp devCon

Square did the same 7 years ago. This module structure was created with Bazel in mind, it's also mentioned in the original design doc. The goal was to scale horizontally. But then Bazel didn't happen ๐Ÿ™ƒ This talk got me a little excited again: www.youtube.com/watch?v=cSYe...

2 months ago 0 0 1 0

I wish we'd consider Bazel more seriously too, but it comes with other downsides. Build times are not the only metric.

2 months ago 1 0 2 0

With this structure we have now 7,000 Gradle modules in our codebase. Configuration time is painful. But with configure-on-demand, configuration caching and other strategies like using dev apps it's somewhat mitigated.

2 months ago 1 0 1 0

I agree with you. Modularizing by type instead of functionality often leads to issues you mentioned. Other bad examples are putting all feature flags in an enum or all Android Activities into the same module.

But I think Jesse's point here was showing how to break circular dependencies.

2 months ago 2 0 1 0
Flattening my Dependency Graph Rounds has a Kotlin server that integrates a few things: PostgreSQL persistence via SQLDelight (hosted on PlanetScale!)WebAuthn4J for Passkeyskotlinx.html for dynamic web pagesKtor for HTTP bindingThe...

๐Ÿฅž

2 months ago 18 5 5 0

No, quite the opposite in my opinion. The UI layer is just one consumer of the navigation state. If I run my app headless, then there's no UI layer.

2 months ago 2 0 1 0
Advertisement

On this scale, what does version 3.0 alpha 8 for 1.5 years mean?

3 months ago 3 0 1 0
Post image

Actually, OpenJDK 25 is 18% faster than OpenJDK 17 and 21 and a whopping 84% faster than OpenJDK 11. Upgrade now!

3 months ago 9 5 1 0
Preview
Adopting Ktfmt and Detekt How Square Android replaced Ktlint with Ktfmt and Detekt and improved Kotlin formatting speed by 40% in a 60,000+ file codebase.

I recently migrated our codebase away from Ktlint to Ktfmt and Detekt. I summarized the reasons and migration steps in a blog post: engineering.block.xyz/blog/adoptin...

3 months ago 21 8 1 0

Kotlin compiler plugins are amazing!

โœ… Expressive syntax
โœ… Compile-time checked
โœ… Fast at runtime

3 months ago 40 6 2 0

For real? We had so many power outages and they never offered anything.

3 months ago 0 0 1 0

I proposed 95% of what Metro became 4 years ago. In particular I called out error messages. I didn't get funding, perhaps I undersold the value.

In hindsight I'm happy. @zacsweers.dev did such a good job and pushes the boundaries of the compiler. 4 years ago this would have been worse.

4 months ago 12 0 1 0

We're getting there, but it'll take another few months. The migration steps are almost identical for us. There are quite a few extra hurdles for historical reasons, like migrating quite a few Java classes to Kotlin first.

4 months ago 2 0 1 0
Advertisement
Preview
Cash Android Moves to Metro The Cash Android team have completed the migration to Metro.

Cash Android has recently switched to Metro, a new, fast dependency injection framework built for K2. That was a fun project and we're really happy with the results! Sharing details on how we approached the migration to help teams adopt Metro: code.cash.app/cash-android...

4 months ago 31 16 0 4

This is fantastic and @zacsweers.dev deserves all the praise but it also is gonna give you a false idea of what Z is like as a maintainer and author, what the project is like, and how you might achieve something like this yourself

5 months ago 22 6 1 2

I adopted to always type "assDeb" for assembleDebug. Please don't judge me during pairing sessions.

6 months ago 7 0 2 0
Preview
Presenter - App Platform A lightweight application framework for state and memory management suitable for Kotlin Multiplatform projects.

Here is my take: amzn.github.io/app-platform...

6 months ago 4 1 1 0
Preview
App Platform A lightweight application framework for state and memory management suitable for Kotlin Multiplatform projects.

I'm quite proud of what I accomplished with my team at Amazon and will miss them. I'll keep working on App Platform as much as I can thanks to open source! amzn.github.io/app-platform/

7 months ago 4 0 0 0

After three wonderful years at Amazon I'm happy to share that I started this week at ... Square / Block again on my old team ๐Ÿชƒ I'm excited to think about developer productivity more deeply again.

7 months ago 30 1 3 0

Metro is conceptional very similar to Dagger + Anvil and kotlin-inject-anvil, which made this migration easy. I expect most new development to happen for Metro, so I wouldn't use kotlin-inject-anvil for new projects anymore.

7 months ago 2 0 1 0