Skip to content

Commit

Permalink
feat(angular): Upgrade to Angular 5 (#38)
Browse files Browse the repository at this point in the history
- Update dependencies
- Remove unnecessary JSDoc tags
- Fix build process

BREAKING CHANGE: The upgrade to Angular 5 breaks compatibility with Angular 4.
  • Loading branch information
DavidRouyer authored and dominique-mueller committed Dec 6, 2017
1 parent 1b8019f commit 355785e
Show file tree
Hide file tree
Showing 18 changed files with 4,863 additions and 3,850 deletions.
8,500 changes: 4,757 additions & 3,743 deletions package-lock.json

Large diffs are not rendered by default.

50 changes: 25 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,63 +49,63 @@
"ci:test": "jest --config tools/jest/jest.config.json --runInBand --no-cache"
},
"peerDependencies": {
"@angular/common": ">= 4.0.0 < 5.0.0",
"@angular/core": ">= 4.0.0 < 5.0.0"
"@angular/common": ">= 5.0.0 < 6.0.0",
"@angular/core": ">= 5.0.0 < 6.0.0"
},
"devDependencies": {
"@angular/common": "4.1.x",
"@angular/compiler-cli": "4.1.x",
"@angular/compiler": "4.1.x",
"@angular/core": "4.1.x",
"@angular/platform-browser-dynamic": "4.1.x",
"@angular/platform-browser": "4.1.x",
"@types/jest": "20.0.x",
"@angular/common": "^5.0.x",
"@angular/compiler-cli": "^5.0.x",
"@angular/compiler": "^5.0.x",
"@angular/core": "^5.0.x",
"@angular/platform-browser-dynamic": "^5.0.x",
"@angular/platform-browser": "^5.0.x",
"@types/jest": "21.1.x",
"@types/node": "8.0.x",
"add-asset-html-webpack-plugin": "2.0.x",
"add-asset-html-webpack-plugin": "2.1.x",
"angular2-template-loader": "0.6.x",
"automatic-release": "1.0.x",
"awesome-typescript-loader": "3.2.x",
"automatic-release": "1.1.x",
"awesome-typescript-loader": "3.4.x",
"browser-sync-webpack-plugin": "1.2.x",
"browser-sync": "2.18.x",
"classlist.js": "1.1.x",
"codecov": "2.2.x",
"codelyzer": "3.1.x",
"core-js": "2.4.x",
"core-js": "2.5.x",
"css-loader": "0.28.x",
"del": "3.0.x",
"friendly-errors-webpack-plugin": "1.6.x",
"gulp-autoprefixer": "4.0.x",
"gulp-inline-ng2-template": "4.0.x",
"gulp-ngc": "0.3.x",
"gulp-rename": "1.2.x",
"gulp-rollup": "2.14.x",
"gulp-rollup": "2.15.x",
"gulp-sass-lint": "1.3.x",
"gulp-sass": "3.1.x",
"gulp-sourcemaps": "2.6.x",
"gulp-tslint": "8.1.x",
"gulp-typescript": "3.2.x",
"gulp": "github:gulpjs/gulp#4.0",
"html-minifier": "3.5.x",
"html-webpack-plugin": "2.29.x",
"jest": "20.0.x",
"jest-preset-angular": "2.0.x",
"html-webpack-plugin": "2.30.x",
"jest": "21.2.x",
"jest-preset-angular": "4.0.x",
"jest-zone-patch": "0.0.x",
"progress-bar-webpack-plugin": "1.10.x",
"raw-loader": "0.5.x",
"reflect-metadata": "0.1.x",
"rxjs": "5.4.x",
"rxjs": "5.5.2",
"sass-loader": "6.0.x",
"script-ext-html-webpack-plugin": "1.8.x",
"simple-progress-webpack-plugin": "1.0.x",
"source-map-loader": "0.2.x",
"style-loader": "0.18.x",
"ts-jest": "20.0.x",
"tslint": "5.5.x",
"style-loader": "0.19.x",
"ts-jest": "21.2.x",
"tslint": "5.8.x",
"tslint-language-service": "0.9.x",
"typescript": "2.4.x",
"web-animations-js": "2.2.x",
"webpack-dev-server": "2.5.x",
"webpack": "3.1.x",
"zone.js": "0.8.10"
"web-animations-js": "2.3.x",
"webpack-dev-server": "2.9.x",
"webpack": "3.8.x",
"zone.js": "0.8.18"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { By } from '@angular/platform-browser';
import { DebugElement, EventEmitter, NO_ERRORS_SCHEMA } from '@angular/core';
import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing';

import { Subject } from 'rxjs/Rx';
import { Subject } from 'rxjs/Subject';

import { NotifierConfigToken } from '../notifier.module';
import { NotifierNotification } from '../models/notifier-notification.model';
Expand Down
62 changes: 31 additions & 31 deletions src/lib/src/components/notifier-container.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ export class NotifierContainerComponent implements OnDestroy, OnInit {
/**
* Constructor
*
* @param {ChangeDetectorRef} changeDetector Change detector, used for manually triggering change detection runs
* @param {NotifierQueueService} notifierQueueService Notifier queue service
* @param {NotifierService} notifierService Notifier service
* @param changeDetector Change detector, used for manually triggering change detection runs
* @param notifierQueueService Notifier queue service
* @param notifierService Notifier service
*/
public constructor( changeDetector: ChangeDetectorRef, notifierQueueService: NotifierQueueService, notifierService: NotifierService ) {
this.changeDetector = changeDetector;
Expand Down Expand Up @@ -99,9 +99,9 @@ export class NotifierContainerComponent implements OnDestroy, OnInit {
/**
* Notification identifier, used as the ngFor trackby function
*
* @param {number} index Index
* @param {NotifierNotification} notification Notifier notification
* @returns {string} Notification ID as the unique identnfier
* @param index Index
* @param notification Notifier notification
* @returns Notification ID as the unique identnfier
*/
public identifyNotification( index: number, notification: NotifierNotification ): string {
return notification.id;
Expand All @@ -110,7 +110,7 @@ export class NotifierContainerComponent implements OnDestroy, OnInit {
/**
* Event handler, handles clicks on notification dismiss buttons
*
* @param {string} notificationId ID of the notification to dismiss
* @param notificationId ID of the notification to dismiss
*/
public onNotificationDismiss( notificationId: string ): void {
this.queueService.push( {
Expand All @@ -122,7 +122,7 @@ export class NotifierContainerComponent implements OnDestroy, OnInit {
/**
* Event handler, handles notification ready events
*
* @param {NotifierNotificationComponent} notificationComponent Notification component reference
* @param notificationComponent Notification component reference
*/
public onNotificationReady( notificationComponent: NotifierNotificationComponent ): void {
let currentNotification: NotifierNotification = this.notifications[ this.notifications.length - 1 ]; // Get the latest notification
Expand All @@ -133,8 +133,8 @@ export class NotifierContainerComponent implements OnDestroy, OnInit {
/**
* Handle incoming actions by mapping action types to methods, and then running them
*
* @param {NotifierAction} action Action object
* @returns {Promise<undefined>} Promise, resolved when done
* @param action Action object
* @returns Promise, resolved when done
*/
private handleAction( action: NotifierAction ): Promise<undefined> {
switch ( action.type ) { // TODO: Maybe a map (actionType -> class method) is a cleaner solution here?
Expand All @@ -160,8 +160,8 @@ export class NotifierContainerComponent implements OnDestroy, OnInit {
*
* We simply add the notification to the list, and then wait until its properly initialized / created / rendered.
*
* @param {NotifierAction} action Action object
* @returns {Promise<undefined>} Promise, resolved when done
* @param action Action object
* @returns Promise, resolved when done
*/
private handleShowAction( action: NotifierAction ): Promise<undefined> {
return new Promise<undefined>( ( resolve: () => void, reject: () => void ) => {
Expand All @@ -178,7 +178,7 @@ export class NotifierContainerComponent implements OnDestroy, OnInit {
* shift all older notifications, and then show our new notification. In addition, if there are too many notification on the screen,
* we hide the oldest one first. Furthermore, if configured, animation overlapping is applied.
*
* @param {NotifierNotification} notification New notification to show
* @param notification New notification to show
*/
private continueHandleShowAction( notification: NotifierNotification ): void {

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

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

Expand All @@ -385,8 +385,8 @@ export class NotifierContainerComponent implements OnDestroy, OnInit {
/**
* Hide all notifications at once
*
* @param {NotifierAction} action Action object
* @returns {Promise<undefined>} Promise, resolved when done
* @param action Action object
* @returns Promise, resolved when done
*/
private handleHideAllAction( action: NotifierAction ): Promise<undefined> {
return new Promise<undefined>( ( resolve: () => void, reject: () => void ) => {
Expand Down Expand Up @@ -437,10 +437,10 @@ export class NotifierContainerComponent implements OnDestroy, OnInit {
/**
* Shift multiple notifications at once
*
* @param {Array<NotifierNotification>} notifications List containing the notifications to be shifted
* @param {number} distance Distance to shift (in px)
* @param {boolean} toMakePlace Flag, defining in which direciton to shift
* @returns {Promise<undefined>} Promise, resolved when done
* @param notifications List containing the notifications to be shifted
* @param distance Distance to shift (in px)
* @param toMakePlace Flag, defining in which direciton to shift
* @returns Promise, resolved when done
*/
private shiftNotifications( notifications: Array<NotifierNotification>, distance: number, toMakePlace: boolean ): Promise<undefined> {
return new Promise<undefined>( ( resolve: () => void, reject: () => void ) => {
Expand All @@ -463,7 +463,7 @@ export class NotifierContainerComponent implements OnDestroy, OnInit {
/**
* Add a new notification to the list of notifications (triggers change detection)
*
* @param {NotifierNotification} notification Notification to add to the list of notifications
* @param notification Notification to add to the list of notifications
*/
private addNotificationToList( notification: NotifierNotification ): void {
this.notifications.push( notification );
Expand All @@ -473,7 +473,7 @@ export class NotifierContainerComponent implements OnDestroy, OnInit {
/**
* Remove an existing notification from the list of notifications (triggers change detection)
*
* @param {NotifierNotification} notification Notification to be removed from the list of notifications
* @param notification Notification to be removed from the list of notifications
*/
private removeNotificationFromList( notification: NotifierNotification ): void {
this.notifications =
Expand All @@ -492,8 +492,8 @@ export class NotifierContainerComponent implements OnDestroy, OnInit {
/**
* Helper: Find a notification in the notification list by a given notification ID
*
* @param {string} notificationId Notification ID, used for finding notification
* @returns {NotifierNotification | undefined} Notification, undefined if not found
* @param notificationId Notification ID, used for finding notification
* @returns Notification, undefined if not found
*/
private findNotificationById( notificationId: string ): NotifierNotification | undefined {
return this.notifications.find( ( currentNotification: NotifierNotification ) => currentNotification.id === notificationId );
Expand All @@ -502,8 +502,8 @@ export class NotifierContainerComponent implements OnDestroy, OnInit {
/**
* Helper: Find a notification's index by a given notification ID
*
* @param {string} notificationId Notification ID, used for finding a notification's index
* @returns {number | undefined} Notification index, undefined if not found
* @param notificationId Notification ID, used for finding a notification's index
* @returns Notification index, undefined if not found
*/
private findNotificationIndexById( notificationId: string ): number | undefined {
const notificationIndex: number =
Expand Down
28 changes: 14 additions & 14 deletions src/lib/src/components/notifier-notification.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ export class NotifierNotificationComponent implements AfterViewInit {
/**
* Constructor
*
* @param {ElementRef} elementRef Reference to the component's element
* @param {Renderer2} renderer Angular renderer
* @param {NotifierService} notifierService Notifier service
* @param {NotifierTimerService} notifierTimerService Notifier timer service
* @param {NotifierAnimationService} notifierAnimationService Notifier animation service
* @param elementRef Reference to the component's element
* @param renderer Angular renderer
* @param notifierService Notifier service
* @param notifierTimerService Notifier timer service
* @param notifierAnimationService Notifier animation service
*/
public constructor( elementRef: ElementRef, renderer: Renderer2, notifierService: NotifierService,
notifierTimerService: NotifierTimerService, notifierAnimationService: NotifierAnimationService ) {
Expand All @@ -125,7 +125,7 @@ export class NotifierNotificationComponent implements AfterViewInit {
/**
* Get the notifier config
*
* @returns {NotifierConfig} Notifier configuration
* @returns Notifier configuration
*/
public getConfig(): NotifierConfig {
return this.config;
Expand All @@ -134,7 +134,7 @@ export class NotifierNotificationComponent implements AfterViewInit {
/**
* Get notification element height (in px)
*
* @returns {number} Notification element height (in px)
* @returns Notification element height (in px)
*/
public getHeight(): number {
return this.elementHeight;
Expand All @@ -143,7 +143,7 @@ export class NotifierNotificationComponent implements AfterViewInit {
/**
* Get notification element width (in px)
*
* @returns {number} Notification element height (in px)
* @returns Notification element height (in px)
*/
public getWidth(): number {
return this.elementWidth;
Expand All @@ -152,7 +152,7 @@ export class NotifierNotificationComponent implements AfterViewInit {
/**
* Get notification shift offset (in px)
*
* @returns {number} Notification element shift offset (in px)
* @returns Notification element shift offset (in px)
*/
public getShift(): number {
return this.elementShift;
Expand All @@ -161,7 +161,7 @@ export class NotifierNotificationComponent implements AfterViewInit {
/**
* Show (animate in) this notification
*
* @returns {Promise<undefined>} Promise, resolved when done
* @returns Promise, resolved when done
*/
public show(): Promise<undefined> {
return new Promise<undefined>( ( resolve: () => void, reject: () => void ) => {
Expand Down Expand Up @@ -203,7 +203,7 @@ export class NotifierNotificationComponent implements AfterViewInit {
/**
* Hide (animate out) this notification
*
* @returns {Promise<undefined>} Promise, resolved when done
* @returns Promise, resolved when done
*/
public hide(): Promise<undefined> {
return new Promise<undefined>( ( resolve: () => void, reject: () => void ) => {
Expand All @@ -227,9 +227,9 @@ export class NotifierNotificationComponent implements AfterViewInit {
/**
* Shift (move) this notification
*
* @param {number} distance Distance to shift (in px)
* @param {boolean} shiftToMakePlace Flag, defining in which direction to shift
* @returns {Promise<undefined>} Promise, resolved when done
* @param distance Distance to shift (in px)
* @param shiftToMakePlace Flag, defining in which direction to shift
* @returns Promise, resolved when done
*/
public shift( distance: number, shiftToMakePlace: boolean ): Promise<undefined> {
return new Promise<undefined>( ( resolve: () => void, reject: () => void ) => {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/src/models/notifier-config.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export class NotifierConfig implements NotifierOptions {
/**
* Constructor
*
* @param {NotifierOptions} [customOptions={}] Custom notifier options, optional
* @param [customOptions={}] Custom notifier options, optional
*/
public constructor( customOptions: NotifierOptions = {} ) {

Expand Down
2 changes: 1 addition & 1 deletion src/lib/src/models/notifier-notification.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class NotifierNotification {
/**
* Constructor
*
* @param {NotifierNotificationOptions} options Notifier options
* @param options Notifier options
*/
public constructor( options: NotifierNotificationOptions ) {

Expand Down
Loading

0 comments on commit 355785e

Please sign in to comment.