Update koin.plugin to v1.0.1 #14
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "renovate/koin.plugin"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR contains the following updates:
1.0.0-RC2→1.0.1Release Notes
InsertKoinIO/koin-compiler-plugin (io.insert-koin.compiler.plugin)
v1.0.1Compare Source
A maintenance release focused on Kotlin 2.4.0 support and Kotlin/Native + WASM/JS build reliability. One plugin artifact now spans Kotlin 2.3.20 → 2.4.x.
🔑 Highlights
@Single(createdAtStart = true)honored on definition functions — eager singletons are created atstartKoinagain.🐛 Fixes
Kotlin version compatibility — #19, #42 (and koin#2431)
The plugin hard-crashed on the two most recent Kotlin versions:
ClassCastExceptionduring FIR extension registration.NoSuchMethodError(IrDeclarationOrigin.IR_EXTERNAL_DECLARATION_STUB).1.0.1 introduces a Kotlin version-adapter layer: the core is compiled against the stable IR API, and a small per-version adapter (selected at compile time) absorbs the breaking compiler-internal differences. A single published jar supports Kotlin 2.3.20 and 2.4.0; an unrecognized newer Kotlin gets a warning and best-effort support, while versions below the floor get a clear, actionable error instead of an internal crash.
Duplicate
injectedparams_*signatures broke iOS + WASM/JS — #44, #40A type collected by more than one
@ComponentScanmodule generated the@InjectedParamhint function twice with identical signatures. The JVM tolerated it; KLIB serialization (iOS/Native/WASM/JS) rejected it with "Different declarations with the same signatures". The hint is now emitted exactly once per target. (Regression vs 1.0.0-RC2.)WASM/JS KLIB serialization — #40
The plugin's generated hint files lacked a resolvable source, failing the JS/WASM KLIB serializer ("No file found for source null"). Fixed — DSL-based projects now build on WASM/JS.
@Single(createdAtStart = true)silently dropped — koin#2425, koin#2415createdAtStart = trueon a@Single/@Singletondefinition function inside a@Modulewas discarded in codegen, so eager singletons were never created atstartKoin(no error or warning). Now propagated correctly. (The@Module(createdAtStart)and@Singleton classcases were already fixed in 1.0.0-RC3.13.)⚠️ Known limitation — annotation-based WASM/JS on Kotlin 2.3.20
Annotation-based projects (
@Module/@ComponentScan) targeting WASM/JS require Kotlin 2.4.0. On Kotlin 2.3.20 they hit an upstream Kotlin compiler bug — KT-82395 — in the JS/WASM KLIB metadata serializer, which the plugin cannot work around. Kotlin 2.4.0 resolves it. (iOS/Native and DSL-based WASM/JS are unaffected and work on both Kotlin versions.)✅ Compatibility
📦 Install
Full changelog: https://github.com/InsertKoinIO/koin-compiler-plugin/compare/1.0.0...1.0.1
v1.0.0Compare Source
Koin Compiler Plugin 1.0.0
The first stable release. RC1 shipped in April 2026; over the following weeks the safety pass, incremental-compilation handling, and K2.3.20 compatibility came together. The compiler-plugin path is now ready for production: full-graph compile-time safety, cross-module call-site validation, IC-aware safe-defaults, and K2.3.20 support.
Requires: Kotlin 2.3.20+ (K2) | Koin 4.2.1+
What's New Since 1.0.0-RC2
Compile-time safety expanded (A2/A3/A4)
A → B → Aare caught during graph traversal in A2/A3, no longer waiting for runtime.get<T> { parametersOf(...) }and ViewModel/inject sites withparametersOf {}flows are validated against the assembled graph.koinViewModel<T>()inside@Composablebuilders is validated like any other call site.(raw class + qualifier)key, preventing silent last-wins overrides at runtime.KOIN-D007—@Factoryreturning a type that extends a suspendfun interfaceis now blocked at compile time (previously crashed Fir2Ir).koinConfiguration/koinApplication/startKoinno longer bypass A3 — the full-graph pass runs even without an explicit<T>type parameter.startKoin<T>()— A4 now sees DSLmodule { … }definitions declared in dependency JARs when the aggregator uses the typed entry point.Incremental compilation & build robustness
strictSafetyflag — auto-enabled on modules that containstartKoin,koinApplication, or@KoinApplication. Forces the full-graph safety pass to re-run on the aggregator each build, working around two K2 IC gaps: DSL changes insidemodule { }lambda bodies (not part of any declaration's ABI) and@ComponentScanpackage-scope discovery (no source-level edge). Library and feature modules stay fully incremental.Hints.ktcollisions during multi-platform builds.KtPsiSourceElement.psiprevents Fir2Ir crashes when the plugin runs alongside kapt or Hilt during migration.Kotlin 2.3.20 compatibility
HINTS_PACKAGEis now claimed unconditionally, fixing a regression when building against the latest K2.Annotation fixes
@Module(createdAtStart = true)— was silently ignored; now correctly forwards the flag to the generatedmodule { }.@Scope(name = "…")— previously produced no bean definition; the scope DSL is now generated as expected.@ScopeId(name = "…")— resolution behaviour locked in via regression coverage.Diagnostics
Performance
startKoinmodule discovery — repeated scans during a single compilation reuse the resolved module set.@ComponentScanfiltering — package-scope discovery now uses an indexed lookup instead of repeated linear scans, noticeably faster on large multi-module projects.Repo / docs
playground-apps/app-dsl,playground-apps/app-annotations) — single clone, single build, no separate repo to keep in sync.strictSafety, K2.3.20 minimum, circular-dep detection at compile time, KOIN-D007.Behaviour changes to note when upgrading
strictSafetyis on by default on aggregator modules. If your app containsstartKoin,koinApplication, or@KoinApplication, that module'scompileKotlintask will re-run the A3 safety pass on every build (library/feature modules unaffected). The cost is bounded, and it closes the IC gaps that previously let graph changes slip through cached builds. SetkoinCompiler { strictSafety = false }to opt out.Kotlin minimum bumped to 2.3.20 (was 2.3.0) — the Fir2Ir fix requires the newer compiler. If you're pinned to 2.3.0, stay on
1.0.0-RC2until you can upgrade.Closed issues since the project went public
Fixed
@ScopeId(@limuyang2)@Providedstill flagging missing dependencies (@kmbisset89)Scope.get()(@alex28sh).module()extension not recognized by IntelliJ (@DenAbr)@Factoryreturningfun interfaceextending suspend function type (@krzdabrowski) — now also blocked diagnostically via KOIN-D007@Single(binds = [...])provider function (@flaringapp)compileSafetymissing binding silently passes on incremental compilation (@j-bajon) — drove thestrictSafetydesign@Scope(name=…)+@Scoped(binds=[…])silently produce no bean definitions (@rduriancik)org.koin.plugin.hints(@0xMatthewGroves)compileSafetychecks bypassed when usingKoinApplicationComposable in CMP (@rajdeepvaghela)Won't fix / deferred
module()extension (@JordanLongstaff) — documented as a known limitation pending IDE-side supportCross-repo fixes
@ScopeId(name = "…")resolution behaviourstartKoin<T>+@KoinApplication(modules=[…])+ scanned@KoinViewModelincludes(...)reachability@KoinApplication(modules = [...])overrides discovered@ConfigurationContributors
Project lead: @arnaudgiuliani (Arnaud Giuliani)
Code contributions (commit authors and merged PRs across all releases):
@Moduleprovider functions (PR #23)@ComponentScanhints without@Configuration(PR #25)Credits for techniques:
LookupTrackerandExpectActualTrackerpatterns from MetroIssue reporters — the high-quality reproductions made all of this possible. See the closed-issues list above for the full set; everyone there contributed time and detail that shortened diagnosis significantly.
Internal feedback: Francois Dabonot (Kotzilla) — RC2.3 missing-artifact compile error came from his migration feedback.
Full changelog
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate.