Skip to content

chore: {N} 7 updates #40

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

Merged
merged 5 commits into from
Oct 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions demo/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ You can use this file to perform app-level initialization, but the primary
purpose of the file is to pass control to the app’s first module.
*/

import * as app from "tns-core-modules/application";
import { Application } from "@nativescript/core";

app.run({ moduleName: "app-root" });
Application.run({ moduleName: "app-root" });

/*
Do not place any code after the application has been started as it will not
Expand Down
7 changes: 3 additions & 4 deletions demo/app/home/home-page.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import * as observable from 'tns-core-modules/data/observable';
import * as pages from 'tns-core-modules/ui/page';
import { EventData, Page } from '@nativescript/core';
import {HelloWorldModel} from './home-view-model';

// Event handler for Page 'loaded' event attached in main-page.xml
export function pageLoaded(args: observable.EventData) {
export function pageLoaded(args: EventData) {
// Get the event sender
let page = <pages.Page>args.object;
let page = <Page>args.object;
page.bindingContext = new HelloWorldModel();
}
3 changes: 1 addition & 2 deletions demo/app/home/home-page.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<Page xmlns="http://schemas.nativescript.org/tns.xsd" loaded="pageLoaded" class="page"
xmlns:ui="nativescript-inappbrowser">
<Page xmlns="http://schemas.nativescript.org/tns.xsd" loaded="pageLoaded" class="page">
<StackLayout class="content" verticalAlignment="center">
<Label text="Welcome InAppBrowser&#xA;for NativeScript" class="t-20 text-center c-black" textWrap="true"/>
<Label text="Type the url" class="text-center p"/>
Expand Down
16 changes: 7 additions & 9 deletions demo/app/home/home-view-model.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { Observable } from 'tns-core-modules/data/observable';
import { openUrl } from 'tns-core-modules/utils/utils';
import { alert } from 'tns-core-modules/ui/dialogs';
import InAppBrowser from 'nativescript-inappbrowser';
import { Observable, Utils, Dialogs } from '@nativescript/core';
import { InAppBrowser } from 'nativescript-inappbrowser';
import { getDeepLink, sleep } from './utilities';

export class HelloWorldModel extends Observable {
Expand Down Expand Up @@ -60,18 +58,18 @@ export class HelloWorldModel extends Observable {
}
});
await sleep(800);
alert({
Dialogs.alert({
title: 'Response',
message: JSON.stringify(result),
okButtonText: 'Ok'
});
}
else {
openUrl(url);
Utils.openUrl(url);
}
}
catch (error) {
alert({
Dialogs.alert({
title: 'Error',
message: error.message,
okButtonText: 'Ok'
Expand All @@ -94,14 +92,14 @@ export class HelloWorldModel extends Observable {
enableDefaultShare: true
});
await sleep(800);
alert({
Dialogs.alert({
title: 'Response',
message: JSON.stringify(result),
okButtonText: 'Ok'
});
}
} catch {
alert('Something’s wrong with the app :(');
Dialogs.alert('Something’s wrong with the app :(');
}
}
}
4 changes: 1 addition & 3 deletions demo/app/home/utilities.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { android } from "tns-core-modules/application";

export const getDeepLink = (path = "") => {
const scheme = 'my-demo';
const prefix = android ? `${scheme}://demo/` : `${scheme}://`;
const prefix = global.isAndroid ? `${scheme}://demo/` : `${scheme}://`;
return prefix + path;
};

Expand Down
7 changes: 0 additions & 7 deletions demo/app/package.json

This file was deleted.

12 changes: 12 additions & 0 deletions demo/nativescript.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { NativeScriptConfig } from '@nativescript/core'

export default {
id: 'org.nativescript.demo',
appResourcesPath: 'app/App_Resources',
android: {
v8Flags: '--expose_gc',
markingMode: 'none',
},
useLegacyWorkflow: false,
appPath: 'app',
} as NativeScriptConfig
3 changes: 0 additions & 3 deletions demo/nsconfig.json

This file was deleted.

19 changes: 6 additions & 13 deletions demo/package.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,18 @@
{
"nativescript": {
"id": "org.nativescript.demo",
"tns-ios": {
"version": "6.5.0"
},
"tns-android": {
"version": "6.5.0"
}
},
"description": "NativeScript Application",
"license": "SEE LICENSE IN <your-license-filename>",
"repository": "<fill-your-repository-here>",
"dependencies": {
"nativescript-inappbrowser": "file:../src",
"nativescript-theme-core": "~2.0.24",
"tns-core-modules": "~6.5.1"
"@nativescript/core": "~7.0.0"
},
"devDependencies": {
"nativescript-dev-webpack": "~1.5.1",
"typescript": "~3.8.3"
"@nativescript/ios": "7.0.0",
"@nativescript/webpack": "~3.0.0",
"typescript": "~3.9.7"
},
"gitHead": "42f2a6a9c94eaf9c68d2a41e0daaa1a2544bc28f",
"readme": "NativeScript Application"
"readme": "NativeScript Application",
"main": "app.js"
}
1 change: 1 addition & 0 deletions demo/references.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference path="../src/references.d.ts" />
14 changes: 7 additions & 7 deletions demo/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es5",
"module": "esnext",
"target": "es2017",
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"noEmitHelpers": true,
"noEmitOnError": true,
"skipLibCheck": true,
"lib": [
"es6",
"dom"
"dom",
"es2017"
],
"baseUrl": ".",
"paths": {
"~/*": [
"app/*"
],
"*": [
"./node_modules/*"
]
}
},
"moduleResolution": "node",
"removeComments": false
},
"exclude": [
"node_modules",
Expand Down
7 changes: 0 additions & 7 deletions demo/tsconfig.tns.json

This file was deleted.

Loading