Skip to content

Commit 355785e

Browse files
DavidRouyeritsdevdom
authored andcommitted
feat(angular): Upgrade to Angular 5 (#38)
- Update dependencies - Remove unnecessary JSDoc tags - Fix build process BREAKING CHANGE: The upgrade to Angular 5 breaks compatibility with Angular 4.
1 parent 1b8019f commit 355785e

18 files changed

+4863
-3850
lines changed

package-lock.json

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

package.json

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -49,63 +49,63 @@
4949
"ci:test": "jest --config tools/jest/jest.config.json --runInBand --no-cache"
5050
},
5151
"peerDependencies": {
52-
"@angular/common": ">= 4.0.0 < 5.0.0",
53-
"@angular/core": ">= 4.0.0 < 5.0.0"
52+
"@angular/common": ">= 5.0.0 < 6.0.0",
53+
"@angular/core": ">= 5.0.0 < 6.0.0"
5454
},
5555
"devDependencies": {
56-
"@angular/common": "4.1.x",
57-
"@angular/compiler-cli": "4.1.x",
58-
"@angular/compiler": "4.1.x",
59-
"@angular/core": "4.1.x",
60-
"@angular/platform-browser-dynamic": "4.1.x",
61-
"@angular/platform-browser": "4.1.x",
62-
"@types/jest": "20.0.x",
56+
"@angular/common": "^5.0.x",
57+
"@angular/compiler-cli": "^5.0.x",
58+
"@angular/compiler": "^5.0.x",
59+
"@angular/core": "^5.0.x",
60+
"@angular/platform-browser-dynamic": "^5.0.x",
61+
"@angular/platform-browser": "^5.0.x",
62+
"@types/jest": "21.1.x",
6363
"@types/node": "8.0.x",
64-
"add-asset-html-webpack-plugin": "2.0.x",
64+
"add-asset-html-webpack-plugin": "2.1.x",
6565
"angular2-template-loader": "0.6.x",
66-
"automatic-release": "1.0.x",
67-
"awesome-typescript-loader": "3.2.x",
66+
"automatic-release": "1.1.x",
67+
"awesome-typescript-loader": "3.4.x",
6868
"browser-sync-webpack-plugin": "1.2.x",
6969
"browser-sync": "2.18.x",
7070
"classlist.js": "1.1.x",
7171
"codecov": "2.2.x",
7272
"codelyzer": "3.1.x",
73-
"core-js": "2.4.x",
73+
"core-js": "2.5.x",
7474
"css-loader": "0.28.x",
7575
"del": "3.0.x",
7676
"friendly-errors-webpack-plugin": "1.6.x",
7777
"gulp-autoprefixer": "4.0.x",
7878
"gulp-inline-ng2-template": "4.0.x",
7979
"gulp-ngc": "0.3.x",
8080
"gulp-rename": "1.2.x",
81-
"gulp-rollup": "2.14.x",
81+
"gulp-rollup": "2.15.x",
8282
"gulp-sass-lint": "1.3.x",
8383
"gulp-sass": "3.1.x",
8484
"gulp-sourcemaps": "2.6.x",
8585
"gulp-tslint": "8.1.x",
8686
"gulp-typescript": "3.2.x",
8787
"gulp": "github:gulpjs/gulp#4.0",
8888
"html-minifier": "3.5.x",
89-
"html-webpack-plugin": "2.29.x",
90-
"jest": "20.0.x",
91-
"jest-preset-angular": "2.0.x",
89+
"html-webpack-plugin": "2.30.x",
90+
"jest": "21.2.x",
91+
"jest-preset-angular": "4.0.x",
9292
"jest-zone-patch": "0.0.x",
9393
"progress-bar-webpack-plugin": "1.10.x",
9494
"raw-loader": "0.5.x",
9595
"reflect-metadata": "0.1.x",
96-
"rxjs": "5.4.x",
96+
"rxjs": "5.5.2",
9797
"sass-loader": "6.0.x",
9898
"script-ext-html-webpack-plugin": "1.8.x",
9999
"simple-progress-webpack-plugin": "1.0.x",
100100
"source-map-loader": "0.2.x",
101-
"style-loader": "0.18.x",
102-
"ts-jest": "20.0.x",
103-
"tslint": "5.5.x",
101+
"style-loader": "0.19.x",
102+
"ts-jest": "21.2.x",
103+
"tslint": "5.8.x",
104104
"tslint-language-service": "0.9.x",
105105
"typescript": "2.4.x",
106-
"web-animations-js": "2.2.x",
107-
"webpack-dev-server": "2.5.x",
108-
"webpack": "3.1.x",
109-
"zone.js": "0.8.10"
106+
"web-animations-js": "2.3.x",
107+
"webpack-dev-server": "2.9.x",
108+
"webpack": "3.8.x",
109+
"zone.js": "0.8.18"
110110
}
111111
}

