-
-
Notifications
You must be signed in to change notification settings - Fork 655
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
Remove most or all definitions in navActions
.
#4417
Labels
Comments
chrisbobbe
added a commit
to chrisbobbe/zulip-mobile
that referenced
this issue
Jul 14, 2021
…pers. navSelectors and navActions are kind of relics from before zulip#3804, and we already have zulip#4417 for removing most or all of navActions. Help along the removal of navSelectors by removing these things that we stopped using in a recent commit.
chrisbobbe
added a commit
to chrisbobbe/zulip-mobile
that referenced
this issue
Jul 14, 2021
As mentioned in a previous commit, navSelectors and navActions are kind of relics from before zulip#3804, and we already have zulip#4417 for removing most or all of navActions. Might as well remove navSelectors.
chrisbobbe
added a commit
to chrisbobbe/zulip-mobile
that referenced
this issue
Jul 26, 2021
…pers. navSelectors and navActions are kind of relics from before zulip#3804, and we already have zulip#4417 for removing most or all of navActions. Help along the removal of navSelectors by removing these things that we stopped using in a recent commit.
chrisbobbe
added a commit
to chrisbobbe/zulip-mobile
that referenced
this issue
Jul 26, 2021
As mentioned in a previous commit, navSelectors and navActions are kind of relics from before zulip#3804, and we already have zulip#4417 for removing most or all of navActions. Might as well remove navSelectors.
chrisbobbe
added a commit
to chrisbobbe/zulip-mobile
that referenced
this issue
Jul 29, 2021
…pers. navSelectors and navActions are kind of relics from before zulip#3804, and we already have zulip#4417 for removing most or all of navActions. Help along the removal of navSelectors by removing these things that we stopped using in a recent commit.
chrisbobbe
added a commit
to chrisbobbe/zulip-mobile
that referenced
this issue
Jul 29, 2021
As mentioned in a previous commit, navSelectors and navActions are kind of relics from before zulip#3804, and we already have zulip#4417 for removing most or all of navActions. Might as well remove navSelectors.
gnprice
pushed a commit
to gnprice/zulip-mobile
that referenced
this issue
Sep 10, 2021
…pers. navSelectors and navActions are kind of relics from before zulip#3804, and we already have zulip#4417 for removing most or all of navActions. Help along the removal of navSelectors by removing these things that we stopped using in a recent commit.
gnprice
pushed a commit
to gnprice/zulip-mobile
that referenced
this issue
Sep 10, 2021
As mentioned in a previous commit, navSelectors and navActions are kind of relics from before zulip#3804, and we already have zulip#4417 for removing most or all of navActions. Might as well remove navSelectors.
chrisbobbe
added a commit
to chrisbobbe/zulip-mobile
that referenced
this issue
Sep 10, 2021
…pers. navSelectors and navActions are kind of relics from before zulip#3804, and we already have zulip#4417 for removing most or all of navActions. Help along the removal of navSelectors by removing these things that we stopped using in a recent commit.
chrisbobbe
added a commit
to chrisbobbe/zulip-mobile
that referenced
this issue
Sep 10, 2021
As mentioned in a previous commit, navSelectors and navActions are kind of relics from before zulip#3804, and we already have zulip#4417 for removing most or all of navActions. Might as well remove navSelectors.
chrisbobbe
added a commit
to chrisbobbe/zulip-mobile
that referenced
this issue
Mar 2, 2022
For some background, see zulip#4417.
chrisbobbe
added a commit
to chrisbobbe/zulip-mobile
that referenced
this issue
Mar 2, 2022
For some background, see zulip#4417.
chrisbobbe
added a commit
that referenced
this issue
Mar 3, 2022
We don't like using NavigationService (#4417), so this is nice to be able to do. Not *quite* NFC: if we somehow manage to have two consecutive UserStatusScreens at the top of the stack, we'll now just pop one of them instead of both, because we lose `navigateBack`'s special logic with its `sameRoutesCount` value. But that logic is designed for `ChatScreen` -- we do expect to have multiple `ChatScreen`s at the top of the stack sometimes. We don't expect that with `UserStatusScreen`s.
chrisbobbe
added a commit
to chrisbobbe/zulip-mobile
that referenced
this issue
Mar 5, 2022
We don't like using NavigationService (zulip#4417), so this is nice to be able to do. Not *quite* NFC: if we somehow manage to have two consecutive EmojiPickerScreens at the top of the stack, we'll now just pop one of them instead of both, because we lose `navigateBack`'s special logic with its `sameRoutesCount` value. But that logic is designed for `ChatScreen` -- we do expect to have multiple of `ChatScreen`s at the top of the stack sometimes. We don't expect that with `EmojiPickerScreen`s.
chrisbobbe
added a commit
to chrisbobbe/zulip-mobile
that referenced
this issue
Mar 8, 2022
We don't like using NavigationService (zulip#4417), so this is nice to be able to do. Not *quite* NFC: if we somehow manage to have two consecutive EmojiPickerScreens at the top of the stack, we'll now just pop one of them instead of both, because we lose `navigateBack`'s special logic with its `sameRoutesCount` value. But that logic is designed for `ChatScreen` -- we do expect to have multiple of `ChatScreen`s at the top of the stack sometimes. We don't expect that with `EmojiPickerScreen`s.
chrisbobbe
added a commit
to chrisbobbe/zulip-mobile
that referenced
this issue
Mar 9, 2022
We don't like using NavigationService (zulip#4417), so this is nice to be able to do. Not *quite* NFC: if we somehow manage to have two consecutive EmojiPickerScreens at the top of the stack, we'll now just pop one of them instead of both, because we lose `navigateBack`'s special logic with its `sameRoutesCount` value. But that logic is designed for `ChatScreen` -- we do expect to have multiple of `ChatScreen`s at the top of the stack sometimes. We don't expect that with `EmojiPickerScreen`s.
gnprice
added a commit
to gnprice/zulip-mobile
that referenced
this issue
Jun 10, 2022
React Navigation upstream has since the 5.x release been discouraging the use of the strategy we call NavigationService. See discussion at 140c28c and: zulip#4417 Instead, the recommendation is to use the `navigation` prop where available, and failing that the `useNavigation` hook. In this commit, we make that change for all sites where we were using NavigationService in a function component that is a screen in a navigator, and gets its own navigation prop.
gnprice
added a commit
to gnprice/zulip-mobile
that referenced
this issue
Jun 10, 2022
This covers most of the `navigateToFoo` nav-action creators, but sadly not all of them: as discussed in the previous commit where we simplified away most of the call sites, there are still some that remain in places where we still use NavigationService. So for now we keep the nav-action creators that are used there. Fixes: zulip#4417
gnprice
added a commit
to gnprice/zulip-mobile
that referenced
this issue
Jun 10, 2022
React Navigation upstream has since the 5.x release been discouraging the use of the strategy we call NavigationService. See discussion at 140c28c and: zulip#4417 Instead, the recommendation is to use the `navigation` prop where available, and failing that the `useNavigation` hook. In this commit, we make that change for all sites where we were using NavigationService in a function component that is a screen in a navigator, and gets its own navigation prop.
gnprice
added a commit
to gnprice/zulip-mobile
that referenced
this issue
Jun 10, 2022
This covers most of the `navigateToFoo` nav-action creators, but sadly not all of them: as discussed in the previous commit where we simplified away most of the call sites, there are still some that remain in places where we still use NavigationService. So for now we keep the nav-action creators that are used there. Fixes: zulip#4417
gnprice
added a commit
to gnprice/zulip-mobile
that referenced
this issue
Jun 14, 2022
React Navigation upstream has since the 5.x release been discouraging the use of the strategy we call NavigationService. See discussion at 140c28c and: zulip#4417 Instead, the recommendation is to use the `navigation` prop where available, and failing that the `useNavigation` hook. In this commit, we make that change for all sites where we were using NavigationService in a function component that is a screen in a navigator, and gets its own navigation prop.
This was done in #5408. There are still some things remaining in
--
--
But 22 out of the 34 |
chrisbobbe
added a commit
to chrisbobbe/zulip-mobile
that referenced
this issue
Sep 15, 2022
Further in the direction of zulip#5408, which switched most of our then-existing uses of NavigationService to use `navigation` instead. As noted there: > Switching away from `NavigationService` is recommended by React > Navigation upstream, as described at zulip#4417. We also now get > type-checking on those `navigation.push` calls -- Flow is able to > check that the route params we pass line up with what the route in > question expects -- which wasn't/isn't the case for the > implementations of the `navActions` functions. This causes a few of the navActions functions to lose their last remaining caller, so delete those.
chrisbobbe
added a commit
to chrisbobbe/zulip-mobile
that referenced
this issue
Nov 17, 2022
Further in the direction of zulip#5408, which switched most of our then-existing uses of NavigationService to use `navigation` instead. As noted there: > Switching away from `NavigationService` is recommended by React > Navigation upstream, as described at zulip#4417. We also now get > type-checking on those `navigation.push` calls -- Flow is able to > check that the route params we pass line up with what the route in > question expects -- which wasn't/isn't the case for the > implementations of the `navActions` functions. This causes a few of the navActions functions to lose their last remaining caller, so delete those.
chrisbobbe
added a commit
to chrisbobbe/zulip-mobile
that referenced
this issue
Nov 17, 2022
Further in the direction of zulip#5408, which switched most of our then-existing uses of NavigationService to use `navigation` instead. As noted there: > Switching away from `NavigationService` is recommended by React > Navigation upstream, as described at zulip#4417. We also now get > type-checking on those `navigation.push` calls -- Flow is able to > check that the route params we pass line up with what the route in > question expects -- which wasn't/isn't the case for the > implementations of the `navActions` functions. This causes a few of the navActions functions to lose their last remaining caller, so delete those.
chrisbobbe
added a commit
to chrisbobbe/zulip-mobile
that referenced
this issue
Nov 17, 2022
Further in the direction of zulip#5408, which switched most of our then-existing uses of NavigationService to use `navigation` instead. As noted there: > Switching away from `NavigationService` is recommended by React > Navigation upstream, as described at zulip#4417. We also now get > type-checking on those `navigation.push` calls -- Flow is able to > check that the route params we pass line up with what the route in > question expects -- which wasn't/isn't the case for the > implementations of the `navActions` functions. This causes a few of the navActions functions to lose their last remaining caller, so delete those.
chrisbobbe
added a commit
to chrisbobbe/zulip-mobile
that referenced
this issue
Nov 17, 2022
Further in the direction of zulip#5408, which switched most of our then-existing uses of NavigationService to use `navigation` instead. As noted there: > Switching away from `NavigationService` is recommended by React > Navigation upstream, as described at zulip#4417. We also now get > type-checking on those `navigation.push` calls -- Flow is able to > check that the route params we pass line up with what the route in > question expects -- which wasn't/isn't the case for the > implementations of the `navActions` functions. This causes a few of the navActions functions to lose their last remaining caller, so delete those.
BrandonNgoranNtam
pushed a commit
to BrandonNgoranNtam/zulip-mobile
that referenced
this issue
Nov 22, 2022
Further in the direction of zulip#5408, which switched most of our then-existing uses of NavigationService to use `navigation` instead. As noted there: > Switching away from `NavigationService` is recommended by React > Navigation upstream, as described at zulip#4417. We also now get > type-checking on those `navigation.push` calls -- Flow is able to > check that the route params we pass line up with what the route in > question expects -- which wasn't/isn't the case for the > implementations of the `navActions` functions. This causes a few of the navActions functions to lose their last remaining caller, so delete those.
BrandonNgoranNtam
pushed a commit
to BrandonNgoranNtam/zulip-mobile
that referenced
this issue
Nov 22, 2022
Further in the direction of zulip#5408, which switched most of our then-existing uses of NavigationService to use `navigation` instead. As noted there: > Switching away from `NavigationService` is recommended by React > Navigation upstream, as described at zulip#4417. We also now get > type-checking on those `navigation.push` calls -- Flow is able to > check that the route params we pass line up with what the route in > question expects -- which wasn't/isn't the case for the > implementations of the `navActions` functions. This causes a few of the navActions functions to lose their last remaining caller, so delete those.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
React Navigation 5, which we've recently upgraded to (#4296), discourages the
NavigationService
strategy we've been using, as we mentioned in 140c28c.From their doc about that strategy:
And from their doc on upgrading from v4 to v5:
We should aim to remove all the action creators in
navActions
and use, e.g.,navigation.navigate
instead. See discussion here and here.The callsites for the action creators in
navActions
seem to fall into three categories:component
prop to a<*.Screen />
component). Thus, it gets passed thenavigation
prop, and it's quite easy to just use it.navigation
prop.useNavigation
can provide the navigation object.ComposeMenu
) the conversion to Hooks would take a bit of effort. We can considernavigation
prop from the nearest component that has it, oruseNavigation
, in the same file, and export that.NavigationService
for these callsites (as an "advanced use case"), rather than finding a way to thread thenavigation
object through from React. But we may find that something forces our hand.The text was updated successfully, but these errors were encountered: