-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Conversation
@hmhealey can you push this PR to be tested first before I do the review, it is a very large PR and I would rather review it after having confirmation that nothing is broken. |
Not only OverlayTrigger, but also Tooltips have same context issue as well. it completely destroys the context API usage and causes memory leaks in VDOM. Wouldn't it be better to upgrade react-bootstrap first, even if it spends more time? |
@enahum I'll see if I can do that, although we're in the release cycle right now, so it might be difficult. If it can't be reviewed right now, I'll look at breaking up this PR some more. @cometkim I could implement a custom Tooltip replacement like OverlayTrigger, but what do you mean by it causing memory leaks? I wasn't aware of anything like that |
@hmhealey never mind. I suspected that because elements are duplicated in the inspector and never removed. It seems to be a bug in the inspector. |
I'm going to break this up into a few more PRs wherever possible. I'll re-add reviewers once those PRs are in |
@cometkim Have you found any specific instances where the Tooltip isn't passing the context correctly? It seems to be working fine everywhere I've checked |
This is ready for review again now that some of the large, distracting changes have been merged separately. For dev reviewers, if you filter out the changes to 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.
LGTM
@hmhealey test are failing, probably related to the merge done |
Mattermost test server updated with git commit Access here: https://mattermost-webapp-pr-4615.test.mattermost.cloud |
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.
LGTM, one question as it seems weird, but not a blocker as long as it works
@@ -704,8 +704,8 @@ class CreateComment extends React.PureComponent { | |||
if (index !== -1) { | |||
uploadsInProgress.splice(index, 1); | |||
|
|||
if (this.refs.fileUpload && this.refs.fileUpload.getWrappedInstance() && this.refs.fileUpload.getWrappedInstance().getWrappedInstance()) { | |||
this.refs.fileUpload.getWrappedInstance().getWrappedInstance().cancelUpload(id); | |||
if (this.refs.fileUpload && this.refs.fileUpload.getWrappedInstance()) { |
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.
do you need getWrappedInstance
even by using forwardRef
? that seems strange
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.
The remaining getWrappedInstance
is actually from connect
. If that gets updated to use React.forwardRef
, then we can remove the second getWrappedInstance
@hmhealey PR needs updating, @jgilliam17 please try and test the PR soon ;) |
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.
Tested, looks good to merge.
- Verified Localizations, checked popovers and modals opened by the app
- Verified invalid slash command trigger error
- Verified using Alt + arrows to switch channels
- Verified profile popover opens as expected
- Able to log in/logout without any issues
Test server destroyed |
This is the final PR to update to the new version of react-intl. Most of it should be nonfunctional stuff like updating snapshots and tests, but there's a few important things I wanted to call out:
The biggest change that I didn't expect is that the version of react-bootstrap'sThis change was merged as a separate PR.OverlayTrigger
that we use doesn't pass context correctly, so I had to make a custom version ofOverlayTrigger
to make it so that modals and popovers (like the profile popover) could be translated correctly.shallowWithIntl
andmountWithIntl
, but I removed the step of them that unwraps calls toReact.forwardRef
since it wasn't necessary and it caused some problems when we were trying to test components that usedforwardRef
when it wasn't frominjectIntl
Related to the above,This change was merged in a separate PR.shallowWithIntl
is only needed for testing components that useinjectIntl
, so I've removed it from all tests where it wasn't needed. Similarly, we no longer need to.dive
into most components when testing them.React.forwardRef
to pass refs intoinjectIntl
components. This was the big source of issues last time that we attempted this upgrade, but I think I've gone through and either tested or removed everywhere we did thisTicket Link
https://mattermost.atlassian.net/browse/MM-17555