build(docs-infra): update Angular framework, Material and CLI to latest methods (#40994)

This commit updates the Angular framework, Angular CDK/Material and
Angular CLI to latest stable versions (11.2.3, 11.2.2 and 11.2.2
respectively).

This update also fixes a Lighthouse audit fail due to
`@angular/core@11.0.0` being identified as vulnerable to XSS:
https://snyk.io/vuln/SNYK-JS-ANGULARCORE-1070902

Regarding the payload size increases, they are mostly attributed to
Angular Material:
- Before this commit:     448461 B
- After framework update: 448554 B ( +93 B)
- After Material update:  449292 B (+738 B)
- After CLI update:       449310 B ( +18 B)

PR Close #40994
This commit is contained in:
George Kalpakas 2021-03-01 13:25:37 +02:00 committed by Zach Arend
parent 6e40551394
commit 21f0deeaa6
7 changed files with 1248 additions and 1096 deletions

View File

@ -20,10 +20,17 @@ module.exports = function (config) {
client: {
clearContext: false, // leave Jasmine Spec Runner output visible in browser
jasmine: {
// you can add configuration options for Jasmine here
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
// for example, you can disable the random execution with `random: false`
// or set a specific seed with `seed: 4321`
random: true,
seed: '',
},
},
jasmineHtmlReporter: {
suppressAll: true // removes the duplicated traces
},
coverageReporter: {
dir: require('path').join(__dirname, './coverage/site'),
subdir: '.',

View File

@ -88,27 +88,27 @@
},
"private": true,
"dependencies": {
"@angular/animations": "11.0.0",
"@angular/cdk": "11.0.0",
"@angular/common": "11.0.0",
"@angular/compiler": "11.0.0",
"@angular/core": "11.0.0",
"@angular/elements": "11.0.0",
"@angular/forms": "11.0.0",
"@angular/material": "11.0.0",
"@angular/platform-browser": "11.0.0",
"@angular/platform-browser-dynamic": "11.0.0",
"@angular/router": "11.0.0",
"@angular/service-worker": "11.0.0",
"@angular/animations": "11.2.3",
"@angular/cdk": "11.2.2",
"@angular/common": "11.2.3",
"@angular/compiler": "11.2.3",
"@angular/core": "11.2.3",
"@angular/elements": "11.2.3",
"@angular/forms": "11.2.3",
"@angular/material": "11.2.2",
"@angular/platform-browser": "11.2.3",
"@angular/platform-browser-dynamic": "11.2.3",
"@angular/router": "11.2.3",
"@angular/service-worker": "11.2.3",
"@webcomponents/custom-elements": "1.2.1",
"rxjs": "^6.5.3",
"tslib": "^2.0.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "0.1100.1",
"@angular/cli": "11.0.1",
"@angular/compiler-cli": "11.0.0",
"@angular-devkit/build-angular": "0.1102.2",
"@angular/cli": "11.2.2",
"@angular/compiler-cli": "11.2.3",
"@types/jasmine": "~3.6.0",
"@types/lunr": "^2.3.2",
"@types/node": "^12.7.9",
@ -141,7 +141,7 @@
"jsdom": "^9.12.0",
"json-schema-traverse": "^0.4.1",
"json5": "^1.0.1",
"karma": "~5.1.1",
"karma": "~6.1.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.0.3",
"karma-jasmine": "~4.0.0",
@ -165,7 +165,7 @@
"tree-kill": "^1.1.0",
"ts-node": "^8.4.1",
"tslint": "~6.1.0",
"typescript": "~4.0.2",
"typescript": "~4.1.2",
"uglify-js": "^3.0.15",
"unist-util-filter": "^0.2.1",
"unist-util-source": "^1.0.1",

View File

@ -468,18 +468,34 @@ describe('ScrollService', () => {
}));
it('should stop updating the stored location href', () => {
const triggerBeforeunloadEvent = () => {
// Karma adds an `onbeforeunload` listener to detect whether the tests do a full page reload
// (and report it as an error). This test tests functionality that requires emitting a
// `beforeunload` event.
// To stop Karma from erroring, we replace Karma's `onbeforeunload` listener and restore it
// after the fake event has been emitted.
const originalOnbeforeunload = window.onbeforeunload;
window.onbeforeunload = () => undefined;
try {
window.dispatchEvent(new Event('beforeunload'));
} finally {
window.onbeforeunload = originalOnbeforeunload;
}
};
const updateScrollLocationHrefSpy = spyOn(scrollService, 'updateScrollLocationHref');
window.dispatchEvent(new Event('beforeunload'));
triggerBeforeunloadEvent();
expect(updateScrollLocationHrefSpy).toHaveBeenCalledTimes(1);
window.dispatchEvent(new Event('beforeunload'));
triggerBeforeunloadEvent();
expect(updateScrollLocationHrefSpy).toHaveBeenCalledTimes(2);
updateScrollLocationHrefSpy.calls.reset();
scrollService.ngOnDestroy();
window.dispatchEvent(new Event('beforeunload'));
triggerBeforeunloadEvent();
expect(updateScrollLocationHrefSpy).not.toHaveBeenCalled();
});

View File

@ -18,7 +18,9 @@
* BROWSER POLYFILLS
*/
/** IE11 requires the following for NgClass support on SVG elements */
/**
* IE11 requires the following for NgClass support on SVG elements
*/
// import 'classlist.js'; // Run `npm install --save classlist.js`.
/**

View File

@ -36,6 +36,7 @@
"tools"
],
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,
"disableTypeScriptVersionCheck": true,
"strictInjectionParameters": true,
"strictInputAccessModifiers": true,

File diff suppressed because it is too large Load Diff

View File

@ -3,7 +3,7 @@
"master": {
"uncompressed": {
"runtime-es2015": 3033,
"main-es2015": 448427,
"main-es2015": 449310,
"polyfills-es2015": 52343
}
}
@ -12,7 +12,7 @@
"master": {
"uncompressed": {
"runtime-es2015": 3033,
"main-es2015": 448936,
"main-es2015": 449759,
"polyfills-es2015": 52493
}
}
@ -21,7 +21,7 @@
"master": {
"uncompressed": {
"runtime-es2015": 3153,
"main-es2015": 434502,
"main-es2015": 435362,
"polyfills-es2015": 52493
}
}