Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
TypeScript debiandeep-videojitsijitsi-meetscalable-video-conferencessfuvideovideo-communicationvideo-conferencingwebrtc
ref: module.exports -> export for the ES6 modules
hristoterezov4d329b510f0e
diff --git a/.jshintignore b/.jshintignoreindex 92a5192db0..bdb025c72e 100644--- a/.jshintignore+++ b/.jshintignore@@ -16,6 +16,7 @@ react/# The following are checked by ESLint with the minimum configuration which does# not supersede JSHint but take advantage of advanced language features such as# Facebook Flow which are not supported by JSHint.+app.jsmodules/translation/translation.jsanalytics.jsdiff --git a/app.js b/app.jsindex 5bd7593606..470420d0d0 100644--- a/app.js+++ b/app.js@@ -15,59 +15,50 @@ import 'aui-experimental-css';window.toastr = require("toastr");-import conference from './conference';-import API from './modules/API';-import keyboardshortcut from './modules/keyboardshortcut/keyboardshortcut';-import remoteControl from "./modules/remotecontrol/RemoteControl";-import settings from "./modules/settings/Settings";-import translation from "./modules/translation/translation";-import UI from "./modules/UI/UI";+export conference from './conference';+export API from './modules/API';+export keyboardshortcut from './modules/keyboardshortcut/keyboardshortcut';+export remoteControl from "./modules/remotecontrol/RemoteControl";+export settings from "./modules/settings/Settings";+export translation from "./modules/translation/translation";+export UI from "./modules/UI/UI";-const APP = {- API,- conference,+/**+ * After the APP has been initialized provides utility methods for dealing+ * with the conference room URL(address).+ * @type ConferenceUrl+ */+export let ConferenceUrl = null;- /**- * After the APP has been initialized provides utility methods for dealing- * with the conference room URL(address).- * @type ConferenceUrl- */- ConferenceUrl: null,+// Used by do_external_connect.js if we receive the attach data after+// connect was already executed. status property can be "initialized",+// "ready" or "connecting". We are interested in "ready" status only which+// means that connect was executed but we have to wait for the attach data.+// In status "ready" handler property will be set to a function that will+// finish the connect process when the attach data or error is received.+export const connect = {+ status: "initialized",+ handler: null+};- // Used by do_external_connect.js if we receive the attach data after- // connect was already executed. status property can be "initialized",- // "ready" or "connecting". We are interested in "ready" status only which- // means that connect was executed but we have to wait for the attach data.- // In status "ready" handler property will be set to a function that will- // finish the connect process when the attach data or error is received.- connect: {- status: "initialized",- handler: null- },- connection: null,+export let connection = null;- // Used for automated performance tests- connectionTimes: {- "index.loaded": window.indexLoadedTime- },- keyboardshortcut,+// Used for automated performance tests+export const connectionTimes = {+ "index.loaded": window.indexLoadedTime+};- /**- * The log collector which captures JS console logs for this app.- * @type {LogCollector}- */- logCollector: null,+/**+ * The log collector which captures JS console logs for this app.+ * @type {LogCollector}+ */+export let logCollector = null;- /**- * Indicates if the log collector has been started (it will not be started- * if the welcome page is displayed).- */- logCollectorStarted : false,- remoteControl,- settings,- translation,- UI-};+/**+ * Indicates if the log collector has been started (it will not be started+ * if the welcome page is displayed).+ */+export let logCollectorStarted = false;// TODO The execution of the mobile app starts from react/index.native.js.// Similarly, the execution of the Web app should start from react/index.web.js@@ -76,5 +67,3 @@ const APP = {// the execution of the Web app to start from app.js in order to reduce the// complexity of the beginning step.import './react';--module.exports = APP;diff --git a/modules/API/external/external_api.js b/modules/API/external/external_api.jsindex a2e40867b2..44cf2b7814 100644--- a/modules/API/external/external_api.js+++ b/modules/API/external/external_api.js@@ -145,7 +145,7 @@ function generateURL(domain, options = {}) {/*** The IFrame API interface class.*/-class JitsiMeetExternalAPI extends EventEmitter {+export default class JitsiMeetExternalAPI extends EventEmitter {/*** Constructs new API instance. Creates iframe and loads Jitsi Meet in it.*@@ -424,5 +424,3 @@ class JitsiMeetExternalAPI extends EventEmitter {eventList.forEach(event => this.removeEventListener(event));}}--module.exports = JitsiMeetExternalAPI;diff --git a/modules/API/external/index.js b/modules/API/external/index.jsnew file mode 100644index 0000000000..7591e6fdc1--- /dev/null+++ b/modules/API/external/index.js@@ -0,0 +1,3 @@+// For legacy purposes, preserve the UMD of the public API of Jitsi Meet+// external API (a.k.a. JitsiMeetExternalAPI).+module.exports = require('./external_api').default;diff --git a/modules/UI/UI.js b/modules/UI/UI.jsindex 92b136a5b6..226740cc2f 100644--- a/modules/UI/UI.js+++ b/modules/UI/UI.js@@ -8,6 +8,8 @@ import Chat from "./side_pannels/chat/Chat";import SidePanels from "./side_pannels/SidePanels";import Avatar from "./avatar/Avatar";import SideContainerToggler from "./side_pannels/SideContainerToggler";+import JitsiPopover from "./util/JitsiPopover";+import messageHandler from "./util/MessageHandler";import UIUtil from "./util/UIUtil";import UIEvents from "../../service/UI/UIEvents";import EtherpadManager from './etherpad/Etherpad';@@ -19,7 +21,7 @@ import Filmstrip from "./videolayout/Filmstrip";import SettingsMenu from "./side_pannels/settings/SettingsMenu";import Profile from "./side_pannels/profile/Profile";import Settings from "./../settings/Settings";-import UIErrors from './UIErrors';+import { FEEDBACK_REQUEST_IN_PROGRESS } from './UIErrors';import { debounce } from "../util/helpers";import { updateDeviceList } from '../../react/features/base/devices';@@ -41,9 +43,7 @@ import {} from '../../react/features/toolbox';var EventEmitter = require("events");-UI.messageHandler = require("./util/MessageHandler");-var messageHandler = UI.messageHandler;-var JitsiPopover = require("./util/JitsiPopover");+UI.messageHandler = messageHandler;import Feedback from "./feedback/Feedback";import FollowMe from "../FollowMe";@@ -1033,7 +1033,7 @@ UI.updateDTMFSupport*/UI.requestFeedbackOnHangup = function () {if (Feedback.isVisible())- return Promise.reject(UIErrors.FEEDBACK_REQUEST_IN_PROGRESS);+ return Promise.reject(FEEDBACK_REQUEST_IN_PROGRESS);// Feedback has been submitted already.else if (Feedback.isEnabled() && Feedback.isSubmitted()) {return Promise.resolve({@@ -1443,4 +1443,6 @@ const UIListeners = new Map([]]);-module.exports = UI;+// TODO: Export every function separately. For now there is no point of doing+// this because we are importing everything.+export default UI;diff --git a/modules/UI/UIErrors.js b/modules/UI/UIErrors.jsindex b6c6310c7a..a7bb030004 100644--- a/modules/UI/UIErrors.js+++ b/modules/UI/UIErrors.js@@ -1,10 +1,10 @@/*** A list of all UI errors.*/-module.exports = {- /**- * Indicates that a Feedback request is currently in progress.- * @type {{FEEDBACK_REQUEST_IN_PROGRESS: string}}- */- FEEDBACK_REQUEST_IN_PROGRESS: "FeedbackRequestInProgress"-};\ No newline at end of file++/**+ * Indicates that a Feedback request is currently in progress.+ *+ * @type {{FEEDBACK_REQUEST_IN_PROGRESS: string}}+ */+export const FEEDBACK_REQUEST_IN_PROGRESS = "FeedbackRequestInProgress";diff --git a/modules/UI/util/JitsiPopover.js b/modules/UI/util/JitsiPopover.jsindex 3bb226aa3e..3717b8f852 100644--- a/modules/UI/util/JitsiPopover.js+++ b/modules/UI/util/JitsiPopover.js@@ -77,7 +77,7 @@ const positionConfigurations = {}}};-var JitsiPopover = (function () {+export default (function () {/*** The default options*/@@ -294,5 +294,3 @@ var JitsiPopover = (function () {return JitsiPopover;})();--module.exports = JitsiPopover;diff --git a/modules/UI/util/MessageHandler.js b/modules/UI/util/MessageHandler.jsindex b23f5df853..f2fc740e28 100644--- a/modules/UI/util/MessageHandler.js+++ b/modules/UI/util/MessageHandler.js@@ -504,4 +504,4 @@ var messageHandler = {}};-module.exports = messageHandler;+export default messageHandler;diff --git a/modules/keyboardshortcut/keyboardshortcut.js b/modules/keyboardshortcut/keyboardshortcut.jsindex b1b4a26e0c..649787f544 100644--- a/modules/keyboardshortcut/keyboardshortcut.js+++ b/modules/keyboardshortcut/keyboardshortcut.js@@ -82,7 +82,7 @@ let enabled = true;/*** Maps keycode to character, id of popover for given function and function.*/-var KeyboardShortcut = {+const KeyboardShortcut = {init: function () {initGlobalShortcuts();@@ -273,4 +273,4 @@ var KeyboardShortcut = {}};-module.exports = KeyboardShortcut;+export default KeyboardShortcut;diff --git a/webpack.config.js b/webpack.config.jsindex 310a822d06..dc34b071f8 100644--- a/webpack.config.js+++ b/webpack.config.js@@ -188,7 +188,7 @@ const configs = [// JitsiMeetExternalAPI).Object.assign({}, config, {entry: {- 'external_api': './modules/API/external/external_api.js'+ 'external_api': './modules/API/external/index.js'},output: Object.assign({}, config.output, {library: 'JitsiMeetExternalAPI'