Bug 1364888 - Upgrade to AngularJS 1.6

The previous commit switched us away from the deprecated `$http`
callback methods, meaning the only other breaking change that affects
us is the `hashPrefix` change, which we revert by manually setting
it back to the empty string, so that existing URLs still work:
https://docs.angularjs.org/guide/migration#commit-aa077e8

For more details, see:
https://docs.angularjs.org/guide/migration#migrating-from-1-5-to-1-6
https://github.com/angular/angular.js/blob/master/CHANGELOG.md#160-rainbow-tsunami-2016-12-08

Closes #3044.
This commit is contained in:
Ed Morley 2017-12-28 13:43:49 +00:00
Родитель 27e516ff4e
Коммит 3ada44e019
6 изменённых файлов: 42 добавлений и 29 удалений

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

@ -12,13 +12,13 @@
}, },
"dependencies": { "dependencies": {
"ajv": "5.5.2", "ajv": "5.5.2",
"angular": "1.5.11", "angular": "1.6.8",
"angular-clipboard": "1.6.2", "angular-clipboard": "1.6.2",
"angular-local-storage": "0.7.1", "angular-local-storage": "0.7.1",
"angular-marked": "1.2.2", "angular-marked": "1.2.2",
"angular-resource": "1.5.11", "angular-resource": "1.6.8",
"angular-route": "1.5.11", "angular-route": "1.6.8",
"angular-sanitize": "1.5.11", "angular-sanitize": "1.6.8",
"angular-toarrayfilter": "1.0.3", "angular-toarrayfilter": "1.0.3",
"angular-ui-router": "0.4.3", "angular-ui-router": "0.4.3",
"angular1-ui-bootstrap4": "2.4.22", "angular1-ui-bootstrap4": "2.4.22",
@ -57,7 +57,7 @@
"taskcluster-client": "2.5.4" "taskcluster-client": "2.5.4"
}, },
"devDependencies": { "devDependencies": {
"angular-mocks": "1.5.11", "angular-mocks": "1.6.8",
"enzyme": "3.3.0", "enzyme": "3.3.0",
"enzyme-adapter-react-16": "1.1.1", "enzyme-adapter-react-16": "1.1.1",
"jasmine-core": "2.8.0", "jasmine-core": "2.8.0",

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

@ -2,9 +2,14 @@
var failureViewerApp = angular.module('failureviewer', ['treeherder']); var failureViewerApp = angular.module('failureviewer', ['treeherder']);
failureViewerApp.config(['$compileProvider', function ($compileProvider) { failureViewerApp.config(['$compileProvider', '$locationProvider',
function ($compileProvider, $locationProvider) {
// Disable debug data, as recommended by https://docs.angularjs.org/guide/production // Disable debug data, as recommended by https://docs.angularjs.org/guide/production
$compileProvider.debugInfoEnabled(false); $compileProvider.debugInfoEnabled(false);
// Revert to the legacy Angular <=1.5 URL hash prefix to save breaking existing links:
// https://docs.angularjs.org/guide/migration#commit-aa077e8
$locationProvider.hashPrefix('');
}]).run(require('./cache-templates')); }]).run(require('./cache-templates'));
module.exports = failureViewerApp; module.exports = failureViewerApp;

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

@ -2,11 +2,15 @@
var logViewerApp = angular.module('logviewer', ['treeherder']); var logViewerApp = angular.module('logviewer', ['treeherder']);
logViewerApp.config(['$compileProvider', '$resourceProvider', logViewerApp.config(['$compileProvider', '$locationProvider', '$resourceProvider',
function ($compileProvider, $resourceProvider) { function ($compileProvider, $locationProvider, $resourceProvider) {
// Disable debug data, as recommended by https://docs.angularjs.org/guide/production // Disable debug data, as recommended by https://docs.angularjs.org/guide/production
$compileProvider.debugInfoEnabled(false); $compileProvider.debugInfoEnabled(false);
// Revert to the legacy Angular <=1.5 URL hash prefix to save breaking existing links:
// https://docs.angularjs.org/guide/migration#commit-aa077e8
$locationProvider.hashPrefix('');
// Don't strip trailing slashes from calculated URLs // Don't strip trailing slashes from calculated URLs
$resourceProvider.defaults.stripTrailingSlashes = false; $resourceProvider.defaults.stripTrailingSlashes = false;

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

@ -1,11 +1,15 @@
"use strict"; "use strict";
// configure the router here, after we have defined all the controllers etc // configure the router here, after we have defined all the controllers etc
perf.config(['$compileProvider', '$httpProvider', '$stateProvider', '$urlRouterProvider', perf.config(['$compileProvider', '$locationProvider', '$httpProvider', '$stateProvider', '$urlRouterProvider',
function ($compileProvider, $httpProvider, $stateProvider, $urlRouterProvider) { function ($compileProvider, $locationProvider, $httpProvider, $stateProvider, $urlRouterProvider) {
// Disable debug data, as recommended by https://docs.angularjs.org/guide/production // Disable debug data, as recommended by https://docs.angularjs.org/guide/production
$compileProvider.debugInfoEnabled(false); $compileProvider.debugInfoEnabled(false);
// Revert to the legacy Angular <=1.5 URL hash prefix to save breaking existing links:
// https://docs.angularjs.org/guide/migration#commit-aa077e8
$locationProvider.hashPrefix('');
$httpProvider.defaults.xsrfHeaderName = 'X-CSRFToken'; $httpProvider.defaults.xsrfHeaderName = 'X-CSRFToken';
$httpProvider.defaults.xsrfCookieName = 'csrftoken'; $httpProvider.defaults.xsrfCookieName = 'csrftoken';
$httpProvider.useApplyAsync(true); $httpProvider.useApplyAsync(true);

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

@ -5,13 +5,17 @@ var treeherderApp = angular.module('treeherder.app',
'mc.resizer', 'angular-toArrayFilter', 'react', 'mc.resizer', 'angular-toArrayFilter', 'react',
'hc.marked']); 'hc.marked']);
treeherderApp.config(['$compileProvider', '$routeProvider', '$httpProvider', treeherderApp.config(['$compileProvider', '$locationProvider', '$routeProvider', '$httpProvider',
'$logProvider', '$resourceProvider', 'localStorageServiceProvider', '$logProvider', '$resourceProvider', 'localStorageServiceProvider',
function ($compileProvider, $routeProvider, $httpProvider, $logProvider, function ($compileProvider, $locationProvider, $routeProvider, $httpProvider, $logProvider,
$resourceProvider, localStorageServiceProvider) { $resourceProvider, localStorageServiceProvider) {
// Disable debug data, as recommended by https://docs.angularjs.org/guide/production // Disable debug data, as recommended by https://docs.angularjs.org/guide/production
$compileProvider.debugInfoEnabled(false); $compileProvider.debugInfoEnabled(false);
// Revert to the legacy Angular <=1.5 URL hash prefix to save breaking existing links:
// https://docs.angularjs.org/guide/migration#commit-aa077e8
$locationProvider.hashPrefix('');
// Don't strip trailing slashes from calculated URLs // Don't strip trailing slashes from calculated URLs
$resourceProvider.defaults.stripTrailingSlashes = false; $resourceProvider.defaults.stripTrailingSlashes = false;

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

@ -116,21 +116,21 @@ angular-marked@1.2.2:
dependencies: dependencies:
marked "^0.3.3" marked "^0.3.3"
angular-mocks@1.5.11: angular-mocks@1.6.8:
version "1.5.11" version "1.6.8"
resolved "https://registry.yarnpkg.com/angular-mocks/-/angular-mocks-1.5.11.tgz#a0e1dd0ea55fd77ee7a757d75536c5e964c86f81" resolved "https://registry.yarnpkg.com/angular-mocks/-/angular-mocks-1.6.8.tgz#ba2120057b4edaa56492d8789ddfbc8f18afa3c5"
angular-resource@1.5.11: angular-resource@1.6.8:
version "1.5.11" version "1.6.8"
resolved "https://registry.yarnpkg.com/angular-resource/-/angular-resource-1.5.11.tgz#d93ea619184a2e0ee3ae338265758363172929f0" resolved "https://registry.yarnpkg.com/angular-resource/-/angular-resource-1.6.8.tgz#cc2172f8ec4a3a8340c43c600a5fed543e4168af"
angular-route@1.5.11: angular-route@1.6.8:
version "1.5.11" version "1.6.8"
resolved "https://registry.yarnpkg.com/angular-route/-/angular-route-1.5.11.tgz#49614f3a167f54291e449fe8ba05d39c58924b83" resolved "https://registry.yarnpkg.com/angular-route/-/angular-route-1.6.8.tgz#82ace773e7b232bf77768370760244a8caab5d36"
angular-sanitize@1.5.11: angular-sanitize@1.6.8:
version "1.5.11" version "1.6.8"
resolved "https://registry.yarnpkg.com/angular-sanitize/-/angular-sanitize-1.5.11.tgz#ebfb3f343e543f9b2ef050fb4c2e9ee048d1772f" resolved "https://registry.yarnpkg.com/angular-sanitize/-/angular-sanitize-1.6.8.tgz#68175a1a5853a6439fffcb251a88a538a44a8e70"
angular-toarrayfilter@1.0.3: angular-toarrayfilter@1.0.3:
version "1.0.3" version "1.0.3"
@ -146,11 +146,7 @@ angular1-ui-bootstrap4@2.4.22:
version "2.4.22" version "2.4.22"
resolved "https://registry.yarnpkg.com/angular1-ui-bootstrap4/-/angular1-ui-bootstrap4-2.4.22.tgz#378697405c957b96f947f42322f36660cd3fc88d" resolved "https://registry.yarnpkg.com/angular1-ui-bootstrap4/-/angular1-ui-bootstrap4-2.4.22.tgz#378697405c957b96f947f42322f36660cd3fc88d"
angular@1.5.11: angular@1.6.8, angular@^1.0.8:
version "1.5.11"
resolved "https://registry.yarnpkg.com/angular/-/angular-1.5.11.tgz#8c5ba7386f15965c9acf3429f6881553aada30d6"
angular@^1.0.8:
version "1.6.8" version "1.6.8"
resolved "https://registry.yarnpkg.com/angular/-/angular-1.6.8.tgz#5be378a58be91a5489e78b59c4518cd9fd273ffb" resolved "https://registry.yarnpkg.com/angular/-/angular-1.6.8.tgz#5be378a58be91a5489e78b59c4518cd9fd273ffb"