Parcourir la source

Reduce the dependencies of the Web ExternalAPI

We broke external_api.min.js by importing react/features/util which
imported react/features/base/lib-jitsi-meet.

1. To reduce the risks of such a breakage until we add
   external_api.min.js to the torture tests, import as little as
   possible in modules/API/external/external_api.js.
2. Use the global JitsiMeetJS on Web in react/features/base/util.
master
Lyubo Marinov il y a 7 ans
Parent
révision
15ab7a292c

+ 1
- 1
modules/API/external/external_api.js Voir le fichier

@@ -1,6 +1,6 @@
1 1
 import EventEmitter from 'events';
2 2
 
3
-import { urlObjectToString } from '../../../react/features/base/util';
3
+import { urlObjectToString } from '../../../react/features/base/util/uri.js';
4 4
 import {
5 5
     PostMessageTransportBackend,
6 6
     Transport

+ 6
- 4
react/features/base/util/loadScript.web.js Voir le fichier

@@ -1,4 +1,6 @@
1
-import JitsiMeetJS from '../lib-jitsi-meet';
1
+/* @flow */
2
+
3
+declare var JitsiMeetJS: Object;
2 4
 
3 5
 /**
4 6
  * Loads a script from a specific URL. The script will be interpreted upon load.
@@ -7,13 +9,13 @@ import JitsiMeetJS from '../lib-jitsi-meet';
7 9
  * @returns {Promise} Resolved with no arguments when the script is loaded and
8 10
  * rejected with the error from JitsiMeetJS.ScriptUtil.loadScript method.
9 11
  */
10
-export function loadScript(url) {
12
+export function loadScript(url: string) {
11 13
     return new Promise((resolve, reject) =>
12 14
         JitsiMeetJS.util.ScriptUtil.loadScript(
13 15
             url,
14 16
             /* async */ true,
15 17
             /* prepend */ false,
16 18
             /* relativeURL */ false,
17
-            /* loadCallback */ () => resolve(),
18
-            /* errorCallback */ error => reject(error)));
19
+            /* loadCallback */ resolve,
20
+            /* errorCallback */ reject));
19 21
 }

Chargement…
Annuler
Enregistrer