src/lib/src/components/notifier-container.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { By } from '@angular/platform-browser';
22
import { DebugElement, EventEmitter, NO_ERRORS_SCHEMA } from '@angular/core';
33
import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing';
44

5-
import { Subject } from 'rxjs/Rx';
5+
import { Subject } from 'rxjs/Subject';
66

77
import { NotifierConfigToken } from '../notifier.module';
88
import { NotifierNotification } from '../models/notifier-notification.model';

src/lib/src/components/notifier-container.component.ts

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ export class NotifierContainerComponent implements OnDestroy, OnInit {
6565
/**
6666
* Constructor
6767
*
68-
* @param {ChangeDetectorRef} changeDetector Change detector, used for manually triggering change detection runs
69-
* @param {NotifierQueueService} notifierQueueService Notifier queue service
70-
* @param {NotifierService} notifierService Notifier service
68+
* @param changeDetector Change detector, used for manually triggering change detection runs
69+
* @param notifierQueueService Notifier queue service
70+
* @param notifierService Notifier service
7171
*/
7272
public constructor( changeDetector: ChangeDetectorRef, notifierQueueService: NotifierQueueService, notifierService: NotifierService ) {
7373
this.changeDetector = changeDetector;
@@ -99,9 +99,9 @@ export class NotifierContainerComponent implements OnDestroy, OnInit {
9999
/**
100100
* Notification identifier, used as the ngFor trackby function
101101
*
102-
* @param {number} index Index
103-
* @param {NotifierNotification} notification Notifier notification
104-
* @returns {string} Notification ID as the unique identnfier
102+
* @param index Index
103+
* @param notification Notifier notification
104+
* @returns Notification ID as the unique identnfier
105105
*/
106106
public identifyNotification( index: number, notification: NotifierNotification ): string {
107107
return notification.id;
@@ -110,7 +110,7 @@ export class NotifierContainerComponent implements OnDestroy, OnInit {
110110
/**
111111
* Event handler, handles clicks on notification dismiss buttons
112112
*
113-
* @param {string} notificationId ID of the notification to dismiss
113+
* @param notificationId ID of the notification to dismiss
114114
*/
115115
public onNotificationDismiss( notificationId: string ): void {
116116
this.queueService.push( {
@@ -122,7 +122,7 @@ export class NotifierContainerComponent implements OnDestroy, OnInit {
122122
/**
123123
* Event handler, handles notification ready events
124124
*
125-
* @param {NotifierNotificationComponent} notificationComponent Notification component reference
125+
* @param notificationComponent Notification component reference
126126
*/
127127
public onNotificationReady( notificationComponent: NotifierNotificationComponent ): void {
128128
let currentNotification: NotifierNotification = this.notifications[ this.notifications.length - 1 ]; // Get the latest notification
@@ -133,8 +133,8 @@ export class NotifierContainerComponent implements OnDestroy, OnInit {
133133
/**
134134
* Handle incoming actions by mapping action types to methods, and then running them
135135
*
136-
* @param {NotifierAction} action Action object
137-
* @returns {Promise<undefined>} Promise, resolved when done
136+
* @param action Action object
137+
* @returns Promise, resolved when done
138138
*/
139139
private handleAction( action: NotifierAction ): Promise<undefined> {
140140
switch ( action.type ) { // TODO: Maybe a map (actionType -> class method) is a cleaner solution here?
@@ -160,8 +160,8 @@ export class NotifierContainerComponent implements OnDestroy, OnInit {
160160
*
161161
* We simply add the notification to the list, and then wait until its properly initialized / created / rendered.
162162
*
163-
* @param {NotifierAction} action Action object
164-
* @returns {Promise<undefined>} Promise, resolved when done
163+
* @param action Action object
164+
* @returns Promise, resolved when done
165165
*/
166166
private handleShowAction( action: NotifierAction ): Promise<undefined> {
167167
return new Promise<undefined>( ( resolve: () => void, reject: () => void ) => {
@@ -178,7 +178,7 @@ export class NotifierContainerComponent implements OnDestroy, OnInit {
178178
* shift all older notifications, and then show our new notification. In addition, if there are too many notification on the screen,
179179
* we hide the oldest one first. Furthermore, if configured, animation overlapping is applied.
180180
*
181-
* @param {NotifierNotification} notification New notification to show
181+
* @param notification New notification to show
182182
*/
183183
private continueHandleShowAction( notification: NotifierNotification ): void {
184184

@@ -281,8 +281,8 @@ export class NotifierContainerComponent implements OnDestroy, OnInit {
281281
* notification. If there exist older notifications, we then shift them around to fill the gap. Once both hiding the given notification
282282
* and shifting the older notificaitons is done, the given notification gets finally removed (from the DOM).
283283
*
284-
* @param {NotifierAction} action Action object, payload contains the notification ID
285-
* @returns {Promise<undefined>} Promise, resolved when done
284+
* @param action Action object, payload contains the notification ID
285+
* @returns Promise, resolved when done
286286
*/
287287
private handleHideAction( action: NotifierAction ): Promise<undefined> {
288288
return new Promise<undefined>( ( resolve: () => void, reject: () => void ) => {
@@ -345,8 +345,8 @@ export class NotifierContainerComponent implements OnDestroy, OnInit {
345345
/**
346346
* Hide the oldest notification (bridge to handleHideAction)
347347
*
348-
* @param {NotifierAction} action Action object
349-
* @returns {Promise<undefined>} Promise, resolved when done
348+
* @param action Action object
349+
* @returns Promise, resolved when done
350350
*/
351351
private handleHideOldestAction( action: NotifierAction ): Promise<undefined> {
352352

@@ -365,8 +365,8 @@ export class NotifierContainerComponent implements OnDestroy, OnInit {
365365
/**
366366
* Hide the newest notification (bridge to handleHideAction)
367367
*
368-
* @param {NotifierAction} action Action object
369-
* @returns {Promise<undefined>} Promise, resolved when done
368+
* @param action Action object
369+
* @returns Promise, resolved when done
370370
*/
371371
private handleHideNewestAction( action: NotifierAction ): Promise<undefined> {
372372

@@ -385,8 +385,8 @@ export class NotifierContainerComponent implements OnDestroy, OnInit {
385385
/**
386386
* Hide all notifications at once
387387
*
388-
* @param {NotifierAction} action Action object
389-
* @returns {Promise<undefined>} Promise, resolved when done
388+
* @param action Action object
389+
* @returns Promise, resolved when done
390390
*/
391391
private handleHideAllAction( action: NotifierAction ): Promise<undefined> {
392392
return new Promise<undefined>( ( resolve: () => void, reject: () => void ) => {
@@ -437,10 +437,10 @@ export class NotifierContainerComponent implements OnDestroy, OnInit {
437437
/**
438438
* Shift multiple notifications at once
439439
*
440-
* @param {Array<NotifierNotification>} notifications List containing the notifications to be shifted
441-
* @param {number} distance Distance to shift (in px)
442-
* @param {boolean} toMakePlace Flag, defining in which direciton to shift
443-
* @returns {Promise<undefined>} Promise, resolved when done
440+
* @param notifications List containing the notifications to be shifted
441+
* @param distance Distance to shift (in px)
442+
* @param toMakePlace Flag, defining in which direciton to shift
443+
* @returns Promise, resolved when done
444444
*/
445445
private shiftNotifications( notifications: Array<NotifierNotification>, distance: number, toMakePlace: boolean ): Promise<undefined> {
446446
return new Promise<undefined>( ( resolve: () => void, reject: () => void ) => {
@@ -463,7 +463,7 @@ export class NotifierContainerComponent implements OnDestroy, OnInit {
463463
/**
464464
* Add a new notification to the list of notifications (triggers change detection)
465465
*
466-
* @param {NotifierNotification} notification Notification to add to the list of notifications
466+
* @param notification Notification to add to the list of notifications
467467
*/
468468
private addNotificationToList( notification: NotifierNotification ): void {
469469
this.notifications.push( notification );
@@ -473,7 +473,7 @@ export class NotifierContainerComponent implements OnDestroy, OnInit {
473473
/**
474474
* Remove an existing notification from the list of notifications (triggers change detection)
475475
*
476-
* @param {NotifierNotification} notification Notification to be removed from the list of notifications
476+
* @param notification Notification to be removed from the list of notifications
477477
*/
478478
private removeNotificationFromList( notification: NotifierNotification ): void {
479479
this.notifications =
@@ -492,8 +492,8 @@ export class NotifierContainerComponent implements OnDestroy, OnInit {
492492
/**
493493
* Helper: Find a notification in the notification list by a given notification ID
494494
*
495-
* @param {string} notificationId Notification ID, used for finding notification
496-
* @returns {NotifierNotification | undefined} Notification, undefined if not found
495+
* @param notificationId Notification ID, used for finding notification
496+
* @returns Notification, undefined if not found
497497
*/
498498
private findNotificationById( notificationId: string ): NotifierNotification | undefined {
499499
return this.notifications.find( ( currentNotification: NotifierNotification ) => currentNotification.id === notificationId );
@@ -502,8 +502,8 @@ export class NotifierContainerComponent implements OnDestroy, OnInit {
502502
/**
503503
* Helper: Find a notification's index by a given notification ID
504504
*
505-
* @param {string} notificationId Notification ID, used for finding a notification's index
506-
* @returns {number | undefined} Notification index, undefined if not found
505+
* @param notificationId Notification ID, used for finding a notification's index
506+
* @returns Notification index, undefined if not found
507507
*/
508508
private findNotificationIndexById( notificationId: string ): number | undefined {
509509
const notificationIndex: number =

src/lib/src/components/notifier-notification.component.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,11 @@ export class NotifierNotificationComponent implements AfterViewInit {
9494
/**
9595
* Constructor
9696
*
97-
* @param {ElementRef} elementRef Reference to the component's element
98-
* @param {Renderer2} renderer Angular renderer
99-
* @param {NotifierService} notifierService Notifier service
100-
* @param {NotifierTimerService} notifierTimerService Notifier timer service
101-
* @param {NotifierAnimationService} notifierAnimationService Notifier animation service
97+
* @param elementRef Reference to the component's element
98+
* @param renderer Angular renderer
99+
* @param notifierService Notifier service
100+
* @param notifierTimerService Notifier timer service
101+
* @param notifierAnimationService Notifier animation service
102102
*/
103103
public constructor( elementRef: ElementRef, renderer: Renderer2, notifierService: NotifierService,
104104
notifierTimerService: NotifierTimerService, notifierAnimationService: NotifierAnimationService ) {
@@ -125,7 +125,7 @@ export class NotifierNotificationComponent implements AfterViewInit {
125125
/**
126126
* Get the notifier config
127127
*
128-
* @returns {NotifierConfig} Notifier configuration
128+
* @returns Notifier configuration
129129
*/
130130
public getConfig(): NotifierConfig {
131131
return this.config;
@@ -134,7 +134,7 @@ export class NotifierNotificationComponent implements AfterViewInit {
134134
/**
135135
* Get notification element height (in px)
136136
*
137-
* @returns {number} Notification element height (in px)
137+
* @returns Notification element height (in px)
138138
*/
139139
public getHeight(): number {
140140
return this.elementHeight;
@@ -143,7 +143,7 @@ export class NotifierNotificationComponent implements AfterViewInit {
143143
/**
144144
* Get notification element width (in px)
145145
*
146-
* @returns {number} Notification element height (in px)
146+
* @returns Notification element height (in px)
147147
*/
148148
public getWidth(): number {
149149
return this.elementWidth;
@@ -152,7 +152,7 @@ export class NotifierNotificationComponent implements AfterViewInit {
152152
/**
153153
* Get notification shift offset (in px)
154154
*
155-
* @returns {number} Notification element shift offset (in px)
155+
* @returns Notification element shift offset (in px)
156156
*/
157157
public getShift(): number {
158158
return this.elementShift;
@@ -161,7 +161,7 @@ export class NotifierNotificationComponent implements AfterViewInit {
161161
/**
162162
* Show (animate in) this notification
163163
*
164-
* @returns {Promise<undefined>} Promise, resolved when done
164+
* @returns Promise, resolved when done
165165
*/
166166
public show(): Promise<undefined> {
167167
return new Promise<undefined>( ( resolve: () => void, reject: () => void ) => {
@@ -203,7 +203,7 @@ export class NotifierNotificationComponent implements AfterViewInit {
203203
/**
204204
* Hide (animate out) this notification
205205
*
206-
* @returns {Promise<undefined>} Promise, resolved when done
206+
* @returns Promise, resolved when done
207207
*/
208208
public hide(): Promise<undefined> {
209209
return new Promise<undefined>( ( resolve: () => void, reject: () => void ) => {
@@ -227,9 +227,9 @@ export class NotifierNotificationComponent implements AfterViewInit {
227227
/**
228228
* Shift (move) this notification
229229
*
230-
* @param {number} distance Distance to shift (in px)
231-
* @param {boolean} shiftToMakePlace Flag, defining in which direction to shift
232-
* @returns {Promise<undefined>} Promise, resolved when done
230+
* @param distance Distance to shift (in px)
231+
* @param shiftToMakePlace Flag, defining in which direction to shift
232+
* @returns Promise, resolved when done
233233
*/
234234
public shift( distance: number, shiftToMakePlace: boolean ): Promise<undefined> {
235235
return new Promise<undefined>( ( resolve: () => void, reject: () => void ) => {

src/lib/src/models/notifier-config.model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export class NotifierConfig implements NotifierOptions {
108108
/**
109109
* Constructor
110110
*
111-
* @param {NotifierOptions} [customOptions={}] Custom notifier options, optional
111+
* @param [customOptions={}] Custom notifier options, optional
112112
*/
113113
public constructor( customOptions: NotifierOptions = {} ) {
114114

src/lib/src/models/notifier-notification.model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export class NotifierNotification {
3030
/**
3131
* Constructor
3232
*
33-
* @param {NotifierNotificationOptions} options Notifier options
33+
* @param options Notifier options
3434
*/
3535
public constructor( options: NotifierNotificationOptions ) {
3636

0 commit comments

Comments
 (0)