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

Update kmp.viewmodel to v0.8.0 #14

Merged
merged 1 commit into from
Jun 9, 2024
Merged

Update kmp.viewmodel to v0.8.0 #14

merged 1 commit into from
Jun 9, 2024

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Jun 9, 2024

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
io.github.hoc081098:kmp-viewmodel-koin-compose 0.7.1 -> 0.8.0 age adoption passing confidence
io.github.hoc081098:kmp-viewmodel-compose 0.7.1 -> 0.8.0 age adoption passing confidence
io.github.hoc081098:kmp-viewmodel-savedstate 0.7.1 -> 0.8.0 age adoption passing confidence
io.github.hoc081098:kmp-viewmodel 0.7.1 -> 0.8.0 age adoption passing confidence

Release Notes

hoc081098/kmp-viewmodel (io.github.hoc081098:kmp-viewmodel-koin-compose)

v0.8.0

Compare Source

Update dependencies
kmp-viewmodel-savedstate
  • Added JvmSerializable - multiplatform reference to Java java.io.Serializable interface,
    along with NonNullSavedStateHandleKey.Companion.serializable and NullableSavedStateHandleKey.Companion.serializable

    // Use `JvmSerializable` with enum classes.
    enum class Gender : JvmSerializable {
      MALE,
      FEMALE,
    }
    
    // Create a `NonNullSavedStateHandleKey` for a serializable type.
    private val genderKey: NonNullSavedStateHandleKey<Gender> = NonNullSavedStateHandleKey.serializable(
      key = "gender",
      defaultValue = Gender.MALE,
    )
    
    // Use `SavedStateHandle.safe` extension function to access `SavedStateHandle` in a type-safe way.
    val genderStateFlow: NonNullStateFlowWrapper<Gender> = savedStateHandle
      .safe { it.getStateFlow(genderKey) }
      .wrap()
  • Since Kotlin 2.0.0, you must add "plugin:org.jetbrains.kotlin.parcelize:additionalAnnotation=com.hoc081098.kmp.viewmodel.parcelable.Parcelize"
    as a free compiler argument to able to use @Parcelize annotation in the common/shared module (Kotlin Multiplatform module).

    // build.gradle.kts
    plugins {
      id("kotlin-parcelize") // Apply the plugin for Android
    }
    
    // Since Kotlin 2.0.0, you must add the below code to your build.gradle.kts of the common/shared module (Kotlin Multiplatform module).
    kotlin {
      [...] // Other configurations
    
      targets.configureEach {
        val isAndroidTarget = platformType == org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType.androidJvm
        compilations.configureEach {
          compileTaskProvider.configure {
            compilerOptions {
              if (isAndroidTarget) {
                freeCompilerArgs.addAll(
                  "-P",
                  "plugin:org.jetbrains.kotlin.parcelize:additionalAnnotation=com.hoc081098.kmp.viewmodel.parcelable.Parcelize",
                )
              }
            }
          }
        }
      }
    }

  • If you want to rebase/retry this PR, check this box

🔕 Ignore: Close this PR and you won't be reminded about these updates again.

@renovate renovate bot added the dependencies label Jun 9, 2024
@renovate renovate bot requested a review from hoc081098 June 9, 2024 13:08
@hoc081098 hoc081098 merged commit 8ccedec into main Jun 9, 2024
1 check passed
@hoc081098 hoc081098 deleted the renovate/kmp.viewmodel branch June 9, 2024 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant