浏览代码

feat(build,rnnoise) don't use an external bundle for the effect

The majority of the code is in the WASM file, the JS is just 9KB.
It's so little, in fact, that the performance hint for the main bundle didn't
have to be adjusted.
j8
Saúl Ibarra Corretgé 4 年前
父节点
当前提交
30d0aabaca
共有 5 个文件被更改,包括 2 次插入53 次删除
  1. 0
    2
      Makefile
  2. 2
    2
      react/features/conference/functions.web.js
  3. 0
    27
      react/features/rnnoise/functions.js
  4. 0
    2
      react/features/rnnoise/index.js
  5. 0
    20
      webpack.config.js

+ 0
- 2
Makefile 查看文件

@@ -51,8 +51,6 @@ deploy-appbundle:
51 51
 		$(OUTPUT_DIR)/analytics-ga.js \
52 52
 		$(BUILD_DIR)/analytics-ga.min.js \
53 53
 		$(BUILD_DIR)/analytics-ga.min.map \
54
-		$(BUILD_DIR)/rnnoise-processor.min.js \
55
-		$(BUILD_DIR)/rnnoise-processor.min.map \
56 54
 		$(BUILD_DIR)/close3.min.js \
57 55
 		$(BUILD_DIR)/close3.min.map \
58 56
 		$(DEPLOY_DIR)

+ 2
- 2
react/features/conference/functions.web.js 查看文件

@@ -6,7 +6,7 @@ import { toState } from '../base/redux';
6 6
 import { getBackendSafePath, getJitsiMeetGlobalNS } from '../base/util';
7 7
 import { getVpaasBillingId } from '../billing-counter/functions';
8 8
 import { showWarningNotification } from '../notifications';
9
-import { createRnnoiseProcessorPromise } from '../rnnoise';
9
+import { createRnnoiseProcessor } from '../stream-effects/rnnoise';
10 10
 
11 11
 export * from './functions.any';
12 12
 
@@ -84,7 +84,7 @@ export function getConferenceOptions(stateful) {
84 84
 
85 85
     options.applicationName = getName();
86 86
     options.getWiFiStatsMethod = getWiFiStatsMethod;
87
-    options.createVADProcessor = createRnnoiseProcessorPromise;
87
+    options.createVADProcessor = createRnnoiseProcessor;
88 88
     options.billingId = getVpaasBillingId(state);
89 89
 
90 90
     // Disable CallStats, if requessted.

+ 0
- 27
react/features/rnnoise/functions.js 查看文件

@@ -1,27 +0,0 @@
1
-// @flow
2
-
3
-import { getJitsiMeetGlobalNS, loadScript } from '../base/util';
4
-
5
-let loadRnnoisePromise;
6
-
7
-/**
8
- * Returns promise that resolves with a RnnoiseProcessor instance.
9
- *
10
- * @returns {Promise<RnnoiseProcessor>} - Resolves with the blur effect instance.
11
- */
12
-export function createRnnoiseProcessorPromise() {
13
-    // Subsequent calls should not attempt to load the script multiple times.
14
-    if (!loadRnnoisePromise) {
15
-        loadRnnoisePromise = loadScript('libs/rnnoise-processor.min.js');
16
-    }
17
-
18
-    return loadRnnoisePromise.then(() => {
19
-        const ns = getJitsiMeetGlobalNS();
20
-
21
-        if (ns?.effects?.rnnoise?.createRnnoiseProcessor) {
22
-            return ns.effects.rnnoise.createRnnoiseProcessor();
23
-        }
24
-
25
-        throw new Error('Rnnoise module binding createRnnoiseProcessor not found!');
26
-    });
27
-}

+ 0
- 2
react/features/rnnoise/index.js 查看文件

@@ -1,2 +0,0 @@
1
-
2
-export * from './functions';

+ 0
- 20
webpack.config.js 查看文件

@@ -240,26 +240,6 @@ module.exports = [
240 240
         performance: getPerformanceHints(128 * 1024)
241 241
     }),
242 242
 
243
-    // Because both virtual-background-effect and rnnoise-processor modules are loaded
244
-    // in a lazy manner using the loadScript function with a hard coded name,
245
-    // i.e.loadScript('libs/rnnoise-processor.min.js'), webpack dev server
246
-    // won't know how to properly load them using the default config filename
247
-    // and sourceMapFilename parameters which target libs without .min in dev
248
-    // mode. Thus we change these modules to have the same filename in both
249
-    // prod and dev mode.
250
-    Object.assign({}, config, {
251
-        entry: {
252
-            'rnnoise-processor': './react/features/stream-effects/rnnoise/index.js'
253
-        },
254
-        output: Object.assign({}, config.output, {
255
-            library: [ 'JitsiMeetJS', 'app', 'effects', 'rnnoise' ],
256
-            libraryTarget: 'window',
257
-            filename: '[name].min.js',
258
-            sourceMapFilename: '[name].min.map'
259
-        }),
260
-        performance: getPerformanceHints(30 * 1024)
261
-    }),
262
-
263 243
     Object.assign({}, config, {
264 244
         entry: {
265 245
             'external_api': './modules/API/external/index.js'

正在加载...
取消
保存