From c39d28dba288095fc56350ac11f46c89878f1215 Mon Sep 17 00:00:00 2001 From: BoykoAlex Date: Wed, 8 Nov 2017 13:31:46 -0500 Subject: [PATCH] Updated to angular 5.2.3 and rxjs 5.5.6 --- package.json | 38 +++++++++---------- src/demo/app/properties.dialog.component.ts | 2 +- src/demo/systemjs.config.js | 4 ++ src/lib/src/directives/resizer.ts | 5 +-- .../src/dsl-editor/dsl-editor.component.ts | 1 - src/lib/src/editor/editor.component.ts | 12 +++--- src/lib/src/palette/palette.component.ts | 5 +-- .../properties/properties.group.component.ts | 2 +- src/lib/src/shared/flo-common.ts | 6 +-- src/lib/src/shared/flo-properties.ts | 5 ++- 10 files changed, 40 insertions(+), 40 deletions(-) diff --git a/package.json b/package.json index 9386b3e..f504bec 100644 --- a/package.json +++ b/package.json @@ -40,12 +40,13 @@ "postinstall": "postinstall-build --only-as-dependency dist \"npm run build && node postinstall.js\"" }, "dependencies": { - "@angular/core": "4.4.6", - "@angular/forms": "4.4.6", - "@angular/platform-browser": "4.4.6", + "@angular/core": "5.2.3", + "@angular/forms": "5.2.3", + "@angular/platform-browser": "5.2.3", "@types/codemirror": "0.0.45", "@types/jointjs": "1.0.4", "@types/lodash": "4.14.73", + "rxjs": "5.5.6", "codemirror": "5.28.0", "jointjs": "1.0.3", "lodash": "3.10.1", @@ -53,18 +54,17 @@ "postinstall-build": "5.0.1" }, "peerDependencies": { - "@angular/core": ">=4.0.0 <5.0.0 || >=4.0.0-beta <5.0.0", - "@angular/animations": "4.2.4" + "@angular/core": ">=5.0.0 <6.0.0" }, "devDependencies": { - "@angular/common": "4.4.6", - "@angular/compiler": "4.4.6", - "@angular/compiler-cli": "4.1.3", - "@angular/core": "4.4.6", - "@angular/forms": "4.4.6", - "@angular/platform-browser": "4.4.6", - "@angular/platform-browser-dynamic": "4.4.6", - "@angular/platform-server": "4.4.6", + "@angular/common": "5.2.3", + "@angular/compiler": "5.2.3", + "@angular/compiler-cli": "4.4.6", + "@angular/core": "5.2.3", + "@angular/forms": "5.2.3", + "@angular/platform-browser": "5.2.3", + "@angular/platform-browser-dynamic": "5.2.3", + "@angular/platform-server": "5.2.3", "@types/jasmine": "2.5.36", "@types/node": "6.0.46", "camelcase": "4.0.0", @@ -81,15 +81,15 @@ "lite-server": "2.2.2", "ngx-bootstrap": "1.8.1", "rimraf": "2.6.1", - "rollup": "0.48.2", + "rollup": "0.51.6", "rollup-plugin-sourcemaps": "0.4.2", "rollup-plugin-uglify": "2.0.1", - "rxjs": "5.4.3", + "rxjs": "5.5.6", "standard-version": "4.0.0", - "systemjs": "0.19.40", - "tslint": "5.3.2", - "typescript": "2.3.3", - "zone.js": "0.8.14", + "systemjs": "0.20.19", + "tslint": "5.9.1", + "typescript": "2.5.3", + "zone.js": "0.8.18", "@types/codemirror": "0.0.45", "@types/jointjs": "1.0.4", "@types/lodash": "4.14.73", diff --git a/src/demo/app/properties.dialog.component.ts b/src/demo/app/properties.dialog.component.ts index d47f164..7fa7451 100644 --- a/src/demo/app/properties.dialog.component.ts +++ b/src/demo/app/properties.dialog.component.ts @@ -1,4 +1,4 @@ -import { Component, ViewEncapsulation, EventEmitter, OnInit } from '@angular/core'; +import { Component, ViewEncapsulation } from '@angular/core'; import { BsModalRef } from 'ngx-bootstrap'; import { Properties } from 'spring-flo'; import { FormGroup } from '@angular/forms'; diff --git a/src/demo/systemjs.config.js b/src/demo/systemjs.config.js index fb1c156..caaadf3 100644 --- a/src/demo/systemjs.config.js +++ b/src/demo/systemjs.config.js @@ -24,6 +24,7 @@ '@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js', // other libraries + // 'rxjs/operators': 'npm:rxjs@5.4.3/operators/index.js', 'rx': 'npm:rx', 'rxjs': 'npm:rxjs', 'jointjs': 'npm:jointjs', @@ -64,6 +65,9 @@ rxjs: { defaultExtension: 'js' }, + 'rxjs/operators': { + main: './index.js' + }, 'ts-disposables': { defaultExtension: 'js', main: './dist/index.js' diff --git a/src/lib/src/directives/resizer.ts b/src/lib/src/directives/resizer.ts index 60c2f61..c7f42dd 100644 --- a/src/lib/src/directives/resizer.ts +++ b/src/lib/src/directives/resizer.ts @@ -1,9 +1,8 @@ import {Directive, Input, Output, EventEmitter, Inject, ElementRef, OnInit, OnDestroy,} from '@angular/core'; import {DOCUMENT} from '@angular/platform-browser' import {Observable} from 'rxjs/Observable'; -import 'rxjs/add/operator/sampleTime'; +import { sampleTime } from 'rxjs/operators/sampleTime'; import 'rxjs/add/observable/fromEvent'; -import 'rxjs/Rx'; import { CompositeDisposable, Disposable } from 'ts-disposables'; import * as _$ from 'jquery'; const $ : any = _$; @@ -125,7 +124,7 @@ export class ResizerDirective implements OnInit, OnDestroy { this.splitSize = this._splitSize; let subscription1 = Observable.fromEvent($(this.document).get(0), 'mousemove') - .sampleTime(300) + .pipe(sampleTime(300)) .subscribe(this.mouseMoveHandler); this._subscriptions.add(Disposable.create(() => subscription1.unsubscribe())); let subscription2 = Observable.fromEvent($(this.document).get(0), 'mouseup') diff --git a/src/lib/src/dsl-editor/dsl-editor.component.ts b/src/lib/src/dsl-editor/dsl-editor.component.ts index e849c88..bfe29ac 100644 --- a/src/lib/src/dsl-editor/dsl-editor.component.ts +++ b/src/lib/src/dsl-editor/dsl-editor.component.ts @@ -1,5 +1,4 @@ import { Component, Input, Output, ElementRef, EventEmitter, OnInit, OnDestroy, ViewEncapsulation } from '@angular/core'; -import 'rxjs/add/operator/debounceTime'; import * as _ from 'lodash'; import * as CodeMirror from 'codemirror'; import * as _$ from 'jquery'; diff --git a/src/lib/src/editor/editor.component.ts b/src/lib/src/editor/editor.component.ts index 963d947..c5d7c62 100644 --- a/src/lib/src/editor/editor.component.ts +++ b/src/lib/src/editor/editor.component.ts @@ -1,5 +1,5 @@ import { Component, Input, Output, ElementRef, EventEmitter, OnInit, OnDestroy, ViewEncapsulation } from '@angular/core'; -import 'rxjs/add/operator/debounceTime'; +import { debounceTime } from 'rxjs/operators/debounceTime'; import { dia } from 'jointjs'; import { Flo } from '../shared/flo-common'; import { Shapes, Constants } from '../shared/shapes'; @@ -564,8 +564,7 @@ export class EditorComponent implements OnInit, OnDestroy { /** * Hides DOM Node (used to determine drop target DOM element) * @param domNode DOM node to hide - * @returns {{visibility: *, children: Array}} - * @private + * @returns */ private _hideNode(domNode : HTMLElement) : VisibilityState { let oldVisibility : VisibilityState = { @@ -586,7 +585,6 @@ export class EditorComponent implements OnInit, OnDestroy { * Restored DOM node original visibility (used to determine drop target DOM element) * @param domNode DOM node to restore visibility of * @param oldVisibility original visibility parameter - * @private */ _restoreNodeVisibility(domNode : HTMLElement, oldVisibility : VisibilityState) { if (domNode.style) { @@ -872,7 +870,7 @@ export class EditorComponent implements OnInit, OnDestroy { this.metamodel.load().then(data => { this.updateGraphRepresentation(); - let textSyncSubscription = this.graphToTextEventEmitter.debounceTime(100).subscribe(() => { + let textSyncSubscription = this.graphToTextEventEmitter.pipe(debounceTime(100)).subscribe(() => { if (this._graphToTextSyncEnabled) { this.updateTextRepresentation(); } @@ -883,10 +881,10 @@ export class EditorComponent implements OnInit, OnDestroy { let graphValidatedSubscription1 = this.graphToTextEventEmitter.subscribe(() => this.contentValidated.emit(false)); this._disposables.add(Disposable.create(() => graphValidatedSubscription1.unsubscribe)); - // let validationSubscription = this.validationEventEmitter.debounceTime(100).subscribe(() => this.validateGraph()); + // let validationSubscription = this.validationEventEmitter.pipe(debounceTime(100)).subscribe(() => this.validateGraph()); // this._disposables.add(Disposable.create(() => validationSubscription.unsubscribe())); - let graphSyncSubscription = this.textToGraphEventEmitter.debounceTime(300).subscribe(() => this.updateGraphRepresentation()); + let graphSyncSubscription = this.textToGraphEventEmitter.pipe(debounceTime(300)).subscribe(() => this.updateGraphRepresentation()); this._disposables.add(Disposable.create(() => graphSyncSubscription.unsubscribe())); // Setup content validated event emitter. Emit not validated when text to graph conversion required diff --git a/src/lib/src/palette/palette.component.ts b/src/lib/src/palette/palette.component.ts index fe8a6e1..165d34b 100644 --- a/src/lib/src/palette/palette.component.ts +++ b/src/lib/src/palette/palette.component.ts @@ -1,6 +1,6 @@ import {Component, ElementRef, Input, Output, EventEmitter, OnInit, OnDestroy, OnChanges, SimpleChanges, Inject, ViewEncapsulation} from '@angular/core'; import { Subject } from 'rxjs/Subject'; -import 'rxjs/add/operator/debounceTime'; +import { debounceTime } from 'rxjs/operators/debounceTime'; import { dia } from 'jointjs'; import { Flo } from '../shared/flo-common'; import { Shapes, Constants } from './../shared/shapes'; @@ -91,7 +91,6 @@ export class Palette implements OnInit, OnDestroy, OnChanges { /** * The names of any groups in the palette that have been deliberately closed (the arrow clicked on) - * @type {String[]} */ private closedGroups : Set; @@ -172,7 +171,7 @@ export class Palette implements OnInit, OnDestroy, OnChanges { // Add debounced listener to filter text changes this.filterTextModel - .debounceTime(DEBOUNCE_TIME) + .pipe(debounceTime(DEBOUNCE_TIME)) .subscribe((value) => this.rebuildPalette()); this.initialized = true; diff --git a/src/lib/src/properties/properties.group.component.ts b/src/lib/src/properties/properties.group.component.ts index 2d0c786..2a01bb6 100644 --- a/src/lib/src/properties/properties.group.component.ts +++ b/src/lib/src/properties/properties.group.component.ts @@ -1,4 +1,4 @@ -import { Component, Input, Output, EventEmitter, OnInit, ViewEncapsulation } from '@angular/core'; +import { Component, Input, OnInit, ViewEncapsulation } from '@angular/core'; import { FormGroup, FormControl } from '@angular/forms'; import { Properties } from '../shared/flo-properties'; diff --git a/src/lib/src/shared/flo-common.ts b/src/lib/src/shared/flo-common.ts index 6e6da03..fccb446 100644 --- a/src/lib/src/shared/flo-common.ts +++ b/src/lib/src/shared/flo-common.ts @@ -210,9 +210,9 @@ export namespace Flo { /** * Return the metadata for a particular palette entry in a particular group. - * @param {String} name - name of the palette entry - * @param {string} group - group in which the palette entry should exist (e.g. sinks) - * @return {{name:string,group:string,unresolved:Boolean}} + * @param name - name of the palette entry + * @param group - group in which the palette entry should exist (e.g. sinks) + * @return */ export function getMetadata(metamodel : Map>, name : string, group : string) : ElementMetadata { if (name && group && metamodel.get(group) && metamodel.get(group).get(name)) { diff --git a/src/lib/src/shared/flo-properties.ts b/src/lib/src/shared/flo-properties.ts index 3631783..30a64b8 100644 --- a/src/lib/src/shared/flo-properties.ts +++ b/src/lib/src/shared/flo-properties.ts @@ -3,6 +3,8 @@ import { ValidatorFn, AsyncValidatorFn, AbstractControl, ValidationErrors } from import { Flo } from './flo-common'; import { Subject } from 'rxjs/Subject' import { Observable } from 'rxjs/Observable'; +import { debounceTime } from 'rxjs/operators/debounceTime'; +import { mergeMap } from 'rxjs/operators/mergeMap'; export namespace Properties { @@ -297,8 +299,7 @@ export namespace Properties { return new Observable(obs => { if (control.valueChanges && control.value) { control.valueChanges - .debounceTime(debounce) - .flatMap(value => service(value)) + .pipe(debounceTime(debounce), mergeMap(value => service(value))) .subscribe(() => { obs.next({uniqueResource: true}); obs.complete();