From 6cdffd3435347c8ac241a13817b1a446de99576b Mon Sep 17 00:00:00 2001 From: sis0k0 Date: Wed, 21 Mar 2018 18:08:52 +0200 Subject: [PATCH 01/12] chore: bump versions of Angular to 6.0 rc --- nativescript-angular/package.json | 44 +++++++++++++++---------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/nativescript-angular/package.json b/nativescript-angular/package.json index c4ce22a52..a7d337fde 100644 --- a/nativescript-angular/package.json +++ b/nativescript-angular/package.json @@ -44,35 +44,35 @@ "reflect-metadata": "^0.1.8" }, "peerDependencies": { - "@angular/platform-browser-dynamic": "~5.2.0", - "@angular/common": "~5.2.0", - "@angular/compiler": "~5.2.0", - "@angular/core": "~5.2.0", - "@angular/forms": "~5.2.0", - "@angular/http": "~5.2.0", - "@angular/platform-browser": "~5.2.0", - "@angular/router": "~5.2.0", - "rxjs": "^5.5.0", + "@angular/platform-browser-dynamic": "~6.0.0-rc.0", + "@angular/common": "~6.0.0-rc.0", + "@angular/compiler": "~6.0.0-rc.0", + "@angular/core": "~6.0.0-rc.0", + "@angular/forms": "~6.0.0-rc.0", + "@angular/http": "~6.0.0-rc.0", + "@angular/platform-browser": "~6.0.0-rc.0", + "@angular/router": "~6.0.0-rc.0", + "rxjs": "~6.0.0-rc.1", "tns-core-modules": "^4.0.0 || >4.0.0- || >4.1.0-", "zone.js": "^0.8.4", - "typescript": "~2.6.2" + "typescript": "~2.7.2" }, "devDependencies": { - "@angular/platform-browser-dynamic": "~5.2.0", - "@angular/animations": "~5.2.0", - "@angular/common": "~5.2.0", - "@angular/compiler": "~5.2.0", - "@angular/compiler-cli": "~5.2.0", - "@angular/core": "~5.2.0", - "@angular/forms": "~5.2.0", - "@angular/http": "~5.2.0", - "@angular/platform-browser": "~5.2.0", - "@angular/router": "~5.2.0", + "@angular/animations": "~6.0.0-rc.0", + "@angular/common": "~6.0.0-rc.0", + "@angular/compiler": "~6.0.0-rc.0", + "@angular/compiler-cli": "~6.0.0-rc.0", + "@angular/core": "~6.0.0-rc.0", + "@angular/forms": "~6.0.0-rc.0", + "@angular/http": "~6.0.0-rc.0", + "@angular/platform-browser": "~6.0.0-rc.0", + "@angular/platform-browser-dynamic": "~6.0.0-rc.0", + "@angular/router": "~6.0.0-rc.0", "codelyzer": "^4.0.0", - "rxjs": "^5.5.0", + "rxjs": "~6.0.0-rc.1", "tns-core-modules": "next", "tslint": "^5.5.0", - "typescript": "~2.6.2", + "typescript": "~2.7.2", "zone.js": "^0.8.12" } } From 2c2afe203802b847236437adb727f14fe585d335 Mon Sep 17 00:00:00 2001 From: sis0k0 Date: Thu, 22 Mar 2018 13:08:43 +0200 Subject: [PATCH 02/12] refactor: update rxjs 6 imports --- nativescript-angular/http-client/http-utils.ts | 3 +-- nativescript-angular/http-client/ns-http-backend.ts | 2 +- nativescript-angular/http/ns-http.ts | 2 +- nativescript-angular/router/ns-router-link-active.ts | 2 +- nativescript-angular/router/page-router-outlet.ts | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/nativescript-angular/http-client/http-utils.ts b/nativescript-angular/http-client/http-utils.ts index ae0ecc6f8..706564830 100644 --- a/nativescript-angular/http-client/http-utils.ts +++ b/nativescript-angular/http-client/http-utils.ts @@ -1,7 +1,6 @@ import { NSFileSystem } from "../file-system/ns-file-system"; -import { Observable } from "rxjs/Observable"; -import { Observer } from "rxjs/Observer"; +import { Observable, Observer } from "rxjs"; import { path } from "tns-core-modules/file-system/file-system"; export type httpResponseFactory = (url: string, body: any, status: number) => T; diff --git a/nativescript-angular/http-client/ns-http-backend.ts b/nativescript-angular/http-client/ns-http-backend.ts index 6cf2f2bf4..ed62c0150 100644 --- a/nativescript-angular/http-client/ns-http-backend.ts +++ b/nativescript-angular/http-client/ns-http-backend.ts @@ -4,7 +4,7 @@ import { XhrFactory, HttpResponse, HttpErrorResponse, HttpXhrBackend } from "@angular/common/http"; -import { Observable } from "rxjs/Observable"; +import { Observable } from "rxjs"; import { NSFileSystem } from "../file-system/ns-file-system"; import { isLocalRequest, processLocalFileRequest } from "./http-utils"; diff --git a/nativescript-angular/http/ns-http.ts b/nativescript-angular/http/ns-http.ts index e0f04b661..26e8ac7da 100644 --- a/nativescript-angular/http/ns-http.ts +++ b/nativescript-angular/http/ns-http.ts @@ -9,7 +9,7 @@ import { ResponseType, Response } from "@angular/http"; -import { Observable } from "rxjs/Observable"; +import { Observable } from "rxjs"; import "rxjs/add/observable/fromPromise"; import { isLocalRequest, processLocalFileRequest } from "../http-client/http-utils"; diff --git a/nativescript-angular/router/ns-router-link-active.ts b/nativescript-angular/router/ns-router-link-active.ts index 9d0210e74..de2e55395 100644 --- a/nativescript-angular/router/ns-router-link-active.ts +++ b/nativescript-angular/router/ns-router-link-active.ts @@ -3,7 +3,7 @@ import { ElementRef, Input, OnChanges, OnDestroy, QueryList, Renderer } from "@angular/core"; -import { Subscription } from "rxjs/Subscription"; +import { Subscription } from "rxjs"; import { NavigationEnd, Router, UrlTree } from "@angular/router"; import { containsTree } from "./private-imports/router-url-tree"; diff --git a/nativescript-angular/router/page-router-outlet.ts b/nativescript-angular/router/page-router-outlet.ts index f053218ce..4db554d51 100644 --- a/nativescript-angular/router/page-router-outlet.ts +++ b/nativescript-angular/router/page-router-outlet.ts @@ -17,7 +17,7 @@ import { Frame } from "tns-core-modules/ui/frame"; import { Page, NavigatedData } from "tns-core-modules/ui/page"; import { profile } from "tns-core-modules/profiling"; -import { BehaviorSubject } from "rxjs/BehaviorSubject"; +import { BehaviorSubject } from "rxjs"; import { DEVICE, PAGE_FACTORY, PageFactory } from "../platform-providers"; import { routerLog as log } from "../trace"; From 83d81bc9d9b6a90dc480592b6375fc0e2aa84102 Mon Sep 17 00:00:00 2001 From: sis0k0 Date: Wed, 11 Apr 2018 14:20:47 +0300 Subject: [PATCH 03/12] refactor: disable strict metadata emit Turn it back on when https://github.com/angular/angular/issues/23310 is resolved. --- nativescript-angular/tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nativescript-angular/tsconfig.json b/nativescript-angular/tsconfig.json index e05ddfed9..7b37a5d7c 100644 --- a/nativescript-angular/tsconfig.json +++ b/nativescript-angular/tsconfig.json @@ -29,6 +29,6 @@ "genDir": ".", "skipMetadataEmit": false, "skipTemplateCodegen": true, - "strictMetadataEmit": true + "strictMetadataEmit": false } } From 0180fd167a401d841533fe71f992d7a7d3afbbe9 Mon Sep 17 00:00:00 2001 From: sis0k0 Date: Thu, 12 Apr 2018 22:46:21 +0300 Subject: [PATCH 04/12] refactor: remove unused import --- nativescript-angular/http/ns-http.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/nativescript-angular/http/ns-http.ts b/nativescript-angular/http/ns-http.ts index 26e8ac7da..5d609473e 100644 --- a/nativescript-angular/http/ns-http.ts +++ b/nativescript-angular/http/ns-http.ts @@ -10,7 +10,6 @@ import { Response } from "@angular/http"; import { Observable } from "rxjs"; -import "rxjs/add/observable/fromPromise"; import { isLocalRequest, processLocalFileRequest } from "../http-client/http-utils"; From 144919f6ed672f8ab6d95a7dda35133e932fb9fc Mon Sep 17 00:00:00 2001 From: sis0k0 Date: Fri, 13 Apr 2018 16:25:39 +0300 Subject: [PATCH 05/12] chore(e2e): update router app to webpack 4 and NG 6 --- e2e/router/app/app.module.ts | 2 - e2e/router/app/first/first.component.ts | 1 - .../lazy-componentless-route.component.ts | 1 - e2e/router/app/lazy/lazy.component.ts | 1 - e2e/router/app/rxjs-operators.ts | 1 - e2e/router/app/second/detail.component.ts | 7 ++-- e2e/router/app/second/second.component.ts | 9 ++-- e2e/router/package.json | 42 ++++++++++--------- 8 files changed, 32 insertions(+), 32 deletions(-) delete mode 100644 e2e/router/app/rxjs-operators.ts diff --git a/e2e/router/app/app.module.ts b/e2e/router/app/app.module.ts index 5d7dcbdbc..82314813b 100644 --- a/e2e/router/app/app.module.ts +++ b/e2e/router/app/app.module.ts @@ -2,8 +2,6 @@ import { NgModule, NgModuleFactoryLoader, NO_ERRORS_SCHEMA } from "@angular/core import { NativeScriptModule } from "nativescript-angular/nativescript.module"; import { NSModuleFactoryLoader } from "nativescript-angular/router"; -import "./rxjs-operators"; - import { AppRoutingModule, navigatableComponents, diff --git a/e2e/router/app/first/first.component.ts b/e2e/router/app/first/first.component.ts index 5748e7b2b..36f42a746 100644 --- a/e2e/router/app/first/first.component.ts +++ b/e2e/router/app/first/first.component.ts @@ -4,7 +4,6 @@ import { Location } from "@angular/common"; import { RouterExtensions } from "nativescript-angular/router"; import { Page } from "ui/page"; -import { Observable } from "rxjs/Observable"; @Component({ selector: "first", diff --git a/e2e/router/app/lazy/lazy-componentless-route.component.ts b/e2e/router/app/lazy/lazy-componentless-route.component.ts index a3df10fd5..02734a982 100644 --- a/e2e/router/app/lazy/lazy-componentless-route.component.ts +++ b/e2e/router/app/lazy/lazy-componentless-route.component.ts @@ -4,7 +4,6 @@ import { Location } from "@angular/common"; import { RouterExtensions } from "nativescript-angular/router"; import { Page } from "ui/page"; -import { Observable } from "rxjs/Observable"; @Component({ selector: "lazy", diff --git a/e2e/router/app/lazy/lazy.component.ts b/e2e/router/app/lazy/lazy.component.ts index 94e3f72b6..0a3b5d1f3 100644 --- a/e2e/router/app/lazy/lazy.component.ts +++ b/e2e/router/app/lazy/lazy.component.ts @@ -4,7 +4,6 @@ import { Location } from "@angular/common"; import { RouterExtensions } from "nativescript-angular/router"; import { Page } from "ui/page"; -import { Observable } from "rxjs/Observable"; @Component({ selector: "lazy", diff --git a/e2e/router/app/rxjs-operators.ts b/e2e/router/app/rxjs-operators.ts deleted file mode 100644 index 480bbe40f..000000000 --- a/e2e/router/app/rxjs-operators.ts +++ /dev/null @@ -1 +0,0 @@ -import "rxjs/add/operator/map"; \ No newline at end of file diff --git a/e2e/router/app/second/detail.component.ts b/e2e/router/app/second/detail.component.ts index e005f6dee..4f42260cd 100644 --- a/e2e/router/app/second/detail.component.ts +++ b/e2e/router/app/second/detail.component.ts @@ -2,7 +2,8 @@ import { Component, OnInit, OnDestroy } from "@angular/core"; import { ActivatedRoute, Router, Route } from "@angular/router"; import { Location } from "@angular/common"; import { Page } from "ui/page"; -import { Observable } from "rxjs/Observable"; +import { Observable } from "rxjs"; +import { map } from "rxjs/operators"; @Component({ selector: "detail", @@ -19,7 +20,7 @@ export class DetailComponent { constructor(private router: Router, private route: ActivatedRoute) { console.log("DetailComponent - constructor()"); - this.id$ = route.params.map(r => r["id"]); + this.id$ = route.params.pipe(map(r => r["id"])); } ngOnInit() { @@ -29,4 +30,4 @@ export class DetailComponent { ngOnDestroy() { console.log("DetailComponent - ngOnDestroy()"); } -} \ No newline at end of file +} diff --git a/e2e/router/app/second/second.component.ts b/e2e/router/app/second/second.component.ts index 75acb847b..a827aab24 100644 --- a/e2e/router/app/second/second.component.ts +++ b/e2e/router/app/second/second.component.ts @@ -3,7 +3,8 @@ import { ActivatedRoute, Router, Route } from "@angular/router"; import { RouterExtensions } from "nativescript-angular/router"; import { Page } from "ui/page"; -import { Observable } from "rxjs/Observable"; +import { Observable } from "rxjs"; +import { map } from "rxjs/operators"; @Component({ selector: "second", @@ -28,8 +29,8 @@ export class SecondComponent implements OnInit, OnDestroy { constructor(private routerExt: RouterExtensions, route: ActivatedRoute, page: Page) { console.log("SecondComponent - constructor() page: " + page); - this.depth$ = route.params.map(r => r["depth"]); - this.nextDepth$ = route.params.map(r => +r["depth"] + 1); + this.depth$ = route.params.pipe(map(r => r["depth"])); + this.nextDepth$ = route.params.pipe(map(r => +r["depth"] + 1)); } ngOnInit() { @@ -43,4 +44,4 @@ export class SecondComponent implements OnInit, OnDestroy { goBack() { this.routerExt.back(); } -} \ No newline at end of file +} diff --git a/e2e/router/package.json b/e2e/router/package.json index a58d18440..f6ea6a8c8 100644 --- a/e2e/router/package.json +++ b/e2e/router/package.json @@ -6,32 +6,33 @@ "nativescript": { "id": "org.nativescript.router", "tns-android": { - "version": "3.4.0-2017-12-4-1" + "version": "next" }, "tns-ios": { "version": "next" } }, "dependencies": { - "@angular/animations": "~5.2.0", - "@angular/common": "~5.2.0", - "@angular/compiler": "~5.2.0", - "@angular/core": "~5.2.0", - "@angular/forms": "~5.2.0", - "@angular/http": "~5.2.0", - "@angular/platform-browser": "~5.2.0", - "@angular/platform-browser-dynamic": "~5.2.0", - "@angular/router": "~5.2.0", + "@angular/animations": "~6.0.0-rc.3", + "@angular/common": "~6.0.0-rc.3", + "@angular/compiler": "~6.0.0-rc.3", + "@angular/core": "~6.0.0-rc.3", + "@angular/forms": "~6.0.0-rc.3", + "@angular/http": "~6.0.0-rc.3", + "@angular/platform-browser": "~6.0.0-rc.3", + "@angular/platform-browser-dynamic": "~6.0.0-rc.3", + "@angular/router": "~6.0.0-rc.3", "nativescript-angular": "file:../../nativescript-angular", "nativescript-intl": "^3.0.0", "reflect-metadata": "~0.1.8", - "rxjs": "^5.5.4", + "rxjs": "~6.0.0-rc.1", "tns-core-modules": "next", "zone.js": "^0.8.4" }, "devDependencies": { - "@angular/compiler-cli": "~5.2.0", - "@ngtools/webpack": "~1.9.4", + "@angular-devkit/core": "~0.5.5", + "@angular/compiler-cli": "~6.0.0-rc.3", + "@ngtools/webpack": "~6.0.0-rc.3", "@types/chai": "^4.0.2", "@types/mocha": "^2.2.41", "@types/node": "^7.0.5", @@ -40,8 +41,9 @@ "babylon": "6.17.4", "chai": "~4.1.1", "chai-as-promised": "~7.1.1", + "clean-webpack-plugin": "~0.1.19", "colors": "^1.1.2", - "copy-webpack-plugin": "~4.3.0", + "copy-webpack-plugin": "~4.5.1", "css-loader": "~0.28.7", "extract-text-webpack-plugin": "~3.0.2", "lazy": "1.0.11", @@ -50,16 +52,18 @@ "mocha-multi": "^0.11.0", "nativescript-dev-appium": "next", "nativescript-dev-typescript": "~0.4.0", - "nativescript-dev-webpack": "^0.11.0", + "nativescript-dev-webpack": "next", "nativescript-worker-loader": "~0.8.1", "raw-loader": "~0.5.1", - "resolve-url-loader": "~2.2.1", + "resolve-url-loader": "~2.3.0", "tslib": "^1.7.1", - "typescript": "~2.6.2", - "uglifyjs-webpack-plugin": "~1.1.6", - "webpack": "~3.10.0", + "typescript": "~2.7.2", + "uglifyjs-webpack-plugin": "~1.2.4", + "webpack": "~4.5.0", "webpack-bundle-analyzer": "^2.9.1", "webpack-sources": "~1.1.0", + "webpack-cli": "~2.0.14", + "webpack-sources": "~1.1.0", "clean-webpack-plugin": "~0.1.19" }, "scripts": { From 2110709ab2183fcc5cbaafdeb2cdea8a83fc9b6b Mon Sep 17 00:00:00 2001 From: sis0k0 Date: Fri, 13 Apr 2018 16:27:20 +0300 Subject: [PATCH 06/12] chore(renderer): update to webpack4 and NG 6 --- e2e/renderer/package.json | 45 +++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/e2e/renderer/package.json b/e2e/renderer/package.json index dc591ba18..209ab9315 100644 --- a/e2e/renderer/package.json +++ b/e2e/renderer/package.json @@ -6,28 +6,29 @@ "nativescript": { "id": "org.nativescript.renderer", "tns-android": { - "version": "3.4.1-2018-02-06-02" + "version": "4.1.0-2018.4.13.1" } }, "dependencies": { - "@angular/common": "~5.2.0", - "@angular/compiler": "~5.2.0", - "@angular/core": "~5.2.0", - "@angular/forms": "~5.2.0", - "@angular/http": "~5.2.0", - "@angular/platform-browser": "~5.2.0", - "@angular/platform-browser-dynamic": "~5.2.0", - "@angular/router": "~5.2.0", + "@angular/common": "~6.0.0-rc.3", + "@angular/compiler": "~6.0.0-rc.3", + "@angular/core": "~6.0.0-rc.3", + "@angular/forms": "~6.0.0-rc.3", + "@angular/http": "~6.0.0-rc.3", + "@angular/platform-browser": "~6.0.0-rc.3", + "@angular/platform-browser-dynamic": "~6.0.0-rc.3", + "@angular/router": "~6.0.0-rc.3", "nativescript-angular": "file:../../nativescript-angular", "nativescript-intl": "^3.0.0", "reflect-metadata": "~0.1.8", - "rxjs": "^5.5.0", + "rxjs": "~6.0.0-rc.1", "tns-core-modules": "next", "zone.js": "^0.8.4" }, "devDependencies": { - "@angular/compiler-cli": "~5.2.0", - "@ngtools/webpack": "~1.9.4", + "@angular-devkit/core": "~0.5.5", + "@angular/compiler-cli": "~6.0.0-rc.3", + "@ngtools/webpack": "~6.0.0-rc.3", "@types/chai": "^4.0.2", "@types/mocha": "^2.2.41", "@types/node": "^7.0.5", @@ -36,8 +37,9 @@ "babylon": "6.17.4", "chai": "~4.1.1", "chai-as-promised": "~7.1.1", + "clean-webpack-plugin": "~0.1.19", "colors": "^1.1.2", - "copy-webpack-plugin": "~4.3.0", + "copy-webpack-plugin": "~4.5.1", "css-loader": "~0.28.7", "extract-text-webpack-plugin": "~3.0.2", "lazy": "1.0.11", @@ -45,18 +47,19 @@ "mocha-junit-reporter": "^1.13.0", "mocha-multi": "^0.11.0", "nativescript-dev-appium": "next", - "nativescript-dev-typescript": "~0.4.0", - "nativescript-dev-webpack": "^0.11.0", + "nativescript-dev-typescript": "~0.7.1", + "nativescript-dev-webpack": "next", "nativescript-worker-loader": "~0.8.1", "raw-loader": "~0.5.1", - "resolve-url-loader": "~2.2.1", + "resolve-url-loader": "~2.3.0", "tslib": "^1.7.1", - "typescript": "~2.6.2", - "uglifyjs-webpack-plugin": "~1.1.6", - "webpack": "~3.10.0", + "typescript": "~2.7.2", + "uglifyjs-webpack-plugin": "~1.2.4", + "webpack": "~4.5.0", "webpack-bundle-analyzer": "^2.9.1", - "webpack-sources": "~1.1.0", - "clean-webpack-plugin": "~0.1.19" + "clean-webpack-plugin": "~0.1.19", + "webpack-cli": "~2.0.14", + "webpack-sources": "~1.1.0" }, "scripts": { "e2e": "tsc -p e2e && mocha --opts ../config/mocha.opts --recursive e2e --appiumCapsLocation ../config/appium.capabilities.json", From 2a12bc51a6d4b8e3a656739bd981d71301ff49cb Mon Sep 17 00:00:00 2001 From: vakrilov Date: Mon, 16 Apr 2018 17:45:25 +0300 Subject: [PATCH 07/12] fix: Use cssType (uglify safe) instead typeName of for view metadata. --- nativescript-angular/view-util.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nativescript-angular/view-util.ts b/nativescript-angular/view-util.ts index ebcd966ac..b9916d313 100644 --- a/nativescript-angular/view-util.ts +++ b/nativescript-angular/view-util.ts @@ -276,7 +276,7 @@ export class ViewUtil { if (view.hasOwnProperty("meta")) { return view as NgView; } else { - const name = view.typeName; + const name = view.cssType; const ngView = this.setNgViewExtensions(view, name); return ngView; From 7c4b854f48631f1ea1f1b4ba47dd85526dd7e892 Mon Sep 17 00:00:00 2001 From: vakrilov Date: Tue, 17 Apr 2018 09:30:02 +0300 Subject: [PATCH 08/12] chore: migrated test porject to ng6+rxjs6 --- tests/app/base.component.ts | 2 +- tests/app/first.component.ts | 2 +- tests/app/main.ts | 2 +- tests/app/second.component.ts | 2 +- tests/app/snippets/navigation/route-params.ts | 8 +++--- tests/app/tests/http.ts | 22 +++++++++++----- tests/app/tests/snippets.ts | 2 +- tests/package.json | 26 +++++++++---------- 8 files changed, 38 insertions(+), 28 deletions(-) diff --git a/tests/app/base.component.ts b/tests/app/base.component.ts index 2ca048204..bcbc32a56 100644 --- a/tests/app/base.component.ts +++ b/tests/app/base.component.ts @@ -1,6 +1,6 @@ import { InjectionToken, OnInit, OnDestroy } from "@angular/core"; export const HOOKS_LOG = new InjectionToken("Hooks log"); -import { BehaviorSubject } from "rxjs/BehaviorSubject"; +import { BehaviorSubject } from "rxjs"; export class BaseComponent implements OnInit, OnDestroy { protected name: string = ""; diff --git a/tests/app/first.component.ts b/tests/app/first.component.ts index c9a8832ec..089e82f36 100644 --- a/tests/app/first.component.ts +++ b/tests/app/first.component.ts @@ -2,7 +2,7 @@ import { Router, ActivatedRoute } from "@angular/router"; import { Component, Inject } from "@angular/core"; import { RouterExtensions } from "nativescript-angular/router"; import { HOOKS_LOG, BaseComponent } from "./base.component"; -import { BehaviorSubject } from "rxjs/BehaviorSubject"; +import { BehaviorSubject } from "rxjs"; @Component({ selector: "first-comp", diff --git a/tests/app/main.ts b/tests/app/main.ts index 6e7af754e..1a4ed9852 100644 --- a/tests/app/main.ts +++ b/tests/app/main.ts @@ -31,7 +31,7 @@ import { NavigationApp } from "./snippets/navigation/router-outlet"; import { rendererTraceCategory, routerTraceCategory } from "nativescript-angular/trace"; -import { BehaviorSubject } from "rxjs/BehaviorSubject"; +import { BehaviorSubject } from "rxjs"; import { GridLayout, ItemSpec } from "tns-core-modules/ui/layouts/grid-layout/grid-layout"; diff --git a/tests/app/second.component.ts b/tests/app/second.component.ts index 20f32305e..9443caab8 100644 --- a/tests/app/second.component.ts +++ b/tests/app/second.component.ts @@ -3,7 +3,7 @@ import { Component, Inject, OnInit } from "@angular/core"; import { Location } from "@angular/common"; import { RouterExtensions } from "nativescript-angular/router"; import { HOOKS_LOG, BaseComponent } from "./base.component"; -import { BehaviorSubject } from "rxjs/BehaviorSubject"; +import { BehaviorSubject } from "rxjs"; @Component({ selector: "second-comp", diff --git a/tests/app/snippets/navigation/route-params.ts b/tests/app/snippets/navigation/route-params.ts index a70839ed6..23148ded4 100644 --- a/tests/app/snippets/navigation/route-params.ts +++ b/tests/app/snippets/navigation/route-params.ts @@ -12,15 +12,15 @@ class MyComponent { // >> router-params-page-route import { PageRoute } from "nativescript-angular/router"; -import "rxjs/add/operator/switchMap"; +import { switchMap } from "rxjs/operators"; class MyPageComponent { id: number; constructor(private pageRoute: PageRoute) { // use switchMap to get the latest activatedRoute instance - this.pageRoute.activatedRoute - .switchMap(activatedRoute => activatedRoute.params) - .forEach((params) => { this.id = +params["id"]; }); + this.pageRoute.activatedRoute.pipe( + switchMap(activatedRoute => activatedRoute.params) + ).forEach((params) => { this.id = +params["id"]; }); } } // << router-params-page-route diff --git a/tests/app/tests/http.ts b/tests/app/tests/http.ts index e02af2ad0..7aa625fef 100644 --- a/tests/app/tests/http.ts +++ b/tests/app/tests/http.ts @@ -6,7 +6,7 @@ import { } from "@angular/core/testing"; import { ReflectiveInjector, Injectable } from "@angular/core"; import { Request, BaseRequestOptions, ConnectionBackend, Http, Response, ResponseOptions } from "@angular/http"; -import "rxjs/add/operator/map"; +import { map } from "rxjs/operators"; import { MockBackend } from "@angular/http/testing"; import { NSHttp } from "nativescript-angular/http/ns-http"; import { NSFileSystem } from "nativescript-angular/file-system/ns-file-system"; @@ -62,14 +62,18 @@ describe("Http", () => { }); it("should work with local files prefixed with '~'", () => { - http.get("~/test.json").map(res => res.json()).subscribe((response: any) => { + http.get("~/test.json").pipe( + map(res => res.json()) + ).subscribe((response: any) => { assert.strictEqual(3, response.length); assert.strictEqual("Alex", response[0].name); }); }); it("request method should work with local files prefixed with '~'", () => { - http.request("~/test.json").map(res => res.json()).subscribe((response: any) => { + http.request("~/test.json").pipe( + map(res => res.json()) + ).subscribe((response: any) => { assert.strictEqual(3, response.length); assert.strictEqual("Alex", response[0].name); }); @@ -81,14 +85,18 @@ describe("Http", () => { method: 'GET', url }); - http.request(req).map(res => res.json()).subscribe((response: any) => { + http.request(req).pipe( + map(res => res.json()) + ).subscribe((response: any) => { assert.strictEqual(3, response.length); assert.strictEqual("Alex", response[0].name); }); }); it("should work with local files prefixed with '/'", () => { - http.get("/test.json").map(res => res.json()).subscribe((response: any) => { + http.get("/test.json").pipe( + map(res => res.json()) + ).subscribe((response: any) => { assert.strictEqual(3, response.length); assert.strictEqual("Panayot", response[2].name); }); @@ -97,7 +105,9 @@ describe("Http", () => { it("should work with remote files", () => { let connection: any; backend.connections.subscribe((c: any) => connection = c); - http.get("http://www.nativescript.org/test.json").map(res => res.json()).subscribe((response: any) => { + http.get("http://www.nativescript.org/test.json").pipe( + map(res => res.json()) + ).subscribe((response: any) => { assert.strictEqual(3, response.length); assert.strictEqual("Rosen", response[1].name); }); diff --git a/tests/app/tests/snippets.ts b/tests/app/tests/snippets.ts index e0ed3464a..9fc7cb1cb 100644 --- a/tests/app/tests/snippets.ts +++ b/tests/app/tests/snippets.ts @@ -2,7 +2,7 @@ import { assert } from "./test-config"; import { NavigationEnd, NavigationStart } from "@angular/router"; -import { Subscription } from "rxjs/Subscription"; +import { Subscription } from "rxjs"; import { TestApp, bootstrapTestApp, destroyTestApp } from "./test-app"; import { GestureComponent } from "../snippets/gestures.component"; diff --git a/tests/package.json b/tests/package.json index eb9f9b460..ba5d56fc0 100644 --- a/tests/package.json +++ b/tests/package.json @@ -2,10 +2,10 @@ "nativescript": { "id": "org.nativescript.ngtests", "tns-ios": { - "version": "next" + "version": "4.0.2-2018-04-13-01" }, "tns-android": { - "version": "next" + "version": "4.1.0-2018.4.16.8" } }, "name": "ngtests", @@ -26,18 +26,18 @@ ], "homepage": "http://nativescript.org", "dependencies": { - "@angular/animations": "~5.2.0", - "@angular/common": "~5.2.0", - "@angular/compiler": "~5.2.0", - "@angular/core": "~5.2.0", - "@angular/forms": "~5.2.0", - "@angular/http": "~5.2.0", - "@angular/platform-browser": "~5.2.0", - "@angular/platform-browser-dynamic": "~5.2.0", - "@angular/router": "~5.2.0", + "@angular/animations": "~6.0.0-rc.3", + "@angular/common": "~6.0.0-rc.3", + "@angular/compiler": "~6.0.0-rc.3", + "@angular/core": "~6.0.0-rc.3", + "@angular/forms": "~6.0.0-rc.3", + "@angular/http": "~6.0.0-rc.3", + "@angular/platform-browser": "~6.0.0-rc.3", + "@angular/platform-browser-dynamic": "~6.0.0-rc.3", + "@angular/router": "~6.0.0-rc.3", "nativescript-angular": "../nativescript-angular", "nativescript-unit-test-runner": "^0.3.4", - "rxjs": "^5.5.0", + "rxjs": "~6.0.0-rc.1", "tns-core-modules": "next", "zone.js": "^0.8.4" }, @@ -66,7 +66,7 @@ "socket.io-client": "1.4.8", "tslib": "^1.7.1", "tslint": "^4.5.1", - "typescript": "~2.6.2", + "typescript": "~2.7.2", "mocha": "~3.5.0" }, "scripts": { From 1f83f29ef3a68ab77aa37f8c163f8d8faded253f Mon Sep 17 00:00:00 2001 From: vakrilov Date: Tue, 17 Apr 2018 10:08:09 +0300 Subject: [PATCH 09/12] chore: Update ng-sample to ng6 + rxjs6 --- ng-sample/app/app.ts | 4 +-- .../examples/http-client/http-client-test.ts | 11 ++++--- ng-sample/app/examples/http/http-test.ts | 32 +++++++++++-------- ng-sample/app/examples/list/data.service.ts | 2 +- .../app/examples/list/list-test-async.ts | 12 +++---- ng-sample/app/examples/modal/modal-test.ts | 2 +- .../app/examples/router/clear-history-test.ts | 2 +- ng-sample/app/examples/router/login-test.ts | 17 +++++----- .../router/page-router-outlet-nested-test.ts | 10 +++--- .../router/page-router-outlet-test.ts | 8 ++--- .../app/examples/router/router-outlet-test.ts | 4 +-- ng-sample/package.json | 26 +++++++-------- 12 files changed, 67 insertions(+), 63 deletions(-) diff --git a/ng-sample/app/app.ts b/ng-sample/app/app.ts index f72e23952..666a570e5 100644 --- a/ng-sample/app/app.ts +++ b/ng-sample/app/app.ts @@ -139,7 +139,7 @@ class MyErrorHandler implements ErrorHandler { // platformNativeScriptDynamic().bootstrapModule(makeExampleModule(Benchmark)); // platformNativeScriptDynamic().bootstrapModule(makeExampleModule(ListTest)); // platformNativeScriptDynamic().bootstrapModule(makeExampleModule(ListTemplateSelectorTest)); -// platformNativeScriptDynamic().bootstrapModule(makeExampleModule(ListTestAsync)); +platformNativeScriptDynamic().bootstrapModule(makeExampleModule(ListTestAsync)); // platformNativeScriptDynamic().bootstrapModule(makeExampleModule(ImageTest)); // platformNativeScriptDynamic().bootstrapModule(makeExampleModule(ModalTest)); // platformNativeScriptDynamic().bootstrapModule(makeExampleModule(HttpTest)); @@ -187,4 +187,4 @@ onAfterLivesync.subscribe(({ moduleRef, error }) => { // platformNativeScriptDynamic().bootstrapModule(makeExampleModule(LivesyncApp)); // console.log("APP RESTART!!!! !!!"); -platformNativeScriptDynamic().bootstrapModule(makeExampleModule(ModalTest)); +// platformNativeScriptDynamic().bootstrapModule(makeExampleModule(ModalTest)); diff --git a/ng-sample/app/examples/http-client/http-client-test.ts b/ng-sample/app/examples/http-client/http-client-test.ts index 7af6fb9d6..ed6f784d3 100644 --- a/ng-sample/app/examples/http-client/http-client-test.ts +++ b/ng-sample/app/examples/http-client/http-client-test.ts @@ -3,18 +3,19 @@ import { HttpClient, HTTP_INTERCEPTORS, HttpEventType, HttpErrorResponse, HttpEvent, HttpInterceptor, HttpHandler, HttpRequest } from "@angular/common/http"; -import { Observable } from "rxjs/Observable"; -import "rxjs/add/operator/do"; +import { Observable } from "rxjs"; +import { tap } from "rxjs/operators"; @Injectable() export class CustomInterceptor implements HttpInterceptor { intercept(req: HttpRequest, next: HttpHandler): Observable> { console.log(`[CustomInterceptor] intercept url: ${req.url}`); - return next.handle(req) - .do(event => { + return next.handle(req).pipe( + tap(event => { console.log(`[CustomInterceptor] handled type: ${HttpEventType[event.type]} url: ${req.url}`); - }); + }) + ); } } diff --git a/ng-sample/app/examples/http/http-test.ts b/ng-sample/app/examples/http/http-test.ts index ae2c4b8ca..15e84c70b 100644 --- a/ng-sample/app/examples/http/http-test.ts +++ b/ng-sample/app/examples/http/http-test.ts @@ -1,6 +1,6 @@ -import {Component} from "@angular/core"; -import {Http} from "@angular/http"; -import "rxjs/add/operator/map"; +import { Component } from "@angular/core"; +import { Http } from "@angular/http"; +import { map } from "rxjs/operators"; /* IMPORTANT In order to test out the full image example, @@ -11,8 +11,8 @@ https://blog.nraboy.com/2015/12/fix-ios-9-app-transport-security-issues-in-nativ */ @Component({ - selector: "http-test", - template: ` + selector: "http-test", + template: ` @@ -20,11 +20,11 @@ https://blog.nraboy.com/2015/12/fix-ios-9-app-transport-security-issues-in-nativ `, - styles: [ - `Button { + styles: [ + `Button { margin-bottom:20; }` - ], + ], }) export class HttpTest { public title: string; @@ -35,7 +35,9 @@ export class HttpTest { } public loadLocal() { - this.http.get("~/examples/http/data.json").map(res => res.json()).subscribe((response: any) => { + this.http.get("~/examples/http/data.json").pipe( + map(res => res.json()) + ).subscribe((response: any) => { let user = response.results[0]; this.title = user.title; this.description = user.description; @@ -43,10 +45,12 @@ export class HttpTest { } public loadRemote() { - this.http.get(`https://randomuser.me/api/?results=1&nat=us`).map(res => res.json()).subscribe((response: any) => { - let user = response.results[0]; - this.title = user.name.first; - this.description = user.email; - }); + this.http.get(`https://randomuser.me/api/?results=1&nat=us`) + .pipe(map(res => res.json())) + .subscribe((response: any) => { + let user = response.results[0]; + this.title = user.name.first; + this.description = user.email; + }); } } diff --git a/ng-sample/app/examples/list/data.service.ts b/ng-sample/app/examples/list/data.service.ts index 2aef70c26..169dd2d9a 100644 --- a/ng-sample/app/examples/list/data.service.ts +++ b/ng-sample/app/examples/list/data.service.ts @@ -1,5 +1,5 @@ import { Injectable } from "@angular/core"; -import { BehaviorSubject } from "rxjs/BehaviorSubject"; +import { BehaviorSubject } from "rxjs"; export class DataItem { constructor(public id: number, public name: string) { } diff --git a/ng-sample/app/examples/list/list-test-async.ts b/ng-sample/app/examples/list/list-test-async.ts index ed635997c..20206a2d1 100644 --- a/ng-sample/app/examples/list/list-test-async.ts +++ b/ng-sample/app/examples/list/list-test-async.ts @@ -1,8 +1,7 @@ import { Component, ChangeDetectionStrategy } from "@angular/core"; import { DataItem, DataService } from "./data.service"; -import { Observable } from "rxjs/Observable"; -import { BehaviorSubject } from "rxjs/BehaviorSubject"; -import "rxjs/add/operator/combineLatest"; +import { Observable, BehaviorSubject } from "rxjs"; +import { combineLatest } from "rxjs/operators"; @Component({ selector: "list-test-async", @@ -95,9 +94,10 @@ export class ListTestFilterAsync { private filter$ = new BehaviorSubject(false); constructor(private service: DataService) { - this.filteredItems$ = this.service.items$.combineLatest(this.filter$, (data, filter) => { - return filter ? data.filter(v => v.id % 2 === 0) : data; - }); + this.filteredItems$ = this.service.items$.pipe( + combineLatest(this.filter$, (data, filter) => { + return filter ? data.filter(v => v.id % 2 === 0) : data; + })); } public onItemTap(args) { diff --git a/ng-sample/app/examples/modal/modal-test.ts b/ng-sample/app/examples/modal/modal-test.ts index 6851c333d..edfebf4fc 100644 --- a/ng-sample/app/examples/modal/modal-test.ts +++ b/ng-sample/app/examples/modal/modal-test.ts @@ -1,5 +1,5 @@ import { Component, ViewContainerRef } from "@angular/core"; -import * as dialogs from "ui/dialogs"; +import * as dialogs from "tns-core-modules/ui/dialogs"; import { ModalDialogService, ModalDialogOptions } from "nativescript-angular/directives/dialogs"; import { ModalContent } from "./modal-content"; diff --git a/ng-sample/app/examples/router/clear-history-test.ts b/ng-sample/app/examples/router/clear-history-test.ts index dba5a8e86..727f982d5 100644 --- a/ng-sample/app/examples/router/clear-history-test.ts +++ b/ng-sample/app/examples/router/clear-history-test.ts @@ -2,7 +2,7 @@ import { Component, OnInit, OnDestroy, Injectable } from "@angular/core"; import { Router } from "@angular/router"; import { RouterExtensions } from "nativescript-angular/router"; import { NSLocationStrategy } from "nativescript-angular/router/ns-location-strategy"; -import { BehaviorSubject } from "rxjs/BehaviorSubject"; +import { BehaviorSubject } from "rxjs"; @Injectable() class LocationLogService { diff --git a/ng-sample/app/examples/router/login-test.ts b/ng-sample/app/examples/router/login-test.ts index 975d19c53..284e2d8bd 100644 --- a/ng-sample/app/examples/router/login-test.ts +++ b/ng-sample/app/examples/router/login-test.ts @@ -2,9 +2,8 @@ import { Component, Injectable } from "@angular/core"; import { CanActivate, Resolve, ActivatedRouteSnapshot, RouterStateSnapshot } from "@angular/router"; import { RouterExtensions, PageRoute } from "nativescript-angular/router"; import * as appSettings from "application-settings"; -import { Observable } from "rxjs/Observable"; -import "rxjs/add/operator/map"; -import "rxjs/add/operator/switchMap"; +import { Observable } from "rxjs"; +import { map, switchMap } from "rxjs/operators"; const USER_KEY = "user"; @@ -88,16 +87,16 @@ export interface ResolvedData { class MainComponent { private data$: Observable; constructor(private nav: RouterExtensions, private loginService: LoginService, private pageRoute: PageRoute) { - this.data$ = this.pageRoute.activatedRoute - .switchMap(activatedRoute => activatedRoute.data) - .map(data => data[0]); + this.data$ = this.pageRoute.activatedRoute.pipe( + switchMap(activatedRoute => activatedRoute.data), + map(data => data[0]) + ); } logout() { this.loginService.logout().then((result) => { - if (result) { + if (result) this.nav.navigate(["/login"], { clearHistory: true }); - } }); } @@ -157,7 +156,7 @@ class AuthGuard implements CanActivate { class ResolveGuard implements Resolve { static counter = 0; resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): - Observable | Promise | ResolvedData { + Observable | Promise | ResolvedData { const result: ResolvedData = { id: ResolveGuard.counter++ }; console.log(`ResolveGuard: Fetching new data. Result: ${JSON.stringify(result)} `); return result; diff --git a/ng-sample/app/examples/router/page-router-outlet-nested-test.ts b/ng-sample/app/examples/router/page-router-outlet-nested-test.ts index 5f5e07da5..a34844fce 100644 --- a/ng-sample/app/examples/router/page-router-outlet-nested-test.ts +++ b/ng-sample/app/examples/router/page-router-outlet-nested-test.ts @@ -2,8 +2,8 @@ import { Component, OnInit, OnDestroy } from "@angular/core"; import { ActivatedRoute, Router, Route } from "@angular/router"; import { Location } from "@angular/common"; import { Page } from "ui/page"; -import { Observable } from "rxjs/Observable"; -import "rxjs/add/operator/map"; +import { Observable } from "rxjs"; +import { map } from "rxjs/operators"; @Component({ selector: "first", @@ -68,7 +68,7 @@ class DetailComponent { public id$: Observable; constructor(private router: Router, private route: ActivatedRoute) { console.log("DetailComponent.constructor()"); - this.id$ = route.params.map(r => r["id"]); + this.id$ = route.params.pipe(map(r => r["id"])); } ngOnInit() { @@ -106,8 +106,8 @@ class SecondComponent implements OnInit, OnDestroy { public nextDepth$: Observable; constructor(private location: Location, route: ActivatedRoute, page: Page) { console.log("SecondComponent.constructor() page: " + page); - this.depth$ = route.params.map(r => r["depth"]); - this.nextDepth$ = route.params.map(r => +r["depth"] + 1); + this.depth$ = route.params.pipe(map(r => r["depth"])); + this.nextDepth$ = route.params.pipe(map(r => +r["depth"] + 1)); } ngOnInit() { diff --git a/ng-sample/app/examples/router/page-router-outlet-test.ts b/ng-sample/app/examples/router/page-router-outlet-test.ts index b7dc43f90..28261d6b3 100644 --- a/ng-sample/app/examples/router/page-router-outlet-test.ts +++ b/ng-sample/app/examples/router/page-router-outlet-test.ts @@ -2,8 +2,8 @@ import { Component, OnInit, OnDestroy } from "@angular/core"; import { ActivatedRoute, Router } from "@angular/router"; import { Location } from "@angular/common"; import { Page } from "ui/page"; -import { Observable } from "rxjs/Observable"; -import "rxjs/add/operator/map"; +import { Observable } from "rxjs"; +import { map } from "rxjs/operators"; @Component({ @@ -51,7 +51,7 @@ class SecondComponent implements OnInit, OnDestroy { public id: Observable; constructor(private location: Location, route: ActivatedRoute, page: Page) { console.log("SecondComponent.constructor() page: " + page); - this.id = route.params.map(r => r["id"]); + this.id = route.params.pipe(map(r => r["id"])); } ngOnInit() { @@ -85,7 +85,7 @@ class ThirdComponent implements OnInit, OnDestroy { public id: Observable; constructor(private location: Location, route: ActivatedRoute, page: Page) { console.log("ThirdComponent.constructor() page: " + page); - this.id = route.params.map(r => r["id"]); + this.id = route.params.pipe(map(r => r["id"])); } ngOnInit() { diff --git a/ng-sample/app/examples/router/router-outlet-test.ts b/ng-sample/app/examples/router/router-outlet-test.ts index 76fa8a8c0..04e82388a 100644 --- a/ng-sample/app/examples/router/router-outlet-test.ts +++ b/ng-sample/app/examples/router/router-outlet-test.ts @@ -1,6 +1,6 @@ import { Component, OnInit, OnDestroy } from "@angular/core"; import { ActivatedRoute } from "@angular/router"; -import "rxjs/add/operator/map"; +import { map } from "rxjs/operators"; @Component({ selector: "first", @@ -31,7 +31,7 @@ class FirstComponent implements OnInit, OnDestroy { class SecondComponent implements OnInit, OnDestroy { id; constructor(route: ActivatedRoute) { - this.id = route.params.map(r => r["id"]); + this.id = route.params.pipe(map(r => r["id"])); } ngOnInit() { diff --git a/ng-sample/package.json b/ng-sample/package.json index 604cee800..4143d58e1 100644 --- a/ng-sample/package.json +++ b/ng-sample/package.json @@ -2,10 +2,10 @@ "nativescript": { "id": "org.nativescript.ngsample", "tns-android": { - "version": "next" + "version": "4.1.0-2018.4.16.8" }, "tns-ios": { - "version": "next" + "version": "4.0.2-2018-04-13-01" } }, "name": "tns-template-hello-world", @@ -32,17 +32,17 @@ }, "homepage": "https://github.com/NativeScript/template-hello-world", "dependencies": { - "@angular/animations": "~5.2.0", - "@angular/common": "~5.2.0", - "@angular/compiler": "~5.2.0", - "@angular/core": "~5.2.0", - "@angular/forms": "~5.2.0", - "@angular/http": "~5.2.0", - "@angular/platform-browser": "~5.2.0", - "@angular/platform-browser-dynamic": "~5.2.0", - "@angular/router": "~5.2.0", + "@angular/animations": "~6.0.0-rc.3", + "@angular/common": "~6.0.0-rc.3", + "@angular/compiler": "~6.0.0-rc.3", + "@angular/core": "~6.0.0-rc.3", + "@angular/forms": "~6.0.0-rc.3", + "@angular/http": "~6.0.0-rc.3", + "@angular/platform-browser": "~6.0.0-rc.3", + "@angular/platform-browser-dynamic": "~6.0.0-rc.3", + "@angular/router": "~6.0.0-rc.3", "nativescript-angular": "file:../nativescript-angular", - "rxjs": "^5.5.0", + "rxjs": "~6.0.0-rc.1", "tns-core-modules": "next", "tns-platform-declarations": "^3.4.0", "zone.js": "^0.8.4" @@ -56,7 +56,7 @@ "nativescript-dev-typescript": "next", "shelljs": "^0.7.0", "tslint": "^4.5.1", - "typescript": "~2.6.2" + "typescript": "~2.7.2" }, "scripts": { "tslint": "tslint --project tsconfig.json --config tslint.json", From 105626ced6276135c6f4facdc6d970d6b8b980c5 Mon Sep 17 00:00:00 2001 From: vakrilov Date: Tue, 17 Apr 2018 10:29:19 +0300 Subject: [PATCH 10/12] chore: e2e apps migrated to ng6 + rxjs6 --- e2e/modal-navigation-ng/package.json | 26 +++++++++---------- e2e/renderer/.vscode/settings.json | 9 ++----- e2e/renderer/app/app.module.ts | 20 ++++++++++---- .../app/player/player-detail.component.ts | 2 +- .../app/team/team-detail.component.ts | 2 +- e2e/router-tab-view/package.json | 22 ++++++++-------- e2e/single-page/app/app.module.ts | 2 -- e2e/single-page/app/first/first.component.ts | 2 +- e2e/single-page/app/rxjs-operators.ts | 1 - .../app/second/second.component.ts | 5 ++-- e2e/single-page/package.json | 24 ++++++++--------- 11 files changed, 59 insertions(+), 56 deletions(-) delete mode 100644 e2e/single-page/app/rxjs-operators.ts diff --git a/e2e/modal-navigation-ng/package.json b/e2e/modal-navigation-ng/package.json index 237cb20ad..eff647a27 100644 --- a/e2e/modal-navigation-ng/package.json +++ b/e2e/modal-navigation-ng/package.json @@ -6,31 +6,31 @@ "nativescript": { "id": "org.nativescript.modalnavigationng", "tns-android": { - "version": "next" + "version": "4.1.0-2018.4.16.8" }, "tns-ios": { "version": "next" } }, "dependencies": { - "@angular/animations": "~5.2.0", - "@angular/common": "~5.2.0", - "@angular/compiler": "~5.2.0", - "@angular/core": "~5.2.0", - "@angular/forms": "~5.2.0", - "@angular/http": "~5.2.0", - "@angular/platform-browser": "~5.2.0", - "@angular/platform-browser-dynamic": "~5.2.0", - "@angular/router": "~5.2.0", + "@angular/animations": "~6.0.0-rc.3", + "@angular/common": "~6.0.0-rc.3", + "@angular/compiler": "~6.0.0-rc.3", + "@angular/core": "~6.0.0-rc.3", + "@angular/forms": "~6.0.0-rc.3", + "@angular/http": "~6.0.0-rc.3", + "@angular/platform-browser": "~6.0.0-rc.3", + "@angular/platform-browser-dynamic": "~6.0.0-rc.3", + "@angular/router": "~6.0.0-rc.3", "nativescript-angular": "file:../../nativescript-angular", "nativescript-theme-core": "~1.0.4", "reflect-metadata": "~0.1.8", - "rxjs": "~5.5.2", + "rxjs": "~6.0.0-rc.1", "tns-core-modules": "next", "zone.js": "~0.8.2" }, "devDependencies": { - "@angular/compiler-cli": "~5.2.0", + "@angular/compiler-cli": "~6.0.0-rc.3", "@ngtools/webpack": "~1.9.4", "@types/chai": "^4.0.2", "@types/mocha": "^2.2.41", @@ -48,7 +48,7 @@ "nativescript-worker-loader": "~0.8.1", "raw-loader": "~0.5.1", "resolve-url-loader": "~2.2.1", - "typescript": "~2.6.2", + "typescript": "~2.7.2", "uglifyjs-webpack-plugin": "~1.1.6", "webpack": "~3.10.0", "webpack-bundle-analyzer": "^2.9.1", diff --git a/e2e/renderer/.vscode/settings.json b/e2e/renderer/.vscode/settings.json index 699fb4408..5d4d7a687 100644 --- a/e2e/renderer/.vscode/settings.json +++ b/e2e/renderer/.vscode/settings.json @@ -1,18 +1,13 @@ { - "typescript.check.tscVersion": false, - "window.zoomLevel": 0, - "workbench.iconTheme": "vscode-icons", - "vsicons.dontShowNewVersionMessage": true, - "workbench.colorTheme": "Default Light+", "files.exclude": { "**/.git": true, "**/.svn": true, "**/.hg": true, "**/CVS": true, "**/.DS_Store": true, - "**/*.js": true, + // "**/*.js": true, "**/*.map": true, - "node_modules": true, + // "node_modules": true, "hooks": true, "platforms": true } diff --git a/e2e/renderer/app/app.module.ts b/e2e/renderer/app/app.module.ts index 92d302565..f4d071ac0 100644 --- a/e2e/renderer/app/app.module.ts +++ b/e2e/renderer/app/app.module.ts @@ -1,4 +1,4 @@ -import { NgModule, NO_ERRORS_SCHEMA } from "@angular/core"; +import { NgModule, NO_ERRORS_SCHEMA, ErrorHandler } from "@angular/core"; import { NativeScriptModule } from "nativescript-angular/nativescript.module"; import { @@ -10,12 +10,21 @@ import { AppComponent } from "./app.component"; import { ItemsService } from "./items.service"; import { rendererTraceCategory, viewUtilCategory, bootstrapCategory } from "nativescript-angular/trace"; -import { addCategories, enable } from "trace"; +import { addCategories, enable, categories } from "trace"; addCategories(bootstrapCategory); -// addCategories(rendererTraceCategory); -// addCategories(viewUtilCategory); +addCategories(rendererTraceCategory); +addCategories(viewUtilCategory); +addCategories(categories.ViewHierarchy); enable(); +export class MyErrorHandler implements ErrorHandler { + handleError(error) { + console.log("### ErrorHandler Error: " + error.toString()); + console.log("### ErrorHandler Stack: " + error.stack); + } +} + + @NgModule({ declarations: [ AppComponent, @@ -23,7 +32,8 @@ enable(); ], bootstrap: [AppComponent], providers: [ - ItemsService + ItemsService, + { provide: ErrorHandler, useClass: MyErrorHandler } ], imports: [ NativeScriptModule, diff --git a/e2e/router-tab-view/app/player/player-detail.component.ts b/e2e/router-tab-view/app/player/player-detail.component.ts index bc465acef..8b18da264 100644 --- a/e2e/router-tab-view/app/player/player-detail.component.ts +++ b/e2e/router-tab-view/app/player/player-detail.component.ts @@ -2,7 +2,7 @@ import { Component, OnInit } from "@angular/core"; import { ActivatedRoute } from "@angular/router"; import { DataService, DataItem } from "../data.service"; -import { Subscription } from "rxjs/Subscription"; +import { Subscription } from "rxjs"; @Component({ selector: "ns-player-details", diff --git a/e2e/router-tab-view/app/team/team-detail.component.ts b/e2e/router-tab-view/app/team/team-detail.component.ts index 383020919..1f055e296 100644 --- a/e2e/router-tab-view/app/team/team-detail.component.ts +++ b/e2e/router-tab-view/app/team/team-detail.component.ts @@ -2,7 +2,7 @@ import { Component, OnInit } from "@angular/core"; import { ActivatedRoute } from "@angular/router"; import { DataService, DataItem } from "../data.service"; -import { Subscription } from "rxjs/Subscription"; +import { Subscription } from "rxjs"; @Component({ selector: "ns-team-details", diff --git a/e2e/router-tab-view/package.json b/e2e/router-tab-view/package.json index 08c23c0ca..83bad1742 100644 --- a/e2e/router-tab-view/package.json +++ b/e2e/router-tab-view/package.json @@ -13,19 +13,19 @@ } }, "dependencies": { - "@angular/animations": "~5.2.0", - "@angular/common": "~5.2.0", - "@angular/compiler": "~5.2.0", - "@angular/core": "~5.2.0", - "@angular/forms": "~5.2.0", - "@angular/http": "~5.2.0", - "@angular/platform-browser": "~5.2.0", - "@angular/platform-browser-dynamic": "~5.2.0", - "@angular/router": "~5.2.0", + "@angular/animations": "~6.0.0-rc.3", + "@angular/common": "~6.0.0-rc.3", + "@angular/compiler": "~6.0.0-rc.3", + "@angular/core": "~6.0.0-rc.3", + "@angular/forms": "~6.0.0-rc.3", + "@angular/http": "~6.0.0-rc.3", + "@angular/platform-browser": "~6.0.0-rc.3", + "@angular/platform-browser-dynamic": "~6.0.0-rc.3", + "@angular/router": "~6.0.0-rc.3", "nativescript-angular": "file:../../nativescript-angular", "nativescript-theme-core": "~1.0.4", "reflect-metadata": "~0.1.8", - "rxjs": "~5.5.2", + "rxjs": "~6.0.0-rc.1", "tns-core-modules": "next", "zone.js": "~0.8.2" }, @@ -36,7 +36,7 @@ "lazy": "1.0.11", "nativescript-dev-appium": "^3.1.0", "nativescript-dev-typescript": "~0.6.0", - "typescript": "~2.6.2" + "typescript": "~2.7.2" }, "scripts": { "e2e": "tsc -p e2e && mocha --opts ./e2e/config/mocha.opts", diff --git a/e2e/single-page/app/app.module.ts b/e2e/single-page/app/app.module.ts index 5d7dcbdbc..82314813b 100644 --- a/e2e/single-page/app/app.module.ts +++ b/e2e/single-page/app/app.module.ts @@ -2,8 +2,6 @@ import { NgModule, NgModuleFactoryLoader, NO_ERRORS_SCHEMA } from "@angular/core import { NativeScriptModule } from "nativescript-angular/nativescript.module"; import { NSModuleFactoryLoader } from "nativescript-angular/router"; -import "./rxjs-operators"; - import { AppRoutingModule, navigatableComponents, diff --git a/e2e/single-page/app/first/first.component.ts b/e2e/single-page/app/first/first.component.ts index 436beb321..d0ae3f94d 100644 --- a/e2e/single-page/app/first/first.component.ts +++ b/e2e/single-page/app/first/first.component.ts @@ -3,7 +3,7 @@ import { ActivatedRoute, Router, Route } from "@angular/router"; import { Location } from "@angular/common"; import { Page } from "ui/page"; -import { Observable } from "rxjs/Observable"; +import { Observable } from "rxjs"; import { FrameService } from "nativescript-angular/platform-providers"; @Component({ diff --git a/e2e/single-page/app/rxjs-operators.ts b/e2e/single-page/app/rxjs-operators.ts deleted file mode 100644 index 480bbe40f..000000000 --- a/e2e/single-page/app/rxjs-operators.ts +++ /dev/null @@ -1 +0,0 @@ -import "rxjs/add/operator/map"; \ No newline at end of file diff --git a/e2e/single-page/app/second/second.component.ts b/e2e/single-page/app/second/second.component.ts index edb8aac7e..516cc2642 100644 --- a/e2e/single-page/app/second/second.component.ts +++ b/e2e/single-page/app/second/second.component.ts @@ -2,7 +2,8 @@ import { Component, OnInit, OnDestroy } from "@angular/core"; import { ActivatedRoute, Router, Route } from "@angular/router"; import { Page } from "ui/page"; -import { Observable } from "rxjs/Observable"; +import { Observable } from "rxjs"; +import { map } from "rxjs/operators"; @Component({ selector: "second", @@ -22,7 +23,7 @@ import { Observable } from "rxjs/Observable"; export class SecondComponent implements OnInit, OnDestroy { public id$: Observable; constructor(route: ActivatedRoute) { - this.id$ = route.params.map(r => +r["id"]); + this.id$ = route.params.pipe(map(r => +r["id"])); } ngOnInit() { diff --git a/e2e/single-page/package.json b/e2e/single-page/package.json index 84b3c8f00..cac64690c 100644 --- a/e2e/single-page/package.json +++ b/e2e/single-page/package.json @@ -13,24 +13,24 @@ } }, "dependencies": { - "@angular/animations": "~5.2.0", - "@angular/common": "~5.2.0", - "@angular/compiler": "~5.2.0", - "@angular/core": "~5.2.0", - "@angular/forms": "~5.2.0", - "@angular/http": "~5.2.0", - "@angular/platform-browser": "~5.2.0", - "@angular/platform-browser-dynamic": "~5.2.0", - "@angular/router": "~5.2.0", + "@angular/animations": "~6.0.0-rc.3", + "@angular/common": "~6.0.0-rc.3", + "@angular/compiler": "~6.0.0-rc.3", + "@angular/core": "~6.0.0-rc.3", + "@angular/forms": "~6.0.0-rc.3", + "@angular/http": "~6.0.0-rc.3", + "@angular/platform-browser": "~6.0.0-rc.3", + "@angular/platform-browser-dynamic": "~6.0.0-rc.3", + "@angular/router": "~6.0.0-rc.3", "nativescript-angular": "file:../../nativescript-angular", "nativescript-intl": "^3.0.0", "reflect-metadata": "~0.1.8", - "rxjs": "^5.5.4", + "rxjs": "~6.0.0-rc.1", "tns-core-modules": "next", "zone.js": "^0.8.4" }, "devDependencies": { - "@angular/compiler-cli": "~5.2.0", + "@angular/compiler-cli": "~6.0.0-rc.3", "@ngtools/webpack": "~1.9.4", "@types/chai": "^4.0.2", "@types/mocha": "^2.2.41", @@ -55,7 +55,7 @@ "raw-loader": "~0.5.1", "resolve-url-loader": "~2.2.1", "tslib": "^1.7.1", - "typescript": "~2.6.2", + "typescript": "~2.7.2", "uglifyjs-webpack-plugin": "~1.1.6", "webpack": "~3.10.0", "webpack-bundle-analyzer": "^2.9.1", From 9c4d326cc1da9fff35590c10b17e20b32f01a39b Mon Sep 17 00:00:00 2001 From: sis0k0 Date: Tue, 24 Apr 2018 10:37:42 +0300 Subject: [PATCH 11/12] Revert "refactor: disable strict metadata emit" This reverts commit 70e68ffa0b285a4370d21e8ddfc54fd673194e1f. Fixed by https://github.com/angular/angular/pull/23349. --- nativescript-angular/tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nativescript-angular/tsconfig.json b/nativescript-angular/tsconfig.json index 7b37a5d7c..e05ddfed9 100644 --- a/nativescript-angular/tsconfig.json +++ b/nativescript-angular/tsconfig.json @@ -29,6 +29,6 @@ "genDir": ".", "skipMetadataEmit": false, "skipTemplateCodegen": true, - "strictMetadataEmit": false + "strictMetadataEmit": true } } From 81711dafe9d95bfb5e702b3aa78f180c408397ba Mon Sep 17 00:00:00 2001 From: sis0k0 Date: Fri, 27 Apr 2018 10:56:28 +0300 Subject: [PATCH 12/12] chore: update dev-webpack to next in demo apps --- e2e/modal-navigation-ng/package.json | 2 +- e2e/single-page/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/e2e/modal-navigation-ng/package.json b/e2e/modal-navigation-ng/package.json index eff647a27..021f56a06 100644 --- a/e2e/modal-navigation-ng/package.json +++ b/e2e/modal-navigation-ng/package.json @@ -44,7 +44,7 @@ "lazy": "1.0.11", "nativescript-dev-appium": "next", "nativescript-dev-typescript": "next", - "nativescript-dev-webpack": "^0.11.0", + "nativescript-dev-webpack": "next", "nativescript-worker-loader": "~0.8.1", "raw-loader": "~0.5.1", "resolve-url-loader": "~2.2.1", diff --git a/e2e/single-page/package.json b/e2e/single-page/package.json index cac64690c..6eaad8d05 100644 --- a/e2e/single-page/package.json +++ b/e2e/single-page/package.json @@ -50,7 +50,7 @@ "mocha-multi": "^0.11.0", "nativescript-dev-appium": "next", "nativescript-dev-typescript": "~0.4.0", - "nativescript-dev-webpack": "^0.11.0", + "nativescript-dev-webpack": "next", "nativescript-worker-loader": "~0.8.1", "raw-loader": "~0.5.1", "resolve-url-loader": "~2.2.1",