-
Notifications
You must be signed in to change notification settings - Fork 191
Update dependencies for React 18 #2114
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
Changes from all commits
11dd988
6c936a4
6adf7b0
befed5f
b524906
6cecf63
5775614
dd823a6
aea64c1
1ec82e6
57544c8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,9 +7,9 @@ | |
| "dependencies": { | ||
| "@apollo/client": "3.7.3", | ||
| "@floating-ui/react": "0.26.28", | ||
| "@mattermost/client": "10.9.0", | ||
| "@mattermost/client": "11.1.0-2", | ||
| "@mattermost/compass-icons": "0.1.32", | ||
| "@mattermost/types": "10.9.0", | ||
| "@mattermost/types": "11.1.0-2", | ||
| "@mdi/js": "^6.5.95", | ||
| "@mdi/react": "1.5.0", | ||
| "@tanstack/react-table": "8.10.7", | ||
|
|
@@ -24,22 +24,23 @@ | |
| "js-trim-multiline-string": "^1.0.8", | ||
| "lodash": "4.17.21", | ||
| "luxon": "3.6.1", | ||
| "mattermost-redux": "10.9.0", | ||
| "mattermost-redux": "11.1.0-2", | ||
| "parse-duration": "2.1.4", | ||
| "qs": "6.10.5", | ||
| "react": "^17.0.2", | ||
| "react": "18.2.0", | ||
| "react-beautiful-dnd": "13.1.1", | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This moved from being a |
||
| "react-chartjs-2": "4.3.1", | ||
| "react-custom-scrollbars": "4.2.1", | ||
| "react-dom": "^17.0.2", | ||
| "react-dom": "18.2.0", | ||
| "react-infinite-scroll-component": "^6.1.0", | ||
| "react-infinite-scroller": "1.2.6", | ||
| "react-intl": "7.1.11", | ||
| "react-redux": "7.2.6", | ||
| "react-redux": "9.2.0", | ||
| "react-router-dom": "5.3.4", | ||
| "react-router-hash-link": "2.4.3", | ||
| "react-select": "4.3.1", | ||
| "react-use": "17.3.2", | ||
| "redux": "4.1.2", | ||
| "react-use": "17.3.3", | ||
| "redux": "5.0.1", | ||
| "styled-components": "5.3.7", | ||
| "typescript": "5.6.3" | ||
| }, | ||
|
|
@@ -60,18 +61,17 @@ | |
| "@types/lodash": "4.14.178", | ||
| "@types/luxon": "3.6.2", | ||
| "@types/qs": "6.9.7", | ||
| "@types/react": "^17.0.2", | ||
| "@types/react": "18.2.64", | ||
| "@types/react-beautiful-dnd": "13.1.2", | ||
| "@types/react-bootstrap": "1.0.1", | ||
| "@types/react-bootstrap": "0.32.35", | ||
| "@types/react-custom-scrollbars": "4.0.10", | ||
| "@types/react-dom": "^17.0.2", | ||
| "@types/react-dom": "18.2.25", | ||
| "@types/react-infinite-scroller": "1.2.3", | ||
| "@types/react-redux": "7.1.21", | ||
| "@types/redux-mock-store": "1.5.0", | ||
| "@types/react-router-dom": "5.3.3", | ||
| "@types/react-router-hash-link": "2.4.5", | ||
| "@types/react-select": "3.1.2", | ||
| "@types/react-test-renderer": "17.0.1", | ||
| "@types/redux-mock-store": "1.0.3", | ||
| "@types/shallow-equals": "1.0.0", | ||
| "@types/styled-components": "5.1.26", | ||
| "@typescript-eslint/eslint-plugin": "8.32.0", | ||
|
|
@@ -102,14 +102,14 @@ | |
| "jest-canvas-mock": "2.3.1", | ||
| "jest-environment-jsdom": "29.7.0", | ||
| "jest-junit": "13.0.0", | ||
| "patch-package": "8.0.1", | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is temporary until I either merge mattermost/react-bootstrap#6 or figure out a better way to modify its dependency without it |
||
| "postcss-styled-syntax": "0.7.1", | ||
| "process": "0.11.10", | ||
| "react-beautiful-dnd": "13.1.0", | ||
| "react-bootstrap": "1.6.1", | ||
| "react-bootstrap": "github:mattermost/react-bootstrap#05559f4c61c5a314783c390d2d82906ee8c7e558", | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As mentioned elsewhere, this is only used during development, but it'll now match the web app's version instead of accidentally depending on a newer version of React Bootstrap |
||
| "react-refresh": "0.11.0", | ||
| "react-test-renderer": "17.0.2", | ||
| "redux-mock-store": "1.5.4", | ||
| "redux-thunk": "2.4.1", | ||
| "react-test-renderer": "18.2.0", | ||
| "redux-thunk": "3.1.0", | ||
| "sass": "1.46.0", | ||
| "sass-loader": "12.4.0", | ||
| "style-loader": "3.3.1", | ||
|
|
@@ -122,9 +122,25 @@ | |
| "webpack-dev-server": "4.15.1" | ||
| }, | ||
| "overrides": { | ||
| "@testing-library/react-hooks": { | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't upgrade a few of these dependencies because newer versions required some further changes. This library doesn't support React 18, but it seems to work fine for now. It needs to be replaced with |
||
| "@types/react": "$@types/react", | ||
| "react": "$react", | ||
| "react-dom": "$react-dom", | ||
| "react-test-renderer": "$react-test-renderer" | ||
| }, | ||
| "@types/redux-mock-store": { | ||
| "redux": "$redux" | ||
| }, | ||
| "react-custom-scrollbars": { | ||
| "react": "17.0.2", | ||
| "react-dom": "17.0.2" | ||
| "react": "$react", | ||
| "react-dom": "$react-dom" | ||
|
Comment on lines
+135
to
+136
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| }, | ||
| "react-input-autosize": { | ||
| "react": "$react" | ||
| }, | ||
| "react-select": { | ||
| "react": "$react", | ||
| "react-dom": "$react-dom" | ||
|
Comment on lines
+138
to
+143
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The web app uses a newer version of React Select (5.9.0) which supports React 18 and has some accessibility improvements, but upgrading requires some breaking changes. React Select 5 also removes the dependency on |
||
| } | ||
| }, | ||
| "scripts": { | ||
|
|
@@ -190,6 +206,9 @@ | |
| "setupFiles": [ | ||
| "jest-canvas-mock" | ||
| ], | ||
| "setupFilesAfterEnv": [ | ||
| "<rootDir>/src/setupTests.ts" | ||
| ], | ||
| "testEnvironmentOptions": { | ||
| "url": "http://localhost:8065" | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -89,7 +89,8 @@ const PlaybookEditor = () => { | |
|
|
||
| const archivedTooltip = archived && ( | ||
| <Tooltip | ||
| delay={{show: 0, hide: 1000}} | ||
| delayShow={0} | ||
| delayHide={1000} | ||
|
Comment on lines
+92
to
+93
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These might be a functional change because the API used before wouldn't have worked with the provided version of React Bootstrap as best as I can tell. We've stopped using these components instead of Floating UI in the web app though because we suspected that |
||
| id={`archive-${playbook.id}`} | ||
| content={formatMessage({defaultMessage: 'This playbook is archived.'})} | ||
| > | ||
|
|
@@ -99,7 +100,8 @@ const PlaybookEditor = () => { | |
|
|
||
| const privateTooltip = !playbook.public && ( | ||
| <Tooltip | ||
| delay={{show: 0, hide: 1000}} | ||
| delayShow={0} | ||
| delayHide={1000} | ||
| id={`private-${playbook.id}`} | ||
| content={formatMessage({defaultMessage: 'This playbook is private.'})} | ||
| > | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,8 @@ | ||
| // Copyright (c) 2020-present Mattermost, Inc. All Rights Reserved. | ||
| // See LICENSE.txt for license information. | ||
|
|
||
| import React, {useEffect, useState} from 'react'; | ||
| import {useSelector, useStore} from 'react-redux'; | ||
| import React, {useEffect, useMemo, useState} from 'react'; | ||
| import {useSelector} from 'react-redux'; | ||
| import {useIntl} from 'react-intl'; | ||
| import ReactSelect, {ActionTypes, ControlProps, StylesConfig} from 'react-select'; | ||
|
|
||
|
|
@@ -88,9 +88,8 @@ export default function ProfileSelector(props: Props) { | |
|
|
||
| // props.userGroups?.subsetUserIds are not guaranteed to be in the page returned by props.getAllUsers | ||
| // but they're expected to be at redux | ||
| const getProfiles = makeGetProfilesByIdsAndUsernames(); | ||
| const store = useStore(); | ||
| const usersInSubset = getProfiles(store.getState(), {allUserIds: props.userGroups?.subsetUserIds || [], allUsernames: []}); | ||
| const getProfiles = useMemo(() => makeGetProfilesByIdsAndUsernames(), []); | ||
| const usersInSubset = useSelector((state: GlobalState) => getProfiles(state, {allUserIds: props.userGroups?.subsetUserIds || [], allUsernames: []})); | ||
|
Comment on lines
+91
to
+92
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I did a bit extra here to fix an incorrectly memoized selector |
||
|
|
||
| useUpdateEffect(() => { | ||
| props.onOpenChange?.(isOpen); | ||
|
|
||
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 updated mattermost-redux and the client/type packages because I forgot that mattermost-redux had a dependency on a specific major version of Redux. I cut these adhoc releases off of the latest 11.1 branch of the monorepo, and we can replace them with proper ones after 11.1.0 releases