Skip to content

Commit 2807eb9

Browse files
committed
feat: use jquery package
1 parent 4204281 commit 2807eb9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+136
-27
lines changed

gulpfile.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,7 @@ function dist_rollup() {
403403
// I will be picked up by rollup and bundled accordingly.
404404
'js/main_cordova': 'src/js/main_cordova.js',
405405
'js/utils/common': 'src/js/utils/common.js',
406+
'js/jquery': 'src/js/jquery.js',
406407
'js/main': 'src/js/main.js',
407408
'js/tabs/receiver_msp': 'src/js/tabs/receiver_msp.js',
408409
},
@@ -437,8 +438,16 @@ function dist_rollup() {
437438
sourcemap: true,
438439
// put any 3rd party module in vendor.js
439440
manualChunks(id) {
441+
/**
442+
* This splits every npm module loaded in into it's own package
443+
* to preserve the loading order. This is to prevent issues
444+
* where after bundling some modules are loaded in the wrong order.
445+
*/
440446
if (id.includes('node_modules')) {
441-
return 'vendor';
447+
const parts = id.split(/[\\/]/);
448+
const nodeModulesIndex = parts.indexOf('node_modules');
449+
const packageName = parts[nodeModulesIndex + 1];
450+
return packageName;
442451
}
443452
},
444453
dir: DIST_DIR,

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@
6363
"i18next-xhr-backend": "^3.2.2",
6464
"inflection": "^1.13.4",
6565
"jbox": "^1.3.3",
66-
"jquery": "^3.6.1",
66+
"jquery": "^3.6.3",
6767
"jquery-textcomplete": "^1.8.5",
6868
"jquery-touchswipe": "^1.6.19",
69-
"jquery-ui-npm": "^1.12.0",
69+
"jquery-ui": "^1.13.2",
7070
"jsdom": "^21.0.0",
7171
"lodash.debounce": "^4.0.8",
7272
"marked": "^4.1.1",
@@ -135,6 +135,9 @@
135135
"optionalDependencies": {
136136
"appdmg": "^0.6.4"
137137
},
138+
"resolutions": {
139+
"jquery": "3.6.3"
140+
},
138141
"husky": {
139142
"hooks": {
140143
"pre-commit": "yarn lint"

src/components/EscDshotDirection/EscDshotDirectionComponent.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import DshotCommand from "../../js/utils/DshotCommand.js";
66
import FC from "../../js/fc.js";
77
import { API_VERSION_1_44 } from '../../js/data_storage.js';
88
import { getMixerImageSrc } from "../../js/utils/common.js";
9+
import $ from "jquery";
910

1011
class EscDshotDirectionComponent
1112
{

src/components/MotorOutputReordering/MotorOutputReorderingComponent.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import FC from "../../js/fc";
88
import { gui_log } from "../../js/gui_log";
99
import { i18n } from "../../js/localization";
1010
import GUI, { TABS } from "../../js/gui";
11+
import $ from "jquery";
1112

1213
export default class MotorOutputReorderComponent
1314
{

src/js/Analytics.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import googleAnalytics from 'universal-ga';
33
import { set as setConfig, get as getConfig } from './ConfigStorage';
44
import GUI from './gui';
55
import CONFIGURATOR from './data_storage';
6+
import $ from 'jquery';
67

78
let tracking = null;
89
export { tracking };

src/js/Beepers.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { bit_check, bit_clear, bit_set } from './bit';
2+
import $ from 'jquery';
23

34
class Beepers {
45
constructor(config, supportedConditions) {

src/js/BuildApi.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { gui_log } from './gui_log';
22
import { i18n } from "./localization";
33
import { get as getStorage, set as setStorage } from "./SessionStorage";
4+
import $ from 'jquery';
45

56
export default class BuildApi {
67

src/js/CliAutoComplete.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import CONFIGURATOR from './data_storage';
33
import FC from './fc';
44
import semver from 'semver';
55
import { tracking } from './Analytics';
6+
import $ from 'jquery';
67

78
/**
89
* Encapsulates the AutoComplete logic

src/js/DarkTheme.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import GUI from "./gui";
22
import windowWatcherUtil from "./utils/window_watchers";
33
import { checkSetupAnalytics } from "./Analytics";
4+
import $ from 'jquery';
45

56
const css_dark = [
67
'./css/dark-theme.css',

src/js/Features.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { bit_check, bit_set, bit_clear } from "./bit";
22
import { API_VERSION_1_44, API_VERSION_1_45 } from './data_storage';
33
import semver from "semver";
44
import { tracking } from "./Analytics";
5+
import $ from 'jquery';
56

67
const Features = function (config) {
78
const self = this;

0 commit comments

Comments
 (0)