From 4703406e4f1c15b12fc8ce6ea8f6cdec21354d8f Mon Sep 17 00:00:00 2001 From: Vladislav Shkodin Date: Thu, 11 Mar 2021 15:40:12 +0200 Subject: [PATCH] chore: remove connected-react-router (#5096) --- packages/netlify-cms-core/package.json | 1 - packages/netlify-cms-core/src/bootstrap.js | 9 +++---- ...{combinedReducer.js => combinedReducer.ts} | 4 +-- packages/netlify-cms-core/src/redux/index.ts | 12 ++------- yarn.lock | 26 ------------------- 5 files changed, 7 insertions(+), 45 deletions(-) rename packages/netlify-cms-core/src/reducers/{combinedReducer.js => combinedReducer.ts} (65%) diff --git a/packages/netlify-cms-core/package.json b/packages/netlify-cms-core/package.json index 0cba0bf3..7055fa07 100644 --- a/packages/netlify-cms-core/package.json +++ b/packages/netlify-cms-core/package.json @@ -29,7 +29,6 @@ "ajv": "^7.0.0", "ajv-errors": "^2.0.0", "ajv-keywords": "^4.0.0", - "connected-react-router": "^6.8.0", "copy-text-to-clipboard": "^3.0.0", "deepmerge": "^4.2.2", "diacritics": "^1.3.0", diff --git a/packages/netlify-cms-core/src/bootstrap.js b/packages/netlify-cms-core/src/bootstrap.js index dfca8b52..b8fadf67 100644 --- a/packages/netlify-cms-core/src/bootstrap.js +++ b/packages/netlify-cms-core/src/bootstrap.js @@ -1,10 +1,9 @@ import React from 'react'; import { render } from 'react-dom'; import { Provider, connect } from 'react-redux'; -import { Route } from 'react-router-dom'; -import { ConnectedRouter } from 'connected-react-router'; -import history from 'Routing/history'; +import { Route, Router } from 'react-router-dom'; import store from 'ReduxStore'; +import history from 'Routing/history'; import { loadConfig } from 'Actions/config'; import { authenticateUser } from 'Actions/auth'; import { getPhrases } from 'Lib/phrases'; @@ -23,9 +22,9 @@ function TranslatedApp({ locale, config }) { return ( - + - + ); diff --git a/packages/netlify-cms-core/src/reducers/combinedReducer.js b/packages/netlify-cms-core/src/reducers/combinedReducer.ts similarity index 65% rename from packages/netlify-cms-core/src/reducers/combinedReducer.js rename to packages/netlify-cms-core/src/reducers/combinedReducer.ts index f38b9f46..389e72c4 100644 --- a/packages/netlify-cms-core/src/reducers/combinedReducer.js +++ b/packages/netlify-cms-core/src/reducers/combinedReducer.ts @@ -1,13 +1,11 @@ import { combineReducers } from 'redux'; -import { connectRouter } from 'connected-react-router'; import { reducer as notifReducer } from 'redux-notifications'; import reducers from './index'; -function createRootReducer(history) { +function createRootReducer() { return combineReducers({ ...reducers, notifs: notifReducer, - router: connectRouter(history), }); } diff --git a/packages/netlify-cms-core/src/redux/index.ts b/packages/netlify-cms-core/src/redux/index.ts index f897e6e5..d293787a 100644 --- a/packages/netlify-cms-core/src/redux/index.ts +++ b/packages/netlify-cms-core/src/redux/index.ts @@ -1,22 +1,14 @@ import { createStore, applyMiddleware, AnyAction } from 'redux'; import { composeWithDevTools } from 'redux-devtools-extension'; import thunkMiddleware, { ThunkMiddleware } from 'redux-thunk'; -import { routerMiddleware } from 'connected-react-router'; import { waitUntilAction } from './middleware/waitUntilAction'; import createRootReducer from '../reducers/combinedReducer'; -import history from '../routing/history'; import { State } from '../types/redux'; import { Reducer } from 'react'; const store = createStore( - (createRootReducer(history) as unknown) as Reducer, - composeWithDevTools( - applyMiddleware( - routerMiddleware(history), - thunkMiddleware as ThunkMiddleware, - waitUntilAction, - ), - ), + (createRootReducer() as unknown) as Reducer, + composeWithDevTools(applyMiddleware(thunkMiddleware as ThunkMiddleware, waitUntilAction)), ); export default store; diff --git a/yarn.lock b/yarn.lock index d02df75b..aadaae97 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6251,17 +6251,6 @@ connect-history-api-fallback@^1.6.0: resolved "https://registry.yarnpkg.com/connect-history-api-fallback/-/connect-history-api-fallback-1.6.0.tgz#8b32089359308d111115d81cad3fceab888f97bc" integrity sha512-e54B99q/OUoH64zYYRf3HBP5z24G38h5D3qXu23JGRoigpX5Ss4r9ZnDk3g0Z8uQC2x2lPaJ+UlWBc1ZWBWdLg== -connected-react-router@^6.8.0: - version "6.9.1" - resolved "https://registry.yarnpkg.com/connected-react-router/-/connected-react-router-6.9.1.tgz#d842eebaa15b9920e2e45fc03d74e41110e94e4c" - integrity sha512-BbtB6t0iqAwGwygDenJl9zmlk7vpKWIRSycULmkAOn2RUaF6+bqETprl0qcIqQmY5CTqSwKanaxkLXYWiffAfQ== - dependencies: - lodash.isequalwith "^4.4.0" - prop-types "^15.7.2" - optionalDependencies: - immutable "^3.8.1 || ^4.0.0-rc.1" - seamless-immutable "^7.1.3" - console-browserify@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.2.0.tgz#67063cef57ceb6cf4993a2ab3a55840ae8c49336" @@ -9895,11 +9884,6 @@ immutable@^3.7.6: resolved "https://registry.yarnpkg.com/immutable/-/immutable-3.8.2.tgz#c2439951455bb39913daf281376f1530e104adf3" integrity sha1-wkOZUUVbs5kT2vKBN28VMOEErfM= -"immutable@^3.8.1 || ^4.0.0-rc.1": - version "4.0.0-rc.12" - resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.0.0-rc.12.tgz#ca59a7e4c19ae8d9bf74a97bdf0f6e2f2a5d0217" - integrity sha512-0M2XxkZLx/mi3t8NVwIm1g8nHoEmM9p9UBl/G9k4+hm0kBgOVdMV/B3CY5dQ8qG8qc80NN4gDV4HQv6FTJ5q7A== - import-cwd@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/import-cwd/-/import-cwd-2.1.0.tgz#aa6cf36e722761285cb371ec6519f53e2435b0a9" @@ -11789,11 +11773,6 @@ lodash.get@^4.4.2: resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99" integrity sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk= -lodash.isequalwith@^4.4.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/lodash.isequalwith/-/lodash.isequalwith-4.4.0.tgz#266726ddd528f854f21f4ea98a065606e0fbc6b0" - integrity sha1-Jmcm3dUo+FTyH06pigZWBuD7xrA= - lodash.ismatch@^4.4.0: version "4.4.0" resolved "https://registry.yarnpkg.com/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz#756cb5150ca3ba6f11085a78849645f188f85f37" @@ -15920,11 +15899,6 @@ schema-utils@^3.0.0: ajv "^6.12.5" ajv-keywords "^3.5.2" -seamless-immutable@^7.1.3: - version "7.1.4" - resolved "https://registry.yarnpkg.com/seamless-immutable/-/seamless-immutable-7.1.4.tgz#6e9536def083ddc4dea0207d722e0e80d0f372f8" - integrity sha512-XiUO1QP4ki4E2PHegiGAlu6r82o5A+6tRh7IkGGTVg/h+UoeX4nFBeCGPOhb4CYjvkqsfm/TUtvOMYC1xmV30A== - section-matter@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/section-matter/-/section-matter-1.0.0.tgz#e9041953506780ec01d59f292a19c7b850b84167"