зеркало из https://github.com/mozilla/treeherder.git
Bug 1456894 - Import jQuery explicitly
The last remaining `ProvidePlugin` definition cannot be removed since AngularJS and Flot both expect `window.jQuery` to be defined (and whilst AngularJS falls back to jqLite, it's buggy). It's not possible to set `window.jQuery` manually in the entrypoints, since ES6 imports are hoisted, thereby giving no opportunity to modify window first.
This commit is contained in:
Родитель
f522727087
Коммит
47ac771a84
|
@ -273,9 +273,8 @@ module.exports = neutrino => {
|
|||
neutrino.config
|
||||
.plugin('provide')
|
||||
.use(webpack.ProvidePlugin, {
|
||||
$: require.resolve('jquery'),
|
||||
// Required since AngularJS and jquery.flot don't import jQuery themselves.
|
||||
jQuery: require.resolve('jquery'),
|
||||
'window.$': require.resolve('jquery'),
|
||||
'window.jQuery': require.resolve('jquery'),
|
||||
});
|
||||
|
||||
|
|
|
@ -60,8 +60,6 @@ module.exports = neutrino => {
|
|||
'spaced-comment': 'off',
|
||||
},
|
||||
globals: [
|
||||
'$',
|
||||
'jQuery',
|
||||
'SERVICE_DOMAIN',
|
||||
]
|
||||
}
|
||||
|
|
|
@ -10,7 +10,6 @@ import Adapter from 'enzyme-adapter-react-16';
|
|||
|
||||
// Global variables are set here instead of with webpack.ProvidePlugin
|
||||
// because neutrino removes plugin definitions for karma runs
|
||||
window.$ = jQuery;
|
||||
window.jQuery = jQuery;
|
||||
|
||||
configure({ adapter: new Adapter() });
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import $ from 'jquery';
|
||||
import PropTypes from 'prop-types';
|
||||
import React from 'react';
|
||||
import { react2angular } from 'react2angular/index.es2015';
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import $ from 'jquery';
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { FormGroup } from 'reactstrap';
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import $ from 'jquery';
|
||||
import _ from 'lodash';
|
||||
|
||||
import { thPlatformMap } from '../js/constants';
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import $ from 'jquery';
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { react2angular } from 'react2angular/index.es2015';
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import $ from 'jquery';
|
||||
import _ from 'lodash';
|
||||
|
||||
import treeherder from '../treeherder';
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import $ from 'jquery';
|
||||
import _ from 'lodash';
|
||||
import Mousetrap from 'mousetrap';
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// TODO: Vet/fix the use-before-defines to ensure switching var
|
||||
// to let/const won't break anything.
|
||||
|
||||
import $ from 'jquery';
|
||||
import _ from 'lodash';
|
||||
import angular from 'angular';
|
||||
import Mousetrap from 'mousetrap';
|
||||
|
@ -615,7 +616,7 @@ perf.controller('GraphsCtrl', [
|
|||
resultSetData: _.map(
|
||||
seriesData[series.signature],
|
||||
'push_id'),
|
||||
thSeries: jQuery.extend({}, series),
|
||||
thSeries: $.extend({}, series),
|
||||
jobIdData: _.map(seriesData[series.signature], 'job_id'),
|
||||
idData: _.map(seriesData[series.signature], 'id')
|
||||
};
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import $ from 'jquery';
|
||||
|
||||
import treeherder from '../../treeherder';
|
||||
import lvLogStepsTemplate from '../../../partials/logviewer/lvLogSteps.html';
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import $ from 'jquery';
|
||||
|
||||
import treeherder from '../../treeherder';
|
||||
import thWatchedRepoTemplate from '../../../partials/main/thWatchedRepo.html';
|
||||
import thWatchedRepoInfoDropDownTemplate from '../../../partials/main/thWatchedRepoInfoDropDown.html';
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import $ from 'jquery';
|
||||
import _ from 'lodash';
|
||||
import angular from 'angular';
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import $ from 'jquery';
|
||||
import angular from 'angular';
|
||||
|
||||
import treeherder from '../treeherder';
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import $ from 'jquery';
|
||||
import angular from 'angular';
|
||||
|
||||
import treeherder from '../treeherder';
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import $ from 'jquery';
|
||||
import _ from 'lodash';
|
||||
import jsyaml from 'js-yaml';
|
||||
import { Queue, slugid } from 'taskcluster-client-web';
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import $ from 'jquery';
|
||||
import _ from 'lodash';
|
||||
import Mousetrap from 'mousetrap';
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import $ from 'jquery';
|
||||
import _ from 'lodash';
|
||||
import angular from 'angular';
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче