From 548e0743eb092ba3fa371ea4d26879ee5bf03983 Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Thu, 3 Sep 2020 19:04:53 -0700 Subject: [PATCH 01/27] feat(angular): ng 10.1 and ns 7 (#2237) --- e2e/animation-examples/app/package.json | 9 ---- e2e/animation-examples/nativescript.config.ts | 11 +++++ e2e/animation-examples/package.json | 49 ++++++++----------- e2e/tests-app-ng/package.json | 28 +++++------ e2e/tests-app-ng/references.d.ts | 2 +- nativescript-angular/index.ts | 2 +- nativescript-angular/package.json | 43 ++++++++-------- 7 files changed, 69 insertions(+), 75 deletions(-) delete mode 100644 e2e/animation-examples/app/package.json create mode 100644 e2e/animation-examples/nativescript.config.ts diff --git a/e2e/animation-examples/app/package.json b/e2e/animation-examples/app/package.json deleted file mode 100644 index 706d1a31b..000000000 --- a/e2e/animation-examples/app/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "main": "main.js", - "name": "nativescript-template-ng-tutorial", - "version": "3.1.0", - "android": { - "v8Flags": "--expose_gc", - "markingMode": "none" - } -} \ No newline at end of file diff --git a/e2e/animation-examples/nativescript.config.ts b/e2e/animation-examples/nativescript.config.ts new file mode 100644 index 000000000..d117ed3e9 --- /dev/null +++ b/e2e/animation-examples/nativescript.config.ts @@ -0,0 +1,11 @@ +import { NativeScriptConfig } from '@nativescript/core' + +export default { + id: 'org.nativescript.ng4animations', + appResourcesPath: 'app/App_Resources', + android: { + v8Flags: '--expose_gc', + markingMode: 'none', + }, + appPath: 'app', +} as NativeScriptConfig diff --git a/e2e/animation-examples/package.json b/e2e/animation-examples/package.json index d000ce3e0..db7a45c75 100644 --- a/e2e/animation-examples/package.json +++ b/e2e/animation-examples/package.json @@ -1,36 +1,30 @@ { "description": "NativeScript Application", + "main": "main.js", "license": "SEE LICENSE IN ", "readme": "NativeScript Application", "repository": "", - "nativescript": { - "id": "org.nativescript.ng4animations", - "tns-ios": { - "version": "6.5.2" - }, - "tns-android": { - "version": "latest" - } - }, "dependencies": { - "@angular/animations": "~10.0.0", - "@angular/common": "~10.0.0", - "@angular/compiler": "~10.0.0", - "@angular/core": "~10.0.0", - "@angular/forms": "~10.0.0", - "@angular/platform-browser": "~10.0.0", - "@angular/platform-browser-dynamic": "~10.0.0", - "@angular/router": "~10.0.0", + "@angular/animations": "~10.1.0", + "@angular/common": "~10.1.0", + "@angular/compiler": "~10.1.0", + "@angular/core": "~10.1.0", + "@angular/forms": "~10.1.0", + "@angular/platform-browser": "~10.1.0", + "@angular/platform-browser-dynamic": "~10.1.0", + "@angular/router": "~10.1.0", "@nativescript/angular": "file:../../dist/nativescript-angular-scoped.tgz", "nativescript-theme-core": "~1.0.2", - "reflect-metadata": "~0.1.8", - "rxjs": "~6.5.5", - "@nativescript/core": "rc", - "zone.js": "^0.10.3" + "reflect-metadata": "~0.1.13", + "rxjs": "~6.6.0", + "@nativescript/core": "~7.0.0", + "zone.js": "^0.11.1" }, "devDependencies": { - "@angular/compiler-cli": "~10.0.0", - "@ngtools/webpack": "~10.0.0", + "@angular/compiler-cli": "~10.1.0", + "@nativescript/ios": "7.0.0", + "@nativescript/webpack": "~3.0.0", + "@ngtools/webpack": "~10.1.0", "@types/chai": "~4.2.0", "@types/mocha": "~7.0.0", "@types/node": "~14.0.0", @@ -41,13 +35,12 @@ "lazy": "~1.0.11", "mocha": "~8.0.1", "mochawesome": "~6.1.1", - "node-sass": "~4.14.1", "nativescript-css-loader": "~0.26.0", - "@nativescript/webpack": "rc", + "node-sass": "~4.14.1", "typescript": "~3.9.0" }, "scripts": { - "clean": "npx rimraf hooks node_modules platforms package-lock.json", + "clean": "ns clean", "setup": "cd ../../nativescript-angular && npm run prep.apps && cd ../e2e/animation-examples && npm run clean", "ngcc": "ngcc --properties es2015 module main --first-only", "postinstall": "npm run ngcc", @@ -56,7 +49,7 @@ "e2e-watch": "tsc -p e2e --watch", "ns-verify-bundle": "ns-verify-bundle", "update-ns-webpack": "update-ns-webpack", - "ios": "tns debug ios --emulator --no-hmr", - "android": "tns debug android --emulator --no-hmr" + "ios": "ns debug ios --emulator --no-hmr", + "android": "ns debug android --emulator --no-hmr" } } diff --git a/e2e/tests-app-ng/package.json b/e2e/tests-app-ng/package.json index e9c720517..2b288597b 100644 --- a/e2e/tests-app-ng/package.json +++ b/e2e/tests-app-ng/package.json @@ -13,31 +13,31 @@ } }, "dependencies": { - "@angular/animations": "~10.0.0", - "@angular/common": "~10.0.0", - "@angular/compiler": "~10.0.0", - "@angular/core": "~10.0.0", - "@angular/forms": "~10.0.0", - "@angular/platform-browser": "~10.0.0", - "@angular/platform-browser-dynamic": "~10.0.0", - "@angular/router": "~10.0.0", + "@angular/animations": "~10.1.0", + "@angular/common": "~10.1.0", + "@angular/compiler": "~10.1.0", + "@angular/core": "~10.1.0", + "@angular/forms": "~10.1.0", + "@angular/platform-browser": "~10.1.0", + "@angular/platform-browser-dynamic": "~10.1.0", + "@angular/router": "~10.1.0", "@nativescript/angular": "file:../../dist/nativescript-angular-scoped.tgz", "nativescript-theme-core": "^1.0.4", "reflect-metadata": "~0.1.8", - "rxjs": "~6.5.5", - "@nativescript/core": "rc", - "zone.js": "^0.10.3" + "rxjs": "~6.6.0", + "@nativescript/core": "~7.0.0", + "zone.js": "^0.11.1" }, "devDependencies": { - "@angular/compiler-cli": "~10.0.0", - "@ngtools/webpack": "~10.0.0", + "@angular/compiler-cli": "~10.1.0", + "@ngtools/webpack": "~10.1.0", "babel-traverse": "6.24.1", "babel-types": "6.24.1", "babylon": "6.17.0", "codelyzer": "^5.1.0", "filewalker": "^0.1.3", "lazy": "1.0.11", - "@nativescript/webpack": "~2.1.1", + "@nativescript/webpack": "~3.0.0", "typescript": "~3.9.0" }, "scripts": { diff --git a/e2e/tests-app-ng/references.d.ts b/e2e/tests-app-ng/references.d.ts index b14f3837d..a5bb99810 100644 --- a/e2e/tests-app-ng/references.d.ts +++ b/e2e/tests-app-ng/references.d.ts @@ -1 +1 @@ -/// Needed for autocompletion and compilation. \ No newline at end of file +/// \ No newline at end of file diff --git a/nativescript-angular/index.ts b/nativescript-angular/index.ts index 6244a00e5..f0e97a09c 100644 --- a/nativescript-angular/index.ts +++ b/nativescript-angular/index.ts @@ -5,9 +5,9 @@ import '@nativescript/zone-js'; // investigate Ivy with templated-items-comp to allow standard zone below to be used instead of patched {N} zone above // import 'zone.js/dist/zone'; import './dom-adapter'; -import 'nativescript-intl'; // import "./polyfills/array"; import './polyfills/console'; +import 'nativescript-intl'; export * from './platform-common'; export * from './platform-providers'; diff --git a/nativescript-angular/package.json b/nativescript-angular/package.json index 067cdbc0f..9af5414c1 100644 --- a/nativescript-angular/package.json +++ b/nativescript-angular/package.json @@ -1,6 +1,6 @@ { "name": "@nativescript/angular", - "version": "10.0.3", + "version": "10.1.0", "description": "An Angular renderer that lets you build mobile apps with NativeScript.", "homepage": "https://www.nativescript.org/", "bugs": "https://github.com/NativeScript/nativescript-angular/issues", @@ -58,42 +58,41 @@ }, "dependencies": { "@nativescript/zone-js": "~1.0.0", - "nativescript-angular": "~10.0.0", "nativescript-intl": "^4.0.0" }, "peerDependencies": { - "@angular/common": "^10.0.0", - "@angular/compiler": "^10.0.0", - "@angular/core": "^10.0.0", - "@angular/forms": "^10.0.0", - "@angular/platform-browser": "^10.0.0", - "@angular/platform-browser-dynamic": "^10.0.0", - "@angular/router": "^10.0.0" + "@angular/common": "^10.1.0", + "@angular/compiler": "^10.1.0", + "@angular/core": "^10.1.0", + "@angular/forms": "^10.1.0", + "@angular/platform-browser": "^10.1.0", + "@angular/platform-browser-dynamic": "^10.1.0", + "@angular/router": "^10.1.0" }, "devDependencies": { - "@angular/animations": "~10.0.0", - "@angular/common": "~10.0.0", - "@angular/compiler": "~10.0.0", - "@angular/compiler-cli": "~10.0.0", - "@angular/core": "~10.0.0", - "@angular/forms": "~10.0.0", - "@angular/platform-browser": "~10.0.0", - "@angular/platform-browser-dynamic": "~10.0.0", - "@angular/router": "~10.0.0", - "@nativescript/core": "rc", + "@angular/animations": "~10.1.0", + "@angular/common": "~10.1.0", + "@angular/compiler": "~10.1.0", + "@angular/compiler-cli": "~10.1.0", + "@angular/core": "~10.1.0", + "@angular/forms": "~10.1.0", + "@angular/platform-browser": "~10.1.0", + "@angular/platform-browser-dynamic": "~10.1.0", + "@angular/router": "~10.1.0", + "@nativescript/core": "~7.0.0", "codelyzer": "^5.2.0", "conventional-changelog-cli": "^2.0.34", "husky": "^4.2.5", "lint-staged": "^10.2.11", "nativescript-typedoc-theme": "git://github.com/NativeScript/nativescript-typedoc-theme.git#master", - "ng-packagr": "~10.0.0", + "ng-packagr": "~10.1.0", "prettier": "^2.0.5", - "rxjs": "~6.5.5", + "rxjs": "~6.6.0", "tslint": "^6.1.2", "tslint-config-prettier": "^1.18.0", "typedoc": "~0.17.0", "typescript": "~3.9.0", - "zone.js": "^0.10.3" + "zone.js": "^0.11.1" }, "husky": { "hooks": { From 302afb350dea56ddbf1a0d772f6d9405413890a5 Mon Sep 17 00:00:00 2001 From: Eduardo Speroni Date: Thu, 3 Sep 2020 23:06:45 -0300 Subject: [PATCH 02/27] fix(list-view): fix crash when used with ngFor (#2121) --- nativescript-angular/directives/dialogs.ts | 34 +++++++++++-------- .../directives/list-view-comp.ts | 6 ++-- .../directives/templated-items-comp.ts | 10 +++--- 3 files changed, 28 insertions(+), 22 deletions(-) diff --git a/nativescript-angular/directives/dialogs.ts b/nativescript-angular/directives/dialogs.ts index e9280f989..7e5aa78bf 100644 --- a/nativescript-angular/directives/dialogs.ts +++ b/nativescript-angular/directives/dialogs.ts @@ -1,4 +1,4 @@ -import { ComponentFactoryResolver, ComponentRef, Injectable, Injector, NgModuleRef, Type, ViewContainerRef } from '@angular/core'; +import { ComponentFactoryResolver, ComponentRef, Injectable, Injector, NgModuleRef, NgZone, Type, ViewContainerRef } from '@angular/core'; import { Frame, View, ViewBase, ProxyViewContainer, ShowModalOptions } from '@nativescript/core'; import { NSLocationStrategy } from '../router/ns-location-strategy'; @@ -32,7 +32,7 @@ export class ModalDialogParams { @Injectable() export class ModalDialogService { - constructor(private location: NSLocationStrategy) {} + constructor(private location: NSLocationStrategy, private zone: NgZone) {} public showModal(type: Type, options: ModalDialogOptions): Promise { if (!options.viewContainerRef) { @@ -98,8 +98,10 @@ export class ModalDialogService { if (componentView) { componentView.closeModal(); this.location._closeModalNavigation(); - detachedLoaderRef.instance.detectChanges(); - detachedLoaderRef.destroy(); + this.zone.run(() => { + detachedLoaderRef.instance.detectChanges(); + detachedLoaderRef.destroy(); + }); } }); @@ -111,20 +113,22 @@ export class ModalDialogService { }); const detachedFactory = options.resolver.resolveComponentFactory(DetachedLoader); detachedLoaderRef = options.containerRef.createComponent(detachedFactory, 0, childInjector, null); - detachedLoaderRef.instance.loadComponent(options.type).then((compRef) => { - const detachedProxy = compRef.location.nativeElement; + this.zone.run(() => { + detachedLoaderRef.instance.loadComponent(options.type).then((compRef) => { + const detachedProxy = compRef.location.nativeElement; - if (detachedProxy.getChildrenCount() > 1) { - throw new Error('Modal content has more than one root view.'); - } - componentView = detachedProxy.getChildAt(0); + if (detachedProxy.getChildrenCount() > 1) { + throw new Error('Modal content has more than one root view.'); + } + componentView = detachedProxy.getChildAt(0); - if (componentView.parent) { - (componentView.parent)._ngDialogRoot = componentView; - (componentView.parent).removeChild(componentView); - } + if (componentView.parent) { + (componentView.parent)._ngDialogRoot = componentView; + (componentView.parent).removeChild(componentView); + } - options.parentView.showModal(componentView, { ...options, closeCallback }); + options.parentView.showModal(componentView, { ...options, closeCallback }); + }); }); } } diff --git a/nativescript-angular/directives/list-view-comp.ts b/nativescript-angular/directives/list-view-comp.ts index dc357d7e9..62e1eadfe 100644 --- a/nativescript-angular/directives/list-view-comp.ts +++ b/nativescript-angular/directives/list-view-comp.ts @@ -1,4 +1,4 @@ -import { ChangeDetectionStrategy, Component, ElementRef, IterableDiffers, forwardRef } from '@angular/core'; +import { ChangeDetectionStrategy, Component, ElementRef, IterableDiffers, forwardRef, NgZone } from '@angular/core'; import { ListView } from '@nativescript/core'; import { TEMPLATED_ITEMS_COMPONENT, TemplatedItemsComponent } from './templated-items-comp'; @@ -17,7 +17,7 @@ export class ListViewComponent extends TemplatedItemsComponent { protected templatedItemsView: ListView; - constructor(_elementRef: ElementRef, _iterableDiffers: IterableDiffers) { - super(_elementRef, _iterableDiffers); + constructor(_elementRef: ElementRef, _iterableDiffers: IterableDiffers, zone: NgZone) { + super(_elementRef, _iterableDiffers, zone); } } diff --git a/nativescript-angular/directives/templated-items-comp.ts b/nativescript-angular/directives/templated-items-comp.ts index 302f85377..5514ffa7b 100644 --- a/nativescript-angular/directives/templated-items-comp.ts +++ b/nativescript-angular/directives/templated-items-comp.ts @@ -1,4 +1,4 @@ -import { AfterContentInit, ContentChild, Directive, DoCheck, ElementRef, EmbeddedViewRef, EventEmitter, Host, Inject, InjectionToken, Input, IterableDiffer, IterableDiffers, OnDestroy, Output, TemplateRef, ViewChild, ViewContainerRef, ɵisListLikeIterable as isListLikeIterable, Injectable } from '@angular/core'; +import { AfterContentInit, ContentChild, Directive, DoCheck, ElementRef, EmbeddedViewRef, EventEmitter, Host, Inject, InjectionToken, Input, IterableDiffer, IterableDiffers, OnDestroy, Output, TemplateRef, ViewChild, ViewContainerRef, ɵisListLikeIterable as isListLikeIterable, Injectable, NgZone } from '@angular/core'; import { ObservableArray, View, KeyedTemplate, LayoutBase, ItemEventData, TemplatedItemsView, profile } from '@nativescript/core'; import { getSingleViewRecursive } from '../element-registry'; @@ -54,7 +54,7 @@ export abstract class TemplatedItemsComponent implements DoCheck, OnDestroy, Aft this.templatedItemsView.items = this._items; } - constructor(_elementRef: ElementRef, private _iterableDiffers: IterableDiffers) { + constructor(_elementRef: ElementRef, private _iterableDiffers: IterableDiffers, private zone: NgZone) { this.templatedItemsView = _elementRef.nativeElement; this.templatedItemsView.on('itemLoading', this.onItemLoading, this); @@ -188,8 +188,10 @@ export abstract class TemplatedItemsComponent implements DoCheck, OnDestroy, Aft NativeScriptDebug.listViewLog(`Manually detect changes in child: ${index}`); } - viewRef.markForCheck(); - viewRef.detectChanges(); + this.zone.run(() => { + viewRef.markForCheck(); + viewRef.detectChanges(); + }); } ngDoCheck() { From fa761aea2d52f8118090e359d9b2b45a7577100c Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Thu, 3 Sep 2020 20:12:31 -0700 Subject: [PATCH 03/27] chore(release): 10.1.0 --- CHANGELOG.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee258f56c..421a50d7d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,17 @@ +# [10.1.0](https://github.com/NativeScript/nativescript-angular/compare/10.0.3...10.1.0) (2020-09-04) + + +### Bug Fixes + +* **list-view:** fix crash when used with ngFor ([#2121](https://github.com/NativeScript/nativescript-angular/issues/2121)) ([302afb3](https://github.com/NativeScript/nativescript-angular/commit/302afb350dea56ddbf1a0d772f6d9405413890a5)) + + +### Features + +* **angular:** ng 10.1 and ns 7 ([#2237](https://github.com/NativeScript/nativescript-angular/issues/2237)) ([548e074](https://github.com/NativeScript/nativescript-angular/commit/548e0743eb092ba3fa371ea4d26879ee5bf03983)) + + + ## [10.0.3](https://github.com/NativeScript/nativescript-angular/compare/10.0.2...10.0.3) (2020-08-27) From 623d2f79e014017fd993685051d125b3c5c72ada Mon Sep 17 00:00:00 2001 From: Eduardo Speroni Date: Sun, 20 Sep 2020 22:27:03 -0300 Subject: [PATCH 04/27] fix(detached-loader): completely deatch components (#2257) --- .../common/detached-loader.ts | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/nativescript-angular/common/detached-loader.ts b/nativescript-angular/common/detached-loader.ts index a2dab3643..b98fbb3b9 100644 --- a/nativescript-angular/common/detached-loader.ts +++ b/nativescript-angular/common/detached-loader.ts @@ -1,4 +1,4 @@ -import { ComponentRef, ComponentFactory, ViewContainerRef, Component, Type, ComponentFactoryResolver, ChangeDetectorRef } from '@angular/core'; +import { ComponentRef, ComponentFactory, ViewContainerRef, Component, Type, ComponentFactoryResolver, ChangeDetectorRef, ApplicationRef, OnDestroy } from '@angular/core'; import { Trace } from '@nativescript/core'; /** @@ -10,13 +10,20 @@ import { Trace } from '@nativescript/core'; selector: 'DetachedContainer', template: ``, }) -export class DetachedLoader { +export class DetachedLoader implements OnDestroy { + private disposeFunctions: Array<() => void> = []; // tslint:disable-line:component-class-suffix - constructor(private resolver: ComponentFactoryResolver, private changeDetector: ChangeDetectorRef, private containerRef: ViewContainerRef) {} + constructor(private resolver: ComponentFactoryResolver, private changeDetector: ChangeDetectorRef, private containerRef: ViewContainerRef, private appRef: ApplicationRef) {} private loadInLocation(componentType: Type): Promise> { const factory = this.resolver.resolveComponentFactory(componentType); - const componentRef = this.containerRef.createComponent(factory, this.containerRef.length, this.containerRef.injector); + const componentRef = factory.create(this.containerRef.injector); + this.appRef.attachView(componentRef.hostView); + + this.disposeFunctions.push(() => { + this.appRef.detachView(componentRef.hostView); + componentRef.destroy(); + }); // Component is created, built may not be checked if we are loading // inside component with OnPush CD strategy. Mark us for check to be sure CD will reach us. @@ -27,6 +34,10 @@ export class DetachedLoader { return Promise.resolve(componentRef); } + public ngOnDestroy() { + this.disposeFunctions.forEach((fn) => fn()); + } + public detectChanges() { this.changeDetector.markForCheck(); } From c2eaef52a66dbbee982f73bb968a706cee38f633 Mon Sep 17 00:00:00 2001 From: Eduardo Speroni Date: Sun, 20 Sep 2020 22:27:37 -0300 Subject: [PATCH 05/27] fix(ivy): support view references in insertBefore (#2258) --- nativescript-angular/renderer.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nativescript-angular/renderer.ts b/nativescript-angular/renderer.ts index bc6f8a5f8..c91d0abc5 100644 --- a/nativescript-angular/renderer.ts +++ b/nativescript-angular/renderer.ts @@ -31,7 +31,8 @@ export class NativeScriptRenderer extends Renderer2 { } @profile - insertBefore(parent: NgView, newChild: NgView, { previous, next }: ElementReference): void { + insertBefore(parent: NgView, newChild: NgView, refChild: NgView | ElementReference): void { + let { previous, next } = refChild instanceof View ? this.nextSibling(refChild) : refChild; if (NativeScriptDebug.isLogEnabled()) { NativeScriptDebug.rendererLog(`NativeScriptRenderer.insertBefore child: ${newChild} ` + `parent: ${parent} previous: ${previous} next: ${next}`); } From 04e5dfcd2c9dd0755a53d67ee579995780368911 Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Sun, 20 Sep 2020 18:28:23 -0700 Subject: [PATCH 06/27] chore: update tests-app-ng --- e2e/animation-examples/package.json | 2 -- e2e/tests-app-ng/app/package.json | 9 ----- e2e/tests-app-ng/nativescript.config.ts | 11 ++++++ e2e/tests-app-ng/package.json | 17 +++------ e2e/tests-app-ng/tsconfig.json | 47 +++++++++++++------------ 5 files changed, 39 insertions(+), 47 deletions(-) delete mode 100644 e2e/tests-app-ng/app/package.json create mode 100644 e2e/tests-app-ng/nativescript.config.ts diff --git a/e2e/animation-examples/package.json b/e2e/animation-examples/package.json index db7a45c75..8d9aaed48 100644 --- a/e2e/animation-examples/package.json +++ b/e2e/animation-examples/package.json @@ -42,8 +42,6 @@ "scripts": { "clean": "ns clean", "setup": "cd ../../nativescript-angular && npm run prep.apps && cd ../e2e/animation-examples && npm run clean", - "ngcc": "ngcc --properties es2015 module main --first-only", - "postinstall": "npm run ngcc", "u": "update-ns-webpack", "e2e": "tsc -p e2e && mocha --opts ../config/mocha.opts --recursive e2e --appiumCapsLocation ../config/appium.capabilities.json", "e2e-watch": "tsc -p e2e --watch", diff --git a/e2e/tests-app-ng/app/package.json b/e2e/tests-app-ng/app/package.json deleted file mode 100644 index 0cd5e824d..000000000 --- a/e2e/tests-app-ng/app/package.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "android": { - "v8Flags": "--expose_gc", - "markingMode": "none" - }, - "main": "main.js", - "name": "tns-template-hello-world-ng", - "version": "3.0.0" -} diff --git a/e2e/tests-app-ng/nativescript.config.ts b/e2e/tests-app-ng/nativescript.config.ts new file mode 100644 index 000000000..89dc02904 --- /dev/null +++ b/e2e/tests-app-ng/nativescript.config.ts @@ -0,0 +1,11 @@ +import { NativeScriptConfig } from '@nativescript/core' + +export default { + id: 'org.nativescript.testsappng', + appResourcesPath: 'app/App_Resources', + android: { + v8Flags: '--expose_gc', + markingMode: 'none', + }, + appPath: 'app', +} as NativeScriptConfig diff --git a/e2e/tests-app-ng/package.json b/e2e/tests-app-ng/package.json index 2b288597b..98cee8a7c 100644 --- a/e2e/tests-app-ng/package.json +++ b/e2e/tests-app-ng/package.json @@ -3,15 +3,6 @@ "license": "SEE LICENSE IN ", "readme": "NativeScript Application", "repository": "", - "nativescript": { - "id": "org.nativescript.testsappng", - "tns-ios": { - "version": "6.5.2" - }, - "tns-android": { - "version": "6.5.3" - } - }, "dependencies": { "@angular/animations": "~10.1.0", "@angular/common": "~10.1.0", @@ -30,6 +21,8 @@ }, "devDependencies": { "@angular/compiler-cli": "~10.1.0", + "@nativescript/ios": "7.0.0", + "@nativescript/webpack": "~3.0.0", "@ngtools/webpack": "~10.1.0", "babel-traverse": "6.24.1", "babel-types": "6.24.1", @@ -37,14 +30,11 @@ "codelyzer": "^5.1.0", "filewalker": "^0.1.3", "lazy": "1.0.11", - "@nativescript/webpack": "~3.0.0", "typescript": "~3.9.0" }, "scripts": { "clean": "npx rimraf hooks node_modules platforms package-lock.json webpack.config.js && npm i", "setup": "cd ../../nativescript-angular && npm run prep.apps && cd ../e2e/tests-app-ng && npm run clean", - "ngcc": "ngcc --properties es2015 module main --first-only", - "postinstall": "npm run ngcc", "u": "update-ns-webpack", "e2e": "tsc -p e2e && mocha --opts ../config/mocha.opts --recursive e2e --appiumCapsLocation ../config/appium.capabilities.json", "e2e-watch": "tsc -p e2e --watch", @@ -52,5 +42,6 @@ "update-ns-webpack": "update-ns-webpack", "ios": "tns debug ios --emulator --no-hmr", "android": "tns debug android --emulator --no-hmr" - } + }, + "main": "main.js" } diff --git a/e2e/tests-app-ng/tsconfig.json b/e2e/tests-app-ng/tsconfig.json index f37dc8578..29c1ff2d7 100644 --- a/e2e/tests-app-ng/tsconfig.json +++ b/e2e/tests-app-ng/tsconfig.json @@ -1,33 +1,34 @@ { "compilerOptions": { - "module": "ESNext", - "target": "es2015", - "moduleResolution": "node", - "experimentalDecorators": true, - "emitDecoratorMetadata": true, - "noEmitHelpers": true, - "noEmitOnError": true, - "skipLibCheck": true, - "lib": [ - "es2017", - "dom", - "es6" - ], - "baseUrl": ".", - "paths": { - "~/*": [ - "app/*" - ] - } + "module": "esnext", + "target": "es2017", + "moduleResolution": "node", + "experimentalDecorators": true, + "emitDecoratorMetadata": true, + "noEmitHelpers": true, + "noEmitOnError": true, + "skipLibCheck": true, + "lib": [ + "es2017", + "dom", + "es6" + ], + "baseUrl": ".", + "paths": { + "~/*": [ + "app/*" + ] + }, + "removeComments": false }, "files": [ "./references.d.ts", "./app/main.ts" ], "exclude": [ - "node_modules", - "platforms", - "**/*.aot", - "e2e" + "node_modules", + "platforms", + "**/*.aot", + "e2e" ] } \ No newline at end of file From bcde284d567ea6b3900dd032cba7ded056e45edb Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Sun, 20 Sep 2020 19:27:15 -0700 Subject: [PATCH 07/27] chore(release): 10.1.3 --- CHANGELOG.md | 10 ++++++++++ nativescript-angular/package.json | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 421a50d7d..f1492dbf7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +## [10.1.3](https://github.com/NativeScript/nativescript-angular/compare/10.1.0...10.1.3) (2020-09-21) + + +### Bug Fixes + +* **detached-loader:** completely deatch components ([#2257](https://github.com/NativeScript/nativescript-angular/issues/2257)) ([623d2f7](https://github.com/NativeScript/nativescript-angular/commit/623d2f79e014017fd993685051d125b3c5c72ada)) +* **ivy:** support view references in insertBefore ([#2258](https://github.com/NativeScript/nativescript-angular/issues/2258)) ([c2eaef5](https://github.com/NativeScript/nativescript-angular/commit/c2eaef52a66dbbee982f73bb968a706cee38f633)) + + + # [10.1.0](https://github.com/NativeScript/nativescript-angular/compare/10.0.3...10.1.0) (2020-09-04) diff --git a/nativescript-angular/package.json b/nativescript-angular/package.json index 9af5414c1..9d4dd66eb 100644 --- a/nativescript-angular/package.json +++ b/nativescript-angular/package.json @@ -1,6 +1,6 @@ { "name": "@nativescript/angular", - "version": "10.1.0", + "version": "10.1.3", "description": "An Angular renderer that lets you build mobile apps with NativeScript.", "homepage": "https://www.nativescript.org/", "bugs": "https://github.com/NativeScript/nativescript-angular/issues", From 1dca81bbc4a1a05a9eefe13988848124885f3178 Mon Sep 17 00:00:00 2001 From: Eduardo Speroni Date: Mon, 21 Sep 2020 12:09:06 -0300 Subject: [PATCH 08/27] fix(detached-loader): detach loadWithFactory (#2260) --- nativescript-angular/common/detached-loader.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/nativescript-angular/common/detached-loader.ts b/nativescript-angular/common/detached-loader.ts index b98fbb3b9..2a433f7d3 100644 --- a/nativescript-angular/common/detached-loader.ts +++ b/nativescript-angular/common/detached-loader.ts @@ -49,6 +49,13 @@ export class DetachedLoader implements OnDestroy { } public loadWithFactory(factory: ComponentFactory): ComponentRef { - return this.containerRef.createComponent(factory, this.containerRef.length, this.containerRef.injector, null); + const componentRef = factory.create(this.containerRef.injector); + this.appRef.attachView(componentRef.hostView); + + this.disposeFunctions.push(() => { + this.appRef.detachView(componentRef.hostView); + componentRef.destroy(); + }); + return componentRef; } } From 07abb9e62c2408be83e8a694384cd529ba5d3309 Mon Sep 17 00:00:00 2001 From: Eduardo Speroni Date: Mon, 21 Sep 2020 12:12:15 -0300 Subject: [PATCH 09/27] fix(renderer): order not preserved (#2261) --- nativescript-angular/element-registry.ts | 2 ++ nativescript-angular/renderer.ts | 16 ++++------------ nativescript-angular/view-util.ts | 10 +++++++++- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/nativescript-angular/element-registry.ts b/nativescript-angular/element-registry.ts index cb39569d8..33925be70 100644 --- a/nativescript-angular/element-registry.ts +++ b/nativescript-angular/element-registry.ts @@ -9,6 +9,7 @@ export interface ViewExtensions { nodeName: string; parentNode: NgView; nextSibling: NgView; + previousSibling: NgView; firstChild: NgView; lastChild: NgView; ngCssClasses: Map; @@ -22,6 +23,7 @@ export abstract class InvisibleNode extends View implements NgView { nodeName: string; parentNode: NgView; nextSibling: NgView; + previousSibling: NgView; firstChild: NgView; lastChild: NgView; ngCssClasses: Map; diff --git a/nativescript-angular/renderer.ts b/nativescript-angular/renderer.ts index c91d0abc5..99e5fd7b9 100644 --- a/nativescript-angular/renderer.ts +++ b/nativescript-angular/renderer.ts @@ -6,11 +6,6 @@ import { ViewUtil } from './view-util'; import { NgView, InvisibleNode } from './element-registry'; import { NativeScriptDebug } from './trace'; -export interface ElementReference { - previous: NgView; - next: NgView; -} - @Injectable() export class NativeScriptRenderer extends Renderer2 { data: { [key: string]: any } = Object.create(null); @@ -31,8 +26,8 @@ export class NativeScriptRenderer extends Renderer2 { } @profile - insertBefore(parent: NgView, newChild: NgView, refChild: NgView | ElementReference): void { - let { previous, next } = refChild instanceof View ? this.nextSibling(refChild) : refChild; + insertBefore(parent: NgView, newChild: NgView, refChild: NgView): void { + let { previous, next } = refChild instanceof View ? { previous: refChild.previousSibling, next: refChild } : { previous: null, next: null }; if (NativeScriptDebug.isLogEnabled()) { NativeScriptDebug.rendererLog(`NativeScriptRenderer.insertBefore child: ${newChild} ` + `parent: ${parent} previous: ${previous} next: ${next}`); } @@ -68,15 +63,12 @@ export class NativeScriptRenderer extends Renderer2 { } @profile - nextSibling(node: NgView): ElementReference { + nextSibling(node: NgView): NgView { if (NativeScriptDebug.isLogEnabled()) { NativeScriptDebug.rendererLog(`NativeScriptRenderer.nextSibling of ${node} is ${node.nextSibling}`); } - return { - previous: node, - next: node.nextSibling, - }; + return node.nextSibling; } @profile diff --git a/nativescript-angular/view-util.ts b/nativescript-angular/view-util.ts index b0b7fc1cb..ea2c39768 100644 --- a/nativescript-angular/view-util.ts +++ b/nativescript-angular/view-util.ts @@ -63,12 +63,14 @@ export class ViewUtil { if (previous) { previous.nextSibling = child; + child.previousSibling = previous; } else { parent.firstChild = child; } if (next) { child.nextSibling = next; + next.previousSibling = child; } else { this.appendToQueue(parent, child); } @@ -81,6 +83,7 @@ export class ViewUtil { if (parent.lastChild) { parent.lastChild.nextSibling = view; + view.previousSibling = parent.lastChild; } parent.lastChild = view; @@ -152,6 +155,7 @@ export class ViewUtil { parent.firstChild = null; parent.lastChild = null; child.nextSibling = null; + child.previousSibling = null; return; } @@ -159,16 +163,20 @@ export class ViewUtil { parent.firstChild = child.nextSibling; } - const previous = this.findPreviousElement(parent, child); + const previous = child.previousSibling; if (parent.lastChild === child) { parent.lastChild = previous; } if (previous) { previous.nextSibling = child.nextSibling; + if (child.nextSibling) { + child.nextSibling.previousSibling = previous; + } } child.nextSibling = null; + child.previousSibling = null; } // NOTE: This one is O(n) - use carefully From a868c3af59381b2627c73e6520e5b4f7e211f283 Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Mon, 21 Sep 2020 08:39:22 -0700 Subject: [PATCH 10/27] chore(release): 10.1.4 --- CHANGELOG.md | 10 ++++++++++ nativescript-angular/package.json | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f1492dbf7..905effdbc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +## [10.1.4](https://github.com/NativeScript/nativescript-angular/compare/10.1.3...10.1.4) (2020-09-21) + + +### Bug Fixes + +* **detached-loader:** detach loadWithFactory ([#2260](https://github.com/NativeScript/nativescript-angular/issues/2260)) ([1dca81b](https://github.com/NativeScript/nativescript-angular/commit/1dca81bbc4a1a05a9eefe13988848124885f3178)) +* **renderer:** order not preserved ([#2261](https://github.com/NativeScript/nativescript-angular/issues/2261)) ([07abb9e](https://github.com/NativeScript/nativescript-angular/commit/07abb9e62c2408be83e8a694384cd529ba5d3309)) + + + ## [10.1.3](https://github.com/NativeScript/nativescript-angular/compare/10.1.0...10.1.3) (2020-09-21) diff --git a/nativescript-angular/package.json b/nativescript-angular/package.json index 9d4dd66eb..800267be2 100644 --- a/nativescript-angular/package.json +++ b/nativescript-angular/package.json @@ -1,6 +1,6 @@ { "name": "@nativescript/angular", - "version": "10.1.3", + "version": "10.1.4", "description": "An Angular renderer that lets you build mobile apps with NativeScript.", "homepage": "https://www.nativescript.org/", "bugs": "https://github.com/NativeScript/nativescript-angular/issues", From 5735a01695d7967b5a63222dcec760ddac0533e3 Mon Sep 17 00:00:00 2001 From: Eduardo Speroni Date: Mon, 21 Sep 2020 20:08:43 -0300 Subject: [PATCH 11/27] fix(renderer): dynamic views can't be prepended (#2262) --- nativescript-angular/view-util.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nativescript-angular/view-util.ts b/nativescript-angular/view-util.ts index ea2c39768..d254b8fd6 100644 --- a/nativescript-angular/view-util.ts +++ b/nativescript-angular/view-util.ts @@ -41,7 +41,11 @@ export class ViewUtil { const extendedParent = this.ensureNgViewExtensions(parent); const extendedChild = this.ensureNgViewExtensions(child); - if (!previous) { + // the element should be between previous and next + // if there's next but no previous, it's the first element + // if there's previous but no next, it's the last element + // elements that have no previous/next elements must be appended + if (!previous && !next) { previous = extendedParent.lastChild; } this.addToQueue(extendedParent, extendedChild, previous, next); From f6d73bbb28b24a93f4c4f80b9d1db313e5969327 Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Mon, 21 Sep 2020 16:13:49 -0700 Subject: [PATCH 12/27] chore(release): 10.1.5 --- CHANGELOG.md | 9 +++++++++ nativescript-angular/package.json | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 905effdbc..13292ef5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +## [10.1.5](https://github.com/NativeScript/nativescript-angular/compare/10.1.4...10.1.5) (2020-09-21) + + +### Bug Fixes + +* **renderer:** dynamic views can't be prepended ([#2262](https://github.com/NativeScript/nativescript-angular/issues/2262)) ([5735a01](https://github.com/NativeScript/nativescript-angular/commit/5735a01695d7967b5a63222dcec760ddac0533e3)) + + + ## [10.1.4](https://github.com/NativeScript/nativescript-angular/compare/10.1.3...10.1.4) (2020-09-21) diff --git a/nativescript-angular/package.json b/nativescript-angular/package.json index 800267be2..1b5f9a6e6 100644 --- a/nativescript-angular/package.json +++ b/nativescript-angular/package.json @@ -1,6 +1,6 @@ { "name": "@nativescript/angular", - "version": "10.1.4", + "version": "10.1.5", "description": "An Angular renderer that lets you build mobile apps with NativeScript.", "homepage": "https://www.nativescript.org/", "bugs": "https://github.com/NativeScript/nativescript-angular/issues", From 861a70645aca51657f871cad54e95f541ac103a0 Mon Sep 17 00:00:00 2001 From: Nathanael Anderson Date: Fri, 9 Oct 2020 21:15:10 -0500 Subject: [PATCH 13/27] chore: Update License --- LICENSE | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LICENSE b/LICENSE index 061c44028..e519ff171 100755 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright (c) 2015-2019 Progress Software Corporation + Copyright (c) 2020 nStudio, LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -198,4 +198,4 @@ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and - limitations under the License. \ No newline at end of file + limitations under the License. From 75865f214d9e53eb36990c779808d50fb697f1ce Mon Sep 17 00:00:00 2001 From: Peter Staev Date: Mon, 12 Oct 2020 09:16:15 +0300 Subject: [PATCH 14/27] fix: Export injection token used by plugins (#2268) Co-authored-by: Nathan Walker --- nativescript-angular/directives/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nativescript-angular/directives/index.ts b/nativescript-angular/directives/index.ts index c6ca38326..c29235554 100644 --- a/nativescript-angular/directives/index.ts +++ b/nativescript-angular/directives/index.ts @@ -1,5 +1,5 @@ import { ListViewComponent } from './list-view-comp'; -import { TemplateKeyDirective, TemplatedItemsComponent } from './templated-items-comp'; +import { TemplateKeyDirective, TemplatedItemsComponent, TEMPLATED_ITEMS_COMPONENT } from './templated-items-comp'; import { TabViewDirective, TabViewItemDirective } from './tab-view'; import { ActionBarComponent, ActionBarScope, ActionItemDirective, NavigationButtonDirective } from './action-bar'; import { AndroidFilterComponent, IosFilterComponent } from './platform-filters'; From 9b8435e13b7f6f42098e79895af5ab3156d1aac3 Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Mon, 12 Oct 2020 08:45:06 -0700 Subject: [PATCH 15/27] fix: expose NSLocationStrategy and NSRouteReuseStrategy --- nativescript-angular/router/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nativescript-angular/router/index.ts b/nativescript-angular/router/index.ts index 26f68bf55..321e53ae6 100644 --- a/nativescript-angular/router/index.ts +++ b/nativescript-angular/router/index.ts @@ -1 +1,3 @@ +export * from './ns-location-strategy'; +export * from './ns-route-reuse-strategy'; export * from './router.module'; From 52a56d7201b70b67edb2ca77e9042737f216a07a Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Mon, 12 Oct 2020 08:48:49 -0700 Subject: [PATCH 16/27] feat: export injectiontoken for template items --- nativescript-angular/directives/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nativescript-angular/directives/index.ts b/nativescript-angular/directives/index.ts index c29235554..29bef98f9 100644 --- a/nativescript-angular/directives/index.ts +++ b/nativescript-angular/directives/index.ts @@ -7,4 +7,4 @@ export { ModalDialogOptions, ModalDialogParams, ModalDialogService } from './dia export const NS_DIRECTIVES = [ListViewComponent, TemplateKeyDirective, TabViewDirective, TabViewItemDirective, ActionBarComponent, ActionBarScope, ActionItemDirective, NavigationButtonDirective, AndroidFilterComponent, IosFilterComponent]; -export { ListViewComponent, TemplateKeyDirective, TemplatedItemsComponent, TabViewDirective, TabViewItemDirective, ActionBarComponent, ActionBarScope, ActionItemDirective, NavigationButtonDirective, AndroidFilterComponent, IosFilterComponent }; +export { ListViewComponent, TemplateKeyDirective, TemplatedItemsComponent, TabViewDirective, TabViewItemDirective, ActionBarComponent, ActionBarScope, ActionItemDirective, NavigationButtonDirective, AndroidFilterComponent, IosFilterComponent, TEMPLATED_ITEMS_COMPONENT }; From 23f89e42630efa55c586487d505380346aa40e2c Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Mon, 12 Oct 2020 08:53:47 -0700 Subject: [PATCH 17/27] chore(release): 10.1.7 --- CHANGELOG.md | 15 +++++++++++++++ nativescript-angular/package.json | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 13292ef5d..9c8ada310 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,18 @@ +## [10.1.7](https://github.com/NativeScript/nativescript-angular/compare/10.1.5...10.1.7) (2020-10-12) + + +### Bug Fixes + +* Export injection token used by plugins ([#2268](https://github.com/NativeScript/nativescript-angular/issues/2268)) ([75865f2](https://github.com/NativeScript/nativescript-angular/commit/75865f214d9e53eb36990c779808d50fb697f1ce)) +* expose NSLocationStrategy and NSRouteReuseStrategy ([9b8435e](https://github.com/NativeScript/nativescript-angular/commit/9b8435e13b7f6f42098e79895af5ab3156d1aac3)) + + +### Features + +* export injectiontoken for template items ([52a56d7](https://github.com/NativeScript/nativescript-angular/commit/52a56d7201b70b67edb2ca77e9042737f216a07a)) + + + ## [10.1.5](https://github.com/NativeScript/nativescript-angular/compare/10.1.4...10.1.5) (2020-09-21) diff --git a/nativescript-angular/package.json b/nativescript-angular/package.json index 1b5f9a6e6..38d0c5311 100644 --- a/nativescript-angular/package.json +++ b/nativescript-angular/package.json @@ -1,6 +1,6 @@ { "name": "@nativescript/angular", - "version": "10.1.5", + "version": "10.1.7", "description": "An Angular renderer that lets you build mobile apps with NativeScript.", "homepage": "https://www.nativescript.org/", "bugs": "https://github.com/NativeScript/nativescript-angular/issues", From e3657c446db7af23d50f8514d001e5709c2b7788 Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Tue, 17 Nov 2020 13:57:27 -0800 Subject: [PATCH 18/27] feat(angular): v11 (#2297) --- e2e/animation-examples/package.json | 24 ++++++------ nativescript-angular-package/package.json | 28 +++++++------- nativescript-angular/app-host-view.ts | 1 + nativescript-angular/package.json | 38 +++++++++---------- nativescript-angular/router/ns-router-link.ts | 2 - 5 files changed, 46 insertions(+), 47 deletions(-) diff --git a/e2e/animation-examples/package.json b/e2e/animation-examples/package.json index 8d9aaed48..a56c99369 100644 --- a/e2e/animation-examples/package.json +++ b/e2e/animation-examples/package.json @@ -5,14 +5,14 @@ "readme": "NativeScript Application", "repository": "", "dependencies": { - "@angular/animations": "~10.1.0", - "@angular/common": "~10.1.0", - "@angular/compiler": "~10.1.0", - "@angular/core": "~10.1.0", - "@angular/forms": "~10.1.0", - "@angular/platform-browser": "~10.1.0", - "@angular/platform-browser-dynamic": "~10.1.0", - "@angular/router": "~10.1.0", + "@angular/animations": "~11.0.0", + "@angular/common": "~11.0.0", + "@angular/compiler": "~11.0.0", + "@angular/core": "~11.0.0", + "@angular/forms": "~11.0.0", + "@angular/platform-browser": "~11.0.0", + "@angular/platform-browser-dynamic": "~11.0.0", + "@angular/router": "~11.0.0", "@nativescript/angular": "file:../../dist/nativescript-angular-scoped.tgz", "nativescript-theme-core": "~1.0.2", "reflect-metadata": "~0.1.13", @@ -21,10 +21,10 @@ "zone.js": "^0.11.1" }, "devDependencies": { - "@angular/compiler-cli": "~10.1.0", - "@nativescript/ios": "7.0.0", + "@angular/compiler-cli": "~11.0.0", + "@nativescript/ios": "7.0.5", "@nativescript/webpack": "~3.0.0", - "@ngtools/webpack": "~10.1.0", + "@ngtools/webpack": "~11.0.0", "@types/chai": "~4.2.0", "@types/mocha": "~7.0.0", "@types/node": "~14.0.0", @@ -37,7 +37,7 @@ "mochawesome": "~6.1.1", "nativescript-css-loader": "~0.26.0", "node-sass": "~4.14.1", - "typescript": "~3.9.0" + "typescript": "~4.0.0" }, "scripts": { "clean": "ns clean", diff --git a/nativescript-angular-package/package.json b/nativescript-angular-package/package.json index 0a75675e8..0d2a16f8e 100644 --- a/nativescript-angular-package/package.json +++ b/nativescript-angular-package/package.json @@ -1,6 +1,6 @@ { "name": "nativescript-angular", - "version": "10.0.0", + "version": "11.0.0", "description": "Compatibility with old style nativescript-angular imports.", "homepage": "https://www.nativescript.org/", "bugs": "https://github.com/NativeScript/nativescript-angular/issues", @@ -35,20 +35,20 @@ ] }, "devDependencies": { - "@angular/animations": "~10.0.0", - "@angular/common": "~10.0.0", - "@angular/compiler": "~10.0.0", - "@angular/compiler-cli": "~10.0.0", - "@angular/core": "~10.0.0", - "@angular/forms": "~10.0.0", - "@angular/platform-browser": "~10.0.0", - "@angular/platform-browser-dynamic": "~10.0.0", - "@angular/router": "~10.0.0", - "@nativescript/angular": "~10.0.0", + "@angular/animations": "~11.0.0", + "@angular/common": "~11.0.0", + "@angular/compiler": "~11.0.0", + "@angular/compiler-cli": "~11.0.0", + "@angular/core": "~11.0.0", + "@angular/forms": "~11.0.0", + "@angular/platform-browser": "~11.0.0", + "@angular/platform-browser-dynamic": "~11.0.0", + "@angular/router": "~11.0.0", + "@nativescript/angular": "rc", "@nativescript/core": "rc", - "ng-packagr": "^10.0.1", - "rxjs": "~6.5.5", - "typescript": "~3.9.0" + "ng-packagr": "^11.0.0", + "rxjs": "~6.6.0", + "typescript": "~4.0.0" }, "scripts": { "setup": "npx rimraf hooks node_modules package-lock.json && npm i", diff --git a/nativescript-angular/app-host-view.ts b/nativescript-angular/app-host-view.ts index 55e91911c..3f14d684d 100644 --- a/nativescript-angular/app-host-view.ts +++ b/nativescript-angular/app-host-view.ts @@ -17,6 +17,7 @@ export class AppHostView extends ContentView { this._ngAppRoot = value; } + // @ts-ignore get content(): View { return this._content; } diff --git a/nativescript-angular/package.json b/nativescript-angular/package.json index 38d0c5311..f027eaaf8 100644 --- a/nativescript-angular/package.json +++ b/nativescript-angular/package.json @@ -1,6 +1,6 @@ { "name": "@nativescript/angular", - "version": "10.1.7", + "version": "11.0.0-rc.0", "description": "An Angular renderer that lets you build mobile apps with NativeScript.", "homepage": "https://www.nativescript.org/", "bugs": "https://github.com/NativeScript/nativescript-angular/issues", @@ -61,37 +61,37 @@ "nativescript-intl": "^4.0.0" }, "peerDependencies": { - "@angular/common": "^10.1.0", - "@angular/compiler": "^10.1.0", - "@angular/core": "^10.1.0", - "@angular/forms": "^10.1.0", - "@angular/platform-browser": "^10.1.0", - "@angular/platform-browser-dynamic": "^10.1.0", - "@angular/router": "^10.1.0" + "@angular/common": "^11.0.0", + "@angular/compiler": "^11.0.0", + "@angular/core": "^11.0.0", + "@angular/forms": "^11.0.0", + "@angular/platform-browser": "^11.0.0", + "@angular/platform-browser-dynamic": "^11.0.0", + "@angular/router": "^11.0.0" }, "devDependencies": { - "@angular/animations": "~10.1.0", - "@angular/common": "~10.1.0", - "@angular/compiler": "~10.1.0", - "@angular/compiler-cli": "~10.1.0", - "@angular/core": "~10.1.0", - "@angular/forms": "~10.1.0", - "@angular/platform-browser": "~10.1.0", - "@angular/platform-browser-dynamic": "~10.1.0", - "@angular/router": "~10.1.0", + "@angular/animations": "~11.0.0", + "@angular/common": "~11.0.0", + "@angular/compiler": "~11.0.0", + "@angular/compiler-cli": "~11.0.0", + "@angular/core": "~11.0.0", + "@angular/forms": "~11.0.0", + "@angular/platform-browser": "~11.0.0", + "@angular/platform-browser-dynamic": "~11.0.0", + "@angular/router": "~11.0.0", "@nativescript/core": "~7.0.0", "codelyzer": "^5.2.0", "conventional-changelog-cli": "^2.0.34", "husky": "^4.2.5", "lint-staged": "^10.2.11", "nativescript-typedoc-theme": "git://github.com/NativeScript/nativescript-typedoc-theme.git#master", - "ng-packagr": "~10.1.0", + "ng-packagr": "~11.0.0", "prettier": "^2.0.5", "rxjs": "~6.6.0", "tslint": "^6.1.2", "tslint-config-prettier": "^1.18.0", "typedoc": "~0.17.0", - "typescript": "~3.9.0", + "typescript": "~4.0.0", "zone.js": "^0.11.1" }, "husky": { diff --git a/nativescript-angular/router/ns-router-link.ts b/nativescript-angular/router/ns-router-link.ts index 23aa97bac..02ba34a39 100644 --- a/nativescript-angular/router/ns-router-link.ts +++ b/nativescript-angular/router/ns-router-link.ts @@ -68,7 +68,6 @@ export class NSRouterLink { relativeTo: this.route, queryParams: this.queryParams, fragment: this.fragment, - preserveQueryParams: attrBoolValue(this.preserveQueryParams), queryParamsHandling: this.queryParamsHandling, preserveFragment: attrBoolValue(this.preserveFragment), }); @@ -102,7 +101,6 @@ export class NSRouterLink { relativeTo: this.route, queryParams: this.queryParams, fragment: this.fragment, - preserveQueryParams: attrBoolValue(this.preserveQueryParams), queryParamsHandling: this.queryParamsHandling, preserveFragment: attrBoolValue(this.preserveFragment), }); From 2dc8e0633c8eb1f55bf0816f2230daecd57b4a7e Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Tue, 17 Nov 2020 14:02:30 -0800 Subject: [PATCH 19/27] chore(release): 11.0.0 --- CHANGELOG.md | 9 +++++++++ nativescript-angular/package.json | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c8ada310..bd4efece2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +# [11.0.0](https://github.com/NativeScript/nativescript-angular/compare/10.1.7...11.0.0) (2020-11-17) + + +### Features + +* **angular:** v11 ([#2297](https://github.com/NativeScript/nativescript-angular/issues/2297)) ([e3657c4](https://github.com/NativeScript/nativescript-angular/commit/e3657c446db7af23d50f8514d001e5709c2b7788)) + + + ## [10.1.7](https://github.com/NativeScript/nativescript-angular/compare/10.1.5...10.1.7) (2020-10-12) diff --git a/nativescript-angular/package.json b/nativescript-angular/package.json index f027eaaf8..bdcce4fa2 100644 --- a/nativescript-angular/package.json +++ b/nativescript-angular/package.json @@ -1,6 +1,6 @@ { "name": "@nativescript/angular", - "version": "11.0.0-rc.0", + "version": "11.0.0", "description": "An Angular renderer that lets you build mobile apps with NativeScript.", "homepage": "https://www.nativescript.org/", "bugs": "https://github.com/NativeScript/nativescript-angular/issues", From 197d802976ddf4ae3bba45f2d000a687049c8027 Mon Sep 17 00:00:00 2001 From: Eduardo Speroni Date: Fri, 22 Jan 2021 18:05:03 -0300 Subject: [PATCH 20/27] fix: blank screen on hmr (#2317) --- nativescript-angular/platform-common.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nativescript-angular/platform-common.ts b/nativescript-angular/platform-common.ts index 913bd3f06..48ffde08f 100644 --- a/nativescript-angular/platform-common.ts +++ b/nativescript-angular/platform-common.ts @@ -302,7 +302,7 @@ export class NativeScriptPlatformRef extends PlatformRef { lastBootstrappedModule = new WeakRef(moduleRef); Application.resetRootView({ - create: () => getRootPage(), + create: () => (getRootPage() instanceof AppHostView ? ((getRootPage()) as AppHostView).ngAppRoot : getRootPage()), }); }, (error) => { From 563289884b9b5a786b0930249b08ba63c1e0922b Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Fri, 22 Jan 2021 15:35:18 -0800 Subject: [PATCH 21/27] chore(release): 11.0.1 --- CHANGELOG.md | 9 +++++++++ nativescript-angular/package.json | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bd4efece2..82b761170 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +## [11.0.1](https://github.com/NativeScript/nativescript-angular/compare/11.0.0...11.0.1) (2021-01-22) + + +### Bug Fixes + +* blank screen on hmr ([#2317](https://github.com/NativeScript/nativescript-angular/issues/2317)) ([197d802](https://github.com/NativeScript/nativescript-angular/commit/197d802976ddf4ae3bba45f2d000a687049c8027)) + + + # [11.0.0](https://github.com/NativeScript/nativescript-angular/compare/10.1.7...11.0.0) (2020-11-17) diff --git a/nativescript-angular/package.json b/nativescript-angular/package.json index bdcce4fa2..8afa82555 100644 --- a/nativescript-angular/package.json +++ b/nativescript-angular/package.json @@ -1,6 +1,6 @@ { "name": "@nativescript/angular", - "version": "11.0.0", + "version": "11.0.1", "description": "An Angular renderer that lets you build mobile apps with NativeScript.", "homepage": "https://www.nativescript.org/", "bugs": "https://github.com/NativeScript/nativescript-angular/issues", @@ -79,7 +79,7 @@ "@angular/platform-browser": "~11.0.0", "@angular/platform-browser-dynamic": "~11.0.0", "@angular/router": "~11.0.0", - "@nativescript/core": "~7.0.0", + "@nativescript/core": "~7.1.0", "codelyzer": "^5.2.0", "conventional-changelog-cli": "^2.0.34", "husky": "^4.2.5", From 13a3562146ef8516fea8bb3d988f8e0ddc9617a7 Mon Sep 17 00:00:00 2001 From: Eduardo Speroni Date: Wed, 24 Mar 2021 15:04:45 -0300 Subject: [PATCH 22/27] fix(ivy): nsRouterLinkActive works on nsRouterLink (#2322) --- .../router/ns-router-link-active.ts | 74 ++++++++++++------- nativescript-angular/router/ns-router-link.ts | 14 +++- 2 files changed, 61 insertions(+), 27 deletions(-) diff --git a/nativescript-angular/router/ns-router-link-active.ts b/nativescript-angular/router/ns-router-link-active.ts index b00a35679..333cba56d 100644 --- a/nativescript-angular/router/ns-router-link-active.ts +++ b/nativescript-angular/router/ns-router-link-active.ts @@ -1,10 +1,11 @@ -import { AfterContentInit, ContentChildren, Directive, ElementRef, Input, OnChanges, OnDestroy, QueryList, Renderer2 } from '@angular/core'; -import { Subscription } from 'rxjs'; +import { AfterContentInit, ChangeDetectorRef, ContentChildren, Directive, ElementRef, Input, OnChanges, OnDestroy, Optional, QueryList, Renderer2 } from '@angular/core'; +import { from, of, Subscription } from 'rxjs'; import { NavigationEnd, Router, UrlTree } from '@angular/router'; import { containsTree } from './private-imports/router-url-tree'; import { NSRouterLink } from './ns-router-link'; +import { mergeAll } from 'rxjs/operators'; /** * The NSRouterLinkActive directive lets you add a CSS class to an element when the link"s route @@ -54,16 +55,17 @@ import { NSRouterLink } from './ns-router-link'; }) export class NSRouterLinkActive implements OnChanges, OnDestroy, AfterContentInit { // tslint:disable-line:max-line-length directive-class-suffix - @ContentChildren(NSRouterLink) links: QueryList; + @ContentChildren(NSRouterLink, { descendants: true }) links: QueryList; private classes: string[] = []; - private subscription: Subscription; + private routerEventsSubscription: Subscription; + private linkInputChangesSubscription?: Subscription; private active: boolean = false; @Input() nsRouterLinkActiveOptions: { exact: boolean } = { exact: false }; - constructor(private router: Router, private element: ElementRef, private renderer: Renderer2) { - this.subscription = router.events.subscribe((s) => { + constructor(private router: Router, private element: ElementRef, private renderer: Renderer2, private readonly cdr: ChangeDetectorRef, @Optional() private link?: NSRouterLink) { + this.routerEventsSubscription = router.events.subscribe((s) => { if (s instanceof NavigationEnd) { this.update(); } @@ -75,8 +77,25 @@ export class NSRouterLinkActive implements OnChanges, OnDestroy, AfterContentIni } ngAfterContentInit(): void { - this.links.changes.subscribe(() => this.update()); - this.update(); + // `of(null)` is used to force subscribe body to execute once immediately (like `startWith`). + from([this.links.changes, of(null)]) + .pipe(mergeAll()) + .subscribe((_) => { + this.update(); + this.subscribeToEachLinkOnChanges(); + }); + } + + private subscribeToEachLinkOnChanges() { + this.linkInputChangesSubscription?.unsubscribe(); + const allLinkChanges = [...this.links.toArray(), this.link].filter((link): link is NSRouterLink => !!link).map((link) => link.onChanges); + this.linkInputChangesSubscription = from(allLinkChanges) + .pipe(mergeAll()) + .subscribe((link) => { + if (this.isActive !== this.isLinkActive(this.router)(link)) { + this.update(); + } + }); } @Input('nsRouterLinkActive') @@ -92,30 +111,34 @@ export class NSRouterLinkActive implements OnChanges, OnDestroy, AfterContentIni this.update(); } ngOnDestroy(): any { - this.subscription.unsubscribe(); + this.routerEventsSubscription.unsubscribe(); + this.linkInputChangesSubscription?.unsubscribe(); } private update(): void { if (!this.links) { return; } - const hasActiveLinks = this.hasActiveLinks(); - // react only when status has changed to prevent unnecessary dom updates - if (this.active !== hasActiveLinks) { - const currentUrlTree = this.router.parseUrl(this.router.url); - const isActiveLinks = this.reduceList(currentUrlTree, this.links); - this.classes.forEach((c) => { - if (isActiveLinks) { - this.renderer.addClass(this.element.nativeElement, c); - } else { - this.renderer.removeClass(this.element.nativeElement, c); - } - }); - } - Promise.resolve(hasActiveLinks).then((active) => (this.active = active)); + Promise.resolve().then(() => { + const hasActiveLinks = this.hasActiveLinks(); + if (this.active !== hasActiveLinks) { + this.active = hasActiveLinks; + const currentUrlTree = this.router.parseUrl(this.router.url); + const links = this.link ? [...this.links.toArray(), this.link] : this.links; + const isActiveLinks = this.reduceList(currentUrlTree, links); + this.cdr.markForCheck(); + this.classes.forEach((c) => { + if (isActiveLinks) { + this.renderer.addClass(this.element.nativeElement, c); + } else { + this.renderer.removeClass(this.element.nativeElement, c); + } + }); + } + }); } - private reduceList(currentUrlTree: UrlTree, q: QueryList): boolean { + private reduceList(currentUrlTree: UrlTree, q: QueryList | Array): boolean { return q.reduce((res: boolean, link: NSRouterLink) => { return res || containsTree(currentUrlTree, link.urlTree, this.nsRouterLinkActiveOptions.exact); }, false); @@ -126,6 +149,7 @@ export class NSRouterLinkActive implements OnChanges, OnDestroy, AfterContentIni } private hasActiveLinks(): boolean { - return this.links.some(this.isLinkActive(this.router)); + const isActiveCheckFn = this.isLinkActive(this.router); + return (this.link && isActiveCheckFn(this.link)) || this.links.some(isActiveCheckFn); } } diff --git a/nativescript-angular/router/ns-router-link.ts b/nativescript-angular/router/ns-router-link.ts index 02ba34a39..40c0b3a10 100644 --- a/nativescript-angular/router/ns-router-link.ts +++ b/nativescript-angular/router/ns-router-link.ts @@ -1,10 +1,11 @@ -import { Directive, Input, ElementRef, NgZone } from '@angular/core'; +import { Directive, Input, ElementRef, NgZone, OnChanges, SimpleChanges } from '@angular/core'; import { NavigationExtras } from '@angular/router'; import { ActivatedRoute, Router, UrlTree } from '@angular/router'; import { NavigationTransition } from '@nativescript/core'; import { NativeScriptDebug } from '../trace'; import { RouterExtensions } from './router-extensions'; import { NavigationOptions } from './ns-location-utils'; +import { Subject } from 'rxjs'; // Copied from "@angular/router/src/config" export type QueryParamsHandling = 'merge' | 'preserve' | ''; @@ -34,7 +35,7 @@ export type QueryParamsHandling = 'merge' | 'preserve' | ''; * And if the segment begins with `../`, the router will go up one level. */ @Directive({ selector: '[nsRouterLink]' }) -export class NSRouterLink { +export class NSRouterLink implements OnChanges { // tslint:disable-line:directive-class-suffix @Input() target: string; @Input() queryParams: { [k: string]: any }; @@ -50,6 +51,9 @@ export class NSRouterLink { @Input() pageTransition: boolean | string | NavigationTransition = true; @Input() pageTransitionDuration; + /** @internal */ + onChanges = new Subject(); + private commands: any[] = []; constructor(private ngZone: NgZone, private router: Router, private navigator: RouterExtensions, private route: ActivatedRoute, private el: ElementRef) {} @@ -75,6 +79,12 @@ export class NSRouterLink { }); } + ngOnChanges(changes: SimpleChanges) { + // This is subscribed to by `RouterLinkActive` so that it knows to update when there are changes + // to the RouterLinks it's tracking. + this.onChanges.next(this); + } + @Input('nsRouterLink') set params(data: any[] | string) { if (Array.isArray(data)) { From 3b4daddd00b24ff2a25a1eccefe4513901106ead Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Wed, 24 Mar 2021 11:21:00 -0700 Subject: [PATCH 23/27] chore(release): 11.2.0 --- nativescript-angular-package/package.json | 4 ++-- nativescript-angular/package.json | 26 +++++++++++------------ nativescript-angular/testing/package.json | 6 +++--- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/nativescript-angular-package/package.json b/nativescript-angular-package/package.json index 0d2a16f8e..317ebb9a1 100644 --- a/nativescript-angular-package/package.json +++ b/nativescript-angular-package/package.json @@ -1,6 +1,6 @@ { "name": "nativescript-angular", - "version": "11.0.0", + "version": "11.2.0", "description": "Compatibility with old style nativescript-angular imports.", "homepage": "https://www.nativescript.org/", "bugs": "https://github.com/NativeScript/nativescript-angular/issues", @@ -30,7 +30,7 @@ "@nativescript/angular": "ns-angular" } }, - "whitelistedNonPeerDependencies": [ + "allowedNonPeerDependencies": [ "." ] }, diff --git a/nativescript-angular/package.json b/nativescript-angular/package.json index 8afa82555..304e20917 100644 --- a/nativescript-angular/package.json +++ b/nativescript-angular/package.json @@ -1,6 +1,6 @@ { "name": "@nativescript/angular", - "version": "11.0.1", + "version": "11.2.0", "description": "An Angular renderer that lets you build mobile apps with NativeScript.", "homepage": "https://www.nativescript.org/", "bugs": "https://github.com/NativeScript/nativescript-angular/issues", @@ -52,7 +52,7 @@ "@nativescript/core": "ns-core" } }, - "whitelistedNonPeerDependencies": [ + "allowedNonPeerDependencies": [ "." ] }, @@ -70,22 +70,22 @@ "@angular/router": "^11.0.0" }, "devDependencies": { - "@angular/animations": "~11.0.0", - "@angular/common": "~11.0.0", - "@angular/compiler": "~11.0.0", - "@angular/compiler-cli": "~11.0.0", - "@angular/core": "~11.0.0", - "@angular/forms": "~11.0.0", - "@angular/platform-browser": "~11.0.0", - "@angular/platform-browser-dynamic": "~11.0.0", - "@angular/router": "~11.0.0", - "@nativescript/core": "~7.1.0", + "@angular/animations": "~11.2.0", + "@angular/common": "~11.2.0", + "@angular/compiler": "~11.2.0", + "@angular/compiler-cli": "~11.2.0", + "@angular/core": "~11.2.0", + "@angular/forms": "~11.2.0", + "@angular/platform-browser": "~11.2.0", + "@angular/platform-browser-dynamic": "~11.2.0", + "@angular/router": "~11.2.0", + "@nativescript/core": "~7.3.0", "codelyzer": "^5.2.0", "conventional-changelog-cli": "^2.0.34", "husky": "^4.2.5", "lint-staged": "^10.2.11", "nativescript-typedoc-theme": "git://github.com/NativeScript/nativescript-typedoc-theme.git#master", - "ng-packagr": "~11.0.0", + "ng-packagr": "~11.2.0", "prettier": "^2.0.5", "rxjs": "~6.6.0", "tslint": "^6.1.2", diff --git a/nativescript-angular/testing/package.json b/nativescript-angular/testing/package.json index a809f1246..3c4d818df 100644 --- a/nativescript-angular/testing/package.json +++ b/nativescript-angular/testing/package.json @@ -6,12 +6,12 @@ "@nativescript/core": "ns-core" } }, - "whitelistedNonPeerDependencies": [ + "allowedNonPeerDependencies": [ "." ] }, "devDependencies": { - "@nativescript/angular": "rc", - "@nativescript/core": "rc" + "@nativescript/angular": "latest", + "@nativescript/core": "latest" } } From ec8bbe0b13f95e67bd65a09ae8fc4f4e1d22d2f0 Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Wed, 24 Mar 2021 11:22:08 -0700 Subject: [PATCH 24/27] chore: 11.2.0 changelog --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 82b761170..e7e0c6b06 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +# [11.2.0](https://github.com/NativeScript/nativescript-angular/compare/11.0.1...11.2.0) (2021-03-24) + + +### Bug Fixes + +* **ivy:** nsRouterLinkActive works on nsRouterLink ([#2322](https://github.com/NativeScript/nativescript-angular/issues/2322)) ([13a3562](https://github.com/NativeScript/nativescript-angular/commit/13a3562146ef8516fea8bb3d988f8e0ddc9617a7)) + + + ## [11.0.1](https://github.com/NativeScript/nativescript-angular/compare/11.0.0...11.0.1) (2021-01-22) From c4ab491367098f61be26dc1a4dff733d558c6d2d Mon Sep 17 00:00:00 2001 From: Eduardo Speroni Date: Tue, 6 Apr 2021 17:22:12 -0300 Subject: [PATCH 25/27] fix: polyfill global.Node for angular testing (#2340) --- nativescript-angular/testing/src/polyfills.ts | 4 ++++ nativescript-angular/testing/src/public_api.ts | 1 + 2 files changed, 5 insertions(+) create mode 100644 nativescript-angular/testing/src/polyfills.ts diff --git a/nativescript-angular/testing/src/polyfills.ts b/nativescript-angular/testing/src/polyfills.ts new file mode 100644 index 000000000..fb0686283 --- /dev/null +++ b/nativescript-angular/testing/src/polyfills.ts @@ -0,0 +1,4 @@ +if (typeof Node === 'undefined' && !global.Node) { + class DummyNode {} + global.Node = DummyNode as any; +} diff --git a/nativescript-angular/testing/src/public_api.ts b/nativescript-angular/testing/src/public_api.ts index 74b1d5516..66d4aa5f3 100644 --- a/nativescript-angular/testing/src/public_api.ts +++ b/nativescript-angular/testing/src/public_api.ts @@ -1,3 +1,4 @@ +import './polyfills'; export * from './util'; export * from './test-root-view'; export * from './nativescript_test_component_renderer'; From a95e56ebd5f6e57cafdbf3192ec2d64f904dc76e Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Tue, 6 Apr 2021 13:25:27 -0700 Subject: [PATCH 26/27] chore: NativeScript 8 (#2344) --- nativescript-angular-package/package.json | 2 +- nativescript-angular/element-registry.ts | 8 ++------ nativescript-angular/package.json | 13 ++---------- nativescript-angular/testing/package.json | 2 +- tests/package.json | 24 +++++++++++------------ 5 files changed, 18 insertions(+), 31 deletions(-) diff --git a/nativescript-angular-package/package.json b/nativescript-angular-package/package.json index 317ebb9a1..54867bcbb 100644 --- a/nativescript-angular-package/package.json +++ b/nativescript-angular-package/package.json @@ -45,7 +45,7 @@ "@angular/platform-browser-dynamic": "~11.0.0", "@angular/router": "~11.0.0", "@nativescript/angular": "rc", - "@nativescript/core": "rc", + "@nativescript/core": "~8.0.0", "ng-packagr": "^11.0.0", "rxjs": "~6.6.0", "typescript": "~4.0.0" diff --git a/nativescript-angular/element-registry.ts b/nativescript-angular/element-registry.ts index 33925be70..d42c91259 100644 --- a/nativescript-angular/element-registry.ts +++ b/nativescript-angular/element-registry.ts @@ -1,4 +1,4 @@ -import { View, LayoutBase, Page, Frame, AbsoluteLayout, ActivityIndicator, BottomNavigation, Button, ContentView, DatePicker, DockLayout, GridLayout, HtmlView, Image, Label, ListPicker, ListView, Placeholder, Progress, ProxyViewContainer, Repeater, ScrollView, SearchBar, SegmentedBar, SegmentedBarItem, Slider, StackLayout, FlexboxLayout, Switch, TabView, TabStrip, TabStripItem, TabContentItem, Tabs, TextField, TextView, TimePicker, WebView, WrapLayout, FormattedString, Span } from '@nativescript/core'; +import { View, LayoutBase, Page, Frame, AbsoluteLayout, ActivityIndicator, Button, ContentView, DatePicker, DockLayout, GridLayout, HtmlView, Image, Label, ListPicker, ListView, Placeholder, Progress, ProxyViewContainer, Repeater, ScrollView, SearchBar, SegmentedBar, SegmentedBarItem, Slider, StackLayout, FlexboxLayout, Switch, TabView, TextField, TextView, TimePicker, WebView, WrapLayout, FormattedString, Span, RootLayout } from '@nativescript/core'; export interface ViewClass { new (): View; @@ -164,7 +164,6 @@ const frameMeta: ViewClassMeta = { // Note: ActionBar related components are registerd together with action-bar directives. registerElement('AbsoluteLayout', () => AbsoluteLayout); registerElement('ActivityIndicator', () => ActivityIndicator); -registerElement('BottomNavigation', () => BottomNavigation); registerElement('Button', () => Button); registerElement('ContentView', () => ContentView); registerElement('DatePicker', () => DatePicker); @@ -183,6 +182,7 @@ registerElement('Placeholder', () => Placeholder); registerElement('Progress', () => Progress); registerElement('ProxyViewContainer', () => ProxyViewContainer); registerElement('Repeater', () => Repeater); +registerElement('RootLayout', () => RootLayout); registerElement('ScrollView', () => ScrollView); registerElement('SearchBar', () => SearchBar); registerElement('SegmentedBar', () => SegmentedBar); @@ -192,10 +192,6 @@ registerElement('StackLayout', () => StackLayout); registerElement('FlexboxLayout', () => FlexboxLayout); registerElement('Switch', () => Switch); registerElement('TabView', () => TabView); -registerElement('TabStrip', () => TabStrip); -registerElement('TabStripItem', () => TabStripItem); -registerElement('TabContentItem', () => TabContentItem); -registerElement('Tabs', () => Tabs); registerElement('TextField', () => TextField); registerElement('TextView', () => TextView); registerElement('TimePicker', () => TimePicker); diff --git a/nativescript-angular/package.json b/nativescript-angular/package.json index 304e20917..574fab819 100644 --- a/nativescript-angular/package.json +++ b/nativescript-angular/package.json @@ -1,6 +1,6 @@ { "name": "@nativescript/angular", - "version": "11.2.0", + "version": "11.8.0", "description": "An Angular renderer that lets you build mobile apps with NativeScript.", "homepage": "https://www.nativescript.org/", "bugs": "https://github.com/NativeScript/nativescript-angular/issues", @@ -60,15 +60,6 @@ "@nativescript/zone-js": "~1.0.0", "nativescript-intl": "^4.0.0" }, - "peerDependencies": { - "@angular/common": "^11.0.0", - "@angular/compiler": "^11.0.0", - "@angular/core": "^11.0.0", - "@angular/forms": "^11.0.0", - "@angular/platform-browser": "^11.0.0", - "@angular/platform-browser-dynamic": "^11.0.0", - "@angular/router": "^11.0.0" - }, "devDependencies": { "@angular/animations": "~11.2.0", "@angular/common": "~11.2.0", @@ -79,7 +70,7 @@ "@angular/platform-browser": "~11.2.0", "@angular/platform-browser-dynamic": "~11.2.0", "@angular/router": "~11.2.0", - "@nativescript/core": "~7.3.0", + "@nativescript/core": "~8.0.0", "codelyzer": "^5.2.0", "conventional-changelog-cli": "^2.0.34", "husky": "^4.2.5", diff --git a/nativescript-angular/testing/package.json b/nativescript-angular/testing/package.json index 3c4d818df..e0ecb51a5 100644 --- a/nativescript-angular/testing/package.json +++ b/nativescript-angular/testing/package.json @@ -12,6 +12,6 @@ }, "devDependencies": { "@nativescript/angular": "latest", - "@nativescript/core": "latest" + "@nativescript/core": "~8.0.0" } } diff --git a/tests/package.json b/tests/package.json index 998965df3..405d8317b 100644 --- a/tests/package.json +++ b/tests/package.json @@ -19,23 +19,23 @@ ], "homepage": "http://nativescript.org", "dependencies": { - "@angular/animations": "~9.1.0", - "@angular/common": "~9.1.0", - "@angular/compiler": "~9.1.0", - "@angular/core": "~9.1.0", - "@angular/forms": "~9.1.0", - "@angular/platform-browser": "~9.1.0", - "@angular/platform-browser-dynamic": "~9.1.0", - "@angular/router": "~9.1.0", + "@angular/animations": "~11.2.0", + "@angular/common": "~11.2.0", + "@angular/compiler": "~11.2.0", + "@angular/core": "~11.2.0", + "@angular/forms": "~11.2.0", + "@angular/platform-browser": "~11.2.0", + "@angular/platform-browser-dynamic": "~11.2.0", + "@angular/router": "~11.2.0", "nativescript-angular": "../nativescript-angular-package", "nativescript-unit-test-runner": "0.7.0", "rxjs": "~6.5.5", - "@nativescript/core": "next", + "@nativescript/core": "~8.0.0", "zone.js": "^0.10.3" }, "devDependencies": { - "@angular/compiler-cli": "8.0.0", - "@ngtools/webpack": "8.0.0", + "@angular/compiler-cli": "~11.2.0", + "@ngtools/webpack": "~11.2.0", "@types/chai": "^4.1.4", "@types/karma-chai": "0.1.1", "@types/mocha": "5.2.7", @@ -57,7 +57,7 @@ "remove-strict-webpack-plugin": "~0.1.2", "sinon": "^7.3.2", "tslint": "^4.5.1", - "typescript": "~3.8.3" + "typescript": "~4.0.0" }, "scripts": { "e2e": "tsc -p e2e && mocha --opts ../e2e/config/mocha.opts --recursive e2e --appiumCapsLocation ../e2e/config/appium.capabilities.json", From 352c5a9d0fc7a7b1cb1ffea0c14e808d7a4801ea Mon Sep 17 00:00:00 2001 From: Nathan Walker Date: Mon, 28 Oct 2024 13:28:55 -0700 Subject: [PATCH 27/27] chore: readme note --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index b6d86f1a1..8819a1595 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ +## Note on repo + +This repo is for Angular <= 11. If looking for 12+ (including 18+, etc) it's maintained here [NativeScript/angular](https://github.com/NativeScript/angular). + # NativeScript Angular [![Build Status](https://travis-ci.org/NativeScript/nativescript-angular.svg?branch=master)](https://travis-ci.org/NativeScript/nativescript-angular)