Using the new nav3 dev builds in a Compose Multipl...
# multiplatform
g
Using the new nav3 dev builds in a Compose Multiplatform project, and migrating a custom backstack with its own saver (to survive process death on Android), what is the equivalent of saving something parcelable (for typed routes) ?
s
Is Nav3 even supporting KMP?
g
it started to, this last week
Settings.gradle.kts:
Copy code
dependencyResolutionManagement {
    repositories {
        //(...)
        maven { url = URI.create("<https://maven.pkg.jetbrains.space/public/p/compose/dev>") }
    }
}
libs.version.toml:
Copy code
[versions]
navigation3 = "1.0.0+dev2849"

[libraries]
androidx-navigation3-runtime = { module = "org.jetbrains.androidx.navigation3:navigation3-runtime", version.ref = "navigation3" }
androidx-navigation3-ui = { module = "org.jetbrains.androidx.navigation3:navigation3-ui", version.ref = "navigation3" }

[bundles]
nav3 = [
    "androidx-navigation3-runtime",
    "androidx-navigation3-ui"
]
In your composeApp build.gradle.kts:
Copy code
commonMain.dependencies {

    implementation(libs.bundles.nav3)
}
Enjoy ๐Ÿ˜Š
โค๏ธ 1
s
Niiice, thanks! Had in my todo to try nav3 on Android, will do it on CMP too:)
K 1
e
My rec would be to use kotlinx-serialization.
๐Ÿ‘ 1
g
@ืืœื™ื”ื• ื”ื“ืก What do you mean, just serialize and deserialize into a string manually?
s
I think KMP SavedState recently migrated in 1.8.2 does that under the hood already
g
oh, so I can just transform that list into a list of strings, interesting, I'll try that
๐Ÿ™ 1
Coz I couldn't find anything receiving Any or T
s
That's my guess, I still need to try out Nav3 too and see what are the limitations and whatnot:) Report your findings, would be nice to hear too~
j
I have one question, is there any documentation or GitHub repo to track the latest version of this library?
s
j
Is androidx.navigation3:navigation3 and org.jetbrains.androidx.navigation3 are the same? I don't think it will be the same version for both libraries.
s
โ€ข androidx - Android-only โ€ข org.jetbrains - KMP-compatible
๐Ÿ‘ 1
g
This new talk released yesterday answers to my question ๐Ÿ˜Š
K 3

https://www.youtube.com/watch?v=jDz_yNZkEzkโ–พ

โค๏ธ 1