Skip to content

fix: warn when the startKoin module has no DSL definition — DSL graph not validated - #135

Merged
arnaudgiuliani merged 1 commit into
1.2.2from
arnaud/ktz-5253-warn-no-local-dsl-defs
Oct 30, 2026
Merged

arnaudgiuliani merged 1 commit into
1.2.2from
arnaud/ktz-5253-warn-no-local-dsl-defs

Conversation

@arnaudgiuliani

Copy link
Copy Markdown
Member

Problem

DSL graph validation (Phase 3.1) only runs when the module calling startKoin { } has at least one DSL definition of its own (KoinIrExtension.kt, dslDefinitions.isNotEmpty()). An app whose startKoin only loads feature modules gets no validation and no message: a missing dependency compiles clean. Behavior since 0.4.0-beta20.

Fix

Log a warning in that case:
[Koin] compile-safety: DSL graph not validated — no DSL definition in this entry-point module.

Same warn() as the existing "no Koin entry point" disclosure, so it follows logSeverity (#73). No validation change.

Behavior change

New informational warning only.

Proof

Check Before After
3 modules :lib → :mid → :app (startKoin, no local def), single<Repo>() removed, jvm + iosArm64 + wasmJs silent warning on all 3
Same, with single<AppThing>() in :app KOIN-D001 KOIN-D001, no warning
Full suite — 476/476

… not validated

DSL graph validation only runs when the module calling startKoin { } has at
least one DSL definition of its own. An entry point that only loads other
modules got no validation and no message: a missing dependency compiled
clean. Now logs a warning (same severity setting as the other informational
output). No validation change.
@arnaudgiuliani
arnaudgiuliani merged commit 50f4d3e into 1.2.2 Oct 30, 2026
2 checks passed
@arnaudgiuliani
arnaudgiuliani deleted the arnaud/ktz-5253-warn-no-local-dsl-defs branch October 30, 2026 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant