Skip to content

Commit 84a4d06

Browse files
committed
chore: update to Angular 11 and TypeScript 4
1 parent 304d231 commit 84a4d06

File tree

8 files changed

+90
-75
lines changed

8 files changed

+90
-75
lines changed

.browserslistrc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
2+
# For additional information regarding the format and rule options, please see:
3+
# https://github.com/browserslist/browserslist#queries
4+
5+
# For the full list of supported browsers by the Angular framework, please see:
6+
# https://angular.io/guide/browser-support
7+
8+
# You can see what browsers were selected by your queries by running:
9+
# npx browserslist
10+
11+
last 1 Chrome version
12+
last 1 Firefox version
13+
last 2 Edge major versions
14+
last 2 Safari major versions
15+
last 2 iOS major versions
16+
Firefox ESR
17+
IE 11 # Angular supports IE 11 only as an opt-in. To opt-out, add the 'not' prefix on this line.

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ CoreUI is meant to be the UX game changer. Pure & transparent code is devoid of
4141
- [Prerequisites](#prerequisites)
4242
- [Node.js](#nodejs)
4343
- [Angular CLI](#angular-cli)
44-
- [Update to Angular 9](#update-to-angular-9)
44+
- [Update to Angular 11](#update-to-angular-9)
4545
- [Installation](#installation)
4646
- [Clone repo](#clone-repo)
4747
- [Usage](#usage)
@@ -62,7 +62,6 @@ CoreUI is built on top of Bootstrap 4 and supports popular frameworks.
6262
* [CoreUI Free Bootstrap Admin Template](https://github.com/coreui/coreui-free-bootstrap-admin-template)
6363
* [CoreUI Free Bootstrap Admin Template (Ajax)](https://github.com/coreui/coreui-free-bootstrap-admin-template-ajax)
6464
* [CoreUI Free Angular 2+ Admin Template](https://github.com/coreui/coreui-free-angular-admin-template)
65-
* 🚧 CoreUI Free .NET Core 2 Admin Template (Available Soon)
6665
* [CoreUI Free React.js Admin Template](https://github.com/coreui/coreui-free-react-admin-template)
6766
* [CoreUI Free Vue.js Admin Template](https://github.com/coreui/coreui-free-vue-admin-template)
6867

@@ -84,7 +83,7 @@ CoreUI is built on top of Bootstrap 4 and supports popular frameworks.
8483
Before you begin, make sure your development environment includes `Node.js®` and an `npm` package manager.
8584

8685
###### Node.js
87-
Angular 9 requires `Node.js` version 10.13 or later.
86+
Angular 11 requires `Node.js` version 10.13 or later.
8887

8988
- To check your version, run `node -v` in a terminal/console window.
9089
- To get `Node.js`, go to [nodejs.org](https://nodejs.org/).
@@ -95,8 +94,8 @@ Install the Angular CLI globally using a terminal/console window.
9594
npm install -g @angular/cli
9695
```
9796

98-
##### Update to Angular 9
99-
Angular 9 requires `Node.js` version 10.x or newer
97+
##### Update to Angular 11
98+
Angular 11 requires `Node.js` version 10.13 or newer
10099
Update guide - see: [https://update.angular.io](https://update.angular.io)
101100

102101
## Installation

angular.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
"optimization": true,
4949
"outputHashing": "all",
5050
"sourceMap": false,
51-
"extractCss": true,
5251
"namedChunks": false,
5352
"aot": true,
5453
"extractLicenses": true,

karma.conf.js

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,28 @@ module.exports = function (config) {
99
require('karma-jasmine'),
1010
require('karma-chrome-launcher'),
1111
require('karma-jasmine-html-reporter'),
12-
require('karma-coverage-istanbul-reporter'),
12+
require('karma-coverage'),
1313
require('@angular-devkit/build-angular/plugins/karma')
1414
],
15-
client:{
15+
client: {
16+
jasmine: {
17+
// you can add configuration options for Jasmine here
18+
// the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
19+
// for example, you can disable the random execution with `random: false`
20+
// or set a specific seed with `seed: 4321`
21+
},
1622
clearContext: false // leave Jasmine Spec Runner output visible in browser
1723
},
18-
coverageIstanbulReporter: {
19-
dir: require('path').join(__dirname, 'coverage'), reports: [ 'html', 'lcovonly' ],
20-
fixWebpackSourcePaths: true
24+
jasmineHtmlReporter: {
25+
suppressAll: true // removes the duplicated traces
26+
},
27+
coverageReporter: {
28+
dir: require('path').join(__dirname, '../../coverage'),
29+
subdir: '.',
30+
reporters: [
31+
{ type: 'html' },
32+
{ type: 'text-summary' }
33+
]
2134
},
2235
angularCli: {
2336
environment: 'dev'
@@ -28,6 +41,7 @@ module.exports = function (config) {
2841
logLevel: config.LOG_INFO,
2942
autoWatch: true,
3043
browsers: ['Chrome'],
31-
singleRun: false
44+
singleRun: false,
45+
restartOnFileChange: true
3246
});
3347
};

package.json

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@
2828
},
2929
"private": true,
3030
"dependencies": {
31-
"@angular/animations": "^10.2.4",
32-
"@angular/cdk": "^10.2.7",
33-
"@angular/common": "^10.2.4",
34-
"@angular/compiler": "^10.2.4",
35-
"@angular/core": "^10.2.4",
36-
"@angular/forms": "^10.2.4",
37-
"@angular/localize": "^10.2.4",
38-
"@angular/platform-browser": "^10.2.4",
39-
"@angular/platform-browser-dynamic": "^10.2.4",
40-
"@angular/router": "^10.2.4",
41-
"@coreui/angular": "~2.10.0",
31+
"@angular/animations": "^11.0.9",
32+
"@angular/cdk": "^11.0.4",
33+
"@angular/common": "^11.0.9",
34+
"@angular/compiler": "^11.0.9",
35+
"@angular/core": "^11.0.9",
36+
"@angular/forms": "^11.0.9",
37+
"@angular/localize": "^11.0.9",
38+
"@angular/platform-browser": "^11.0.9",
39+
"@angular/platform-browser-dynamic": "^11.0.9",
40+
"@angular/router": "^11.0.9",
41+
"@coreui/angular": "~2.11.0",
4242
"@coreui/coreui": "^2.1.16",
4343
"@coreui/coreui-plugin-chartjs-custom-tooltips": "^1.3.1",
4444
"@coreui/icons": "^2.0.0-rc.0",
@@ -49,7 +49,6 @@
4949
"core-js": "^3.8.2",
5050
"flag-icon-css": "^3.5.0",
5151
"font-awesome": "^4.7.0",
52-
"mutationobserver-shim": "^0.3.7",
5352
"ng2-charts": "^2.4.2",
5453
"ngx-bootstrap": "^6.2.0",
5554
"ngx-perfect-scrollbar": "^10.1.0",
@@ -61,25 +60,25 @@
6160
"zone.js": "~0.10.3"
6261
},
6362
"devDependencies": {
64-
"@angular-devkit/build-angular": "^0.1002.1",
65-
"@angular/cli": "^10.2.1",
66-
"@angular/compiler-cli": "^10.2.4",
67-
"@angular/language-service": "^10.2.4",
68-
"@types/jasmine": "^3.6.2",
63+
"@angular-devkit/build-angular": "^0.1100.7",
64+
"@angular/cli": "^11.0.7",
65+
"@angular/compiler-cli": "^11.0.9",
66+
"@angular/language-service": "^11.0.9",
67+
"@types/jasmine": "~3.6.0",
6968
"@types/jasminewd2": "^2.0.8",
7069
"@types/node": "^14.14.20",
71-
"codelyzer": "^5.2.2",
70+
"codelyzer": "^6.0.0",
7271
"jasmine-core": "~3.6.0",
7372
"jasmine-spec-reporter": "~5.0.0",
7473
"karma": "~5.2.0",
7574
"karma-chrome-launcher": "~3.1.0",
76-
"karma-coverage-istanbul-reporter": "~3.0.2",
75+
"karma-coverage": "~2.0.3",
7776
"karma-jasmine": "~4.0.0",
7877
"karma-jasmine-html-reporter": "^1.5.0",
7978
"protractor": "~7.0.0",
8079
"ts-node": "^8.10.2",
8180
"tslint": "~6.1.0",
82-
"typescript": "^3.9.7"
81+
"typescript": "~4.0.5"
8382
},
8483
"engines": {
8584
"node": ">= 10.13",

src/app/app.routing.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export const routes: Routes = [
8888
];
8989

9090
@NgModule({
91-
imports: [ RouterModule.forRoot(routes) ],
91+
imports: [ RouterModule.forRoot(routes, { relativeLinkResolution: 'legacy' }) ],
9292
exports: [ RouterModule ]
9393
})
9494
export class AppRoutingModule {}

src/polyfills.ts

Lines changed: 28 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* Load `$localize` onto the global scope - used if i18n tags appear in Angular templates.
33
*/
44
import '@angular/localize/init';
5+
56
/**
67
* This file includes polyfills needed by Angular and is loaded before the app.
78
* You can add your own extra polyfills to this file.
@@ -15,71 +16,56 @@ import '@angular/localize/init';
1516
* automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
1617
* Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
1718
*
18-
* Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html
19+
* Learn more in https://angular.io/guide/browser-support
1920
*/
2021

2122
/***************************************************************************************************
2223
* BROWSER POLYFILLS
2324
*/
2425

25-
/** IE9, IE10 and IE11 requires all of the following polyfills. **/
26+
/** IE11 requires all of the following polyfills. **/
2627
import 'core-js';
2728

28-
/** IE10 and IE11 requires the following for NgClass support on SVG elements */
29+
/** IE11 requires the following for NgClass support on SVG elements */
2930
// import 'classlist.js'; // Run `npm install --save classlist.js`.
3031

31-
/** IE10 and IE11 requires the following for the Reflect API. */
32-
import 'core-js/es/reflect';
33-
34-
// for IE10
35-
import 'mutationobserver-shim';
36-
3732
/**
38-
* Required to support Web Animations `@angular/platform-browser/animations`.
39-
* Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation
40-
**/
41-
import 'web-animations-js'; // Run `npm install --save web-animations-js`.
33+
* Web Animations `@angular/platform-browser/animations`
34+
* Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
35+
* Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
36+
*/
37+
// import 'web-animations-js'; // Run `npm install --save web-animations-js`.
4238

4339
/**
4440
* By default, zone.js will patch all possible macroTask and DomEvents
4541
* user can disable parts of macroTask/DomEvents patch by setting following flags
42+
* because those flags need to be set before `zone.js` being loaded, and webpack
43+
* will put import in the top of bundle, so user need to create a separate file
44+
* in this directory (for example: zone-flags.ts), and put the following flags
45+
* into that file, and then add the following code before importing zone.js.
46+
* import './zone-flags';
47+
*
48+
* The flags allowed in zone-flags.ts are listed here.
49+
*
50+
* The following flags will work for all browsers.
51+
*
52+
* (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
53+
* (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
54+
* (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
55+
*
56+
* in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
57+
* with the following flag, it will bypass `zone.js` patch for IE/Edge
58+
*
59+
* (window as any).__Zone_enable_cross_context_check = true;
60+
*
4661
*/
4762

48-
(window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
49-
(window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
50-
(window as any).__zone_symbol__BLACK_LISTED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
51-
52-
/*
53-
* in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
54-
* with the following flag, it will bypass `zone.js` patch for IE/Edge
55-
*/
56-
(window as any).__Zone_enable_cross_context_check = true;
57-
5863
/***************************************************************************************************
5964
* Zone JS is required by default for Angular itself.
6065
*/
6166
import 'zone.js/dist/zone'; // Included with Angular CLI.
6267

6368

64-
6569
/***************************************************************************************************
6670
* APPLICATION IMPORTS
6771
*/
68-
69-
/***************************************************************************************************
70-
* IE10 issues
71-
*/
72-
73-
/**
74-
* IE10 - some CSS3 properties and HTML5 elements are not fully supported or require prefixed properties for full functionality
75-
* to let Autoprefixer use old flexbox prefixes - add a browserslist property to the package.json file:
76-
* "browserslist": [
77-
* "last 2 versions",
78-
* "not ie < 10",
79-
* ]
80-
*/
81-
82-
/**
83-
* IE10 - TypeError: Object doesn't support property or method 'getRootNode'
84-
*/
85-
// import 'get-root-node-polyfill/implement'; // Run `npm i get-root-node-polyfill`.

src/tsconfig.spec.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* To learn more about this file see: https://angular.io/config/tsconfig. */
12
{
23
"extends": "../tsconfig.json",
34
"compilerOptions": {

0 commit comments

Comments
 (0)