Ralf's Avatar

Ralf

@ralf-wondratschek.com

https://ralf-wondratschek.com/ | Senior staff engineer at Block / Square, formerly Principal Engineers at Amazon and Evernote | GoogleDevExpert for Android | https://github.com/amzn/app-platform

1,021
Followers
122
Following
91
Posts
03.11.2024
Joined
Posts Following

Latest posts by Ralf @ralf-wondratschek.com

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.

06.02.2026 02:38 ๐Ÿ‘ 1 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0
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

05.02.2026 16:25 ๐Ÿ‘ 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...

03.02.2026 20:36 ๐Ÿ‘ 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.

03.02.2026 17:25 ๐Ÿ‘ 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.

03.02.2026 16:37 ๐Ÿ‘ 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.

03.02.2026 07:57 ๐Ÿ‘ 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...

๐Ÿฅž

03.02.2026 05:33 ๐Ÿ‘ 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.

19.01.2026 03:24 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

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

18.01.2026 08:11 ๐Ÿ‘ 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!

09.01.2026 08:36 ๐Ÿ‘ 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...

05.01.2026 18:20 ๐Ÿ‘ 21 ๐Ÿ” 8 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

Kotlin compiler plugins are amazing!

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

28.12.2025 12:50 ๐Ÿ‘ 40 ๐Ÿ” 6 ๐Ÿ’ฌ 2 ๐Ÿ“Œ 0

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

23.12.2025 05:48 ๐Ÿ‘ 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.

23.11.2025 00:33 ๐Ÿ‘ 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.

19.11.2025 15:19 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0
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...

18.11.2025 22:40 ๐Ÿ‘ 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

08.11.2025 07:01 ๐Ÿ‘ 22 ๐Ÿ” 6 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 2

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

14.10.2025 16:04 ๐Ÿ‘ 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...

18.09.2025 23:55 ๐Ÿ‘ 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/

11.09.2025 23:07 ๐Ÿ‘ 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.

11.09.2025 23:07 ๐Ÿ‘ 31 ๐Ÿ” 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.

05.09.2025 18:34 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0
Preview
Release 0.0.6 ยท amzn/app-platform Added Added support for Metro as dependency injection framework. User can choose between kotlin-inject-anvil and Metro. For more details see the documentation for how to setup and use both depende...

Our KMP framework App Platform now supports Metro out of the box: github.com/amzn/app-pla...

@zacsweers.dev is pushing the boundaries with Metro and there are still some Kotlin compiler bugs that need to be resolved, but on the JVM / Android it works.

05.09.2025 18:34 ๐Ÿ‘ 6 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0
ktfmt - the Kotlin code formatter

I've been using ktfmt over KtLint for a few months for some projects. It's a blessing and so much easier to deal with. I forgot how much I missed 2 space indent in Kotlin.

facebook.github.io/ktfmt/

22.08.2025 18:36 ๐Ÿ‘ 5 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
GitHub - Evernote/android-job: Android library to handle jobs in the background. Android library to handle jobs in the background. Contribute to Evernote/android-job development by creating an account on GitHub.

Can I delete this now? github.com/Evernote/and...

02.08.2025 02:06 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0
Preview
Changelog - App Platform A lightweight application framework for state and memory management suitable for Kotlin Multiplatform projects.

We published a new version of App Platform with back button support. We also added recipes for saving presenter state, app bar integration and backstack navigation.

Working with Compose in the business logic (Molecule) and UI (Compose Multiplatform) is so much fun.

amzn.github.io/app-platform...

25.07.2025 18:03 ๐Ÿ‘ 8 ๐Ÿ” 0 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0
Preview
GitHub - uber/needle: Compile-time safe Swift dependency injection framework Compile-time safe Swift dependency injection framework - uber/needle

Today I learned that Cleanse from Square was deprecated. I haven't tried Needle yet, but it makes the same promises as Dagger.

github.com/uber/needle

24.07.2025 15:46 ๐Ÿ‘ 2 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

Singleton in the scope by default, based on the large codebases I've seen. I've written @SingleIn way too often and explained way too often why a class doesn't need to be a Singleton. I want this to be explicit.

18.07.2025 14:17 ๐Ÿ‘ 4 ๐Ÿ” 0 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0

Anvil was quite successful inside and outside of Square, but now it's time for the next big improvement. Metro is 95% of what I pitched as Dagger 3 within Square. I'm excited.

18.07.2025 14:02 ๐Ÿ‘ 19 ๐Ÿ” 4 ๐Ÿ’ฌ 1 ๐Ÿ“Œ 0
Preview
Release 0.34.0 ยท vanniktech/gradle-maven-publish-plugin Added configuration cache support for publishing. Removed support for publishing through Sonatype OSSRH since it has been shut down. See the 0.33.0 release notes for upgrade instructions if you hav...

Version 0.34.0 of the gradle-maven-publish-plugin finally comes with configuration cache support. Dropping support for Sonatype OSSRH unblocked us from waiting for Gradle to resolve the underlying issue on their side.

github.com/vanniktech/g...

14.07.2025 09:53 ๐Ÿ‘ 15 ๐Ÿ” 5 ๐Ÿ’ฌ 0 ๐Ÿ“Œ 0