Skip to content

Commit 51bd639

Browse files
committed
chore: dep updates
1 parent 6a4a3bf commit 51bd639

File tree

6 files changed

+28
-34
lines changed

6 files changed

+28
-34
lines changed

Diff for: e2e/animation-examples/app/main.ts

+5-21
Original file line numberDiff line numberDiff line change
@@ -8,36 +8,24 @@ Trace.enable();
88

99
class LaunchAnimation extends GridLayout implements AppLaunchView {
1010
circle: GridLayout;
11-
animatedContainer: GridLayout;
1211
finished = false;
1312
complete: () => void;
1413

1514
constructor() {
1615
super();
16+
this.backgroundColor = "#4caef7";
17+
this.className = "w-full h-full";
1718

18-
// setup container to house launch animation
19-
this.animatedContainer = new GridLayout();
20-
this.animatedContainer.style.zIndex = 100;
21-
this.animatedContainer.backgroundColor = "#4caef7";
22-
this.animatedContainer.className = "w-full h-full";
23-
24-
// any creative animation can be put inside
19+
// construct any creative animation
2520
this.circle = new GridLayout();
2621
this.circle.width = 30;
2722
this.circle.height = 30;
2823
this.circle.borderRadius = 15;
2924
this.circle.horizontalAlignment = "center";
3025
this.circle.verticalAlignment = "middle";
3126
this.circle.backgroundColor = "#fff";
32-
this.animatedContainer.addRow(new ItemSpec(1, GridUnitType.STAR));
33-
this.animatedContainer.addRow(new ItemSpec(1, GridUnitType.AUTO));
34-
this.animatedContainer.addRow(new ItemSpec(1, GridUnitType.STAR));
35-
GridLayout.setRow(this.circle, 1);
36-
this.animatedContainer.addChild(this.circle);
3727

38-
// add animation to top row since booted app will insert into bottom row
39-
GridLayout.setRow(this.animatedContainer, 1);
40-
this.addChild(this.animatedContainer);
28+
this.addChild(this.circle);
4129
}
4230

4331
async startAnimation() {
@@ -71,14 +59,10 @@ class LaunchAnimation extends GridLayout implements AppLaunchView {
7159
}
7260

7361
async fadeOut() {
74-
await this.animatedContainer.animate({
62+
await this.animate({
7563
opacity: 0,
7664
duration: 400,
7765
});
78-
// done with animation, can safely remove to reveal bootstrapped app
79-
this.removeChild(this.animatedContainer);
80-
this.animatedContainer = null;
81-
this.circle = null;
8266
this.complete();
8367
}
8468
}

Diff for: nativescript-angular-package/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nativescript-angular",
3-
"version": "10.0.0-rc.5",
3+
"version": "10.0.0",
44
"description": "Compatibility with old style nativescript-angular imports.",
55
"homepage": "https://www.nativescript.org/",
66
"bugs": "https://github.com/NativeScript/nativescript-angular/issues",
@@ -44,7 +44,7 @@
4444
"@angular/platform-browser": "~10.0.0",
4545
"@angular/platform-browser-dynamic": "~10.0.0",
4646
"@angular/router": "~10.0.0",
47-
"@nativescript/angular": "rc",
47+
"@nativescript/angular": "~10.0.0",
4848
"@nativescript/core": "rc",
4949
"ng-packagr": "^10.0.1",
5050
"rxjs": "~6.5.5",

Diff for: nativescript-angular/common/detached-loader.ts

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
import { ComponentRef, ComponentFactory, ViewContainerRef, Component, Type, ComponentFactoryResolver, ChangeDetectorRef } from '@angular/core';
22
import { Trace } from '@nativescript/core';
33

4-
export const CATEGORY = 'detached-loader';
5-
function log(message: string) {
6-
Trace.write(message, CATEGORY);
7-
}
8-
94
/**
105
* Wrapper component used for loading components when navigating
116
* It uses DetachedContainer as selector so that it is containerRef is not attached to
@@ -27,7 +22,7 @@ export class DetachedLoader {
2722
// inside component with OnPush CD strategy. Mark us for check to be sure CD will reach us.
2823
// We are inside a promise here so no need for setTimeout - CD should trigger
2924
// after the promise.
30-
log('DetachedLoader.loadInLocation component loaded -> markForCheck');
25+
Trace.write('DetachedLoader.loadInLocation component loaded -> markForCheck', 'detached-loader');
3126

3227
return Promise.resolve(componentRef);
3328
}
@@ -38,7 +33,7 @@ export class DetachedLoader {
3833

3934
// TODO: change this API -- async promises not needed here anymore.
4035
public loadComponent(componentType: Type<any>): Promise<ComponentRef<any>> {
41-
log('DetachedLoader.loadComponent');
36+
Trace.write('DetachedLoader.loadComponent', 'detached-loader');
4237
return this.loadInLocation(componentType);
4338
}
4439

Diff for: nativescript-angular/common/utils.ts

+9
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
1+
/**
2+
* Utility method to ensure a NgModule is only imported once in a codebase, otherwise will throw to help prevent accidental double importing
3+
* @param parentModule Parent module name
4+
* @param moduleName The module name
5+
*/
16
export function throwIfAlreadyLoaded(parentModule: any, moduleName: string) {
27
if (parentModule) {
38
throw new Error(`${moduleName} has already been loaded. Import ${moduleName} in the AppModule only.`);
49
}
510
}
611

12+
/**
13+
* Utility method which will only fire the callback once ever
14+
* @param fn callback to call only once
15+
*/
716
export function once(fn: Function) {
817
let wasCalled = false;
918

Diff for: nativescript-angular/index.ts

+8-2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ export * from './resource-loader';
1616

1717
export * from './nativescript.module';
1818
export * from './common';
19+
export * from './common/detached-loader';
20+
export * from './common/utils';
1921

2022
export { NativeScriptAnimationsModule } from './animations';
2123
export * from './file-system';
@@ -24,9 +26,13 @@ export * from './forms';
2426
export * from './directives';
2527
export * from './router';
2628
export * from './frame.service';
27-
export { NativeScriptDebug } from './trace';
2829

2930
export { NativeScriptRenderer } from './renderer';
3031
export { EmulatedRenderer } from './renderer-emulated';
3132
export { NativeScriptRendererFactory } from './renderer-factory';
32-
export { ViewClass, ViewClassMeta, ViewResolver, getViewClass, getViewMeta, isKnownView, registerElement, NgView, CommentNode, getSingleViewRecursive } from './element-registry';
33+
34+
// utils
35+
export { NativeScriptDebug } from './trace';
36+
export * from './app-host-view';
37+
export { getViewClass, getViewMeta, isKnownView, registerElement, CommentNode, getSingleViewRecursive, isInvisibleNode, isView } from './element-registry';
38+
export type { NgView, ViewClass, ViewClassMeta, ViewResolver, ViewExtensions } from './element-registry';

Diff for: nativescript-angular/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nativescript/angular",
3-
"version": "10.0.0-rc.8",
3+
"version": "10.0.0",
44
"description": "An Angular renderer that lets you build mobile apps with NativeScript.",
55
"homepage": "https://www.nativescript.org/",
66
"bugs": "https://github.com/NativeScript/nativescript-angular/issues",
@@ -58,7 +58,7 @@
5858
},
5959
"dependencies": {
6060
"@nativescript/zone-js": "~1.0.0",
61-
"nativescript-angular": "rc",
61+
"nativescript-angular": "~10.0.0",
6262
"nativescript-intl": "^4.0.0"
6363
},
6464
"peerDependencies": {

0 commit comments

Comments
 (0)