Koin + Kotlin Compiler = ♥️
summary
Koin now ships a Kotlin compiler plugin (published as Koin compiler plugin 1.00‑RC1) that replaces prior KSP codegen, generating the Koin DSL, verifying full DI graphs at compile time, and surfacing call‑site errors in the IDE. The system supports a safer reified DSL and annotation-driven modules with component scan, handles nullable/lazy/list params, and promises a precomputed dependency index for faster startup; the plugin is multi‑platform and already produces IDE errors and generated wiring.
AI-written summary · about
chapters (21)
- 0:00Introduction
- 1:29Koin journey over 9 years
- 3:36From KSP to compiler plugin
- 5:22Kotlin compiler phases & Koin
- 6:48Safer DSL with reified types
- 8:59DSL features & hybrid approach
- 15:20Annotation flow & module discovery
- 18:52Automatic module config
- 20:13Compile-safe Koin start
- 23:01Compile safety & graph validation
- 27:39Koin engine & performance
- 31:53Service locator vs DI
- 34:04Migration to compiler plugin
- 35:51AI & observability with Codila
- 37:55Summary & future plans
- 38:40Q&A: Startup optimization
- 39:46Q&A: Module caching
- 40:26Q&A: OpenTelemetry
- 41:29Q&A: Koin test limits
- 42:34Q&A: Plugin & build systems
- 43:18Q&A wrap-up
related talks
42mKoin 3.2 - Improving the Kotlin Developer Experience
31mKoin in Action - Dependency Injection for Kotlin
28mInsert Koin
40mSimplify your Android development with Koin
17mKoin vs. Kotlin-inject
42mAndroid Architecture Design with Koin
33mMeta-programming with KSP and Kotlin compiler plugins
48mAndroid, Compose, Multiplatform & Server - Inject them all with Koin
