Closed hmhealey closed 1 year ago
During this sweep of updates, I'm wondering if we should also include other packages that are available on window:
window.React = require('react');
window.ReactDOM = require('react-dom');
window.ReactIntl = require('react-intl');
window.Redux = require('redux');
window.ReactRedux = require('react-redux');
window.ReactBootstrap = require('react-bootstrap');
window.ReactRouterDom = require('react-router-dom');
window.PropTypes = require('prop-types');
window.Luxon = require('luxon');
window.StyledComponents = require('styled-components');
I'm wondering if we should also update package.json
to have React 17, to make sure any existing libraries in the individual plugin projects are updated to follow relevant breaking changes from the React library. I wonder what sort of backwards compatbilities this may cause on a server running React 16 if we go down this route.
I'm 0/5 on whether or not we want to include those other externals as well. I don't know if adding them to externals means that we need to include them in the package.json or not.
As for updating the actual version, that's probably a good idea, but it will 100% cause dependency conflicts because of how we import mattermost-webapp, so I'd prefer to spin that off into a separate ticket. We need to resolve that issue as well, but it's likely going to be a pain because we're in a bit of dependency hell here.
/update-branch
Skipping QA review on this since it's a straightforward enough fix that we've already applied to a bunch of other repos
For some more context, see here. The short version though is that we updated the web app to React 17, and there's a chance that plugins will have some issues with it because they're compiled with the React 16 version of ReactDOM. I'm submitting PRs to the 3 products, the demo plugin, and the plugin template to have them use the web app's version of React DOM to fix any immediate issues, but we'll want to properly migrate them to React 17 going forward.
Ticket Link
https://mattermost.atlassian.net/browse/MM-47046
Related Pull Requests
https://github.com/mattermost/mattermost-plugin-playbooks/pull/1489 https://github.com/mattermost/focalboard/pull/3861 https://github.com/mattermost/mattermost-plugin-todo/pull/190 https://github.com/mattermost/mattermost-plugin-demo/pull/153