Skip to content

Commit 45fc20a

Browse files
committed
upgrade to Angular 8 and Node 12
1 parent 46fc54e commit 45fc20a

11 files changed

+3651
-9376
lines changed

browserslist

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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+
# You can see what browsers were selected by your queries by running:
6+
# npx browserslist
7+
8+
> 0.5%
9+
last 2 versions
10+
Firefox ESR
11+
not dead
12+
not IE 9-11 # For IE 9-11 support, remove 'not'.

package-lock.json

Lines changed: 3590 additions & 9333 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"scripts": {
66
"ng": "ng",
77
"start": "ng serve --proxy-config ./proxy.json --live-reload false",
8-
"server": "./node_modules/.bin/ts-node ./server/server.ts",
8+
"server": "ts-node -P ./server/server.tsconfig.json ./server/server.ts",
99
"build": "ng build",
1010
"start:prod": "ng build --prod && cd dist && http-server -c-1 -P http://localhost:9000 .",
1111
"test": "ng test",
@@ -14,17 +14,16 @@
1414
},
1515
"private": true,
1616
"dependencies": {
17-
"@angular/animations": "^7.0.0",
18-
"@angular/common": "^7.0.0",
19-
"@angular/compiler": "^7.0.0",
20-
"@angular/core": "^7.0.0",
21-
"@angular/forms": "^7.0.0",
22-
"@angular/http": "^7.0.0",
23-
"@angular/platform-browser": "^7.0.0",
24-
"@angular/platform-browser-dynamic": "^7.0.0",
25-
"@angular/platform-server": "^7.0.0",
26-
"@angular/router": "^7.0.0",
27-
"@angular/service-worker": "^7.0.0",
17+
"@angular/animations": "^8.0.0",
18+
"@angular/common": "^8.0.0",
19+
"@angular/compiler": "^8.0.0",
20+
"@angular/core": "^8.0.0",
21+
"@angular/forms": "^8.0.0",
22+
"@angular/platform-browser": "^8.0.0",
23+
"@angular/platform-browser-dynamic": "^8.0.0",
24+
"@angular/platform-server": "^8.0.0",
25+
"@angular/router": "^8.0.0",
26+
"@angular/service-worker": "^8.0.0",
2827
"@types/express": "^4.0.36",
2928
"@types/lodash": "^4.14.70",
3029
"body-parser": "^1.17.2",
@@ -33,32 +32,31 @@
3332
"core-js": "^2.4.1",
3433
"http-server": "^0.10.0",
3534
"moment": "^2.18.1",
36-
"nodemon": "^1.11.0",
35+
"nodemon": "^1.19.1",
3736
"rxjs": "^6.3.3",
3837
"web-push": "^3.2.5",
39-
"zone.js": "^0.8.26",
40-
"rxjs-compat": "^6.0.0-rc.0"
38+
"zone.js": "~0.9.1"
4139
},
4240
"devDependencies": {
43-
"@angular/cli": "^7.0.1",
44-
"@angular/compiler-cli": "^7.0.0",
45-
"@angular/language-service": "^7.0.0",
41+
"@angular-devkit/build-angular": "~0.800.0",
42+
"@angular/cli": "^8.0.1",
43+
"@angular/compiler-cli": "^8.0.0",
44+
"@angular/language-service": "^8.0.0",
4645
"@types/jasmine": "~2.5.53",
4746
"@types/jasminewd2": "~2.0.2",
4847
"@types/node": "~6.0.60",
49-
"codelyzer": "~4.2.0",
48+
"codelyzer": "^5.0.1",
5049
"jasmine-core": "~2.6.2",
5150
"jasmine-spec-reporter": "~4.1.0",
52-
"karma": "~1.7.0",
51+
"karma": "^4.1.0",
5352
"karma-chrome-launcher": "~2.1.1",
5453
"karma-cli": "~1.0.1",
5554
"karma-coverage-istanbul-reporter": "^1.2.1",
5655
"karma-jasmine": "~1.1.0",
5756
"karma-jasmine-html-reporter": "^0.2.2",
58-
"protractor": "~5.1.2",
57+
"protractor": "^6.0.0",
5958
"ts-node": "~3.2.0",
6059
"tslint": "~5.7.0",
61-
"typescript": "~3.1.3",
62-
"@angular-devkit/build-angular": "~0.10.0"
60+
"typescript": "~3.4.5"
6361
}
6462
}

