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

Update dependencies and upgrade to RN 0.76.5 #8421

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Update dependencies and upgrade to RN 0.76.5 #8421

wants to merge 12 commits into from

Conversation

enahum
Copy link
Contributor

@enahum enahum commented Dec 17, 2024

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

NONE

@enahum enahum added 2: Dev Review Requires review by a core commiter 3: QA Review Requires review by a QA tester labels Dec 17, 2024
Copy link
Contributor

@larkox larkox left a 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>}
Copy link
Contributor

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]);
Copy link
Contributor

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>;
Copy link
Contributor

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]);
Copy link
Contributor

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,
},
]
}
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Comment on lines 16 to 17
afterAll(() => {
// jest.resetAllMocks();
Copy link
Contributor

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?

@@ -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!;
Copy link
Contributor

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 !.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2: Dev Review Requires review by a core commiter 3: QA Review Requires review by a QA tester release-note-none
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants