-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Conversation
/e2e-test |
Successfully triggered e2e testing! |
458f361
to
f5a20b2
Compare
@@ -219,7 +219,7 @@ describe('AppsFormComponent', () => { | |||
<AppsForm {...props}/> | |||
</Provider>, | |||
); | |||
expect(wrapper.find(Modal.Body).find('.react-select__single-value').text()).toEqual('Option3'); | |||
expect(wrapper.find(Modal.Body).find('div.react-select__single-value').text()).toEqual('Option3'); |
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.
Emotion adds a wrapper around the actual div that has the same classNames as the actual div containing the value, so the test had to become more specific.
} | ||
return (v as EmailInvite).value; | ||
})); | ||
if (value) { |
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 breaking change in v3 of react-select is that when there are no options (e.g. a multi-select that we have deleted all options) previously it would lead to an empty array, while now it becomes more consistent and becomes a null value (same as initial state).
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.
Should we be exposing the webapp's ReactSelect
package to plugins? I'm wondering what the impact is, on plugins that are currently using v2 of the package
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.
That's a good question. Currently we're not exposing it (in the sense that we eg expose luxon or other libraries). Are plugins making assumptions about react-select and its version? cc: @hmhealey probably you have some context around this?
In that case, any major upgrade of this package would cause issues (e.g. there is an even bigger change in v3 with the multiple entrypoints that leads to changing how we import react-select, in that case plugins would again have to change).
Those things would be an issue if the plugin does not rely(as a dependency) on their react-select versions, though right?
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 don't think we have any way of guaranteeing that a plugin doesn't depend on a specific version of react-select or any other dependency. Even if we're careful with major version increases, there's still no guarantee that a minor update doesn't break anything.
I'd like to hold off on adding any more shared dependencies until we have plugins using module federation eventually since that has some ability to control the versions of dependencies in a way that's safe. Right now, every package we expose through the window ends up being another spot we may accidentally introduce breaking changes between the web app and plugins
/e2e-test |
Successfully triggered e2e testing! |
E2E tests not automatically triggered, because PR has no approval yet. Please ask a developer to review and then try again to attach the QA label. |
@M-ZubairAhmed @mickmister I'd love any further feedback/approval on this |
@m1lt0n I've deployed this PR with the cloud plugin for testing with plugins. I'm not seeing any issues when using the React Select components on this page: https://react-select-v3-plugin-test.test.mattermost.cloud/admin_console/plugins/plugin_com.mattermost.custom-attributes. LGTM 👍 |
Notes for QA review: This change affects multi-select (e.g. inviting emails to team) and some single-select (dropdown) components we have. Specific usages that I have tested for is invitation modal (users email) or add to channels, as well as retention policy in admin console, language selection in user settings, but there may be some more (I know of apps form that I wasn't able to test manually). Also, since our css explicitly mentions class names from this library, it makes sense to keep an eye for visual regressions around selects. |
Thanks @m1lt0n for including testing instructions. |
Test server destroyed |
Summary
In the context of regular dependency upgrades, this PR upgrades react-select to version 3.0.3 (from v2.4 that we're currently on. Current version of react-select is 5.6, but we need to take a multi-step approach as there are lots of breaking changes and it will require a significant amount of effort to get to the latest version).
Notes for QA review: This change affects multi-select (e.g. inviting emails to team) and some single-select (dropdown) components we have. Specific usages that I have tested for is invitation modal (users email) or add to channels, as well as retention policy in admin console, language selection in user settings, but there may be some more (I know of apps form that I wasn't able to test manually). Also, since our css explicitly mentions class names from this library, it makes sense to keep an eye for visual regressions around selects.
Ticket Link
https://mattermost.atlassian.net/browse/MM-48340
Release Note