server/server.tsconfig.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"compilerOptions": {
3+
"module": "commonjs",
4+
"lib": ["es2017"]
5+
}
6+
}

src/app/app.module.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ import {ReactiveFormsModule} from "@angular/forms";
1111
import {environment} from '../environments/environment.prod';
1212
import {ServiceWorkerModule} from '@angular/service-worker';
1313

14-
import 'rxjs/add/operator/switchMap';
15-
import 'rxjs/add/operator/map';
16-
import 'rxjs/add/operator/shareReplay';
17-
import 'rxjs/add/operator/do';
18-
import 'rxjs/add/operator/filter';
19-
import 'rxjs/add/operator/catch';
20-
import 'rxjs/add/operator/first';
21-
import 'rxjs/add/observable/of';
14+
15+
16+
17+
18+
19+
20+
21+
2222
import {BrowserAnimationsModule} from "@angular/platform-browser/animations";
2323
import {AppRoutingModule} from "./app-routing.module";
2424
import {NewsletterService} from "./services/newsletter.service";

src/app/lessons/lessons.component.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import {Component, OnInit} from '@angular/core';
22
import {LessonsService} from "../services/lessons.service";
3-
import {Observable} from "rxjs/Observable";
3+
import {Observable, of} from 'rxjs';
44
import {Lesson} from "../model/lesson";
55
import {SwPush} from "@angular/service-worker";
66
import {NewsletterService} from "../services/newsletter.service";
7+
import {catchError} from 'rxjs/operators';
78

89
@Component({
910
selector: 'lessons',
@@ -29,7 +30,7 @@ export class LessonsComponent implements OnInit {
2930

3031

3132
loadLessons() {
32-
this.lessons$ = this.lessonsService.loadAllLessons().catch(err => Observable.of([]));
33+
this.lessons$ = this.lessonsService.loadAllLessons().pipe(catchError(err => of([])));
3334
}
3435

3536
subscribeToNotifications() {

src/app/services/lessons.service.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
import {Injectable} from "@angular/core";
33
import {HttpClient} from "@angular/common/http";
44
import {Lesson} from "../model/lesson";
5-
import {Observable} from "rxjs/Observable";
5+
import {Observable} from "rxjs";
6+
import {map} from 'rxjs/operators';
67

78

89
@Injectable()
@@ -14,7 +15,9 @@ export class LessonsService {
1415

1516
loadAllLessons() : Observable<Lesson[]> {
1617
return this.http.get<any>('/api/lessons')
17-
.map(res => res.lessons);
18+
.pipe(
19+
map(res => res.lessons)
20+
)
1821
}
1922

2023
findLessonById(id:number) {

src/tsconfig.app.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"compilerOptions": {
44
"outDir": "../out-tsc/app",
55
"baseUrl": "./",
6-
"module": "es2015",
76
"types": []
87
},
98
"exclude": [

src/tsconfig.spec.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
"compilerOptions": {
44
"outDir": "../out-tsc/spec",
55
"baseUrl": "./",
6-
"module": "commonjs",
7-
"target": "es5",
86
"types": [
97
"jasmine",
108
"node"

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
{
22
"compileOnSave": false,
33
"compilerOptions": {
4+
"module": "esnext",
45
"outDir": "./dist/out-tsc",
56
"sourceMap": true,
67
"declaration": false,
78
"moduleResolution": "node",
89
"emitDecoratorMetadata": true,
910
"experimentalDecorators": true,
10-
"target": "es5",
11+
"target": "es2015",
1112
"typeRoots": [
1213
"node_modules/@types"
1314
],

tslint.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,12 +125,12 @@
125125
"app",
126126
"kebab-case"
127127
],
128-
"use-input-property-decorator": true,
129-
"use-output-property-decorator": true,
130-
"use-host-property-decorator": true,
128+
"no-inputs-metadata-property": true,
129+
"no-outputs-metadata-property": true,
130+
"no-host-metadata-property": true,
131131
"no-input-rename": true,
132132
"no-output-rename": true,
133-
"use-life-cycle-interface": true,
133+
"use-lifecycle-interface": true,
134134
"use-pipe-transform-interface": true,
135135
"component-class-suffix": true,
136136
"directive-class-suffix": true,

0 commit comments

Comments
 (0)