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:
Ed Morley 2018-04-21 19:07:56 +01:00
Родитель f522727087
Коммит 47ac771a84
18 изменённых файлов: 19 добавлений и 6 удалений

Просмотреть файл

@ -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';