瀏覽代碼

feat(build) embed jquery slim

Avoid needing an external dependency.
dev1
Saúl Ibarra Corretgé 2 年之前
父節點
當前提交
e1ca2f5a7b

+ 1
- 2
JitsiConference.js 查看文件

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

+ 1
- 1
karma.conf.js 查看文件

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

+ 1
- 2
modules/sdp/SDP.js 查看文件

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

+ 1
- 2
modules/xmpp/Caps.js 查看文件

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

+ 1
- 2
modules/xmpp/ChatRoom.js 查看文件

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

+ 1
- 2
modules/xmpp/JingleHelperFunctions.js 查看文件

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

+ 1
- 2
modules/xmpp/JingleSessionPC.js 查看文件

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

+ 4
- 3
modules/xmpp/JingleSessionPC.spec.js 查看文件

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

+ 1
- 2
modules/xmpp/moderator.js 查看文件

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

+ 1
- 2
modules/xmpp/strophe.emuc.js 查看文件

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

+ 1
- 2
modules/xmpp/strophe.jingle.js 查看文件

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

+ 1
- 2
modules/xmpp/strophe.rayo.js 查看文件

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

+ 1
- 2
modules/xmpp/xmpp.js 查看文件

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

+ 11
- 0
package-lock.json 查看文件

16
         "async": "3.2.3",
16
         "async": "3.2.3",
17
         "base64-js": "1.3.1",
17
         "base64-js": "1.3.1",
18
         "current-executing-script": "0.1.3",
18
         "current-executing-script": "0.1.3",
19
+        "jquery": "3.6.1",
19
         "lodash.clonedeep": "4.5.0",
20
         "lodash.clonedeep": "4.5.0",
20
         "lodash.debounce": "4.0.8",
21
         "lodash.debounce": "4.0.8",
21
         "lodash.isequal": "4.5.0",
22
         "lodash.isequal": "4.5.0",
4565
         "url": "https://github.com/chalk/supports-color?sponsor=1"
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
     "node_modules/js-md5": {
4574
     "node_modules/js-md5": {
4569
       "version": "0.7.3",
4575
       "version": "0.7.3",
4570
       "resolved": "https://registry.npmjs.org/js-md5/-/js-md5-0.7.3.tgz",
4576
       "resolved": "https://registry.npmjs.org/js-md5/-/js-md5-0.7.3.tgz",
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
     "js-md5": {
10290
     "js-md5": {
10280
       "version": "0.7.3",
10291
       "version": "0.7.3",
10281
       "resolved": "https://registry.npmjs.org/js-md5/-/js-md5-0.7.3.tgz",
10292
       "resolved": "https://registry.npmjs.org/js-md5/-/js-md5-0.7.3.tgz",

+ 1
- 0
package.json 查看文件

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

+ 5
- 2
webpack-shared-config.js 查看文件

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

Loading…
取消
儲存