Joel and Jacob are two of the most talented (and most pleasant!) people I have ever worked with.
Posts by Ralf
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...
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...
I enjoyed this episode a lot too!
This is one of the best podcast episodes I have listened to in a while. Highly recommend
podcastaddict.com/the-peterman...
I'm more excited about this than I should be.
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...
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...
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.
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
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...
I wish we'd consider Bazel more seriously too, but it comes with other downsides. Build times are not the only metric.
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.
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.
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.
On this scale, what does version 3.0 alpha 8 for 1.5 years mean?
Actually, OpenJDK 25 is 18% faster than OpenJDK 17 and 21 and a whopping 84% faster than OpenJDK 11. Upgrade now!
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...
Kotlin compiler plugins are amazing!
โ
Expressive syntax
โ
Compile-time checked
โ
Fast at runtime
For real? We had so many power outages and they never offered anything.
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.
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.
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...
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
I adopted to always type "assDeb" for assembleDebug. Please don't judge me during pairing sessions.
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/
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.
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.