Skip to content

release: cut the 7.2.4 release #1790

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 51 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
3c3c10e
chore: bump package versino tp 7.3.0
SvetoslavTsenov Feb 8, 2019
3c7ad92
Merge pull request #1721 from NativeScript/svetoslavtsenov/bump-versi…
SvetoslavTsenov Feb 8, 2019
c49e65f
Merge remote-tracking branch 'origin/master' into merge-release-in-ma…
SvetoslavTsenov Feb 10, 2019
1da4cfb
Merge pull request #1725 from NativeScript/merge-release-in-master
SvetoslavTsenov Feb 11, 2019
a21454f
chor(NativeScriptPlatformRef): Destroy lastModuleRef on exitEvent
m-abs Feb 12, 2019
a4ee021
fix(tslint): missing whitespace
m-abs Feb 12, 2019
b95296c
Merge branch 'master' into myankov/merge-release-master
MartoYankov Feb 19, 2019
0f6a975
fix(router): routing services should be provided in forRoot only (#1729)
Feb 19, 2019
1119e2a
Merge branch 'master' into fix/923-module-not-destroyed
Feb 19, 2019
90753c0
Merge branch 'master' into myankov/merge-release-master
Feb 19, 2019
a16063b
Merge pull request #1741 from NativeScript/myankov/merge-release-master
MartoYankov Feb 19, 2019
849e16e
Merge remote-tracking branch 'origin/master' into merge-release-maste…
SvetoslavTsenov Feb 19, 2019
402fbde
Merge pull request #1743 from NativeScript/merge-release-master-7.2.2
SvetoslavTsenov Feb 19, 2019
bdd3250
Merge branch 'master' into fix/923-module-not-destroyed
m-abs Feb 20, 2019
f9b1d0c
Merge branch 'fix/923-module-not-destroyed' of github.com:m-abs/nativ…
m-abs Feb 20, 2019
14e787f
fix: remove rootContent on exit
m-abs Feb 21, 2019
ea66985
fix: page might be null'ed before clearHistory's navigatedToEvent
m-abs Feb 22, 2019
878f44d
Merge branch 'master' into djenkov/release-to-master
ADjenkov Feb 26, 2019
9b3a3ba
Merge pull request #1750 from NativeScript/djenkov/release-to-master
ADjenkov Feb 26, 2019
ed6954a
refactor: minor changes after review
Feb 28, 2019
16af2e8
Merge branch 'master' into fix/923-module-not-destroyed
m-abs Mar 5, 2019
5e13263
fix: on destroy remove the lastBootstrappedModule
m-abs Mar 8, 2019
30db0d2
Merge branch 'fix/923-module-not-destroyed' of github.com:m-abs/nativ…
m-abs Mar 8, 2019
9fc172c
chore(tsconfig): remove path resolution for short imports (`ui/page`)
sis0k0 Mar 11, 2019
3dffbd5
fix: the exit event is triggered on restart
m-abs Mar 11, 2019
9ba7fca
NS Angular api ref build script
tsonevn Mar 12, 2019
b1c4340
exclude files from api ref build
tsonevn Mar 12, 2019
06bbcae
Merge pull request #1760 from NativeScript/ng_apiref
tsonevn Mar 12, 2019
e1b6e20
Merge branch 'master' into sis0k0/remove-short-imports-resolution
SvetoslavTsenov Mar 12, 2019
9122c23
Merge branch 'master' into fix/923-module-not-destroyed
m-abs Mar 12, 2019
f549b94
Merge remote-tracking branch 'origin/master' into merge-release-in-ma…
SvetoslavTsenov Mar 14, 2019
9cfa127
feat(modal): add ‘ios presentationStyle’ option to ModalDialogParams
Feb 1, 2019
a4282ff
chore: remove object cast as it is not needed
Mar 25, 2019
c9dc826
chore: add example that shows "popover" mode for modal service
Mar 25, 2019
0e90cc3
chore: remove old todo comment
Mar 26, 2019
2ce8007
chore(list-view): change the import to be from the base module
Mar 27, 2019
cb7da86
chore: update "pop over modal" example with new API
Mar 27, 2019
3feada8
chore: fix tslint error
Mar 27, 2019
9dfc569
Merge pull request #1771 from NativeScript/amiorkov/modal-options
VladimirAmiorkov Mar 28, 2019
685ddca
Merge branch 'master' into sis0k0/remove-short-imports-resolution
elena-p Apr 5, 2019
8931415
Merge branch 'master' into minor-fixes
elena-p Apr 5, 2019
b57c661
Merge branch 'master' into merge-release-in-master
elena-p Apr 5, 2019
72d877b
Merge branch 'master' into fix/923-module-not-destroyed
Apr 5, 2019
a77683e
Merge pull request #1763 from NativeScript/merge-release-in-master
elena-p Apr 11, 2019
738b15d
Merge branch 'master' into minor-fixes
elena-p Apr 11, 2019
20d48ee
Merge pull request #1753 from NativeScript/minor-fixes
elena-p Apr 12, 2019
ac9a59f
Merge branch 'master' into fix/923-module-not-destroyed
elena-p Apr 12, 2019
f12000e
Merge pull request #1728 from m-abs/fix/923-module-not-destroyed
elena-p Apr 15, 2019
51a61f1
Merge branch 'master' into sis0k0/remove-short-imports-resolution
elena-p Apr 15, 2019
d4739f5
Merge pull request #1759 from NativeScript/sis0k0/remove-short-import…
elena-p Apr 19, 2019
210e71b
release: cut the 7.2.4 release
SvetoslavTsenov Apr 23, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
<a name="7.2.4"></a>
## [7.2.4](https://github.com/NativeScript/nativescript-angular/compare/7.2.3...7.2.4) (2019-04-23)


### Bug Fixes

* **router:** routing services should be provided in forRoot only ([#1729](https://github.com/NativeScript/nativescript-angular/issues/1729)) ([0f6a975](https://github.com/NativeScript/nativescript-angular/commit/0f6a975))
* on destroy remove the lastBootstrappedModule ([5e13263](https://github.com/NativeScript/nativescript-angular/commit/5e13263))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this and the next 3 commits are all part of one PR - #1728 could we link only this PR and/or the issue it is related to - #923 instead of listing all commits

* page might be null'ed before clearHistory's navigatedToEvent ([ea66985](https://github.com/NativeScript/nativescript-angular/commit/ea66985))
* remove rootContent on exit ([14e787f](https://github.com/NativeScript/nativescript-angular/commit/14e787f))
* the exit event is triggered on restart ([3dffbd5](https://github.com/NativeScript/nativescript-angular/commit/3dffbd5))


### Features

* **modal:** add ‘ios presentationStyle’ option to ModalDialogParams ([9cfa127](https://github.com/NativeScript/nativescript-angular/commit/9cfa127))



<a name="7.2.3"></a>
## [7.2.3](https://github.com/NativeScript/nativescript-angular/compare/7.2.2...7.2.3) (2019-03-14)

Expand Down
9 changes: 9 additions & 0 deletions build-docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
set -e

ENV="${ENV:-dev}"
DIST_DIR="nativescript-angular/bin/dist"
APIREF_DIR="$DIST_DIR/ng-api-reference"
rm -rf "$APIREF_DIR"
cd "nativescript-angular"
npm install
npm run typedoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, ViewContainerRef, Input } from "@angular/core";
import { Component, ViewContainerRef, Input, ViewChild, ElementRef } from "@angular/core";
import { Router, NavigationEnd } from "@angular/router";
import { ModalDialogService, ModalDialogOptions } from "nativescript-angular/directives/dialogs";
import { ModalComponent } from "../modal/modal.component";
Expand All @@ -17,19 +17,21 @@ import { ModalViewComponent } from "~/modal-shared/modal-view.component";
<Button text="Show Modal Page With Frame" (tap)="onModalFrame()" textAlignment="left"></Button>
<Button text="Show Shared Modal" (tap)="onRootModalTap()" textAlignment="left"></Button>
<Button text="Show Dialog" (tap)="onShowDialog()" textAlignment="left"></Button>
<Button #popoverButtonComp text="Show 'popover' modal" (tap)="onPopoverModal()" textAlignment="left"></Button>
</StackLayout>`
})

export class BasicsNavigationComponent {

@ViewChild("popoverButtonComp") popoverButtonComp: ElementRef;
@Input() col: number;
constructor(
private modal: ModalDialogService,
private router: Router,
private vcf: ViewContainerRef,
private viewContainerRefService: ViewContainerRefService) {
}

onModalNoFrame() {
const options: ModalDialogOptions = {
context: {
Expand Down Expand Up @@ -74,14 +76,28 @@ export class BasicsNavigationComponent {

onRootModalTap(): void {
const options: ModalDialogOptions = {
viewContainerRef: this.viewContainerRefService.root,
context: {},
fullscreen: true
viewContainerRef: this.viewContainerRefService.root,
context: {},
fullscreen: true
};

this.modal.showModal(ModalViewComponent, options)
.then((result: string) => {
console.log(result);
});
}
.then((result: string) => {
console.log(result);
});
}

onPopoverModal() {
const options: ModalDialogOptions = {
viewContainerRef: this.viewContainerRefService.root,
context: {},
ios: {
presentationStyle: UIModalPresentationStyle.Popover
},
target: this.popoverButtonComp.nativeElement
};

this.modal.showModal(ModalViewComponent, options)
.then((result: string) => { console.log(result);});
}
}
1 change: 1 addition & 0 deletions e2e/modal-navigation-ng/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"nativescript-dev-appium": "next",
"nativescript-dev-typescript": "next",
"nativescript-dev-webpack": "next",
"tns-platform-declarations": "next",
"typescript": "~3.1.1"
},
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions e2e/modal-navigation-ng/references.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference path="./node_modules/tns-platform-declarations/ios.d.ts" />
69 changes: 28 additions & 41 deletions nativescript-angular/directives/dialogs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
NgModuleRef,
ReflectiveInjector,
Type,
ViewContainerRef,
ViewContainerRef
} from "@angular/core";

import { NSLocationStrategy } from "../router/ns-location-strategy";
Expand All @@ -18,14 +18,15 @@ import { DetachedLoader } from "../common/detached-loader";
import { PageFactory, PAGE_FACTORY } from "../platform-providers";
import { once } from "../common/utils";
import { topmost, Frame } from "tns-core-modules/ui/frame";
import { ShowModalOptions } from "tns-core-modules/ui/core/view";

export interface ModalDialogOptions {
export type BaseShowModalOptions = Pick<ShowModalOptions, Exclude<keyof ShowModalOptions, "closeCallback" | "context">>;

export interface ModalDialogOptions extends BaseShowModalOptions {
context?: any;
fullscreen?: boolean;
animated?: boolean;
stretched?: boolean;
viewContainerRef?: ViewContainerRef;
moduleRef?: NgModuleRef<any>;
target?: View;
}

export class ModalDialogParams {
Expand All @@ -35,13 +36,10 @@ export class ModalDialogParams {
}
}

interface ShowDialogOptions {
interface ShowDialogOptions extends BaseShowModalOptions {
containerRef: ViewContainerRef;
context: any;
doneCallback;
fullscreen: boolean;
animated: boolean;
stretched: boolean;
pageFactory: PageFactory;
parentView: ViewBase;
resolver: ComponentFactoryResolver;
Expand All @@ -54,16 +52,20 @@ export class ModalDialogService {
}

public showModal(type: Type<any>,
{ viewContainerRef, moduleRef, context, fullscreen, animated, stretched }: ModalDialogOptions
options: ModalDialogOptions
): Promise<any> {
if (!viewContainerRef) {
if (!options.viewContainerRef) {
throw new Error(
"No viewContainerRef: " +
"Make sure you pass viewContainerRef in ModalDialogOptions."
);
}

let parentView = viewContainerRef.element.nativeElement;
let parentView = options.viewContainerRef.element.nativeElement;
if (options.target) {
parentView = options.target;
}

if (parentView instanceof AppHostView && parentView.ngAppRoot) {
parentView = parentView.ngAppRoot;
}
Expand All @@ -75,11 +77,11 @@ export class ModalDialogService {
parentView = parentView._ngDialogRoot;
}

const pageFactory: PageFactory = viewContainerRef.injector.get(PAGE_FACTORY);
const pageFactory: PageFactory = options.viewContainerRef.injector.get(PAGE_FACTORY);

// resolve from particular module (moduleRef)
// or from same module as parentView (viewContainerRef)
const componentContainer = moduleRef || viewContainerRef;
const componentContainer = options.moduleRef || options.viewContainerRef;
const resolver = componentContainer.injector.get(ComponentFactoryResolver);

let frame = parentView;
Expand All @@ -93,16 +95,14 @@ export class ModalDialogService {
setTimeout(() => {
try {
this._showDialog({
containerRef: viewContainerRef,
context,
...options,
containerRef: options.viewContainerRef,
context: options.context,
doneCallback: resolve,
fullscreen,
animated,
stretched,
pageFactory,
parentView,
resolver,
type,
type
});
} catch (err) {
reject(err);
Expand All @@ -111,23 +111,12 @@ export class ModalDialogService {
});
}

private _showDialog({
containerRef,
context,
doneCallback,
fullscreen,
animated,
stretched,
pageFactory,
parentView,
resolver,
type,
}: ShowDialogOptions): void {
private _showDialog(options: ShowDialogOptions): void {
let componentView: View;
let detachedLoaderRef: ComponentRef<DetachedLoader>;

const closeCallback = once((...args) => {
doneCallback.apply(undefined, args);
options.doneCallback.apply(undefined, args);
if (componentView) {
componentView.closeModal();
this.location._closeModalNavigation();
Expand All @@ -136,15 +125,15 @@ export class ModalDialogService {
}
});

const modalParams = new ModalDialogParams(context, closeCallback);
const modalParams = new ModalDialogParams(options.context, closeCallback);
const providers = ReflectiveInjector.resolve([
{ provide: ModalDialogParams, useValue: modalParams },
]);

const childInjector = ReflectiveInjector.fromResolvedProviders(providers, containerRef.parentInjector);
const detachedFactory = resolver.resolveComponentFactory(DetachedLoader);
detachedLoaderRef = containerRef.createComponent(detachedFactory, -1, childInjector, null);
detachedLoaderRef.instance.loadComponent(type).then((compRef) => {
const childInjector = ReflectiveInjector.fromResolvedProviders(providers, options.containerRef.parentInjector);
const detachedFactory = options.resolver.resolveComponentFactory(DetachedLoader);
detachedLoaderRef = options.containerRef.createComponent(detachedFactory, -1, childInjector, null);
detachedLoaderRef.instance.loadComponent(options.type).then((compRef) => {
const detachedProxy = <ProxyViewContainer>compRef.location.nativeElement;

if (detachedProxy.getChildrenCount() > 1) {
Expand All @@ -157,9 +146,7 @@ export class ModalDialogService {
(<any>componentView.parent).removeChild(componentView);
}

// TODO: remove <any> cast after https://github.com/NativeScript/NativeScript/pull/5734
// is in a published version of tns-core-modules.
(<any>parentView).showModal(componentView, context, closeCallback, fullscreen, animated, stretched);
options.parentView.showModal(componentView, { ...options, closeCallback });
});
}
}
Expand Down
9 changes: 6 additions & 3 deletions nativescript-angular/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nativescript-angular",
"version": "7.2.3",
"version": "7.2.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",
Expand Down Expand Up @@ -34,7 +34,8 @@
"tsc-w": "tsc -p tsconfig.json -w",
"ngc": "ngc -p tsconfig.json",
"prepare": "npm run ngc",
"version": "rm -rf package-lock.json && conventional-changelog -p angular -i ../CHANGELOG.md -s && git add ../CHANGELOG.md"
"version": "rm -rf package-lock.json && conventional-changelog -p angular -i ../CHANGELOG.md -s && git add ../CHANGELOG.md",
"typedoc": "typedoc --tsconfig \"./tsconfig.typedoc.json\" --out ./bin/dist/ng-api-reference --includeDeclarations --name \"NativeScript Angular\" --theme ./node_modules/nativescript-typedoc-theme --excludeExternals --externalPattern \"**/+(tns-core-modules|module|declarations).d.ts\""
},
"bin": {
"update-app-ng-deps": "./bin/update-app-ng-deps"
Expand Down Expand Up @@ -73,6 +74,8 @@
"tns-core-modules": "next",
"tslint": "^5.5.0",
"typescript": "~3.1.1",
"zone.js": "^0.8.4"
"zone.js": "^0.8.4",
"nativescript-typedoc-theme": "git://github.com/NativeScript/nativescript-typedoc-theme.git#master",
"typedoc": "^0.13.0"
}
}
24 changes: 24 additions & 0 deletions nativescript-angular/platform-common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ import {
on,
launchEvent,
LaunchEventData,
exitEvent,
ApplicationEventData,
} from "tns-core-modules/application";
import { TextView } from "tns-core-modules/ui/text-view";

Expand Down Expand Up @@ -255,7 +257,29 @@ export class NativeScriptPlatformRef extends PlatformRef {
args.root = rootContent;
}
);
const exitCallback = profile(
"nativescript-angular/platform-common.exitCallback", (args: ApplicationEventData) => {
const androidActivity = args.android;
if (androidActivity && !androidActivity.isFinishing()) {
// Exit event was triggered as a part of a restart of the app.
return;
}

const lastModuleRef = lastBootstrappedModule ? lastBootstrappedModule.get() : null;
if (lastModuleRef) {
// Make sure the module is only destroyed once
lastBootstrappedModule = null;

lastModuleRef.destroy();
}

if (!autoCreateFrame) {
rootContent = null;
}
}
);
on(launchEvent, launchCallback);
on(exitEvent, exitCallback);

applicationRun();
}
Expand Down
12 changes: 6 additions & 6 deletions nativescript-angular/router/ns-platform-location.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { routerLog, isLogEnabled } from "../trace";
@Injectable()
export class NativescriptPlatformLocation extends PlatformLocation {

constructor(private locationStartegy: NSLocationStrategy) {
constructor(private locationStrategy: NSLocationStrategy) {
super();
if (isLogEnabled()) {
routerLog("NativescriptPlatformLocation.constructor()");
Expand All @@ -18,7 +18,7 @@ export class NativescriptPlatformLocation extends PlatformLocation {
}

onPopState(fn: LocationChangeListener): void {
this.locationStartegy.onPopState(fn);
this.locationStrategy.onPopState(fn);
}

onHashChange(_fn: LocationChangeListener): void {
Expand All @@ -31,25 +31,25 @@ export class NativescriptPlatformLocation extends PlatformLocation {
return "";
}
get pathname(): string {
return this.locationStartegy.path();
return this.locationStrategy.path();
}
set pathname(_newPath: string) {
throw new Error("NativescriptPlatformLocation set pathname - not implemented");
}

pushState(state: any, title: string, url: string): void {
this.locationStartegy.pushState(state, title, url, null);
this.locationStrategy.pushState(state, title, url, null);
}

replaceState(state: any, title: string, url: string): void {
this.locationStartegy.replaceState(state, title, url, null);
this.locationStrategy.replaceState(state, title, url, null);
}

forward(): void {
throw new Error("NativescriptPlatformLocation.forward() - not implemented");
}

back(): void {
this.locationStartegy.back();
this.locationStrategy.back();
}
}
Loading