-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Update dependencies and upgrade to RN 0.76.5 #8421
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nitpicks here and there, but nothing really blocking.
@@ -60,7 +60,7 @@ const BookmarkIcon = ({emoji, emojiSize, emojiStyle, file, genericStyle, iconSiz | |||
name='book-outline' | |||
size={22} | |||
color={theme.centerChannelColor} | |||
style={genericStyle} | |||
style={genericStyle as StyleProp<TextStyle>} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In several files we are doing this, and the prop is only used to then be casted. Shouldn't we change the type directly in the prop?
|
||
useEffect(() => { | ||
if (files.length) { | ||
containerHeight.value = CONTAINER_HEIGHT_MAX; | ||
return; | ||
} | ||
containerHeight.value = CONTAINER_HEIGHT_MIN; | ||
}, [files.length > 0]); | ||
}, [containerHeight, files.length]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick:
If we create a new variable hasFiles
, we might not run this effect so often, and may be slightly more intention revealing. (Not that this is neither hard to understand or has any performance issue though)
const hasFiles = Boolean(files.length);
useEffect(() => {
if (hasFiles) {...}
...
}, [containerHeight, hasFiles]);
@@ -13,7 +13,7 @@ import {typography} from '@utils/typography'; | |||
|
|||
type DateSeparatorProps = { | |||
date: number | Date; | |||
style?: StyleProp<ViewStyle>; | |||
style?: StyleProp<TextStyle>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to make this type safe, you can use the Intersection utility type we have like this:
style?: StyleProp<Intersection<TextStyle, ViewStyle>>;
That way, we don't need the casting, and we make sure we don't pass styles that may create issues.
@@ -130,7 +130,7 @@ const PostList = ({ | |||
return false; | |||
} | |||
return posts[0]?.id !== lastPostId; | |||
}, [posts[0]?.id, lastPostId]); | |||
}, [lastPostId, posts]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably this memo is not needed at all (it is memoizing a boolean value and doing a pretty fast operation). But 0/5 on whether it is desirable to change it in this PR.
"cursor": undefined, | ||
}, | ||
] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bit surprised of these snapshots changing. Do you know where is this change coming from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can be caused by the upgrade of react-native-gesture-handler library or the update to react-native or react, this is defo not done by us.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is another reason why I think snapshots are silly.
afterAll(() => { | ||
// jest.resetAllMocks(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this no longer needed? If so, should we just remove it?
app/utils/errors.ts
Outdated
@@ -70,15 +70,15 @@ export const getFullErrorMessage = (error: unknown, intl?: IntlShape, depth = 0) | |||
return `${message}; ${getFullErrorMessage(error.details, intl, depth + 1)}`; | |||
} | |||
|
|||
return message; | |||
return message!; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is causing us to need this? Same on line 81. We should add some default value instead of using the !
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a lot of changes in here. I feel like in the future it is better to compartmentalize changes into smaller PRs. I see changes that correspond to react-native upgrade, and changes to linting errors, and anything else in between.
My $0.02.
"cursor": undefined, | ||
}, | ||
] | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is another reason why I think snapshots are silly.
@@ -114,7 +114,7 @@ const AnnouncementBanner = ({ | |||
snapPoints: [1, snapPoint], | |||
theme, | |||
}); | |||
}, [theme.sidebarHeaderTextColor, intl.locale, renderContent, allowDismissal]); | |||
}, [intl, allowDismissal, renderContent, theme]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm guessing this (and others) is more of a lint error vs react-native upgrade?
@yasserfaraazkhan ping. Can you do a smoke test on this? I see the E2E with iOS has passed, but can you check on Android? There's a growing demand to get this through. |
Hi @rahimrahman |
Observed defect on android |
Thanks for testing. I'm not as worried about the issue you found, whether it's caused by this or something completely different since it's not blocking. But I will take a look at it nevertheless. |
/update-branch |
@rahimrahman @yasserfaraazkhan I tried installing from the PR build as posted here and also the previously built one here, but in both cases the app doesn't launch successfully. It installs, and I tap the icon to launch, it flashes/blurs the screen for a moment, then it returns to the state before I tapped. I can't get the app to launch. Am I missing something obvious here? Are others able to install and launch the PR build for iOS? I see this issue on both iPhone 13 Pro Max with iOS 18.2 and also iPad Pro 11-inch with iOS 18.1.1 (tried twice with each). iPhone-Mm-doesnt-launch.mp4 |
Hi @lindalumitchell @rahimrahman It might be blocker for latest versions. |
@lindy65 @yasserfaraazkhan I have this running on iPhone 15 simulator on 17.5 and iPhone 16 Max simulator on 18.2. I will try in the AM again on real devices. I have devices running on 17.x and 18.2.1. I just updated the branch with |
Thanks @rahimrahman , I'm afraid you're right -- I tried on the new PR build and the issue is still there and the app won't launch. |
(I added myself as a reviewer to help keep this on my radar next week. For anyone reading this, I'll be doing smoke tests on iPad to round out the testing.) |
@lindalumitchell @yasserfaraazkhan I think I found the culprit and pushed the fix. It is building. I will verify it with my devices (18.2, I appreciate the testing on this and catching the issue. It is not a problem when doing an install on top of older version, but it is a problem on new install (hard install). It works on iPhone 15 simulator 17.5. |
This is my iPhone X running 16.x. So probably not a valid test. But for the record. RPReplay_Final1736620562.MP4 |
Summary
Upgrade all dependencies (the app should be tested in its entirety) and upgraded to React Native 0.76.5, still blocked to switch to the new arch by the navigation library
Ticket Link
https://mattermost.atlassian.net/browse/MM-60562
Release Note