Eko Prasetyo
05/15/2022, 2:10 PMtrevjones
05/15/2022, 4:35 PMtrevjones
05/15/2022, 4:36 PMColton Idle
05/15/2022, 6:08 PMColton Idle
05/15/2022, 6:12 PMZach Klippenstein (he/him) [MOD]
05/15/2022, 8:31 PMColton Idle
05/15/2022, 10:19 PMZach Klippenstein (he/him) [MOD]
05/15/2022, 10:59 PMColton Idle
05/15/2022, 11:03 PMEko Prasetyo
05/16/2022, 1:42 AMColton Idle
05/26/2022, 8:38 PMThe best thing to do in a fully declarative/compose app is have some top-level thing in your UI determine whether there's a session or not, and then show the correct screen directly. Introducing the indirection of “imperative” navigation doesn't mean bugs like this are inevitable, but it's a lot easier to introduce them.So. That makes sense to me. Like total sense. (this is actually like week 1 of me being an android dev in 2012 and just swapping out R.layout.signin and R.layout.homescreen based on an if statement). BUT since this makes a ton of sense for me in the compose world... why do we even need compose-navigation? Wouldn't I want to modify that navigation stack directly instead of using this "event" based technique where the event callback bubbles up to the NavHost and the navhost calls
.navigate(OtherScreen)?Zach Klippenstein (he/him) [MOD]
05/26/2022, 8:52 PMwhy do we even need compose-navigationShort answer: Exactly! We don’t! 🙂 Longer answer: There are some navigation-related things that are pretty boilerplaty and helpful to factor out (e.g. state saving/restoration, maybe some common transition animations). I think an ideal navigation library for Compose would help solve those problems, but not try to manage its own source of truth for actual navigation. There are already a few libraries out there that do exactly that. I think (my personal opinion, not my employer’s) the only reason compose-navigation really exists is because it already existed for fragments, it’s been the “official” recommendation for navigation for some time, and it can be helpful when migrating a large app incrementally. It’s a lot easier to answer 100 “how do we do navigation” questions with “the same as before” than trying to get everyone to reconceptualize what “navigation” even is, and there are a limited number of devrels 😅
Zach Klippenstein (he/him) [MOD]
05/26/2022, 8:59 PMColton Idle
05/27/2022, 2:16 PMtrevjones
05/27/2022, 2:19 PM