mirror of
https://github.com/strapi/strapi.git
synced 2025-09-02 13:23:12 +00:00
Merge pull request #9966 from strapi/chore/upgrade-redux
Upgrade react-redux
This commit is contained in:
commit
27a5546a16
@ -23,15 +23,15 @@ window.strapi = Object.assign(window.strapi || {}, {
|
||||
});
|
||||
|
||||
module.exports = {
|
||||
// 'strapi-plugin-documentation': require('../../../strapi-plugin-documentation/admin/src').default,
|
||||
// 'strapi-plugin-users-permissions': require('../../../strapi-plugin-users-permissions/admin/src')
|
||||
// .default,
|
||||
'strapi-plugin-documentation': require('../../../strapi-plugin-documentation/admin/src').default,
|
||||
'strapi-plugin-users-permissions': require('../../../strapi-plugin-users-permissions/admin/src')
|
||||
.default,
|
||||
'strapi-plugin-content-manager': require('../../../strapi-plugin-content-manager/admin/src')
|
||||
.default,
|
||||
'strapi-plugin-content-type-builder': require('../../../strapi-plugin-content-type-builder/admin/src')
|
||||
.default,
|
||||
// 'strapi-plugin-email': require('../../../strapi-plugin-email/admin/src').default,
|
||||
'strapi-plugin-email': require('../../../strapi-plugin-email/admin/src').default,
|
||||
'strapi-plugin-upload': require('../../../strapi-plugin-upload/admin/src').default,
|
||||
// 'strapi-plugin-graphql': require('../../../strapi-plugin-graphql/admin/src').default,
|
||||
'strapi-plugin-graphql': require('../../../strapi-plugin-graphql/admin/src').default,
|
||||
'strapi-plugin-i18n': require('../../../strapi-plugin-i18n/admin/src').default,
|
||||
};
|
||||
|
@ -86,7 +86,7 @@
|
||||
"react-is": "^16.12.0",
|
||||
"react-loadable": "^5.5.0",
|
||||
"react-query": "3.8.3",
|
||||
"react-redux": "7.2.2",
|
||||
"react-redux": "7.2.3",
|
||||
"react-router": "^5.2.0",
|
||||
"react-router-dom": "^5.0.0",
|
||||
"react-select": "^4.0.2",
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React, { memo, useEffect, useMemo, useReducer } from 'react';
|
||||
import { useParams } from 'react-router-dom';
|
||||
import { CheckPagePermissions, LoadingIndicatorPage, request } from 'strapi-helper-plugin';
|
||||
import { useSelector } from 'react-redux';
|
||||
import { useSelector, shallowEqual } from 'react-redux';
|
||||
import { getRequestUrl, mergeMetasWithSchema } from '../../utils';
|
||||
import { makeSelectModelAndComponentSchemas } from '../Main/selectors';
|
||||
import pluginPermissions from '../../permissions';
|
||||
@ -12,7 +12,7 @@ import EditSettingsView from '../EditSettingsView';
|
||||
const ComponentSettingsView = () => {
|
||||
const [{ isLoading, data: layout }, dispatch] = useReducer(crudReducer, crudInitialState);
|
||||
const schemasSelector = useMemo(makeSelectModelAndComponentSchemas, []);
|
||||
const { schemas } = useSelector(state => schemasSelector(state), []);
|
||||
const { schemas } = useSelector(state => schemasSelector(state), shallowEqual);
|
||||
const { uid } = useParams();
|
||||
|
||||
useEffect(() => {
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React, { useCallback, useMemo, useReducer, useState } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import { useSelector } from 'react-redux';
|
||||
import { useSelector, shallowEqual } from 'react-redux';
|
||||
import { cloneDeep, flatMap, get, set, pick } from 'lodash';
|
||||
import { request, useGlobalContext } from 'strapi-helper-plugin';
|
||||
import { Inputs as Input } from '@buffetjs/custom';
|
||||
@ -32,7 +32,7 @@ const EditSettingsView = ({ components, mainLayout, isContentTypeView, slug, upd
|
||||
const [isDraggingSibling, setIsDraggingSibling] = useState(false);
|
||||
|
||||
const schemasSelector = useMemo(makeSelectModelAndComponentSchemas, []);
|
||||
const { schemas } = useSelector(state => schemasSelector(state), []);
|
||||
const { schemas } = useSelector(state => schemasSelector(state), shallowEqual);
|
||||
|
||||
const { componentLayouts, initialData, metaToEdit, modifiedData, metaForm } = reducerState.toJS();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { useCallback, useEffect, useMemo, useReducer, useRef } from 'react';
|
||||
import { useSelector } from 'react-redux';
|
||||
import { useSelector, shallowEqual } from 'react-redux';
|
||||
import { request } from 'strapi-helper-plugin';
|
||||
import formatLayouts from './utils/formatLayouts';
|
||||
import reducer, { initialState } from './reducer';
|
||||
@ -8,7 +8,7 @@ import { makeSelectModelAndComponentSchemas } from '../../containers/Main/select
|
||||
const useFetchContentTypeLayout = contentTypeUID => {
|
||||
const [{ error, isLoading, layout, layouts }, dispatch] = useReducer(reducer, initialState);
|
||||
const schemasSelector = useMemo(makeSelectModelAndComponentSchemas, []);
|
||||
const { schemas } = useSelector(state => schemasSelector(state), []);
|
||||
const { schemas } = useSelector(state => schemasSelector(state), shallowEqual);
|
||||
const isMounted = useRef(true);
|
||||
|
||||
const getData = useCallback(
|
||||
|
@ -37,7 +37,7 @@
|
||||
"react-dom": "^16.9.0",
|
||||
"react-fast-compare": "^3.2.0",
|
||||
"react-intl": "4.5.0",
|
||||
"react-redux": "7.2.2",
|
||||
"react-redux": "7.2.3",
|
||||
"react-router": "^5.2.0",
|
||||
"react-router-dom": "^5.0.0",
|
||||
"reactstrap": "8.4.1",
|
||||
|
@ -18,7 +18,7 @@ import { Inputs } from '@buffetjs/custom';
|
||||
import { useHistory, useLocation } from 'react-router-dom';
|
||||
import { FormattedMessage } from 'react-intl';
|
||||
import { get, has, isEmpty, set, toLower, toString, upperFirst } from 'lodash';
|
||||
import { useSelector, useDispatch } from 'react-redux';
|
||||
import { useSelector, useDispatch, shallowEqual } from 'react-redux';
|
||||
import pluginId from '../../pluginId';
|
||||
import useDataManager from '../../hooks/useDataManager';
|
||||
import AttributeOption from '../../components/AttributeOption';
|
||||
@ -68,7 +68,7 @@ const FormModal = () => {
|
||||
const [showConfirmModal, setShowConfirmModal] = useState(false);
|
||||
const formModalSelector = useMemo(makeSelectFormModal, []);
|
||||
const dispatch = useDispatch();
|
||||
const reducerState = useSelector(state => formModalSelector(state), []);
|
||||
const reducerState = useSelector(state => formModalSelector(state), shallowEqual);
|
||||
const { push } = useHistory();
|
||||
const { search } = useLocation();
|
||||
const { emitEvent, formatMessage } = useGlobalContext();
|
||||
|
@ -22,7 +22,7 @@
|
||||
"react": "^16.14.0",
|
||||
"react-dom": "^16.9.0",
|
||||
"react-intl": "4.5.0",
|
||||
"react-redux": "7.2.2",
|
||||
"react-redux": "7.2.3",
|
||||
"react-router": "^5.2.0",
|
||||
"react-router-dom": "^5.0.0",
|
||||
"reactstrap": "8.4.1",
|
||||
|
@ -28,7 +28,7 @@
|
||||
"react-copy-to-clipboard": "^5.0.3",
|
||||
"react-dom": "^16.9.0",
|
||||
"react-intl": "4.5.0",
|
||||
"react-redux": "7.2.2",
|
||||
"react-redux": "7.2.3",
|
||||
"react-router": "^5.2.0",
|
||||
"react-router-dom": "^5.0.0",
|
||||
"reactstrap": "8.4.1",
|
||||
|
@ -31,7 +31,7 @@
|
||||
"react-copy-to-clipboard": "^5.0.3",
|
||||
"react-dom": "^16.9.0",
|
||||
"react-intl": "4.5.0",
|
||||
"react-redux": "7.2.2",
|
||||
"react-redux": "7.2.3",
|
||||
"react-router": "^5.2.0",
|
||||
"react-router-dom": "^5.0.0",
|
||||
"reactstrap": "8.4.1",
|
||||
|
@ -29,7 +29,7 @@
|
||||
"react": "^16.14.0",
|
||||
"react-dom": "^16.9.0",
|
||||
"react-intl": "4.5.0",
|
||||
"react-redux": "7.2.2",
|
||||
"react-redux": "7.2.3",
|
||||
"react-router": "^5.2.0",
|
||||
"react-router-dom": "^5.0.0",
|
||||
"reactstrap": "8.4.1",
|
||||
|
23
yarn.lock
23
yarn.lock
@ -3507,7 +3507,7 @@
|
||||
resolved "https://registry.yarnpkg.com/@types/graphlib/-/graphlib-2.1.7.tgz#e6a47a4f43511f5bad30058a669ce5ce93bfd823"
|
||||
integrity sha512-K7T1n6U2HbTYu+SFHlBjz/RH74OA2D/zF1qlzn8uXbvB4uRg7knOM85ugS2bbXI1TXMh7rLqk4OVRwIwEBaixg==
|
||||
|
||||
"@types/hoist-non-react-statics@^3.3.1":
|
||||
"@types/hoist-non-react-statics@^3.3.0", "@types/hoist-non-react-statics@^3.3.1":
|
||||
version "3.3.1"
|
||||
resolved "https://registry.yarnpkg.com/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz#1124aafe5118cb591977aeb1ceaaed1070eb039f"
|
||||
integrity sha512-iMIqiko6ooLrTh1joXodJK5X9xeEALT1kM5G3ZLhD3hszxBdIEd5C75U834D9mLcINgD4OyZf5uQXjkuYydWvA==
|
||||
@ -3745,6 +3745,16 @@
|
||||
resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.3.tgz#7ee330ba7caafb98090bece86a5ee44115904c2c"
|
||||
integrity sha512-ewFXqrQHlFsgc09MK5jP5iR7vumV/BYayNC6PgJO2LPe8vrnNFyjQjSppfEngITi0qvfKtzFvgKymGheFM9UOA==
|
||||
|
||||
"@types/react-redux@^7.1.16":
|
||||
version "7.1.16"
|
||||
resolved "https://registry.yarnpkg.com/@types/react-redux/-/react-redux-7.1.16.tgz#0fbd04c2500c12105494c83d4a3e45c084e3cb21"
|
||||
integrity sha512-f/FKzIrZwZk7YEO9E1yoxIuDNRiDducxkFlkw/GNMGEnK9n4K8wJzlJBghpSuOVDgEUHoDkDF7Gi9lHNQR4siw==
|
||||
dependencies:
|
||||
"@types/hoist-non-react-statics" "^3.3.0"
|
||||
"@types/react" "*"
|
||||
hoist-non-react-statics "^3.3.0"
|
||||
redux "^4.0.0"
|
||||
|
||||
"@types/react-test-renderer@*":
|
||||
version "16.9.3"
|
||||
resolved "https://registry.yarnpkg.com/@types/react-test-renderer/-/react-test-renderer-16.9.3.tgz#96bab1860904366f4e848b739ba0e2f67bcae87e"
|
||||
@ -16405,12 +16415,13 @@ react-query@3.8.3:
|
||||
"@babel/runtime" "^7.5.5"
|
||||
match-sorter "^6.0.2"
|
||||
|
||||
react-redux@7.2.2:
|
||||
version "7.2.2"
|
||||
resolved "https://registry.yarnpkg.com/react-redux/-/react-redux-7.2.2.tgz#03862e803a30b6b9ef8582dadcc810947f74b736"
|
||||
integrity sha512-8+CQ1EvIVFkYL/vu6Olo7JFLWop1qRUeb46sGtIMDCSpgwPQq8fPLpirIB0iTqFe9XYEFPHssdX8/UwN6pAkEA==
|
||||
react-redux@7.2.3:
|
||||
version "7.2.3"
|
||||
resolved "https://registry.yarnpkg.com/react-redux/-/react-redux-7.2.3.tgz#4c084618600bb199012687da9e42123cca3f0be9"
|
||||
integrity sha512-ZhAmQ1lrK+Pyi0ZXNMUZuYxYAZd59wFuVDGUt536kSGdD0ya9Q7BfsE95E3TsFLE3kOSFp5m6G5qbatE+Ic1+w==
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.12.1"
|
||||
"@types/react-redux" "^7.1.16"
|
||||
hoist-non-react-statics "^3.3.2"
|
||||
loose-envify "^1.4.0"
|
||||
prop-types "^15.7.2"
|
||||
@ -16836,7 +16847,7 @@ redux-saga@^0.16.0:
|
||||
resolved "https://registry.yarnpkg.com/redux-saga/-/redux-saga-0.16.2.tgz#993662e86bc945d8509ac2b8daba3a8c615cc971"
|
||||
integrity sha512-iIjKnRThI5sKPEASpUvySemjzwqwI13e3qP7oLub+FycCRDysLSAOwt958niZW6LhxfmS6Qm1BzbU70w/Koc4w==
|
||||
|
||||
redux@^4.0.1, redux@^4.0.4:
|
||||
redux@^4.0.0, redux@^4.0.1, redux@^4.0.4:
|
||||
version "4.0.5"
|
||||
resolved "https://registry.yarnpkg.com/redux/-/redux-4.0.5.tgz#4db5de5816e17891de8a80c424232d06f051d93f"
|
||||
integrity sha512-VSz1uMAH24DM6MF72vcojpYPtrTUu3ByVWfPL1nPfVRb5mZVTve5GnNCUV53QM/BZ66xfWrm0CTWoM+Xlz8V1w==
|
||||
|
Loading…
x
Reference in New Issue
Block a user