. do you see a way to adopt it incrementally? Or does it have to be an atomic change for all of the 100 screens in my app?
h
Hristijan
06/28/2025, 1:37 PM
If you had your previous navigation set-up decoupled from your architecture and made it so that it doesn't pull itself into your UI screens/sub screens, the change should be easy like systematic replacement of the way your screens are rendered.
I have that in my personal apps and work apps, but we're waiting for navigation 3 to stabilize and have deep links since we have those, a lot.
➕ 1
u
ursus
06/28/2025, 2:28 PM
easy sure but it has to be atomically applied everywhere right? no way to have 2 nav libs at the same time?
s
Stylianos Gakis
06/28/2025, 2:30 PM
Yeah, you'd be asking yourself for trouble otherwise I'm pretty sure.
But what Hristijan is saying is important. You should optimally have everything setup in a way where changing the nav lib should be just one sweep of the glue code. The screens themselves should optimally not need to do something themselves.
I am also waiting for deeplink support btw, along with navigateUp etc before I even consider such a migration
u
ursus
06/28/2025, 2:33 PM
Well im coming from Fragments (with comppse as a detail of the screen)
Just checking how to go about it
thanks
m
mattinger
06/30/2025, 4:14 PM
Atomic, no, but mixing xml and compose based navigation comes with a lot of headaches. But you could create fragment destinations in your xml based graph, and within those fragments, have a compose based navigation graph. It gets hairy though how to handle the pop and deep link mechanics if you try to do this though.
mattinger
06/30/2025, 4:15 PM
That said, I'm glad Nav3 took a more data driven approach, rather than an imperitive approach (modelling the backstack as data, rather than backstack entries, and having navigation functions).