Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add KOIN_USE_COMPOSE_VIEWMODEL key to replace USE_COMPOSE_VIEWMODEL #149

Merged
merged 1 commit into from
Jul 25, 2024

Conversation

arnaudgiuliani
Copy link
Member

Add KOIN_USE_COMPOSE_VIEWMODEL key to replace USE_COMPOSE_VIEWMODEL

@arnaudgiuliani arnaudgiuliani added this to the 1.4.0 milestone Jul 25, 2024
@arnaudgiuliani arnaudgiuliani merged commit 7215381 into 1.4.0 Jul 25, 2024
1 check passed
@arnaudgiuliani arnaudgiuliani deleted the rename_key branch July 25, 2024 07:28
private fun isComposeViewModelActive(): Boolean {
logger.warn("Use Compose ViewModel for @KoinViewModel generation")
logger.warn("[Deprecated] Please use KOIN_USE_COMPOSE_VIEWMODEL arg")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why isn't this behind a check if the argument is actually set? I don't even use Compose and this deprecation notice is still printed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it still present?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As of 1.4.0-RC4, yes. Even when explicitly disabling USE_COMPOSE_VIEWMODEL.
the warnings
ksp config

Looking at the code, it appears the isComposeViewModelActive is called in any case, leading to the message being logged without any further checks.
https://github.com/InsertKoinIO/koin-annotations/blob/1.4.0-RC4/projects/koin-ksp-compiler/src/jvmMain/kotlin/org/koin/compiler/BuilderProcessor.kt#L83-L87

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.

2 participants