~/talk

Navigating Dependency Injection with Metro

Talkat DroidKaigi 2025 · 2025-09-10..09-12· [android, kotlin]
github:hzsweers
slides:none on file

Metro is a Kotlin compiler plugin that implements a compile-time DI system, generating IR (no source stubs) and claiming 40–70% faster builds by avoiding multiple KSP/annotation-processing compilation stages. It produces graphs, supports scopes, assisted injection, multibindings, and private provider generation so injected helpers can stay nonpublic. Aggregation mirrors Anvil with Anvil-style aggregation built-in and offers runtime interop with Dagger/Anvil/Kotlin Inject; benchmarks and repo samples validate the approach. Multiplatform and IDE support are experimental but present.

AI-written summary · about

  1. 0:00Introduction
  2. 1:49Dependency injection importance
  3. 4:40Manual DI vs frameworks
  4. 5:42Why Metro DI
  5. 7:05Metro basics
  6. 9:10Binding types explained
  7. 12:00Advanced binding types
  8. 15:12Aggregation and contributions
  9. 18:01Provider and Lazy in Metro
  10. 19:25Graph extensions and architecture
  11. 21:53Metro compiler advantages
  12. 26:48Frontend FIR processing
  13. 29:39IR transformation and validation
  14. 33:49Error handling in Metro
  15. 35:11Interoperability with frameworks
  16. 37:40FAQ and future plans
  17. 39:25Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.