瀏覽代碼

ref: reduce device popup bundle size

master
Bettenbuk Zoltan 5 年之前
父節點
當前提交
382ec011eb

+ 3
- 3
react/features/base/dialog/components/web/AbstractDialogTab.js 查看文件

@@ -29,14 +29,14 @@ export type Props = {
29 29
  *
30 30
  * @extends Component
31 31
  */
32
-class AbstractDialogTab extends Component<Props> {
32
+class AbstractDialogTab<P: Props, S: *> extends Component<P, S> {
33 33
     /**
34 34
      * Initializes a new {@code AbstractDialogTab} instance.
35 35
      *
36
-     * @param {Object} props - The read-only properties with which the new
36
+     * @param {P} props - The read-only properties with which the new
37 37
      * instance is to be initialized.
38 38
      */
39
-    constructor(props: Props) {
39
+    constructor(props: P) {
40 40
         super(props);
41 41
 
42 42
         // Bind event handler so it is only bound once for every instance.

+ 3
- 2
react/features/base/dialog/components/web/DialogWithTabs.js 查看文件

@@ -3,11 +3,12 @@
3 3
 import Tabs from '@atlaskit/tabs';
4 4
 import React, { Component } from 'react';
5 5
 
6
-import { StatelessDialog } from '../../../dialog';
7
-import { translate } from '../../../i18n';
6
+import { translate } from '../../../i18n/functions';
8 7
 
9 8
 import logger from '../../logger';
10 9
 
10
+import StatelessDialog from './StatelessDialog';
11
+
11 12
 /**
12 13
  * The type of the React {@code Component} props of {@link DialogWithTabs}.
13 14
  */

+ 1
- 1
react/features/base/dialog/components/web/StatelessDialog.js 查看文件

@@ -5,7 +5,7 @@ import Modal, { ModalFooter } from '@atlaskit/modal-dialog';
5 5
 import _ from 'lodash';
6 6
 import React, { Component } from 'react';
7 7
 
8
-import { translate } from '../../../i18n';
8
+import { translate } from '../../../i18n/functions';
9 9
 
10 10
 import type { DialogProps } from '../../constants';
11 11
 

+ 1
- 1
react/features/base/logging/functions.js 查看文件

@@ -33,7 +33,7 @@ export const _initLogging = _.once(() => {
33 33
     }
34 34
 
35 35
     // Lazy load it to avoid cycles in early web bootstrap code.
36
-    const { default: JitsiMeetJS } = require('../lib-jitsi-meet');
36
+    const { default: JitsiMeetJS } = require('../lib-jitsi-meet/_');
37 37
 
38 38
     Logger.setGlobalOptions(DEFAULT_RN_OPTS);
39 39
     JitsiMeetJS.setGlobalLogOptions(DEFAULT_RN_OPTS);

+ 1
- 1
react/features/base/media/components/AbstractAudio.js 查看文件

@@ -36,7 +36,7 @@ type Props = {
36 36
      * @type {Object | string}
37 37
      */
38 38
     src: Object | string,
39
-    stream: Object,
39
+    stream?: Object,
40 40
     loop?: ?boolean
41 41
 }
42 42
 

+ 5
- 0
react/features/base/media/components/Audio.native.js 查看文件

@@ -0,0 +1,5 @@
1
+// @flow
2
+
3
+import Audio from './native/Audio';
4
+
5
+export default Audio;

+ 5
- 0
react/features/base/media/components/Audio.web.js 查看文件

@@ -0,0 +1,5 @@
1
+// @flow
2
+
3
+import Audio from './web/Audio';
4
+
5
+export default Audio;

+ 5
- 0
react/features/base/media/components/Video.native.js 查看文件

@@ -0,0 +1,5 @@
1
+// @flow
2
+
3
+import Video from './native/Video';
4
+
5
+export default Video;

+ 5
- 0
react/features/base/media/components/Video.web.js 查看文件

@@ -0,0 +1,5 @@
1
+// @flow
2
+
3
+import Video from './web/Video';
4
+
5
+export default Video;

+ 1
- 1
react/features/base/media/components/web/Video.js 查看文件

@@ -21,7 +21,7 @@ type Props = {
21 21
     /**
22 22
      * Optional callback to invoke once the video starts playing.
23 23
      */
24
-    onVideoPlaying: Function,
24
+    onVideoPlaying?: Function,
25 25
 
26 26
     /**
27 27
      * The JitsiLocalTrack to display.

+ 3
- 1
react/features/device-selection/components/AudioInputPreview.js 查看文件

@@ -2,7 +2,9 @@
2 2
 
3 3
 import React, { Component } from 'react';
4 4
 
5
-import { JitsiTrackEvents } from '../../base/lib-jitsi-meet';
5
+import JitsiMeetJS from '../../base/lib-jitsi-meet/_';
6
+
7
+const JitsiTrackEvents = JitsiMeetJS.events.track;
6 8
 
7 9
 /**
8 10
  * The type of the React {@code Component} props of {@link AudioInputPreview}.

+ 2
- 2
react/features/device-selection/components/AudioOutputPreview.js 查看文件

@@ -2,8 +2,8 @@
2 2
 
3 3
 import React, { Component } from 'react';
4 4
 
5
-import { translate } from '../../base/i18n';
6
-import { Audio } from '../../base/media';
5
+import { translate } from '../../base/i18n/functions';
6
+import Audio from '../../base/media/components/Audio';
7 7
 
8 8
 const TEST_SOUND_PATH = 'sounds/ring.wav';
9 9
 

+ 6
- 4
react/features/device-selection/components/DeviceSelection.js 查看文件

@@ -2,10 +2,12 @@
2 2
 
3 3
 import React from 'react';
4 4
 
5
-import { AbstractDialogTab } from '../../base/dialog';
6
-import type { Props as AbstractDialogTabProps } from '../../base/dialog';
7
-import { translate } from '../../base/i18n';
8
-import JitsiMeetJS, { createLocalTrack } from '../../base/lib-jitsi-meet';
5
+import AbstractDialogTab, {
6
+    type Props as AbstractDialogTabProps
7
+} from '../../base/dialog/components/web/AbstractDialogTab';
8
+import { translate } from '../../base/i18n/functions';
9
+import JitsiMeetJS from '../../base/lib-jitsi-meet/_';
10
+import { createLocalTrack } from '../../base/lib-jitsi-meet/functions';
9 11
 
10 12
 import logger from '../logger';
11 13
 

+ 1
- 1
react/features/device-selection/components/DeviceSelector.web.js 查看文件

@@ -4,7 +4,7 @@ import AKDropdownMenu from '@atlaskit/dropdown-menu';
4 4
 import ChevronDownIcon from '@atlaskit/icon/glyph/chevron-down';
5 5
 import React, { Component } from 'react';
6 6
 
7
-import { translate } from '../../base/i18n';
7
+import { translate } from '../../base/i18n/functions';
8 8
 
9 9
 /**
10 10
  * The type of the React {@code Component} props of {@link DeviceSelector}.

+ 2
- 2
react/features/device-selection/components/VideoInputPreview.js 查看文件

@@ -2,7 +2,7 @@
2 2
 
3 3
 import React, { Component } from 'react';
4 4
 
5
-import { Video } from '../../base/media';
5
+import Video from '../../base/media/components/Video';
6 6
 
7 7
 const VIDEO_ERROR_CLASS = 'video-preview-has-error';
8 8
 
@@ -15,7 +15,7 @@ type Props = {
15 15
      * An error message to display instead of a preview. Displaying an error
16 16
      * will take priority over displaying a video preview.
17 17
      */
18
-    error: string,
18
+    error: ?string,
19 19
 
20 20
     /**
21 21
      * The JitsiLocalTrack to display.

+ 3
- 3
react/features/settings/components/web/DeviceSelectionPopup.js 查看文件

@@ -20,9 +20,9 @@ import {
20 20
     setVideoInputDevice
21 21
 } from '../../../../../modules/API/external/functions';
22 22
 
23
-import { parseURLParams } from '../../../base/config';
24
-import { DialogWithTabs } from '../../../base/dialog';
25
-import { DeviceSelection } from '../../../device-selection';
23
+import parseURLParams from '../../../base/config/parseURLParams';
24
+import DialogWithTabs from '../../../base/dialog/components/web/DialogWithTabs';
25
+import DeviceSelection from '../../../device-selection/components/DeviceSelection';
26 26
 
27 27
 /**
28 28
  * Implements a class that renders the React components for the device selection

+ 1
- 1
webpack.config.js 查看文件

@@ -182,7 +182,7 @@ module.exports = [
182 182
         entry: {
183 183
             'device_selection_popup_bundle': './react/features/settings/popup.js'
184 184
         },
185
-        performance: getPerformanceHints(2.5 * 1024 * 1024)
185
+        performance: getPerformanceHints(700 * 1024)
186 186
     }),
187 187
     Object.assign({}, config, {
188 188
         entry: {

Loading…
取消
儲存