Skip to content
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

RN v0.60 upgrade immediate-term followup #4147

Merged
merged 3 commits into from
Jun 9, 2020

Conversation

chrisbobbe
Copy link
Contributor

@chrisbobbe chrisbobbe commented Jun 9, 2020

This doesn't include as much as I was hoping to include; see details at #3548 (comment).

In particular (these are the major things), it doesn't include using Hermes (#4131) or upgrading Unimodules (#4091). But Hermes, IIUC, can be done any time; the Unimodules upgrade should Just Work, but only following the RN v0.61 upgrade.

Fixes: #4118

@chrisbobbe chrisbobbe requested a review from gnprice June 9, 2020 20:57
@gnprice
Copy link
Member

gnprice commented Jun 9, 2020

Second commit message has a [1] but there's no footnote -- I'm curious to follow that link 🙂

@chrisbobbe
Copy link
Contributor Author

Thanks for catching that! I'll add that in—along with a note about how the "default screen orientation" bit, in those instructions, is misleading (see #4118 (comment)).

@gnprice
Copy link
Member

gnprice commented Jun 9, 2020

Mentioning the issue one of these fixes, so it gets a backlink to the PR: this fixes #4118.

[edit: OK, and that didn't fill in the "Linked issues" in the sidebar -- so I edited the PR description, and that did.]

@chrisbobbe
Copy link
Contributor Author

Mentioning the issue one of these fixes, so it gets a backlink to the PR: this fixes #4118.

I was just about to do that, when I saw you posted. Thanks!

Comment on lines 90 to 93

const {
orientationInfo: { orientation },
} = event;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The multi-line formatting is kind of a sign here of the fact that this syntax takes a bit of effort for the reader to unpack 😉

The usual way we'd write this is:

const { orientation } = event.orientationInfo;

@chrisbobbe
Copy link
Contributor Author

Thanks for the comments! I've pushed a new revision.

This responds to a new warning raised when using React Native
0.60.0, which we upgraded to recently:

"""
warn The following packages use deprecated "rnpm" config that will stop working from next release:
  - react-native-orientation: https://github.com/yamill/react-native-orientation#readme
  - rn-fetch-blob: https://npmjs.com/package/rn-fetch-blob
"""

We will handle `react-native-orientation` in an upcoming commit.
This is a best approximation of the functionality previously
provided by `react-native-orientation`, which is unmaintained and is
giving us errors that hint it will be unusable in the future.

We followed the installation instructions [1] for bare React Native
apps, which meant changing a line in ios/ZulipMobile/AppDelegate.m.

This note in those instructions appears misleading:

"""
or if you want to change the default screen orientation, with:
"""

Looking at the relevant Apple doc [2], though, it's not to set the
default orientation, but to set supported orientations.  That's also
what we find empirically: if we use the simple version of the code
suggested in those instructions, the effect is actually to lock the
app's orientation to a single value.

Instead we choose to support all orientations, with
`UIInterfaceOrientationMaskAll`.

That setup step is done in the same commit as the JavaScript package
is used; we assume the `AppDelegate.m` changes will break something
if they coincide with the use of `react-native-orientation`.

[1]: https://github.com/expo/expo/tree/ce446ed8b/packages/expo-screen-orientation

[2]: https://developer.apple.com/documentation/uikit/uiinterfaceorientationmask?language=objc
@gnprice
Copy link
Member

gnprice commented Jun 9, 2020

Looks good, thanks! I've added a few words to the commit message with your findings from #4118 (comment) ; merging.

@gnprice gnprice merged commit 0d5a19a into zulip:master Jun 9, 2020
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this pull request Jun 11, 2020
In 0d5a19a, for zulip#4147, we forgot to remove some Android
configuration specific to `react-native-orientation` [1], added in
3149c9d. So, remove it.

It appears that the iOS configuration at the
`react-native-orientation` doc was never done, so there's nothing to
do for that.

[1]: https://github.com/yamill/react-native-orientation#configuration
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this pull request Jun 11, 2020
In 0d5a19a, for zulip#4147, we forgot to remove some Android
configuration specific to `react-native-orientation` [1], added in
3149c9d. So, remove it.

It appears that the iOS configuration at the
`react-native-orientation` doc was never done, so there's nothing to
do for that.

[1]: https://github.com/yamill/react-native-orientation#configuration
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this pull request Jun 12, 2020
In 0d5a19a, for zulip#4147, we forgot to remove some Android
configuration specific to `react-native-orientation` in
MainActivity.java [1], added in 3149c9d. So, remove it.

It appears that the iOS configuration at the
`react-native-orientation` doc was never done, so there's nothing to
do for that.

Greg pointed out that this override was replicated in
ReceiveShareActivity.kt when that file was created (in 0b84717)
and that he was puzzled by it while reviewing zulip#4124 and supposed it
might be generic RN boilerplate. Now that we've identified it,
remove it.

[1]: https://github.com/yamill/react-native-orientation#configuration
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this pull request Jun 12, 2020
In 0d5a19a, for zulip#4147, we forgot to remove some Android
configuration specific to `react-native-orientation` in
MainActivity.java [1], added in 3149c9d. So, remove it.

It appears that the iOS configuration at the
`react-native-orientation` doc was never done, so there's nothing to
do for that.

Greg pointed out that this override was replicated in
ReceiveShareActivity.kt when that file was created (in 0b84717)
and that he was puzzled by it while reviewing zulip#4124 and supposed it
might be generic RN boilerplate. Now that we've identified it,
remove it.

[1]: https://github.com/yamill/react-native-orientation#configuration
gnprice pushed a commit to chrisbobbe/zulip-mobile that referenced this pull request Jun 12, 2020
In 0d5a19a, for zulip#4147, we forgot to remove some Android
configuration specific to `react-native-orientation` in
MainActivity.java [1], added in 3149c9d. So, remove it.

It appears that the iOS configuration at the
`react-native-orientation` doc was never done, so there's nothing to
do for that.

Greg pointed out that this override was replicated in
ReceiveShareActivity.kt when that file was created (in 0b84717)
and that he was puzzled by it while reviewing zulip#4124 and supposed it
might be generic RN boilerplate. Now that we've identified it,
remove it.

[1]: https://github.com/yamill/react-native-orientation#configuration
@chrisbobbe chrisbobbe deleted the rn-60-followup branch November 6, 2020 03:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace unmaintained dep react-native-orientation.
2 participants