Skip to content

ViewModel should be an implementation detail of circuit-retained #1988

@itsandreramon

Description

@itsandreramon

The circuit-retained artifact exposes ViewModel dependencies to its consumers, when it should be an implementation detail. I don't want to have ViewModel-related dependencies on my classpath when I'm building an MVP application.

Running ./gradlew :composeApp:dependencies gives me the following output

+--- com.slack.circuit:circuit-retained:0.27.0
|    |    |         |    \--- com.slack.circuit:circuit-retained-android:0.27.0
|    |    |         |         +--- androidx.lifecycle:lifecycle-viewmodel-compose:2.8.7 (*)
|    |    |         |         +--- androidx.lifecycle:lifecycle-viewmodel:2.8.7 (*)

I can see the androidMain source set is configured as follows for circuit-retained:

androidMain {
      dependencies {
        api(libs.androidx.lifecycle.viewModel.compose)
        api(libs.androidx.lifecycle.viewModel)
        api(libs.androidx.compose.runtime)
        implementation(libs.androidx.compose.ui.ui)
      }
    }

Is it possible to use implementation here to avoid exposing the ViewModel artifacts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions