Skip to content

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

ref: reduce device popup bundle size

Bettenbuk Zoltan382ec011eb23
diff --git a/react/features/base/dialog/components/web/AbstractDialogTab.js b/react/features/base/dialog/components/web/AbstractDialogTab.js
index 3fc4e17d1d..0f1d29488e 100644
--- a/react/features/base/dialog/components/web/AbstractDialogTab.js
+++ b/react/features/base/dialog/components/web/AbstractDialogTab.js
@@ -29,14 +29,14 @@ export type Props = {
*
* @extends Component
*/
-class AbstractDialogTab extends Component<Props> {
+class AbstractDialogTab<P: Props, S: *> extends Component<P, S> {
/**
* Initializes a new {@code AbstractDialogTab} instance.
*
- * @param {Object} props - The read-only properties with which the new
+ * @param {P} props - The read-only properties with which the new
* instance is to be initialized.
*/
- constructor(props: Props) {
+ constructor(props: P) {
super(props);
// Bind event handler so it is only bound once for every instance.
diff --git a/react/features/base/dialog/components/web/DialogWithTabs.js b/react/features/base/dialog/components/web/DialogWithTabs.js
index 52037e7ff0..3b599ed124 100644
--- a/react/features/base/dialog/components/web/DialogWithTabs.js
+++ b/react/features/base/dialog/components/web/DialogWithTabs.js
@@ -3,11 +3,12 @@
import Tabs from '@atlaskit/tabs';
import React, { Component } from 'react';
-import { StatelessDialog } from '../../../dialog';
-import { translate } from '../../../i18n';
+import { translate } from '../../../i18n/functions';
import logger from '../../logger';
+import StatelessDialog from './StatelessDialog';
+
/**
* The type of the React {@code Component} props of {@link DialogWithTabs}.
*/
diff --git a/react/features/base/dialog/components/web/StatelessDialog.js b/react/features/base/dialog/components/web/StatelessDialog.js
index 5b6de4f01b..5507520842 100644
--- a/react/features/base/dialog/components/web/StatelessDialog.js
+++ b/react/features/base/dialog/components/web/StatelessDialog.js
@@ -5,7 +5,7 @@ import Modal, { ModalFooter } from '@atlaskit/modal-dialog';
import _ from 'lodash';
import React, { Component } from 'react';
-import { translate } from '../../../i18n';
+import { translate } from '../../../i18n/functions';
import type { DialogProps } from '../../constants';
diff --git a/react/features/base/logging/functions.js b/react/features/base/logging/functions.js
index 54cd32019a..6977863dff 100644
--- a/react/features/base/logging/functions.js
+++ b/react/features/base/logging/functions.js
@@ -33,7 +33,7 @@ export const _initLogging = _.once(() => {
}
// Lazy load it to avoid cycles in early web bootstrap code.
- const { default: JitsiMeetJS } = require('../lib-jitsi-meet');
+ const { default: JitsiMeetJS } = require('../lib-jitsi-meet/_');
Logger.setGlobalOptions(DEFAULT_RN_OPTS);
JitsiMeetJS.setGlobalLogOptions(DEFAULT_RN_OPTS);
diff --git a/react/features/base/media/components/AbstractAudio.js b/react/features/base/media/components/AbstractAudio.js
index 698d539bce..dc2778d939 100644
--- a/react/features/base/media/components/AbstractAudio.js
+++ b/react/features/base/media/components/AbstractAudio.js
@@ -36,7 +36,7 @@ type Props = {
* @type {Object | string}
*/
src: Object | string,
- stream: Object,
+ stream?: Object,
loop?: ?boolean
}
diff --git a/react/features/base/media/components/Audio.native.js b/react/features/base/media/components/Audio.native.js
new file mode 100644
index 0000000000..883aa01246
--- /dev/null
+++ b/react/features/base/media/components/Audio.native.js
@@ -0,0 +1,5 @@
+// @flow
+
+import Audio from './native/Audio';
+
+export default Audio;
diff --git a/react/features/base/media/components/Audio.web.js b/react/features/base/media/components/Audio.web.js
new file mode 100644
index 0000000000..bcac3bad94
--- /dev/null
+++ b/react/features/base/media/components/Audio.web.js
@@ -0,0 +1,5 @@
+// @flow
+
+import Audio from './web/Audio';
+
+export default Audio;
diff --git a/react/features/base/media/components/Video.native.js b/react/features/base/media/components/Video.native.js
new file mode 100644
index 0000000000..6f5cfbc430
--- /dev/null
+++ b/react/features/base/media/components/Video.native.js
@@ -0,0 +1,5 @@
+// @flow
+
+import Video from './native/Video';
+
+export default Video;
diff --git a/react/features/base/media/components/Video.web.js b/react/features/base/media/components/Video.web.js
new file mode 100644
index 0000000000..3243aade83
--- /dev/null
+++ b/react/features/base/media/components/Video.web.js
@@ -0,0 +1,5 @@
+// @flow
+
+import Video from './web/Video';
+
+export default Video;
diff --git a/react/features/base/media/components/web/Video.js b/react/features/base/media/components/web/Video.js
index 601213c928..8b678d811a 100644
--- a/react/features/base/media/components/web/Video.js
+++ b/react/features/base/media/components/web/Video.js
@@ -21,7 +21,7 @@ type Props = {
/**
* Optional callback to invoke once the video starts playing.
*/
- onVideoPlaying: Function,
+ onVideoPlaying?: Function,
/**
* The JitsiLocalTrack to display.
diff --git a/react/features/device-selection/components/AudioInputPreview.js b/react/features/device-selection/components/AudioInputPreview.js
index 2953568c46..5c0df3ce2e 100644
--- a/react/features/device-selection/components/AudioInputPreview.js
+++ b/react/features/device-selection/components/AudioInputPreview.js
@@ -2,7 +2,9 @@
import React, { Component } from 'react';
-import { JitsiTrackEvents } from '../../base/lib-jitsi-meet';
+import JitsiMeetJS from '../../base/lib-jitsi-meet/_';
+
+const JitsiTrackEvents = JitsiMeetJS.events.track;
/**
* The type of the React {@code Component} props of {@link AudioInputPreview}.
diff --git a/react/features/device-selection/components/AudioOutputPreview.js b/react/features/device-selection/components/AudioOutputPreview.js
index 0d855be67f..0d5e67a4e4 100644
--- a/react/features/device-selection/components/AudioOutputPreview.js
+++ b/react/features/device-selection/components/AudioOutputPreview.js
@@ -2,8 +2,8 @@
import React, { Component } from 'react';
-import { translate } from '../../base/i18n';
-import { Audio } from '../../base/media';
+import { translate } from '../../base/i18n/functions';
+import Audio from '../../base/media/components/Audio';
const TEST_SOUND_PATH = 'sounds/ring.wav';
diff --git a/react/features/device-selection/components/DeviceSelection.js b/react/features/device-selection/components/DeviceSelection.js
index 136ec62c23..ede0efd185 100644
--- a/react/features/device-selection/components/DeviceSelection.js
+++ b/react/features/device-selection/components/DeviceSelection.js
@@ -2,10 +2,12 @@
import React from 'react';
-import { AbstractDialogTab } from '../../base/dialog';
-import type { Props as AbstractDialogTabProps } from '../../base/dialog';
-import { translate } from '../../base/i18n';
-import JitsiMeetJS, { createLocalTrack } from '../../base/lib-jitsi-meet';
+import AbstractDialogTab, {
+ type Props as AbstractDialogTabProps
+} from '../../base/dialog/components/web/AbstractDialogTab';
+import { translate } from '../../base/i18n/functions';
+import JitsiMeetJS from '../../base/lib-jitsi-meet/_';
+import { createLocalTrack } from '../../base/lib-jitsi-meet/functions';
import logger from '../logger';
diff --git a/react/features/device-selection/components/DeviceSelector.web.js b/react/features/device-selection/components/DeviceSelector.web.js
index 68db750a35..8d3b08429c 100644
--- a/react/features/device-selection/components/DeviceSelector.web.js
+++ b/react/features/device-selection/components/DeviceSelector.web.js
@@ -4,7 +4,7 @@ import AKDropdownMenu from '@atlaskit/dropdown-menu';
import ChevronDownIcon from '@atlaskit/icon/glyph/chevron-down';
import React, { Component } from 'react';
-import { translate } from '../../base/i18n';
+import { translate } from '../../base/i18n/functions';
/**
* The type of the React {@code Component} props of {@link DeviceSelector}.
diff --git a/react/features/device-selection/components/VideoInputPreview.js b/react/features/device-selection/components/VideoInputPreview.js
index 984758af1b..e8e1154f5a 100644
--- a/react/features/device-selection/components/VideoInputPreview.js
+++ b/react/features/device-selection/components/VideoInputPreview.js
@@ -2,7 +2,7 @@
import React, { Component } from 'react';
-import { Video } from '../../base/media';
+import Video from '../../base/media/components/Video';
const VIDEO_ERROR_CLASS = 'video-preview-has-error';
@@ -15,7 +15,7 @@ type Props = {
* An error message to display instead of a preview. Displaying an error
* will take priority over displaying a video preview.
*/
- error: string,
+ error: ?string,
/**
* The JitsiLocalTrack to display.
diff --git a/react/features/settings/components/web/DeviceSelectionPopup.js b/react/features/settings/components/web/DeviceSelectionPopup.js
index a7b184cb35..617e13a06d 100644
--- a/react/features/settings/components/web/DeviceSelectionPopup.js
+++ b/react/features/settings/components/web/DeviceSelectionPopup.js
@@ -20,9 +20,9 @@ import {
setVideoInputDevice
} from '../../../../../modules/API/external/functions';
-import { parseURLParams } from '../../../base/config';
-import { DialogWithTabs } from '../../../base/dialog';
-import { DeviceSelection } from '../../../device-selection';
+import parseURLParams from '../../../base/config/parseURLParams';
+import DialogWithTabs from '../../../base/dialog/components/web/DialogWithTabs';
+import DeviceSelection from '../../../device-selection/components/DeviceSelection';
/**
* Implements a class that renders the React components for the device selection
diff --git a/webpack.config.js b/webpack.config.js
index fe1057f207..5edd336afb 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -182,7 +182,7 @@ module.exports = [
entry: {
'device_selection_popup_bundle': './react/features/settings/popup.js'
},
- performance: getPerformanceHints(2.5 * 1024 * 1024)
+ performance: getPerformanceHints(700 * 1024)
}),
Object.assign({}, config, {
entry: {