Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normalized jquery bundle #6970

Merged
merged 2 commits into from
Nov 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions client/galaxy/scripts/libs/jquery.custom.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* jQuery and all its horrible plugins. Bundled together and repackaged into a
* single module, then aliased by webpack as "jquery";
*/

var jQuery = require("jqueryVendor");

require("imports-loader?jQuery=jqueryVendor!libs/jquery/jquery.autocomplete");
require("imports-loader?jQuery=jqueryVendor!libs/jquery/jquery.event.hover");
require("imports-loader?jQuery=jqueryVendor!libs/jquery/jquery.event.drag");
require("imports-loader?jQuery=jqueryVendor!libs/jquery/jquery.event.drop");
require("imports-loader?jQuery=jqueryVendor,define=>false!jquery-mousewheel");
require("imports-loader?jQuery=jqueryVendor!libs/jquery/jquery.form");
require("imports-loader?jQuery=jqueryVendor!libs/jquery/jquery.rating");
require("imports-loader?jQuery=jqueryVendor!libs/jquery/select2");
require("imports-loader?jQuery=jqueryVendor!libs/jquery/jquery-ui");
require("imports-loader?jQuery=jqueryVendor!libs/jquery/jstorage");
require("imports-loader?jQuery=jqueryVendor!libs/farbtastic");
require("imports-loader?jQuery=jqueryVendor,$=jqueryVendor,define=>false!jquery.cookie");
require("imports-loader?jQuery=jqueryVendor!libs/jquery/jquery.dynatree");
require("imports-loader?jQuery=jqueryVendor!jquery.complexify");
require("imports-loader?jQuery=jqueryVendor!jquery-migrate");

module.exports = jQuery;
19 changes: 0 additions & 19 deletions client/galaxy/scripts/onload/index.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,6 @@
/* global $, _, Galaxy */

import "polyfills";

// Jquery and all its horrible plugins
import "jquery-migrate";
/* we really need to get rid of these jquery plugins */
import "libs/jquery/jquery.autocomplete";
import "libs/jquery/jquery.event.hover";
import "libs/jquery/jquery.event.drag";
import "libs/jquery/jquery.event.drop";
import "jquery-mousewheel";
import "libs/jquery/jquery.form";
import "libs/jquery/jquery.rating";
import "libs/jquery/select2";
import "libs/jquery/jquery-ui";
import "libs/jquery/jstorage";
import "libs/farbtastic";
import "jquery.cookie";
import "libs/jquery/jquery.dynatree";
import "jquery.complexify";

// Bootstrap overwrites .tooltip() method, so load it after jquery-ui
import "bootstrap";
import "bootstrap-tour";
Expand Down
2 changes: 1 addition & 1 deletion client/galaxy/scripts/qunit/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ import jd from "qunit/tests/job_dag_tests";
import hc from "qunit/tests/history_contents_model_tests";
import hda from "qunit/tests/hda_base_tests";
import modal from "qunit/tests/modal_tests";
// import page from "qunit/tests/page_tests";
import page from "qunit/tests/page_tests";
import utils from "qunit/tests/utils_tests";
import ui from "qunit/tests/ui_tests";
4 changes: 3 additions & 1 deletion client/galaxy/scripts/qunit/tests/page_tests.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* global QUnit */

import _ from "underscore";
import $ from "jquery";
import Backbone from "backbone";
import testApp from "qunit/test-app";
import Page from "layout/page";

Expand Down
5 changes: 3 additions & 2 deletions client/galaxy/scripts/utils/installMonitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export function installMonitor(globalProp, fallbackValue = null) {
logger.groupCollapsed(`${label} write...`, newValue);
logger.trace();
logger.groupEnd();
return (window._monitorStorage[globalProp] = newValue);
window._monitorStorage[globalProp] = newValue;
}
});
} catch (err) {
Expand Down Expand Up @@ -76,7 +76,8 @@ export function installMonitor(globalProp, fallbackValue = null) {
logger.log("target?", target);
logger.trace();
logger.groupEnd();
return (target[prop] = val);
target[prop] = val;
return true;
}
}
);
Expand Down
12 changes: 8 additions & 4 deletions client/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ let buildconfig = {
chunkFilename: "[name].chunk.js"
},
resolve: {
modules: [scriptsBase, "node_modules", styleBase, imageBase]
modules: [scriptsBase, "node_modules", styleBase, imageBase],
alias: {
jquery$: `${libsBase}/jquery.custom.js`,
jqueryVendor$: `${libsBase}/jquery/jquery.js`
}
},
optimization: {
splitChunks: {
Expand Down Expand Up @@ -61,7 +65,7 @@ let buildconfig = {
options: { babelrc: true }
},
{
test: require.resolve("jquery"),
test: `${libsBase}/jquery.custom.js`,
use: [
{
loader: "expose-loader",
Expand Down Expand Up @@ -149,8 +153,8 @@ let buildconfig = {
// this plugin allows using the following keys/globals in scripts (w/o req'ing them first)
// and webpack will automagically require them in the bundle for you
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery",
$: `${libsBase}/jquery.custom.js`,
jQuery: `${libsBase}/jquery.custom.js`,
_: "underscore",
Backbone: "backbone",
Galaxy: ["galaxy.monitor", "default"]
Expand Down
1 change: 1 addition & 0 deletions client/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12876,6 +12876,7 @@ vue-loader@^15.2.4, vue-loader@^15.4.2:
vue-router@3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-3.0.1.tgz#d9b05ad9c7420ba0f626d6500d693e60092cc1e9"
integrity sha512-vLLoY452L+JBpALMP5UHum9+7nzR9PeIBCghU9ZtJ1eWm6ieUI8Zb/DI3MYxH32bxkjzYV1LRjNv4qr8d+uX/w==

vue-style-loader@^3.0.1:
version "3.1.2"
Expand Down