JetBrains / compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
https://jetbrains.com/lp/compose-multiplatform
Apache License 2.0
16.27k stars 1.18k forks source link

Support type-safe navigation #5022

Closed HamaniKhalil closed 4 months ago

HamaniKhalil commented 4 months ago

Hi,

I very much like the compose multiplatform navigation that has been backported from android's library. You wouldn't believe how straight forward the migration to the commonMain sourceSet is 💪

I've seen that recently the android team released version 2.8.0-alpha08 that includes a pretty major feature that consists of using a type-safe navigation instead of using parcelables when dealing with non-primitive types. 🚀

I already looked up in the maven central, the latest version is 2.8.0-alpha02 for org.jetbrains.androidx.navigation:navigation-compose.

That would be of a great help if that version is backported to compose navigation multiplatform, it allows us developers to pass Serializable objects to prevent from having to pass only the id of the object, then making an Http or database request to fetch the object while it's already sitting in the memory already.

I'm willing to use the public dev repository :

maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")

So if there's any dev version of the library is available with this feature I'd be happy to try it 💯

MatkovIvan commented 4 months ago

I've already ported this, but it's not merged to main branch yet. The blocker here is dependency to Compose 1.7.0 - we need to stabilize it a bit first, at least to "alpha". I don't want to announce any specific ETA, but it will happen soon

HamaniKhalil commented 4 months ago

Oh that's great news for me ! I was afraid to migrate my android source sets to the android type-safe navigation, now I know I can already do it. That way, when the library will be available I can move my sources to the commonMain straight away. Thank you guys for doing such amazing job on porting all these features to multiplatform 🚀 💪

hmy65 commented 4 months ago

Glad to hear, we plan to migrate our android project to multiplatform, but we do not want to depend on third party navigation library. Our android project has already changed to androidx navigation version 2.8.0-beta03 type-safe navigation.

okushnikov commented 2 months ago

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.