Browse Source

feat(build) embed jquery slim

Avoid needing an external dependency.
tags/v0.0.2
Saúl Ibarra Corretgé 2 years ago
parent
commit
e1ca2f5a7b

+ 1
- 2
JitsiConference.js View File

@@ -1,7 +1,6 @@
1
-/* global $ */
2
-
3 1
 import { getLogger } from '@jitsi/logger';
4 2
 import EventEmitter from 'events';
3
+import $ from 'jquery';
5 4
 import isEqual from 'lodash.isequal';
6 5
 import { Strophe } from 'strophe.js';
7 6
 

+ 1
- 1
karma.conf.js View File

@@ -14,8 +14,8 @@ module.exports = function(config) {
14 14
 
15 15
         // list of files / patterns to load in the browser
16 16
         files: [
17
-            'https://code.jquery.com/jquery-3.5.1.min.js',
18 17
             'node_modules/core-js/index.js',
18
+            'node_modules/jquery/dist/jquery.slim.min.js',
19 19
             './modules/**/*.spec.js',
20 20
             './modules/**/*.spec.ts',
21 21
             './service/**/*.spec.ts',

+ 1
- 2
modules/sdp/SDP.js View File

@@ -1,5 +1,4 @@
1
-/* global $ */
2
-
1
+import $ from 'jquery';
3 2
 import clonedeep from 'lodash.clonedeep';
4 3
 import transform from 'sdp-transform';
5 4
 

+ 1
- 2
modules/xmpp/Caps.js View File

@@ -1,5 +1,4 @@
1
-/* global $ */
2
-
1
+import $ from 'jquery';
3 2
 import { b64_sha1, Strophe } from 'strophe.js'; // eslint-disable-line camelcase
4 3
 
5 4
 import { XMPPEvents } from '../../service/xmpp/XMPPEvents';

+ 1
- 2
modules/xmpp/ChatRoom.js View File

@@ -1,6 +1,5 @@
1
-/* global $ */
2
-
3 1
 import { getLogger } from '@jitsi/logger';
2
+import $ from 'jquery';
4 3
 import isEqual from 'lodash.isequal';
5 4
 import { $iq, $msg, $pres, Strophe } from 'strophe.js';
6 5
 

+ 1
- 2
modules/xmpp/JingleHelperFunctions.js View File

@@ -1,6 +1,5 @@
1
-/* global $ */
2
-
3 1
 import { getLogger } from '@jitsi/logger';
2
+import $ from 'jquery';
4 3
 import { $build } from 'strophe.js';
5 4
 
6 5
 import { MediaType } from '../../service/RTC/MediaType';

+ 1
- 2
modules/xmpp/JingleSessionPC.js View File

@@ -1,6 +1,5 @@
1
-/* global $ */
2
-
3 1
 import { getLogger } from '@jitsi/logger';
2
+import $ from 'jquery';
4 3
 import { $iq, Strophe } from 'strophe.js';
5 4
 
6 5
 import * as CodecMimeType from '../../service/RTC/CodecMimeType';

+ 4
- 3
modules/xmpp/JingleSessionPC.spec.js View File

@@ -1,4 +1,5 @@
1
-/* global $, jQuery */
1
+import $ from 'jquery';
2
+
2 3
 import { MockRTC } from '../RTC/MockClasses';
3 4
 import FeatureFlags from '../flags/FeatureFlags';
4 5
 
@@ -14,7 +15,7 @@ import { MockChatRoom, MockStropheConnection } from './MockClasses';
14 15
  * @returns {jQuery}
15 16
  */
16 17
 function createContentModify(senders = 'both', maxFrameHeight) {
17
-    const modifyContentsIq = jQuery.parseXML(
18
+    const modifyContentsIq = $.parseXML(
18 19
         '<jingle action="content-modify" initiator="peer2" sid="sid12345" xmlns="urn:xmpp:jingle:1">'
19 20
         + `<content name="video" senders="${senders}">`
20 21
         + `<max-frame-height xmlns="http://jitsi.org/jitmeet/video">${maxFrameHeight}</max-frame-height>`
@@ -29,7 +30,7 @@ function createContentModify(senders = 'both', maxFrameHeight) {
29 30
  * @returns {jQuery}
30 31
  */
31 32
 function createContentModifyForSourceNames() {
32
-    const modifyContentsIq = jQuery.parseXML(
33
+    const modifyContentsIq = $.parseXML(
33 34
         '<jingle action="content-modify" initiator="peer2" sid="sid12345" xmlns="urn:xmpp:jingle:1">'
34 35
         + '<content name="video" senders="both">'
35 36
         + '<source-frame-height maxHeight="180" sourceName="8d519815-v0" xmlns="http://jitsi.org/jitmeet/video"/>'

+ 1
- 2
modules/xmpp/moderator.js View File

@@ -1,6 +1,5 @@
1
-/* global $ */
2
-
3 1
 import { getLogger } from '@jitsi/logger';
2
+import $ from 'jquery';
4 3
 import { $iq, Strophe } from 'strophe.js';
5 4
 
6 5
 import Settings from '../settings/Settings';

+ 1
- 2
modules/xmpp/strophe.emuc.js View File

@@ -1,6 +1,5 @@
1
-/* global $ */
2
-
3 1
 import { getLogger } from '@jitsi/logger';
2
+import $ from 'jquery';
4 3
 import { Strophe } from 'strophe.js';
5 4
 
6 5
 import { XMPPEvents } from '../../service/xmpp/XMPPEvents';

+ 1
- 2
modules/xmpp/strophe.jingle.js View File

@@ -1,6 +1,5 @@
1
-/* global $ */
2
-
3 1
 import { getLogger } from '@jitsi/logger';
2
+import $ from 'jquery';
4 3
 import { $iq, Strophe } from 'strophe.js';
5 4
 
6 5
 import { MediaType } from '../../service/RTC/MediaType';

+ 1
- 2
modules/xmpp/strophe.rayo.js View File

@@ -1,6 +1,5 @@
1
-/* global $ */
2
-
3 1
 import { getLogger } from '@jitsi/logger';
2
+import $ from 'jquery';
4 3
 import { $iq } from 'strophe.js';
5 4
 
6 5
 import ConnectionPlugin from './ConnectionPlugin';

+ 1
- 2
modules/xmpp/xmpp.js View File

@@ -1,6 +1,5 @@
1
-/* global $ */
2
-
3 1
 import { getLogger } from '@jitsi/logger';
2
+import $ from 'jquery';
4 3
 import { $msg, Strophe } from 'strophe.js';
5 4
 import 'strophejs-plugin-disco';
6 5
 

+ 11
- 0
package-lock.json View File

@@ -16,6 +16,7 @@
16 16
         "async": "3.2.3",
17 17
         "base64-js": "1.3.1",
18 18
         "current-executing-script": "0.1.3",
19
+        "jquery": "3.6.1",
19 20
         "lodash.clonedeep": "4.5.0",
20 21
         "lodash.debounce": "4.0.8",
21 22
         "lodash.isequal": "4.5.0",
@@ -4565,6 +4566,11 @@
4565 4566
         "url": "https://github.com/chalk/supports-color?sponsor=1"
4566 4567
       }
4567 4568
     },
4569
+    "node_modules/jquery": {
4570
+      "version": "3.6.1",
4571
+      "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.6.1.tgz",
4572
+      "integrity": "sha512-opJeO4nCucVnsjiXOE+/PcCgYw9Gwpvs/a6B1LL/lQhwWwpbVEVYDZ1FokFr8PRc7ghYlrFPuyHuiiDNTQxmcw=="
4573
+    },
4568 4574
     "node_modules/js-md5": {
4569 4575
       "version": "0.7.3",
4570 4576
       "resolved": "https://registry.npmjs.org/js-md5/-/js-md5-0.7.3.tgz",
@@ -10276,6 +10282,11 @@
10276 10282
         }
10277 10283
       }
10278 10284
     },
10285
+    "jquery": {
10286
+      "version": "3.6.1",
10287
+      "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.6.1.tgz",
10288
+      "integrity": "sha512-opJeO4nCucVnsjiXOE+/PcCgYw9Gwpvs/a6B1LL/lQhwWwpbVEVYDZ1FokFr8PRc7ghYlrFPuyHuiiDNTQxmcw=="
10289
+    },
10279 10290
     "js-md5": {
10280 10291
       "version": "0.7.3",
10281 10292
       "resolved": "https://registry.npmjs.org/js-md5/-/js-md5-0.7.3.tgz",

+ 1
- 0
package.json View File

@@ -23,6 +23,7 @@
23 23
     "async": "3.2.3",
24 24
     "base64-js": "1.3.1",
25 25
     "current-executing-script": "0.1.3",
26
+    "jquery": "3.6.1",
26 27
     "lodash.clonedeep": "4.5.0",
27 28
     "lodash.debounce": "4.0.8",
28 29
     "lodash.isequal": "4.5.0",

+ 5
- 2
webpack-shared-config.js View File

@@ -11,6 +11,9 @@ module.exports = (minimize, analyzeBundle) => {
11 11
         // The inline-source-map is used to allow debugging the unit tests with Karma
12 12
         devtool: minimize ? 'source-map' : 'inline-source-map',
13 13
         resolve: {
14
+            alias: {
15
+                'jquery': require.resolve('jquery/dist/jquery.slim.min.js')
16
+            },
14 17
             extensions: [ '', '.js', '.ts' ]
15 18
         },
16 19
         mode: minimize ? 'production' : 'development',
@@ -72,8 +75,8 @@ module.exports = (minimize, analyzeBundle) => {
72 75
         },
73 76
         performance: {
74 77
             hints: minimize ? 'error' : false,
75
-            maxAssetSize: 750 * 1024,
76
-            maxEntrypointSize: 750 * 1024
78
+            maxAssetSize: 825 * 1024,
79
+            maxEntrypointSize: 825 * 1024
77 80
         },
78 81
         plugins: [
79 82
             analyzeBundle

Loading…
Cancel
Save