Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

redux: refactor loading of middlewares and reducers

Saúl Ibarra Corretgé6e679f952f93
diff --git a/Makefile b/Makefile
index 871d1b7583..4cbbdfea72 100644
--- a/Makefile
+++ b/Makefile
@@ -82,7 +82,7 @@ deploy-local:
.NOTPARALLEL:
dev: deploy-init deploy-css deploy-rnnoise-binary deploy-lib-jitsi-meet deploy-libflac
- $(WEBPACK_DEV_SERVER)
+ $(WEBPACK_DEV_SERVER) --detect-circular-deps
source-package:
mkdir -p source_package/jitsi-meet/css && \
diff --git a/conference.js b/conference.js
index 5e1dcd52c4..4e266bdc32 100644
--- a/conference.js
+++ b/conference.js
@@ -22,7 +22,7 @@ import {
maybeRedirectToWelcomePage,
redirectToStaticPage,
reloadWithStoredParams
-} from './react/features/app';
+} from './react/features/app/actions';
import {
AVATAR_ID_COMMAND,
AVATAR_URL_COMMAND,
diff --git a/connection.js b/connection.js
index 4652060aaa..8c92bfb977 100644
--- a/connection.js
+++ b/connection.js
@@ -7,7 +7,7 @@ import AuthHandler from './modules/UI/authentication/AuthHandler';
import {
connectionEstablished,
connectionFailed
-} from './react/features/base/connection';
+} from './react/features/base/connection/actions';
import {
isFatalJitsiConnectionError,
JitsiConnectionErrors,
diff --git a/modules/UI/authentication/LoginDialog.js b/modules/UI/authentication/LoginDialog.js
index 9f56aaf541..fe39badbcf 100644
--- a/modules/UI/authentication/LoginDialog.js
+++ b/modules/UI/authentication/LoginDialog.js
@@ -1,6 +1,6 @@
/* global $, APP, config */
-import { toJid } from '../../../react/features/base/connection';
+import { toJid } from '../../../react/features/base/connection/functions';
import {
JitsiConnectionErrors
} from '../../../react/features/base/lib-jitsi-meet';
diff --git a/react/features/analytics/index.js b/react/features/analytics/index.js
index ede2addc71..d45cd39bd6 100644
--- a/react/features/analytics/index.js
+++ b/react/features/analytics/index.js
@@ -1,5 +1,2 @@
export * from './AnalyticsEvents';
export * from './functions';
-
-import './middleware';
-import './reducer';
diff --git a/react/features/app/components/AbstractApp.js b/react/features/app/components/AbstractApp.js
index cd5bec43bb..2e42dce49e 100644
--- a/react/features/app/components/AbstractApp.js
+++ b/react/features/app/components/AbstractApp.js
@@ -3,12 +3,8 @@
import React, { Fragment } from 'react';
import { BaseApp } from '../../base/app';
-import '../../base/lastn'; // Register lastN middleware
import { toURLString } from '../../base/util';
-import '../../follow-me';
import { OverlayContainer } from '../../overlay';
-import '../../lobby'; // Import lobby function
-import '../../rejoin'; // Enable rejoin analytics
import { appNavigate } from '../actions';
import { getDefaultURL } from '../functions';
diff --git a/react/features/app/components/App.native.js b/react/features/app/components/App.native.js
index 54aa783cc4..f0343253e8 100644
--- a/react/features/app/components/App.native.js
+++ b/react/features/app/components/App.native.js
@@ -2,32 +2,21 @@
import React from 'react';
-import '../../analytics';
-import '../../authentication';
import { setColorScheme } from '../../base/color-scheme';
import { DialogContainer } from '../../base/dialog';
import { CALL_INTEGRATION_ENABLED, updateFlags } from '../../base/flags';
-import '../../base/jwt';
import { Platform } from '../../base/react';
import { DimensionsDetector, clientResized } from '../../base/responsive-ui';
import { updateSettings } from '../../base/settings';
-import '../../google-api';
-import '../../mobile/audio-mode';
-import '../../mobile/back-button';
-import '../../mobile/background';
-import '../../mobile/call-integration';
-import '../../mobile/external-api';
-import '../../mobile/full-screen';
-import '../../mobile/permissions';
-import '../../mobile/picture-in-picture';
-import '../../mobile/proximity';
-import '../../mobile/wake-lock';
-import '../../mobile/watchos';
import logger from '../logger';
import { AbstractApp } from './AbstractApp';
import type { Props as AbstractAppProps } from './AbstractApp';
+// Register middlewares and reducers.
+import '../middlewares';
+import '../reducers';
+
declare var __DEV__;
/**
diff --git a/react/features/app/components/App.web.js b/react/features/app/components/App.web.js
index dad24fb107..e8e029ae9a 100644
--- a/react/features/app/components/App.web.js
+++ b/react/features/app/components/App.web.js
@@ -5,19 +5,13 @@ import React from 'react';
import { DialogContainer } from '../../base/dialog';
import { ChromeExtensionBanner } from '../../chrome-extension-banner';
-import '../../base/user-interaction';
-import '../../chat';
-import '../../external-api';
-import '../../no-audio-signal';
-import '../../noise-detection';
-import '../../power-monitor';
-import '../../room-lock';
-import '../../talk-while-muted';
-import '../../video-layout';
-import '../../old-client-notification';
import { AbstractApp } from './AbstractApp';
+// Register middlewares and reducers.
+import '../middlewares';
+import '../reducers';
+
/**
* Root app {@code Component} on Web/React.
*
diff --git a/react/features/app/index.js b/react/features/app/index.js
deleted file mode 100644
index 46a00713e0..0000000000
--- a/react/features/app/index.js
+++ /dev/null
@@ -1,7 +0,0 @@
-// @flow
-
-export * from './actions';
-export * from './components';
-export * from './functions';
-
-import './middleware';
diff --git a/react/features/app/middlewares.any.js b/react/features/app/middlewares.any.js
new file mode 100644
index 0000000000..019cae38e8
--- /dev/null
+++ b/react/features/app/middlewares.any.js
@@ -0,0 +1,46 @@
+// @flow
+
+import '../analytics/middleware';
+import '../base/conference/middleware';
+import '../base/config/middleware';
+import '../base/jwt/middleware';
+import '../base/known-domains/middleware';
+import '../base/lastn/middleware';
+import '../base/lib-jitsi-meet/middleware';
+import '../base/logging/middleware';
+import '../base/media/middleware';
+import '../base/net-info/middleware';
+import '../base/participants/middleware';
+import '../base/redux/middleware';
+import '../base/responsive-ui/middleware';
+import '../base/settings/middleware';
+import '../base/sounds/middleware';
+import '../base/testing/middleware';
+import '../base/tracks/middleware';
+import '../base/user-interaction/middleware';
+import '../calendar-sync/middleware';
+import '../chat/middleware';
+import '../conference/middleware';
+import '../connection-indicator/middleware';
+import '../deep-linking/middleware';
+import '../device-selection/middleware';
+import '../display-name/middleware';
+import '../etherpad/middleware';
+import '../filmstrip/middleware';
+import '../follow-me/middleware';
+import '../invite/middleware';
+import '../large-video/middleware';
+import '../lobby/middleware';
+import '../notifications/middleware';
+import '../overlay/middleware';
+import '../recent-list/middleware';
+import '../recording/middleware';
+import '../rejoin/middleware';
+import '../room-lock/middleware';
+import '../subtitles/middleware';
+import '../toolbox/middleware';
+import '../transcribing/middleware';
+import '../video-layout/middleware';
+import '../videosipgw/middleware';
+
+import './middleware';
diff --git a/react/features/app/middlewares.native.js b/react/features/app/middlewares.native.js
new file mode 100644
index 0000000000..23d969ec2f
--- /dev/null
+++ b/react/features/app/middlewares.native.js
@@ -0,0 +1,18 @@
+// @flow
+
+import '../authentication/middleware';
+import '../mobile/audio-mode/middleware';
+import '../mobile/back-button/middleware';
+import '../mobile/background/middleware';
+import '../mobile/call-integration/middleware';
+import '../mobile/external-api/middleware';
+import '../mobile/full-screen/middleware';
+import '../mobile/incoming-call/middleware';
+import '../mobile/permissions/middleware';
+import '../mobile/proximity/middleware';
+import '../mobile/wake-lock/middleware';
+import '../mobile/watchos/middleware';
+import '../share-room/middleware';
+import '../youtube-player/middleware';
+
+import './middlewares.any';
diff --git a/react/features/app/middlewares.web.js b/react/features/app/middlewares.web.js
new file mode 100644
index 0000000000..c21180d8d9
--- /dev/null
+++ b/react/features/app/middlewares.web.js
@@ -0,0 +1,16 @@
+// @flow
+
+import '../base/devices/middleware';
+import '../e2ee/middleware';
+import '../external-api/middleware';
+import '../keyboard-shortcuts/middleware';
+import '../local-recording/middleware';
+import '../no-audio-signal/middleware';
+import '../noise-detection/middleware';
+import '../old-client-notification/middleware';
+import '../power-monitor/middleware';
+import '../prejoin/middleware';
+import '../shared-video/middleware';
+import '../talk-while-muted/middleware';
+
+import './middlewares.any';
diff --git a/react/features/app/reducers.any.js b/react/features/app/reducers.any.js
new file mode 100644
index 0000000000..0723eb77e3
--- /dev/null
+++ b/react/features/app/reducers.any.js
@@ -0,0 +1,49 @@
+// @flow
+
+import '../analytics/reducer';
+import '../base/app/reducer';
+import '../base/audio-only/reducer';
+import '../base/color-scheme/reducer';
+import '../base/conference/reducer';
+import '../base/config/reducer';
+import '../base/connection/reducer';
+import '../base/dialog/reducer';
+import '../base/flags/reducer';
+import '../base/jwt/reducer';
+import '../base/known-domains/reducer';
+import '../base/lib-jitsi-meet/reducer';
+import '../base/logging/reducer';
+import '../base/media/reducer';
+import '../base/modal/reducer';
+import '../base/net-info/reducer';
+import '../base/participants/reducer';
+import '../base/responsive-ui/reducer';
+import '../base/settings/reducer';
+import '../base/sounds/reducer';
+import '../base/testing/reducer';
+import '../base/tracks/reducer';
+import '../base/user-interaction/reducer';
+import '../blur/reducer';
+import '../calendar-sync/reducer';
+import '../chat/reducer';
+import '../deep-linking/reducer';
+import '../device-selection/reducer';
+import '../dropbox/reducer';
+import '../etherpad/reducer';
+import '../filmstrip/reducer';
+import '../follow-me/reducer';
+import '../google-api/reducer';
+import '../invite/reducer';
+import '../large-video/reducer';
+import '../lobby/reducer';
+import '../notifications/reducer';
+import '../overlay/reducer';
+import '../recent-list/reducer';
+import '../recording/reducer';
+import '../settings/reducer';
+import '../subtitles/reducer';
+import '../toolbox/reducer';
+import '../transcribing/reducer';
+import '../video-layout/reducer';
+import '../videosipgw/reducer';
+import '../welcome/reducer';
diff --git a/react/features/app/reducers.native.js b/react/features/app/reducers.native.js
new file mode 100644
index 0000000000..8adaebd5b5
--- /dev/null
+++ b/react/features/app/reducers.native.js
@@ -0,0 +1,12 @@
+// @flow
+
+import '../authentication/reducer';
+import '../mobile/audio-mode/reducer';
+import '../mobile/background/reducer';
+import '../mobile/call-integration/reducer';
+import '../mobile/full-screen/reducer';
+import '../mobile/incoming-call/reducer';
+import '../mobile/watchos/reducer';
+import '../youtube-player/reducer';
+
+import './reducers.any';
diff --git a/react/features/app/reducers.web.js b/react/features/app/reducers.web.js
new file mode 100644
index 0000000000..28c988f2d6
--- /dev/null
+++ b/react/features/app/reducers.web.js
@@ -0,0 +1,15 @@
+// @flow
+
+import '../base/devices/reducer';
+import '../e2ee/reducer';
+import '../feedback/reducer';
+import '../local-recording/reducer';
+import '../no-audio-signal/reducer';
+import '../noise-detection/reducer';
+import '../power-monitor/reducer';
+import '../prejoin/reducer';
+import '../screenshot-capture/reducer';
+import '../shared-video/reducer';
+import '../talk-while-muted/reducer';
+
+import './reducers.any';
diff --git a/react/features/authentication/actions.js b/react/features/authentication/actions.js
index 51e5eaed42..2183fa3e4b 100644
--- a/react/features/authentication/actions.js
+++ b/react/features/authentication/actions.js
@@ -2,7 +2,7 @@
import type { Dispatch } from 'redux';
-import { appNavigate } from '../app';
+import { appNavigate } from '../app/actions';
import { checkIfCanJoin, conferenceLeft } from '../base/conference';
import { connectionFailed } from '../base/connection';
import { openDialog } from '../base/dialog';
diff --git a/react/features/authentication/index.js b/react/features/authentication/index.js
index a29aa08e02..803dacd06c 100644
--- a/react/features/authentication/index.js
+++ b/react/features/authentication/index.js
@@ -1,6 +1,3 @@
export * from './actions';
export * from './actionTypes';
export * from './components';
-
-import './middleware';
-import './reducer';
diff --git a/react/features/authentication/middleware.js b/react/features/authentication/middleware.js
index 29f36212f6..0f0cb3e7bd 100644
--- a/react/features/authentication/middleware.js
+++ b/react/features/authentication/middleware.js
@@ -2,7 +2,7 @@
import type { Dispatch } from 'redux';
-import { appNavigate } from '../app';
+import { appNavigate } from '../app/actions';
import {
CONFERENCE_FAILED,
CONFERENCE_JOINED,
diff --git a/react/features/base/app/index.js b/react/features/base/app/index.js
index 5d564613e6..b845e8859c 100644
--- a/react/features/base/app/index.js
+++ b/react/features/base/app/index.js
@@ -2,5 +2,3 @@ export * from './actions';
export * from './actionTypes';
export * from './components';
export * from './functions';
-
-import './reducer';
diff --git a/react/features/base/audio-only/index.js b/react/features/base/audio-only/index.js
index f6aa63cd53..3d915f1aad 100644
--- a/react/features/base/audio-only/index.js
+++ b/react/features/base/audio-only/index.js
@@ -2,5 +2,3 @@
export * from './actions';
export * from './actionTypes';
-
-import './reducer';
diff --git a/react/features/base/color-scheme/index.js b/react/features/base/color-scheme/index.js
index fdc97c28a0..bdb92c87fe 100644
--- a/react/features/base/color-scheme/index.js
+++ b/react/features/base/color-scheme/index.js
@@ -4,5 +4,3 @@ export * from './actions';
export * from './actionTypes';
export * from './functions';
export { default as ColorSchemeRegistry } from './ColorSchemeRegistry';
-
-import './reducer';
diff --git a/react/features/base/conference/actions.js b/react/features/base/conference/actions.js
index edfae3ee96..9043aa911d 100644
--- a/react/features/base/conference/actions.js
+++ b/react/features/base/conference/actions.js
@@ -6,7 +6,7 @@ import {
createStartMutedConfigurationEvent,
sendAnalytics
} from '../../analytics';
-import { getName } from '../../app';
+import { getName } from '../../app/functions';
import { endpointMessageReceived } from '../../subtitles';
import { JITSI_CONNECTION_CONFERENCE_KEY } from '../connection';
import { JitsiConferenceEvents } from '../lib-jitsi-meet';
diff --git a/react/features/base/conference/index.js b/react/features/base/conference/index.js
index 39f1ee456a..a60a814b1e 100644
--- a/react/features/base/conference/index.js
+++ b/react/features/base/conference/index.js
@@ -2,6 +2,3 @@ export * from './actions';
export * from './actionTypes';
export * from './constants';
export * from './functions';
-
-import './middleware';
-import './reducer';
diff --git a/react/features/base/config/index.js b/react/features/base/config/index.js
index 4057a3ed68..9fbf5c252c 100644
--- a/react/features/base/config/index.js
+++ b/react/features/base/config/index.js
@@ -2,6 +2,3 @@ export * from './actions';
export * from './actionTypes';
export { default as CONFIG_WHITELIST } from './configWhitelist';
export * from './functions';
-
-import './middleware';
-import './reducer';
diff --git a/react/features/base/connection/actions.native.js b/react/features/base/connection/actions.native.js
index 1aceb3f31c..8fc45d93b9 100644
--- a/react/features/base/connection/actions.native.js
+++ b/react/features/base/connection/actions.native.js
@@ -3,11 +3,8 @@
import _ from 'lodash';
import type { Dispatch } from 'redux';
-import {
- conferenceLeft,
- conferenceWillLeave,
- getCurrentConference
-} from '../conference';
+import { conferenceLeft, conferenceWillLeave } from '../conference/actions';
+import { getCurrentConference } from '../conference/functions';
import JitsiMeetJS, { JitsiConnectionEvents } from '../lib-jitsi-meet';
import {
getBackendSafeRoomName,
diff --git a/react/features/base/connection/index.js b/react/features/base/connection/index.js
index 125852addc..8548669120 100644
--- a/react/features/base/connection/index.js
+++ b/react/features/base/connection/index.js
@@ -4,5 +4,3 @@ export * from './actions';
export * from './actionTypes';
export * from './constants';
export * from './functions';
-
-import './reducer';
diff --git a/react/features/base/devices/index.js b/react/features/base/devices/index.js
index 969667b3a4..08fe9014b1 100644
--- a/react/features/base/devices/index.js
+++ b/react/features/base/devices/index.js
@@ -1,6 +1,3 @@
export * from './actions';
export * from './actionTypes';
export * from './functions';
-
-import './middleware';
-import './reducer';
diff --git a/react/features/base/dialog/index.js b/react/features/base/dialog/index.js
index 5d564613e6..b845e8859c 100644
--- a/react/features/base/dialog/index.js
+++ b/react/features/base/dialog/index.js
@@ -2,5 +2,3 @@ export * from './actions';
export * from './actionTypes';
export * from './components';
export * from './functions';
-
-import './reducer';
diff --git a/react/features/base/flags/index.js b/react/features/base/flags/index.js
index daf82271a8..a60a814b1e 100644
--- a/react/features/base/flags/index.js
+++ b/react/features/base/flags/index.js
@@ -2,5 +2,3 @@ export * from './actions';
export * from './actionTypes';
export * from './constants';
export * from './functions';
-
-import './reducer';
diff --git a/react/features/base/jwt/index.js b/react/features/base/jwt/index.js
index 969667b3a4..08fe9014b1 100644
--- a/react/features/base/jwt/index.js
+++ b/react/features/base/jwt/index.js
@@ -1,6 +1,3 @@
export * from './actions';
export * from './actionTypes';
export * from './functions';
-
-import './middleware';
-import './reducer';
diff --git a/react/features/base/known-domains/index.js b/react/features/base/known-domains/index.js
index f3a2aac65c..e40f04336c 100644
--- a/react/features/base/known-domains/index.js
+++ b/react/features/base/known-domains/index.js
@@ -1,5 +1,2 @@
export * from './actions';
export * from './actionTypes';
-
-import './middleware';
-import './reducer';
diff --git a/react/features/base/known-domains/middleware.js b/react/features/base/known-domains/middleware.js
index dc17be6058..e04cca9ac8 100644
--- a/react/features/base/known-domains/middleware.js
+++ b/react/features/base/known-domains/middleware.js
@@ -1,6 +1,6 @@
// @flow
-import { getDefaultURL } from '../../app';
+import { getDefaultURL } from '../../app/functions';
import { APP_WILL_MOUNT } from '../app';
import { SET_ROOM } from '../conference';
import { MiddlewareRegistry } from '../redux';
diff --git a/react/features/base/known-domains/reducer.js b/react/features/base/known-domains/reducer.js
index 13d4786c44..9604bf8591 100644
--- a/react/features/base/known-domains/reducer.js
+++ b/react/features/base/known-domains/reducer.js
@@ -1,6 +1,6 @@
// @flow
-import { APP_WILL_MOUNT } from '../app';
+import { APP_WILL_MOUNT } from '../app/actionTypes';
import { PersistenceRegistry, ReducerRegistry } from '../redux';
import { ADD_KNOWN_DOMAINS } from './actionTypes';
diff --git a/react/features/base/lastn/index.js b/react/features/base/lastn/index.js
deleted file mode 100644
index ae4bc5164c..0000000000
--- a/react/features/base/lastn/index.js
+++ /dev/null
@@ -1,3 +0,0 @@
-// @flow
-
-import './middleware';
diff --git a/react/features/base/lastn/middleware.js b/react/features/base/lastn/middleware.js
index ea00ece5cc..73cb53d90d 100644
--- a/react/features/base/lastn/middleware.js
+++ b/react/features/base/lastn/middleware.js
@@ -43,7 +43,7 @@ function _updateLastN({ getState }) {
const state = getState();
const { conference } = state['features/base/conference'];
const { enabled: audioOnly } = state['features/base/audio-only'];
- const { appState } = state['features/background'];
+ const { appState } = state['features/background'] || {};
const { enabled: filmStripEnabled } = state['features/filmstrip'];
const config = state['features/base/config'];
@@ -56,7 +56,7 @@ function _updateLastN({ getState }) {
const defaultLastN = typeof config.channelLastN === 'undefined' ? -1 : config.channelLastN;
let lastN = defaultLastN;
- if (appState !== 'active') {
+ if (typeof appState !== 'undefined' && appState !== 'active') {
lastN = 0;
} else if (audioOnly) {
const { screenShares, tileViewEnabled } = state['features/video-layout'];
diff --git a/react/features/base/lib-jitsi-meet/index.js b/react/features/base/lib-jitsi-meet/index.js
index 5d46e65579..309c192c35 100644
--- a/react/features/base/lib-jitsi-meet/index.js
+++ b/react/features/base/lib-jitsi-meet/index.js
@@ -27,6 +27,3 @@ export const JitsiTrackEvents = JitsiMeetJS.events.track;
export * from './actions';
export * from './actionTypes';
export * from './functions';
-
-import './middleware';
-import './reducer';
diff --git a/react/features/base/logging/index.js b/react/features/base/logging/index.js
index 969667b3a4..08fe9014b1 100644
--- a/react/features/base/logging/index.js
+++ b/react/features/base/logging/index.js
@@ -1,6 +1,3 @@
export * from './actions';
export * from './actionTypes';
export * from './functions';
-
-import './middleware';
-import './reducer';
diff --git a/react/features/base/media/index.js b/react/features/base/media/index.js
index 0a8f4ad7bb..b826983c44 100644
--- a/react/features/base/media/index.js
+++ b/react/features/base/media/index.js
@@ -3,6 +3,3 @@ export * from './actionTypes';
export * from './components';
export * from './constants';
export * from './functions';
-
-import './middleware';
-import './reducer';
diff --git a/react/features/base/modal/index.js b/react/features/base/modal/index.js
index 04b78b6850..7fdd75c293 100644
--- a/react/features/base/modal/index.js
+++ b/react/features/base/modal/index.js
@@ -1,7 +1,5 @@
// @flow
-import './reducer';
-
export * from './actions';
export * from './actionTypes';
export * from './components';
diff --git a/react/features/base/net-info/index.js b/react/features/base/net-info/index.js
index 79da85d3d0..3eb256deba 100644
--- a/react/features/base/net-info/index.js
+++ b/react/features/base/net-info/index.js
@@ -1,4 +1 @@
export * from './actionTypes';
-
-import './middleware';
-import './reducer';
diff --git a/react/features/base/participants/index.js b/react/features/base/participants/index.js
index 0a8f4ad7bb..b826983c44 100644
--- a/react/features/base/participants/index.js
+++ b/react/features/base/participants/index.js
@@ -3,6 +3,3 @@ export * from './actionTypes';
export * from './components';
export * from './constants';
export * from './functions';
-
-import './middleware';
-import './reducer';
diff --git a/react/features/base/responsive-ui/index.js b/react/features/base/responsive-ui/index.js
index 2bf2602369..291539e5c2 100644
--- a/react/features/base/responsive-ui/index.js
+++ b/react/features/base/responsive-ui/index.js
@@ -2,6 +2,3 @@ export * from './actions';
export * from './actionTypes';
export * from './components';
export * from './constants';
-
-import './middleware';
-import './reducer';
diff --git a/react/features/base/settings/index.js b/react/features/base/settings/index.js
index 39f1ee456a..a60a814b1e 100644
--- a/react/features/base/settings/index.js
+++ b/react/features/base/settings/index.js
@@ -2,6 +2,3 @@ export * from './actions';
export * from './actionTypes';
export * from './constants';
export * from './functions';
-
-import './middleware';
-import './reducer';
diff --git a/react/features/base/settings/reducer.js b/react/features/base/settings/reducer.js
index 14a667cd99..9e81470e51 100644
--- a/react/features/base/settings/reducer.js
+++ b/react/features/base/settings/reducer.js
@@ -4,7 +4,7 @@ import { jitsiLocalStorage } from 'js-utils';
import { randomHexString } from 'js-utils/random';
import _ from 'lodash';
-import { APP_WILL_MOUNT } from '../app';
+import { APP_WILL_MOUNT } from '../app/actionTypes';
import { browser } from '../lib-jitsi-meet';
import { PersistenceRegistry, ReducerRegistry } from '../redux';
import { assignIfDefined } from '../util';
diff --git a/react/features/base/sounds/functions.ios.js b/react/features/base/sounds/functions.ios.js
index bfdb5037e5..d086d82fb0 100644
--- a/react/features/base/sounds/functions.ios.js
+++ b/react/features/base/sounds/functions.ios.js
@@ -1,4 +1,4 @@
-import { getSdkBundlePath } from '../../app';
+import { getSdkBundlePath } from '../../app/functions';
/**
* Returns the location of the sounds. On iOS it's the location of the SDK
diff --git a/react/features/base/sounds/index.js b/react/features/base/sounds/index.js
index a29aa08e02..803dacd06c 100644
--- a/react/features/base/sounds/index.js
+++ b/react/features/base/sounds/index.js
@@ -1,6 +1,3 @@
export * from './actions';
export * from './actionTypes';
export * from './components';
-
-import './middleware';
-import './reducer';
diff --git a/react/features/base/testing/index.js b/react/features/base/testing/index.js
index 65787823fa..8b45add519 100644
--- a/react/features/base/testing/index.js
+++ b/react/features/base/testing/index.js
@@ -1,5 +1,2 @@
export * from './components';
export * from './functions';
-
-import './middleware';
-import './reducer';
diff --git a/react/features/base/tracks/index.js b/react/features/base/tracks/index.js
index 969667b3a4..08fe9014b1 100644
--- a/react/features/base/tracks/index.js
+++ b/react/features/base/tracks/index.js
@@ -1,6 +1,3 @@
export * from './actions';
export * from './actionTypes';
export * from './functions';
-
-import './middleware';
-import './reducer';
diff --git a/react/features/base/user-interaction/index.js b/react/features/base/user-interaction/index.js
deleted file mode 100644
index 200d254929..0000000000
--- a/react/features/base/user-interaction/index.js
+++ /dev/null
@@ -1,2 +0,0 @@
-import './middleware';
-import './reducer';
diff --git a/react/features/blur/index.js b/react/features/blur/index.js
index 61438458ce..cc25e46aa0 100644
--- a/react/features/blur/index.js
+++ b/react/features/blur/index.js
@@ -1,5 +1,3 @@
export * from './actions';
export * from './components';
export * from './functions';
-
-import './reducer';
diff --git a/react/features/calendar-sync/actions.native.js b/react/features/calendar-sync/actions.native.js
index c68a08e4c9..344a8d4ec2 100644
--- a/react/features/calendar-sync/actions.native.js
+++ b/react/features/calendar-sync/actions.native.js
@@ -2,7 +2,7 @@
import { generateRoomWithoutSeparator } from 'js-utils/random';
import type { Dispatch } from 'redux';
-import { getDefaultURL } from '../app';
+import { getDefaultURL } from '../app/functions';
import { openDialog } from '../base/dialog';
import { refreshCalendar } from './actions';
diff --git a/react/features/calendar-sync/components/CalendarListContent.native.js b/react/features/calendar-sync/components/CalendarListContent.native.js
index e6e2d79902..c2c791ee6c 100644
--- a/react/features/calendar-sync/components/CalendarListContent.native.js
+++ b/react/features/calendar-sync/components/CalendarListContent.native.js
@@ -7,7 +7,7 @@ import {
createCalendarSelectedEvent,
sendAnalytics
} from '../../analytics';
-import { appNavigate } from '../../app';
+import { appNavigate } from '../../app/actions';
import { getLocalizedDateFormatter, translate } from '../../base/i18n';
import { NavigateSectionList } from '../../base/react';
import { connect } from '../../base/redux';
diff --git a/react/features/calendar-sync/components/CalendarListContent.web.js b/react/features/calendar-sync/components/CalendarListContent.web.js
index 646b42e943..898a950f41 100644
--- a/react/features/calendar-sync/components/CalendarListContent.web.js
+++ b/react/features/calendar-sync/components/CalendarListContent.web.js
@@ -7,7 +7,7 @@ import {
createCalendarSelectedEvent,
sendAnalytics
} from '../../analytics';
-import { appNavigate } from '../../app';
+import { appNavigate } from '../../app/actions';
import { MeetingsList } from '../../base/react';
import { connect } from '../../base/redux';
diff --git a/react/features/calendar-sync/components/ConferenceNotification.native.js b/react/features/calendar-sync/components/ConferenceNotification.native.js
index e9cd4ae9ea..2596a4984f 100644
--- a/react/features/calendar-sync/components/ConferenceNotification.native.js
+++ b/react/features/calendar-sync/components/ConferenceNotification.native.js
@@ -3,7 +3,7 @@
import React, { Component } from 'react';
import { Text, TouchableOpacity, View } from 'react-native';
-import { appNavigate } from '../../app';
+import { appNavigate } from '../../app/actions';
import { getURLWithoutParamsNormalized } from '../../base/connection';
import { getLocalizedDateFormatter, translate } from '../../base/i18n';
import { Icon, IconNotificationJoin } from '../../base/icons';
diff --git a/react/features/calendar-sync/index.js b/react/features/calendar-sync/index.js
index 2ab7a37f66..5d78a5f0de 100644
--- a/react/features/calendar-sync/index.js
+++ b/react/features/calendar-sync/index.js
@@ -2,6 +2,3 @@ export * from './actions';
export * from './components';
export * from './constants';
export { isCalendarEnabled } from './functions';
-
-import './middleware';
-import './reducer';
diff --git a/react/features/chat/index.js b/react/features/chat/index.js
index 2bf2602369..291539e5c2 100644
--- a/react/features/chat/index.js
+++ b/react/features/chat/index.js
@@ -2,6 +2,3 @@ export * from './actions';
export * from './actionTypes';
export * from './components';
export * from './constants';
-
-import './middleware';
-import './reducer';
diff --git a/react/features/conference/components/native/Conference.js b/react/features/conference/components/native/Conference.js
index e647555d55..b3cd5984fb 100644
--- a/react/features/conference/components/native/Conference.js
+++ b/react/features/conference/components/native/Conference.js
@@ -4,7 +4,7 @@ import React from 'react';
import { NativeModules, SafeAreaView, StatusBar } from 'react-native';
import LinearGradient from 'react-native-linear-gradient';
-import { appNavigate } from '../../../app';
+import { appNavigate } from '../../../app/actions';
import { PIP_ENABLED, getFeatureFlag } from '../../../base/flags';
import { Container, LoadingIndicator, TintedView } from '../../../base/react';
import { connect } from '../../../base/redux';
diff --git a/react/features/conference/index.js b/react/features/conference/index.js
index 01943cd7f2..7cd20acdfd 100644
--- a/react/features/conference/index.js
+++ b/react/features/conference/index.js
@@ -1,5 +1,4 @@
// @flow
+
export * from './actions';
export * from './components';
-
-import './middleware';
diff --git a/react/features/conference/middleware.js b/react/features/conference/middleware.js
index b5b5b7dab6..cf8fcf42fb 100644
--- a/react/features/conference/middleware.js
+++ b/react/features/conference/middleware.js
@@ -1,5 +1,5 @@
// @flow
-import { appNavigate } from '../app';
+import { appNavigate } from '../app/actions';
import {
CONFERENCE_JOINED,
KICKED_OUT,
diff --git a/react/features/connection-indicator/index.js b/react/features/connection-indicator/index.js
index 71c314d9da..d309bedc1e 100644
--- a/react/features/connection-indicator/index.js
+++ b/react/features/connection-indicator/index.js
@@ -3,5 +3,3 @@
export * from './components';
export { default as statsEmitter } from './statsEmitter';
-
-import './middleware';
diff --git a/react/features/deep-linking/actions.js b/react/features/deep-linking/actions.js
index 5dc4c0fa4c..54f5f249b3 100644
--- a/react/features/deep-linking/actions.js
+++ b/react/features/deep-linking/actions.js
@@ -2,7 +2,7 @@
import type { Dispatch } from 'redux';
-import { appNavigate } from '../app';
+import { appNavigate } from '../app/actions';
import { OPEN_DESKTOP_APP, OPEN_WEB_APP } from './actionTypes';
diff --git a/react/features/deep-linking/index.js b/react/features/deep-linking/index.js
index c19d5eb7b9..484b71595f 100644
--- a/react/features/deep-linking/index.js
+++ b/react/features/deep-linking/index.js
@@ -1,4 +1 @@
export * from './functions';
-
-import './middleware';
-import './reducer';
diff --git a/react/features/deep-linking/middleware.js b/react/features/deep-linking/middleware.js
index 6e4111c7f5..814436c075 100644
--- a/react/features/deep-linking/middleware.js
+++ b/react/features/deep-linking/middleware.js
@@ -11,7 +11,6 @@ import { openDesktopApp } from './functions';
* @param {Store} store - The redux store.
* @returns {Function}
*/
-// eslint-disable-next-line no-unused-vars
MiddlewareRegistry.register(store => next => action => {
switch (action.type) {
case OPEN_DESKTOP_APP:
diff --git a/react/features/device-selection/index.js b/react/features/device-selection/index.js
index 44000a1a7b..b845e8859c 100644
--- a/react/features/device-selection/index.js
+++ b/react/features/device-selection/index.js
@@ -2,6 +2,3 @@ export * from './actions';
export * from './actionTypes';
export * from './components';
export * from './functions';
-
-import './middleware';
-import './reducer';
diff --git a/react/features/display-name/index.js b/react/features/display-name/index.js
index 46a00713e0..c13d3e017d 100644
--- a/react/features/display-name/index.js
+++ b/react/features/display-name/index.js
@@ -3,5 +3,3 @@
export * from './actions';
export * from './components';
export * from './functions';
-
-import './middleware';
diff --git a/react/features/dropbox/index.js b/react/features/dropbox/index.js
index 274d331371..b780791827 100644
--- a/react/features/dropbox/index.js
+++ b/react/features/dropbox/index.js
@@ -1,4 +1,2 @@
export * from './actions';
export * from './functions.any';
-
-import './reducer';
diff --git a/react/features/e2ee/index.js b/react/features/e2ee/index.js
index a29aa08e02..803dacd06c 100644
--- a/react/features/e2ee/index.js
+++ b/react/features/e2ee/index.js
@@ -1,6 +1,3 @@
export * from './actions';
export * from './actionTypes';
export * from './components';
-
-import './middleware';
-import './reducer';
diff --git a/react/features/etherpad/index.js b/react/features/etherpad/index.js
index 0a8f4ad7bb..b826983c44 100644
--- a/react/features/etherpad/index.js
+++ b/react/features/etherpad/index.js
@@ -3,6 +3,3 @@ export * from './actionTypes';
export * from './components';
export * from './constants';
export * from './functions';
-
-import './middleware';
-import './reducer';
diff --git a/react/features/external-api/index.js b/react/features/external-api/index.js
deleted file mode 100644
index eec6b85ef4..0000000000
--- a/react/features/external-api/index.js
+++ /dev/null
@@ -1,2 +0,0 @@
-import './middleware';
-import './subscriber';
diff --git a/react/features/external-api/middleware.js b/react/features/external-api/middleware.js
index a9d41ea4bc..bfd45e4335 100644
--- a/react/features/external-api/middleware.js
+++ b/react/features/external-api/middleware.js
@@ -23,6 +23,8 @@ import { appendSuffix } from '../display-name';
import { SUBMIT_FEEDBACK_ERROR, SUBMIT_FEEDBACK_SUCCESS } from '../feedback';
import { SET_FILMSTRIP_VISIBLE } from '../filmstrip';
+import './subscriber';
+
declare var APP: Object;
declare var interfaceConfig: Object;
diff --git a/react/features/feedback/index.js b/react/features/feedback/index.js
index b2e9c09f6c..803dacd06c 100644
--- a/react/features/feedback/index.js
+++ b/react/features/feedback/index.js
@@ -1,5 +1,3 @@
export * from './actions';
export * from './actionTypes';
export * from './components';
-
-import './reducer';
diff --git a/react/features/filmstrip/index.js b/react/features/filmstrip/index.js
index 7689c0d793..b826983c44 100644
--- a/react/features/filmstrip/index.js
+++ b/react/features/filmstrip/index.js
@@ -3,7 +3,3 @@ export * from './actionTypes';
export * from './components';
export * from './constants';
export * from './functions';
-
-import './reducer';
-import './subscriber';
-import './middleware';
diff --git a/react/features/filmstrip/middleware.web.js b/react/features/filmstrip/middleware.web.js
index 48d2d79149..6ec99b69c0 100644
--- a/react/features/filmstrip/middleware.web.js
+++ b/react/features/filmstrip/middleware.web.js
@@ -13,6 +13,8 @@ import {
import { SET_HORIZONTAL_VIEW_DIMENSIONS, SET_TILE_VIEW_DIMENSIONS } from './actionTypes';
import { setHorizontalViewDimensions, setTileViewDimensions } from './actions';
+import './subscriber.web';
+
/**
* The middleware of the feature Filmstrip.
*/
diff --git a/react/features/filmstrip/subscriber.native.js b/react/features/filmstrip/subscriber.native.js
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/react/features/follow-me/index.js b/react/features/follow-me/index.js
index 024c757add..484b71595f 100644
--- a/react/features/follow-me/index.js
+++ b/react/features/follow-me/index.js
@@ -1,5 +1 @@
export * from './functions';
-export * from './middleware';
-export * from './subscriber';
-
-import './reducer';
diff --git a/react/features/follow-me/middleware.js b/react/features/follow-me/middleware.js
index 731b528ebf..f65f37a644 100644
--- a/react/features/follow-me/middleware.js
+++ b/react/features/follow-me/middleware.js
@@ -1,6 +1,6 @@
// @flow
-import { CONFERENCE_WILL_JOIN } from '../base/conference';
+import { CONFERENCE_WILL_JOIN } from '../base/conference/actionTypes';
import {
getParticipantById,
getPinnedParticipant,
@@ -19,6 +19,8 @@ import { FOLLOW_ME_COMMAND } from './constants';
import { isFollowMeActive } from './functions';
import logger from './logger';
+import './subscriber';
+
declare var APP: Object;
/**
diff --git a/react/features/google-api/index.js b/react/features/google-api/index.js
index 085a371714..4ab7407810 100644
--- a/react/features/google-api/index.js
+++ b/react/features/google-api/index.js
@@ -4,5 +4,3 @@ export * from './actions';
export * from './components';
export * from './constants';
export { default as googleApi } from './googleApi';
-
-import './reducer';
diff --git a/react/features/invite/index.js b/react/features/invite/index.js
index 48450b4e0e..cc25e46aa0 100644
--- a/react/features/invite/index.js
+++ b/react/features/invite/index.js
@@ -1,6 +1,3 @@
export * from './actions';
export * from './components';
export * from './functions';
-
-import './reducer';
-import './middleware';
diff --git a/react/features/keyboard-shortcuts/index.js b/react/features/keyboard-shortcuts/index.js
index a640fd3bf6..3c46ed49d1 100644
--- a/react/features/keyboard-shortcuts/index.js
+++ b/react/features/keyboard-shortcuts/index.js
@@ -1,4 +1,2 @@
export * from './actions';
export * from './components';
-
-import './middleware';
diff --git a/react/features/large-video/index.js b/react/features/large-video/index.js
index 12269a10f9..3c46ed49d1 100644
--- a/react/features/large-video/index.js
+++ b/react/features/large-video/index.js
@@ -1,6 +1,2 @@
export * from './actions';
export * from './components';
-
-import './middleware';
-import './reducer';
-import './subscriber';
diff --git a/react/features/large-video/middleware.js b/react/features/large-video/middleware.js
index fb8ed2e4ea..31a59ac8f7 100644
--- a/react/features/large-video/middleware.js
+++ b/react/features/large-video/middleware.js
@@ -18,6 +18,8 @@ import {
import { selectParticipant, selectParticipantInLargeVideo } from './actions';
+import './subscriber';
+
/**
* Middleware that catches actions related to participants and tracks and
* dispatches an action to select a participant depicted by LargeVideo.
diff --git a/react/features/lobby/actions.web.js b/react/features/lobby/actions.web.js
index 07a061a579..ca52c29b4c 100644
--- a/react/features/lobby/actions.web.js
+++ b/react/features/lobby/actions.web.js
@@ -2,7 +2,7 @@
import { type Dispatch } from 'redux';
-import { appNavigate, maybeRedirectToWelcomePage } from '../app';
+import { appNavigate, maybeRedirectToWelcomePage } from '../app/actions';
import { conferenceWillJoin, getCurrentConference, setPassword } from '../base/conference';
import { hideDialog, openDialog } from '../base/dialog';
import { getLocalParticipant } from '../base/participants';
diff --git a/react/features/lobby/index.js b/react/features/lobby/index.js
index e4e0b51e5a..68ddef9ba1 100644
--- a/react/features/lobby/index.js
+++ b/react/features/lobby/index.js
@@ -1,6 +1,3 @@
// @flow
-import './middleware';
-import './reducer';
-
export * from './components';
diff --git a/react/features/local-recording/index.js b/react/features/local-recording/index.js
index 049bb678d5..d83e6ef8a0 100644
--- a/react/features/local-recording/index.js
+++ b/react/features/local-recording/index.js
@@ -2,6 +2,3 @@ export * from './actions';
export * from './actionTypes';
export * from './components';
export * from './controller';
-
-import './middleware';
-import './reducer';
diff --git a/react/features/local-recording/middleware.js b/react/features/local-recording/middleware.js
index 8ef415b455..6b7fdc105f 100644
--- a/react/features/local-recording/middleware.js
+++ b/react/features/local-recording/middleware.js
@@ -1,14 +1,14 @@
/* @flow */
import { createShortcutEvent, sendAnalytics } from '../analytics';
-import { APP_WILL_UNMOUNT } from '../base/app';
-import { CONFERENCE_JOINED } from '../base/conference';
-import { toggleDialog } from '../base/dialog';
+import { APP_WILL_UNMOUNT } from '../base/app/actionTypes';
+import { CONFERENCE_JOINED } from '../base/conference/actionTypes';
+import { toggleDialog } from '../base/dialog/actions';
import { i18next } from '../base/i18n';
-import { SET_AUDIO_MUTED } from '../base/media';
+import { SET_AUDIO_MUTED } from '../base/media/actionTypes';
import { MiddlewareRegistry } from '../base/redux';
import { SETTINGS_UPDATED } from '../base/settings/actionTypes';
-import { showNotification } from '../notifications';
+import { showNotification } from '../notifications/actions';
import { localRecordingEngaged, localRecordingUnengaged } from './actions';
import { LocalRecordingInfoDialog } from './components';
diff --git a/react/features/mobile/audio-mode/index.js b/react/features/mobile/audio-mode/index.js
index daaa5d02a7..07635cbbc8 100644
--- a/react/features/mobile/audio-mode/index.js
+++ b/react/features/mobile/audio-mode/index.js
@@ -1,4 +1 @@
export * from './components';
-
-import './middleware';
-import './reducer';
diff --git a/react/features/mobile/back-button/index.js b/react/features/mobile/back-button/index.js
index 9e4c5488ee..f80ffd3fc4 100644
--- a/react/features/mobile/back-button/index.js
+++ b/react/features/mobile/back-button/index.js
@@ -1,5 +1,3 @@
// @flow
export { default as BackButtonRegistry } from './BackButtonRegistry';
-
-import './middleware';
diff --git a/react/features/mobile/background/index.js b/react/features/mobile/background/index.js
index f3a2aac65c..e40f04336c 100644
--- a/react/features/mobile/background/index.js
+++ b/react/features/mobile/background/index.js
@@ -1,5 +1,2 @@
export * from './actions';
export * from './actionTypes';
-
-import './middleware';
-import './reducer';
diff --git a/react/features/mobile/call-integration/CallKit.js b/react/features/mobile/call-integration/CallKit.js
index 9b3f768301..ff4c24bb2e 100644
--- a/react/features/mobile/call-integration/CallKit.js
+++ b/react/features/mobile/call-integration/CallKit.js
@@ -1,6 +1,6 @@
import { NativeModules, NativeEventEmitter } from 'react-native';
-import { getName } from '../../app';
+import { getName } from '../../app/functions';
/**
* Thin wrapper around Apple's CallKit functionality.
diff --git a/react/features/mobile/call-integration/index.js b/react/features/mobile/call-integration/index.js
deleted file mode 100644
index 200d254929..0000000000
--- a/react/features/mobile/call-integration/index.js
+++ /dev/null
@@ -1,2 +0,0 @@
-import './middleware';
-import './reducer';
diff --git a/react/features/mobile/call-integration/middleware.js b/react/features/mobile/call-integration/middleware.js
index 815567f919..965fb3eb9f 100644
--- a/react/features/mobile/call-integration/middleware.js
+++ b/react/features/mobile/call-integration/middleware.js
@@ -4,7 +4,7 @@ import { Alert, NativeModules, Platform } from 'react-native';
import uuid from 'uuid';
import { createTrackMutedEvent, sendAnalytics } from '../../analytics';
-import { appNavigate } from '../../app';
+import { appNavigate } from '../../app/actions';
import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../../base/app';
import { SET_AUDIO_ONLY } from '../../base/audio-only';
import {
diff --git a/react/features/mobile/external-api/index.js b/react/features/mobile/external-api/index.js
index e975ed0e86..484b71595f 100644
--- a/react/features/mobile/external-api/index.js
+++ b/react/features/mobile/external-api/index.js
@@ -1,3 +1 @@
export * from './functions';
-
-import './middleware';
diff --git a/react/features/mobile/full-screen/index.js b/react/features/mobile/full-screen/index.js
deleted file mode 100644
index 200d254929..0000000000
--- a/react/features/mobile/full-screen/index.js
+++ /dev/null
@@ -1,2 +0,0 @@
-import './middleware';
-import './reducer';
diff --git a/react/features/mobile/incoming-call/index.js b/react/features/mobile/incoming-call/index.js
index daaa5d02a7..07635cbbc8 100644
--- a/react/features/mobile/incoming-call/index.js
+++ b/react/features/mobile/incoming-call/index.js
@@ -1,4 +1 @@
export * from './components';
-
-import './middleware';
-import './reducer';
diff --git a/react/features/mobile/permissions/index.js b/react/features/mobile/permissions/index.js
index e975ed0e86..484b71595f 100644
--- a/react/features/mobile/permissions/index.js
+++ b/react/features/mobile/permissions/index.js
@@ -1,3 +1 @@
export * from './functions';
-
-import './middleware';
diff --git a/react/features/mobile/proximity/index.js b/react/features/mobile/proximity/index.js
deleted file mode 100644
index d436892893..0000000000
--- a/react/features/mobile/proximity/index.js
+++ /dev/null
@@ -1 +0,0 @@
-import './middleware';
diff --git a/react/features/mobile/wake-lock/index.js b/react/features/mobile/wake-lock/index.js
deleted file mode 100644
index d436892893..0000000000
--- a/react/features/mobile/wake-lock/index.js
+++ /dev/null
@@ -1 +0,0 @@
-import './middleware';
diff --git a/react/features/mobile/watchos/index.js b/react/features/mobile/watchos/index.js
deleted file mode 100644
index 200d254929..0000000000
--- a/react/features/mobile/watchos/index.js
+++ /dev/null
@@ -1,2 +0,0 @@
-import './middleware';
-import './reducer';
diff --git a/react/features/mobile/watchos/middleware.js b/react/features/mobile/watchos/middleware.js
index 336952cbda..75c5d61f8f 100644
--- a/react/features/mobile/watchos/middleware.js
+++ b/react/features/mobile/watchos/middleware.js
@@ -3,7 +3,7 @@
import { Platform } from 'react-native';
import * as watch from 'react-native-watch-connectivity';
-import { appNavigate } from '../../app';
+import { appNavigate } from '../../app/actions';
import { APP_WILL_MOUNT } from '../../base/app';
import { CONFERENCE_JOINED } from '../../base/conference';
import { getCurrentConferenceUrl } from '../../base/connection';
diff --git a/react/features/no-audio-signal/index.js b/react/features/no-audio-signal/index.js
deleted file mode 100644
index d040422d06..0000000000
--- a/react/features/no-audio-signal/index.js
+++ /dev/null
@@ -1,4 +0,0 @@
-// @flow
-
-import './middleware';
-import './reducer';
diff --git a/react/features/noise-detection/index.js b/react/features/noise-detection/index.js
deleted file mode 100644
index d040422d06..0000000000
--- a/react/features/noise-detection/index.js
+++ /dev/null
@@ -1,4 +0,0 @@
-// @flow
-
-import './middleware';
-import './reducer';
diff --git a/react/features/notifications/index.js b/react/features/notifications/index.js
index 2e85be6d3c..8a597c6ea5 100644
--- a/react/features/notifications/index.js
+++ b/react/features/notifications/index.js
@@ -5,6 +5,3 @@ export * from './actionTypes';
export * from './components';
export * from './constants';
export * from './functions';
-
-import './middleware';
-import './reducer';
diff --git a/react/features/old-client-notification/index.js b/react/features/old-client-notification/index.js
deleted file mode 100644
index d436892893..0000000000
--- a/react/features/old-client-notification/index.js
+++ /dev/null
@@ -1 +0,0 @@
-import './middleware';
diff --git a/react/features/overlay/components/AbstractPageReloadOverlay.js b/react/features/overlay/components/AbstractPageReloadOverlay.js
index fca34348ef..139a4900e9 100644
--- a/react/features/overlay/components/AbstractPageReloadOverlay.js
+++ b/react/features/overlay/components/AbstractPageReloadOverlay.js
@@ -8,7 +8,7 @@ import {
createPageReloadScheduledEvent,
sendAnalytics
} from '../../analytics';
-import { reloadNow } from '../../app';
+import { reloadNow } from '../../app/actions';
import {
isFatalJitsiConferenceError,
isFatalJitsiConnectionError
diff --git a/react/features/overlay/components/native/PageReloadOverlay.js b/react/features/overlay/components/native/PageReloadOverlay.js
index e194b8d13f..0796470fc0 100644
--- a/react/features/overlay/components/native/PageReloadOverlay.js
+++ b/react/features/overlay/components/native/PageReloadOverlay.js
@@ -3,7 +3,7 @@
import React from 'react';
import { Text } from 'react-native';
-import { appNavigate, reloadNow } from '../../../app';
+import { appNavigate, reloadNow } from '../../../app/actions';
import { ColorSchemeRegistry } from '../../../base/color-scheme';
import { ConfirmDialog } from '../../../base/dialog';
import { translate } from '../../../base/i18n';
diff --git a/react/features/overlay/components/web/ReloadButton.js b/react/features/overlay/components/web/ReloadButton.js
index 58bdf96f80..effb37fa0d 100644
--- a/react/features/overlay/components/web/ReloadButton.js
+++ b/react/features/overlay/components/web/ReloadButton.js
@@ -2,7 +2,7 @@
import React, { Component } from 'react';
-import { reloadNow } from '../../../app';
+import { reloadNow } from '../../../app/actions';
import { translate } from '../../../base/i18n';
import { connect } from '../../../base/redux';
diff --git a/react/features/overlay/index.js b/react/features/overlay/index.js
index ff4db602c3..c13d3e017d 100644
--- a/react/features/overlay/index.js
+++ b/react/features/overlay/index.js
@@ -3,6 +3,3 @@
export * from './actions';
export * from './components';
export * from './functions';
-
-import './middleware';
-import './reducer';
diff --git a/react/features/power-monitor/index.js b/react/features/power-monitor/index.js
index 47fff5db37..3d915f1aad 100644
--- a/react/features/power-monitor/index.js
+++ b/react/features/power-monitor/index.js
@@ -2,6 +2,3 @@
export * from './actions';
export * from './actionTypes';
-
-import './middleware';
-import './reducer';
diff --git a/react/features/prejoin/index.js b/react/features/prejoin/index.js
index 65b9d3a890..5c58a5f3fa 100644
--- a/react/features/prejoin/index.js
+++ b/react/features/prejoin/index.js
@@ -2,6 +2,3 @@ export * from './actions';
export * from './functions';
export { default as Prejoin } from './components/Prejoin';
-
-import './middleware';
-import './reducer';
diff --git a/react/features/recent-list/components/AbstractRecentList.js b/react/features/recent-list/components/AbstractRecentList.js
index f48115778f..f61e3a0050 100644
--- a/react/features/recent-list/components/AbstractRecentList.js
+++ b/react/features/recent-list/components/AbstractRecentList.js
@@ -8,7 +8,7 @@ import {
createRecentSelectedEvent,
sendAnalytics
} from '../../analytics';
-import { appNavigate } from '../../app';
+import { appNavigate } from '../../app/actions';
import {
AbstractPage,
Container,
diff --git a/react/features/recent-list/components/RecentList.native.js b/react/features/recent-list/components/RecentList.native.js
index d737ebb8c9..4aa669d443 100644
--- a/react/features/recent-list/components/RecentList.native.js
+++ b/react/features/recent-list/components/RecentList.native.js
@@ -3,7 +3,7 @@
import React from 'react';
import type { Dispatch } from 'redux';
-import { getDefaultURL } from '../../app';
+import { getDefaultURL } from '../../app/functions';
import { translate } from '../../base/i18n';
import { setActiveModalId } from '../../base/modal';
import { NavigateSectionList, type Section } from '../../base/react';
diff --git a/react/features/recent-list/index.js b/react/features/recent-list/index.js
index daaa5d02a7..07635cbbc8 100644
--- a/react/features/recent-list/index.js
+++ b/react/features/recent-list/index.js
@@ -1,4 +1 @@
export * from './components';
-
-import './middleware';
-import './reducer';
diff --git a/react/features/recording/index.js b/react/features/recording/index.js
index c95362f28f..286c5342fa 100644
--- a/react/features/recording/index.js
+++ b/react/features/recording/index.js
@@ -2,6 +2,3 @@ export * from './actions';
export * from './components';
export * from './constants';
export * from './functions';
-
-import './middleware';
-import './reducer';
diff --git a/react/features/rejoin/index.js b/react/features/rejoin/index.js
deleted file mode 100644
index d436892893..0000000000
--- a/react/features/rejoin/index.js
+++ /dev/null
@@ -1 +0,0 @@
-import './middleware';
diff --git a/react/features/room-lock/actions.js b/react/features/room-lock/actions.js
index a3cd588661..d6f0a37f92 100644
--- a/react/features/room-lock/actions.js
+++ b/react/features/room-lock/actions.js
@@ -5,7 +5,7 @@ import type { Dispatch } from 'redux';
import {
appNavigate,
maybeRedirectToWelcomePage
-} from '../app';
+} from '../app/actions';
import {
conferenceLeft,
JITSI_CONFERENCE_URL_KEY,
diff --git a/react/features/room-lock/index.js b/react/features/room-lock/index.js
index d7ebc65366..7279934d83 100644
--- a/react/features/room-lock/index.js
+++ b/react/features/room-lock/index.js
@@ -1,5 +1,3 @@
export * from './actions';
export * from './components';
export * from './constants';
-
-import './middleware';
diff --git a/react/features/screenshot-capture/index.js b/react/features/screenshot-capture/index.js
index f70f2a44f8..485f1b10af 100644
--- a/react/features/screenshot-capture/index.js
+++ b/react/features/screenshot-capture/index.js
@@ -1,3 +1 @@
export * from './actions';
-
-import './reducer';
diff --git a/react/features/settings/components/AbstractSettingsView.js b/react/features/settings/components/AbstractSettingsView.js
index 35173f9215..9399ed6020 100644
--- a/react/features/settings/components/AbstractSettingsView.js
+++ b/react/features/settings/components/AbstractSettingsView.js
@@ -3,7 +3,7 @@
import { Component } from 'react';
import type { Dispatch } from 'redux';
-import { getDefaultURL } from '../../app';
+import { getDefaultURL } from '../../app/functions';
import { updateSettings } from '../../base/settings';
/**
diff --git a/react/features/settings/index.js b/react/features/settings/index.js
index 0bacc21c50..b826983c44 100644
--- a/react/features/settings/index.js
+++ b/react/features/settings/index.js
@@ -3,5 +3,3 @@ export * from './actionTypes';
export * from './components';
export * from './constants';
export * from './functions';
-
-import './reducer';
diff --git a/react/features/share-room/index.js b/react/features/share-room/index.js
index e72b2584af..e40f04336c 100644
--- a/react/features/share-room/index.js
+++ b/react/features/share-room/index.js
@@ -1,4 +1,2 @@
export * from './actions';
export * from './actionTypes';
-
-import './middleware';
diff --git a/react/features/share-room/middleware.js b/react/features/share-room/middleware.js
index 3763ca0095..c23ca0fac9 100644
--- a/react/features/share-room/middleware.js
+++ b/react/features/share-room/middleware.js
@@ -2,7 +2,7 @@
import { Share } from 'react-native';
-import { getName } from '../app';
+import { getName } from '../app/functions';
import { MiddlewareRegistry } from '../base/redux';
import { getShareInfoText } from '../invite';
diff --git a/react/features/shared-video/index.js b/react/features/shared-video/index.js
index f3a2aac65c..e40f04336c 100644
--- a/react/features/shared-video/index.js
+++ b/react/features/shared-video/index.js
@@ -1,5 +1,2 @@
export * from './actions';
export * from './actionTypes';
-
-import './middleware';
-import './reducer';
diff --git a/react/features/subtitles/index.js b/react/features/subtitles/index.js
index a29aa08e02..803dacd06c 100644
--- a/react/features/subtitles/index.js
+++ b/react/features/subtitles/index.js
@@ -1,6 +1,3 @@
export * from './actions';
export * from './actionTypes';
export * from './components';
-
-import './middleware';
-import './reducer';
diff --git a/react/features/talk-while-muted/index.js b/react/features/talk-while-muted/index.js
deleted file mode 100644
index d040422d06..0000000000
--- a/react/features/talk-while-muted/index.js
+++ /dev/null
@@ -1,4 +0,0 @@
-// @flow
-
-import './middleware';
-import './reducer';
diff --git a/react/features/toolbox/components/HangupButton.js b/react/features/toolbox/components/HangupButton.js
index c182dba234..2b2d8911f5 100644
--- a/react/features/toolbox/components/HangupButton.js
+++ b/react/features/toolbox/components/HangupButton.js
@@ -3,7 +3,7 @@
import _ from 'lodash';
import { createToolbarEvent, sendAnalytics } from '../../analytics';
-import { appNavigate } from '../../app';
+import { appNavigate } from '../../app/actions';
import { disconnect } from '../../base/connection';
import { translate } from '../../base/i18n';
import { connect } from '../../base/redux';
diff --git a/react/features/toolbox/index.js b/react/features/toolbox/index.js
index 44000a1a7b..b845e8859c 100644
--- a/react/features/toolbox/index.js
+++ b/react/features/toolbox/index.js
@@ -2,6 +2,3 @@ export * from './actions';
export * from './actionTypes';
export * from './components';
export * from './functions';
-
-import './middleware';
-import './reducer';
diff --git a/react/features/transcribing/index.js b/react/features/transcribing/index.js
index 7f0ef0251d..3c46ed49d1 100644
--- a/react/features/transcribing/index.js
+++ b/react/features/transcribing/index.js
@@ -1,5 +1,2 @@
export * from './actions';
export * from './components';
-
-import './middleware';
-import './reducer';
diff --git a/react/features/video-layout/index.js b/react/features/video-layout/index.js
index a1178fd2ba..b826983c44 100644
--- a/react/features/video-layout/index.js
+++ b/react/features/video-layout/index.js
@@ -3,7 +3,3 @@ export * from './actionTypes';
export * from './components';
export * from './constants';
export * from './functions';
-
-import './middleware';
-import './reducer';
-import './subscriber';
diff --git a/react/features/video-layout/middleware.any.js b/react/features/video-layout/middleware.any.js
index 2f3675f42e..996b9cce32 100644
--- a/react/features/video-layout/middleware.any.js
+++ b/react/features/video-layout/middleware.any.js
@@ -9,6 +9,8 @@ import { SET_DOCUMENT_EDITING_STATUS, toggleDocument } from '../etherpad';
import { SET_TILE_VIEW } from './actionTypes';
import { setTileView } from './actions';
+import './subscriber';
+
/**
* Middleware which intercepts actions and updates tile view related state.
*
diff --git a/react/features/video-quality/components/OverflowMenuVideoQualityItem.web.js b/react/features/video-quality/components/OverflowMenuVideoQualityItem.web.js
index 5e643a5910..39c4612018 100644
--- a/react/features/video-quality/components/OverflowMenuVideoQualityItem.web.js
+++ b/react/features/video-quality/components/OverflowMenuVideoQualityItem.web.js
@@ -2,7 +2,7 @@
import React, { Component } from 'react';
-import { VIDEO_QUALITY_LEVELS } from '../../base/conference';
+import { VIDEO_QUALITY_LEVELS } from '../../base/conference/constants';
import { translate } from '../../base/i18n';
import {
Icon,
diff --git a/react/features/videosipgw/index.js b/react/features/videosipgw/index.js
index dbf9c8839e..485f1b10af 100644
--- a/react/features/videosipgw/index.js
+++ b/react/features/videosipgw/index.js
@@ -1,4 +1 @@
export * from './actions';
-
-import './middleware';
-import './reducer';
diff --git a/react/features/welcome/components/AbstractWelcomePage.js b/react/features/welcome/components/AbstractWelcomePage.js
index acd4a7f183..b52a3525f1 100644
--- a/react/features/welcome/components/AbstractWelcomePage.js
+++ b/react/features/welcome/components/AbstractWelcomePage.js
@@ -5,7 +5,7 @@ import { Component } from 'react';
import type { Dispatch } from 'redux';
import { createWelcomePageEvent, sendAnalytics } from '../../analytics';
-import { appNavigate } from '../../app';
+import { appNavigate } from '../../app/actions';
import isInsecureRoomName from '../../base/util/isInsecureRoomName';
import { isCalendarEnabled } from '../../calendar-sync';
import { isRecentListEnabled } from '../../recent-list/functions';
diff --git a/react/features/welcome/components/WelcomePage.native.js b/react/features/welcome/components/WelcomePage.native.js
index 8272182b36..8dcac4e23b 100644
--- a/react/features/welcome/components/WelcomePage.native.js
+++ b/react/features/welcome/components/WelcomePage.native.js
@@ -9,7 +9,7 @@ import {
View
} from 'react-native';
-import { getName } from '../../app';
+import { getName } from '../../app/functions';
import { ColorSchemeRegistry } from '../../base/color-scheme';
import { translate } from '../../base/i18n';
import { Icon, IconMenu, IconWarning } from '../../base/icons';
diff --git a/react/features/welcome/index.js b/react/features/welcome/index.js
index 076f379b72..8b45add519 100644
--- a/react/features/welcome/index.js
+++ b/react/features/welcome/index.js
@@ -1,4 +1,2 @@
export * from './components';
export * from './functions';
-
-import './reducer';
diff --git a/react/features/youtube-player/index.js b/react/features/youtube-player/index.js
index a29aa08e02..803dacd06c 100644
--- a/react/features/youtube-player/index.js
+++ b/react/features/youtube-player/index.js
@@ -1,6 +1,3 @@
export * from './actions';
export * from './actionTypes';
export * from './components';
-
-import './middleware';
-import './reducer';
diff --git a/react/index.native.js b/react/index.native.js
index 87e363598f..763442988a 100644
--- a/react/index.native.js
+++ b/react/index.native.js
@@ -7,7 +7,7 @@ import './features/mobile/polyfills';
import React, { PureComponent } from 'react';
import { AppRegistry } from 'react-native';
-import { App } from './features/app';
+import { App } from './features/app/components';
import { _initLogging } from './features/base/logging/functions';
import { IncomingCallApp } from './features/mobile/incoming-call';
diff --git a/react/index.web.js b/react/index.web.js
index 2e8d8dec7f..300d084198 100644
--- a/react/index.web.js
+++ b/react/index.web.js
@@ -5,7 +5,7 @@ import ReactDOM from 'react-dom';
import { getJitsiMeetTransport } from '../modules/transport';
-import { App } from './features/app';
+import { App } from './features/app/components';
import { getLogger } from './features/base/logging/functions';
import { Platform } from './features/base/react';
diff --git a/webpack.config.js b/webpack.config.js
index 083af74841..49719fc97b 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -193,7 +193,7 @@ module.exports = [
entry: {
'device_selection_popup_bundle': './react/features/settings/popup.js'
},
- performance: getPerformanceHints(700 * 1024)
+ performance: getPerformanceHints(750 * 1024)
}),
Object.assign({}, config, {
entry: {