From 80d7e5fb7f279f4ff76315170ce3423757239f33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Wed, 3 Jun 2020 16:56:08 +0200 Subject: [PATCH] redux: move PersistenceRegistry to the redux feature --- react/features/base/app/components/BaseApp.js | 2 +- react/features/base/known-domains/reducer.js | 3 +-- .../features/base/{storage => redux}/PersistenceRegistry.js | 0 react/features/base/{storage => redux}/README.md | 0 react/features/base/redux/index.js | 1 + react/features/base/{storage => redux}/middleware.js | 4 ++-- react/features/base/settings/reducer.js | 3 +-- react/features/base/storage/index.js | 3 --- react/features/base/storage/logger.js | 5 ----- react/features/calendar-sync/reducer.js | 3 +-- react/features/dropbox/reducer.js | 3 +-- react/features/recent-list/reducer.js | 3 +-- react/features/screenshot-capture/reducer.js | 3 +-- react/features/video-layout/reducer.js | 3 +-- react/features/welcome/reducer.js | 3 +-- 15 files changed, 12 insertions(+), 27 deletions(-) rename react/features/base/{storage => redux}/PersistenceRegistry.js (100%) rename react/features/base/{storage => redux}/README.md (100%) rename react/features/base/{storage => redux}/middleware.js (92%) delete mode 100644 react/features/base/storage/index.js delete mode 100644 react/features/base/storage/logger.js diff --git a/react/features/base/app/components/BaseApp.js b/react/features/base/app/components/BaseApp.js index 5ee6f35a2..e01a091df 100644 --- a/react/features/base/app/components/BaseApp.js +++ b/react/features/base/app/components/BaseApp.js @@ -11,11 +11,11 @@ import Thunk from 'redux-thunk'; import { i18next } from '../../i18n'; import { MiddlewareRegistry, + PersistenceRegistry, ReducerRegistry, StateListenerRegistry } from '../../redux'; import { SoundCollection } from '../../sounds'; -import { PersistenceRegistry } from '../../storage'; import { appWillMount, appWillUnmount } from '../actions'; import logger from '../logger'; diff --git a/react/features/base/known-domains/reducer.js b/react/features/base/known-domains/reducer.js index 78fb7a88b..13d4786c4 100644 --- a/react/features/base/known-domains/reducer.js +++ b/react/features/base/known-domains/reducer.js @@ -1,8 +1,7 @@ // @flow import { APP_WILL_MOUNT } from '../app'; -import { ReducerRegistry } from '../redux'; -import { PersistenceRegistry } from '../storage'; +import { PersistenceRegistry, ReducerRegistry } from '../redux'; import { ADD_KNOWN_DOMAINS } from './actionTypes'; diff --git a/react/features/base/storage/PersistenceRegistry.js b/react/features/base/redux/PersistenceRegistry.js similarity index 100% rename from react/features/base/storage/PersistenceRegistry.js rename to react/features/base/redux/PersistenceRegistry.js diff --git a/react/features/base/storage/README.md b/react/features/base/redux/README.md similarity index 100% rename from react/features/base/storage/README.md rename to react/features/base/redux/README.md diff --git a/react/features/base/redux/index.js b/react/features/base/redux/index.js index 1643344a8..1dcf48b9e 100644 --- a/react/features/base/redux/index.js +++ b/react/features/base/redux/index.js @@ -1,4 +1,5 @@ export * from './functions'; export { default as MiddlewareRegistry } from './MiddlewareRegistry'; +export { default as PersistenceRegistry } from './PersistenceRegistry'; export { default as ReducerRegistry } from './ReducerRegistry'; export { default as StateListenerRegistry } from './StateListenerRegistry'; diff --git a/react/features/base/storage/middleware.js b/react/features/base/redux/middleware.js similarity index 92% rename from react/features/base/storage/middleware.js rename to react/features/base/redux/middleware.js index 3cbb1ae59..4fe2a8bb1 100644 --- a/react/features/base/storage/middleware.js +++ b/react/features/base/redux/middleware.js @@ -2,9 +2,9 @@ import _ from 'lodash'; -import { MiddlewareRegistry, toState } from '../redux'; - +import MiddlewareRegistry from './MiddlewareRegistry'; import PersistenceRegistry from './PersistenceRegistry'; +import { toState } from './functions'; /** * The delay in milliseconds that passes between the last state change and the diff --git a/react/features/base/settings/reducer.js b/react/features/base/settings/reducer.js index b4e9bac75..14a667cd9 100644 --- a/react/features/base/settings/reducer.js +++ b/react/features/base/settings/reducer.js @@ -6,8 +6,7 @@ import _ from 'lodash'; import { APP_WILL_MOUNT } from '../app'; import { browser } from '../lib-jitsi-meet'; -import { ReducerRegistry } from '../redux'; -import { PersistenceRegistry } from '../storage'; +import { PersistenceRegistry, ReducerRegistry } from '../redux'; import { assignIfDefined } from '../util'; import { SETTINGS_UPDATED } from './actionTypes'; diff --git a/react/features/base/storage/index.js b/react/features/base/storage/index.js deleted file mode 100644 index 621913703..000000000 --- a/react/features/base/storage/index.js +++ /dev/null @@ -1,3 +0,0 @@ -export { default as PersistenceRegistry } from './PersistenceRegistry'; - -import './middleware'; diff --git a/react/features/base/storage/logger.js b/react/features/base/storage/logger.js deleted file mode 100644 index ed620ca50..000000000 --- a/react/features/base/storage/logger.js +++ /dev/null @@ -1,5 +0,0 @@ -// @flow - -import { getLogger } from '../logging/functions'; - -export default getLogger('features/base/storage'); diff --git a/react/features/calendar-sync/reducer.js b/react/features/calendar-sync/reducer.js index 47c1a4eaa..c243c0ae9 100644 --- a/react/features/calendar-sync/reducer.js +++ b/react/features/calendar-sync/reducer.js @@ -1,7 +1,6 @@ // @flow -import { ReducerRegistry, set } from '../base/redux'; -import { PersistenceRegistry } from '../base/storage'; +import { PersistenceRegistry, ReducerRegistry, set } from '../base/redux'; import { CLEAR_CALENDAR_INTEGRATION, diff --git a/react/features/dropbox/reducer.js b/react/features/dropbox/reducer.js index c38006814..3821ff56b 100644 --- a/react/features/dropbox/reducer.js +++ b/react/features/dropbox/reducer.js @@ -1,7 +1,6 @@ // @flow -import { ReducerRegistry } from '../base/redux'; -import { PersistenceRegistry } from '../base/storage'; +import { PersistenceRegistry, ReducerRegistry } from '../base/redux'; import { UPDATE_DROPBOX_TOKEN } from './actionTypes'; diff --git a/react/features/recent-list/reducer.js b/react/features/recent-list/reducer.js index ea4974f08..3a2bb9f21 100644 --- a/react/features/recent-list/reducer.js +++ b/react/features/recent-list/reducer.js @@ -4,8 +4,7 @@ import { jitsiLocalStorage } from 'js-utils'; import { APP_WILL_MOUNT } from '../base/app'; import { getURLWithoutParamsNormalized } from '../base/connection'; -import { ReducerRegistry } from '../base/redux'; -import { PersistenceRegistry } from '../base/storage'; +import { PersistenceRegistry, ReducerRegistry } from '../base/redux'; import { _STORE_CURRENT_CONFERENCE, diff --git a/react/features/screenshot-capture/reducer.js b/react/features/screenshot-capture/reducer.js index 769b1744e..6a5f8760e 100644 --- a/react/features/screenshot-capture/reducer.js +++ b/react/features/screenshot-capture/reducer.js @@ -1,7 +1,6 @@ // @flow -import { ReducerRegistry } from '../base/redux'; -import { PersistenceRegistry } from '../base/storage'; +import { PersistenceRegistry, ReducerRegistry } from '../base/redux'; import { SET_SCREENSHOT_CAPTURE } from './actionTypes'; diff --git a/react/features/video-layout/reducer.js b/react/features/video-layout/reducer.js index 51d62eddd..df3366660 100644 --- a/react/features/video-layout/reducer.js +++ b/react/features/video-layout/reducer.js @@ -1,7 +1,6 @@ // @flow -import { ReducerRegistry } from '../base/redux'; -import { PersistenceRegistry } from '../base/storage'; +import { PersistenceRegistry, ReducerRegistry } from '../base/redux'; import { SCREEN_SHARE_PARTICIPANTS_UPDATED, diff --git a/react/features/welcome/reducer.js b/react/features/welcome/reducer.js index df382ddf7..68e2f9888 100644 --- a/react/features/welcome/reducer.js +++ b/react/features/welcome/reducer.js @@ -1,7 +1,6 @@ // @flow -import { ReducerRegistry, set } from '../base/redux'; -import { PersistenceRegistry } from '../base/storage'; +import { PersistenceRegistry, ReducerRegistry, set } from '../base/redux'; import { SET_SIDEBAR_VISIBLE,