Skip to content

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

feat(build,ljm) don't expose jquery

Saúl Ibarra Corretgé7e7107d45a4f
diff --git a/app.js b/app.js
index a7997f4efb..9e6904b7d7 100644
--- a/app.js
+++ b/app.js
@@ -1,7 +1,5 @@
/* application specific logic */
-import 'jquery';
-
import '@matrix-org/olm';
import 'focus-visible';
diff --git a/modules/UI/UI.js b/modules/UI/UI.js
index 9b97d68912..ff0eb8c698 100644
--- a/modules/UI/UI.js
+++ b/modules/UI/UI.js
@@ -1,10 +1,11 @@
-/* global APP, $, config */
+/* global APP, config */
const UI = {};
import Logger from '@jitsi/logger';
import EventEmitter from 'events';
+import $ from 'jquery';
import { isMobileBrowser } from '../../react/features/base/environment/utils';
import { setColorAlpha } from '../../react/features/base/util';
diff --git a/modules/UI/etherpad/Etherpad.js b/modules/UI/etherpad/Etherpad.js
index eb9182e144..9207c64118 100644
--- a/modules/UI/etherpad/Etherpad.js
+++ b/modules/UI/etherpad/Etherpad.js
@@ -1,4 +1,6 @@
-/* global $, APP, interfaceConfig */
+/* global APP, interfaceConfig */
+
+import $ from 'jquery';
import { getSharedDocumentUrl, setDocumentEditingState } from '../../../react/features/etherpad';
import { getToolboxHeight } from '../../../react/features/toolbox/functions.web';
diff --git a/modules/UI/util/UIUtil.js b/modules/UI/util/UIUtil.js
index c2a9488836..9c4788ea8b 100644
--- a/modules/UI/util/UIUtil.js
+++ b/modules/UI/util/UIUtil.js
@@ -1,4 +1,4 @@
-/* global $ */
+import $ from 'jquery';
/**
* Created by hristo on 12/22/14.
diff --git a/modules/UI/videolayout/Filmstrip.js b/modules/UI/videolayout/Filmstrip.js
index c9ec6e141b..4958450112 100644
--- a/modules/UI/videolayout/Filmstrip.js
+++ b/modules/UI/videolayout/Filmstrip.js
@@ -1,4 +1,6 @@
-/* global $, APP, interfaceConfig */
+/* global APP, interfaceConfig */
+
+import $ from 'jquery';
import { getVerticalFilmstripVisibleAreaWidth, isFilmstripVisible } from '../../../react/features/filmstrip';
diff --git a/modules/UI/videolayout/LargeVideoManager.js b/modules/UI/videolayout/LargeVideoManager.js
index ce859bbcb5..7fc18e9194 100644
--- a/modules/UI/videolayout/LargeVideoManager.js
+++ b/modules/UI/videolayout/LargeVideoManager.js
@@ -1,6 +1,7 @@
-/* global $, APP */
+/* global APP */
/* eslint-disable no-unused-vars */
import Logger from '@jitsi/logger';
+import $ from 'jquery';
import React from 'react';
import ReactDOM from 'react-dom';
import { I18nextProvider } from 'react-i18next';
diff --git a/modules/UI/videolayout/VideoContainer.js b/modules/UI/videolayout/VideoContainer.js
index 05865f3a42..46f207f83d 100644
--- a/modules/UI/videolayout/VideoContainer.js
+++ b/modules/UI/videolayout/VideoContainer.js
@@ -1,6 +1,7 @@
-/* global $, APP, interfaceConfig */
+/* global APP, interfaceConfig */
/* eslint-disable no-unused-vars */
+import $ from 'jquery';
import React from 'react';
import ReactDOM from 'react-dom';
diff --git a/modules/translation/translation.js b/modules/translation/translation.js
index d7f48e5b96..8b87df2e4e 100644
--- a/modules/translation/translation.js
+++ b/modules/translation/translation.js
@@ -1,10 +1,10 @@
/* @flow */
+import $ from 'jquery';
import jqueryI18next from 'jquery-i18next';
import { i18next } from '../../react/features/base/i18n';
-declare var $: Function;
type DocumentElement = {
lang: string
diff --git a/package-lock.json b/package-lock.json
index c7a33f348d..de5ac4bddc 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -65,7 +65,7 @@
"i18next-browser-languagedetector": "3.0.1",
"i18next-xhr-backend": "3.0.0",
"image-capture": "0.4.0",
- "jquery": "3.5.1",
+ "jquery": "3.6.1",
"jquery-i18next": "1.2.1",
"js-md5": "0.6.1",
"js-sha512": "0.8.0",
@@ -161,7 +161,6 @@
"eslint-plugin-react": "7.26.1",
"eslint-plugin-react-native": "3.11.0",
"eslint-plugin-typescript-sort-keys": "2.1.0",
- "expose-loader": "3.0.0",
"imports-loader": "0.7.1",
"jetifier": "1.6.4",
"metro-react-native-babel-preset": "0.67.0",
@@ -9789,22 +9788,6 @@
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
},
- "node_modules/expose-loader": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/expose-loader/-/expose-loader-3.0.0.tgz",
- "integrity": "sha512-X7ncrzmiQbJHOyLwuymECHk4NYvoPFwnsINMYFaRrm4fxuxR59hV1v65bho3TpIoWieP8WZmhz6micKny8orWg==",
- "dev": true,
- "engines": {
- "node": ">= 12.13.0"
- },
- "funding": {
- "type": "opencollective",
- "url": "https://opencollective.com/webpack"
- },
- "peerDependencies": {
- "webpack": "^5.0.0"
- }
- },
"node_modules/express": {
"version": "4.17.3",
"resolved": "https://registry.npmjs.org/express/-/express-4.17.3.tgz",
@@ -11968,9 +11951,9 @@
}
},
"node_modules/jquery": {
- "version": "3.5.1",
- "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.5.1.tgz",
- "integrity": "sha512-XwIBPqcMn57FxfT+Go5pzySnm4KWkT1Tv7gjrpT1srtf8Weynl6R273VJ5GjkRb51IzMp5nbaPjJXMWeju2MKg=="
+ "version": "3.6.1",
+ "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.6.1.tgz",
+ "integrity": "sha512-opJeO4nCucVnsjiXOE+/PcCgYw9Gwpvs/a6B1LL/lQhwWwpbVEVYDZ1FokFr8PRc7ghYlrFPuyHuiiDNTQxmcw=="
},
"node_modules/jquery-i18next": {
"version": "1.2.1",
@@ -27242,12 +27225,6 @@
}
}
},
- "expose-loader": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/expose-loader/-/expose-loader-3.0.0.tgz",
- "integrity": "sha512-X7ncrzmiQbJHOyLwuymECHk4NYvoPFwnsINMYFaRrm4fxuxR59hV1v65bho3TpIoWieP8WZmhz6micKny8orWg==",
- "dev": true
- },
"express": {
"version": "4.17.3",
"resolved": "https://registry.npmjs.org/express/-/express-4.17.3.tgz",
@@ -28883,9 +28860,9 @@
}
},
"jquery": {
- "version": "3.5.1",
- "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.5.1.tgz",
- "integrity": "sha512-XwIBPqcMn57FxfT+Go5pzySnm4KWkT1Tv7gjrpT1srtf8Weynl6R273VJ5GjkRb51IzMp5nbaPjJXMWeju2MKg=="
+ "version": "3.6.1",
+ "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.6.1.tgz",
+ "integrity": "sha512-opJeO4nCucVnsjiXOE+/PcCgYw9Gwpvs/a6B1LL/lQhwWwpbVEVYDZ1FokFr8PRc7ghYlrFPuyHuiiDNTQxmcw=="
},
"jquery-i18next": {
"version": "1.2.1",
diff --git a/package.json b/package.json
index 96fdf62ab9..d21883612b 100644
--- a/package.json
+++ b/package.json
@@ -70,7 +70,7 @@
"i18next-browser-languagedetector": "3.0.1",
"i18next-xhr-backend": "3.0.0",
"image-capture": "0.4.0",
- "jquery": "3.5.1",
+ "jquery": "3.6.1",
"jquery-i18next": "1.2.1",
"js-md5": "0.6.1",
"js-sha512": "0.8.0",
@@ -166,7 +166,6 @@
"eslint-plugin-react": "7.26.1",
"eslint-plugin-react-native": "3.11.0",
"eslint-plugin-typescript-sort-keys": "2.1.0",
- "expose-loader": "3.0.0",
"imports-loader": "0.7.1",
"jetifier": "1.6.4",
"metro-react-native-babel-preset": "0.67.0",
diff --git a/react/features/base/lib-jitsi-meet/_.native.js b/react/features/base/lib-jitsi-meet/_.native.js
index eae90fffc5..63103a2824 100644
--- a/react/features/base/lib-jitsi-meet/_.native.js
+++ b/react/features/base/lib-jitsi-meet/_.native.js
@@ -1,16 +1,5 @@
import './native';
-// The library lib-jitsi-meet (externally) depends on the libraries jQuery
-(global => {
- // jQuery
- if (typeof global.$ === 'undefined') {
- const jQuery = require('jquery');
-
- jQuery(global);
- global.$ = jQuery;
- }
-})(global || window || this); // eslint-disable-line no-invalid-this
-
// Re-export JitsiMeetJS from the library lib-jitsi-meet to (the other features
// of) the project jitsi-meet.
//
diff --git a/react/features/remote-control/actions.js b/react/features/remote-control/actions.js
index 967b69c2a7..a497ea9962 100644
--- a/react/features/remote-control/actions.js
+++ b/react/features/remote-control/actions.js
@@ -1,5 +1,7 @@
// @flow
+import $ from 'jquery';
+
import { getMultipleVideoSendingSupportFeatureFlag } from '../base/config/functions.any';
import { openDialog } from '../base/dialog';
import { JitsiConferenceEvents } from '../base/lib-jitsi-meet';
@@ -39,7 +41,6 @@ import logger from './logger';
let permissionsReplyListener, receiverEndpointMessageListener, stopListener;
declare var APP: Object;
-declare var $: Function;
/**
* Signals that the remote control authorization dialog should be displayed.
diff --git a/webpack.config.js b/webpack.config.js
index 21d47a90cc..849f4ff88e 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -141,15 +141,6 @@ function getConfig(options = {}) {
]
},
test: /\.jsx?$/
- }, {
- // TODO: get rid of this.
- // Expose jquery as the globals $ and jQuery because it is expected
- // to be available in such a form by lib-jitsi-meet.
- loader: 'expose-loader',
- options: {
- exposes: [ '$', 'jQuery' ]
- },
- test: require.resolve('jquery')
}, {
// Allow CSS to be imported into JavaScript.