Giter Site home page Giter Site logo

nativescript / nativescript Goto Github PK

View Code? Open in Web Editor NEW
23.6K 656.0 1.6K 155.17 MB

⚡ Empowering JavaScript with native platform APIs. ✨ Best of all worlds (TypeScript, Swift, Objective C, Kotlin, Java). Use what you love ❤️ Angular, Capacitor, Ionic, React, Solid, Svelte, Vue with: iOS (UIKit, SwiftUI), Android (View, Jetpack Compose), Dart (Flutter) and you name it compatible.

Home Page: https://nativescript.org

License: MIT License

TypeScript 85.46% CSS 0.72% JavaScript 1.43% HTML 0.03% Shell 0.31% Objective-C 1.35% Java 10.55% SCSS 0.01% Ruby 0.01% Swift 0.13%
nativescript android ios angular vue typescript javascript cross-platform react svelte

nativescript's People

Contributors

adjenkov avatar atanasovg avatar catchabus avatar dtopuzov avatar edusperoni avatar enchev avatar erjangavalji avatar farfromrefug avatar hamorphis avatar hdeshev avatar jasssonpet avatar manoldonev avatar martoyankov avatar nathanaela avatar nathanwalker avatar nickiliev avatar panayotcankov avatar petekanev avatar peterstaev avatar plamen5kov avatar rigor789 avatar sis0k0 avatar svetoslavtsenov avatar triniwiz avatar tsonevn avatar tzraikov avatar vakrilov avatar vchimev avatar vtrifonov avatar zh-m avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nativescript's Issues

error install on window 7 64 bit

hay guys, i have problem to install nativescript on my computer , i dont know what happend , but this error log i get after run command install native script

npm ERR! Windows_NT 6.1.7601                                                                                                                            
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "i" "-g" "nativescript"           
npm ERR! node v0.10.35                                                                                                                                  
npm ERR! npm  v2.1.17                                                                                                                                   

npm ERR! shasum check failed for C:\Users\ardani\AppData\Local\Temp\npm-1976-9fdf059e\registry.npmjs.org\nativescript\-\nativescript-0.9.1.tgz          
npm ERR! Expected: 60b86c184f4053ba5180970c49dfe8c16ae60843                                                                                             
npm ERR! Actual:   28d285e4b818926a3d55116fc2756b7dee9a7983                                                                                             
npm ERR! From:     https://registry.npmjs.org/nativescript/-/nativescript-0.9.1.tgz                                                                     
npm ERR!                                                                                                                                                
npm ERR! If you need help, you may report this error at:                                                                                                
npm ERR!     <http://github.com/npm/npm/issues>                                                                                                         

npm ERR! Please include the following file with any support request:                                                                                    
npm ERR!     C:\Users\ardani\npm-debug.log                 

any have idea to solve that?

Feature request: Pull-to-refresh ListView

From @truongsinh on April 9, 2015 18:31

I'm trying to implement "pull-to-refresh" myself with native iOS UIRefreshControl, however, I could not addTargetActionForControlEvents, the app crashes with segfault every time i pull

class RefreshHandlerImpl extends NSObject {
    static new(): RefreshHandlerImpl {
        return <RefreshHandlerImpl>super.new();
    }

    private _owner: UIRefreshControl;

    public initWithOwner(owner: UIRefreshControl): RefreshHandlerImpl {
        this._owner = owner;
        return this;
    }

    public "myRefresh" (sender: UIRefreshControl) {
        //console.log("refresh")
        //this._owner._emit(eventReload);


    public static ObjCExposedMethods = {
        'myRefresh': { returns: interop.types.void, params: [UIRefreshControl] }
    };
}


// Event handler for Page "loaded" event attached in main-page.xml
export function pageLoaded(args: EventData) {
    var page: Page = <any>args.object;
    var postListView: ListView = view.getViewById(page, "PostListView");


    var refreshControl = new UIRefreshControl();
    var rHandler = RefreshHandlerImpl.new().initWithOwner(refreshControl);
    refreshControl.addTargetActionForControlEvents(rHandler, "myRefresh", UIControlEvents.UIControlEventValueChanged)
    postListView.ios.addSubview(refreshControl);


    page.bindingContext = mainViewModel;
}

Copied from original issue: NativeScript/cross-platform-modules#278

first loading is slow?

I run the samples "Tasks" and "cuteness" on android device. first loading is almost 8-15s.

strange wrong

What is wrong? I just added the android platform.
Alt Text

Environment

Windows 7
node.js v 0.12.0
jdk 1.7.0_67
and 1.9.4
language: Chinese (GBK)

background service?

hi, would it be possible to create a background service with native script?

thx, dan

how to debug App?

js can debug chrome or firebug or node-inspector, how to debug with NativeScript? thanks.

tap does not work when cssClass present on <Button>

By simply adding any cssClass to a <Button>, the tap event is not fired anymore. This can be replicated by simply creating a new project and adding cssClass="message" to the <Button>. I can only confirm this for iOS.

loadMoreItems is called on ListViews items initialization

From @qpautrat on April 20, 2015 9:6

Hi there,

Considering following code:

exports.pageLoaded = function(args) {
    console.log("pageLoaded");

    var page = args.object;

    page.bindingContext = {'items':[{'name':'Foo'},{'name':'Bar'}]};
};

exports.loadMoreItems = function(data) {
    console.log("loadMoreItems");
}

and this view:

<Page xmlns="http://www.nativescript.org/tns.xsd" loaded="pageLoaded">
    <ListView items="{{ items }}" loadMoreItems="loadMoreItems">
        <ListView.itemTemplate>
            <Label text="{{ name }}" />
        </ListView.itemTemplate>
    </ListView>
</Page>

I get:

Apr 20 09:49:28: /app/test.js:3:16: CONSOLE LOG pageLoaded
Apr 20 09:49:28: /app/test.js:11:16: CONSOLE LOG loadMoreItems

However if my items is empty loadMoreItems is not called like it should be.

Copied from original issue: NativeScript/cross-platform-modules#294

Improve the console module

From @atanasovg on April 14, 2015 10:32

The current console implementation uses the built-in console object for iOS and our custom JavaScript implementation for Android. This custom implementation is not behaving like the Web one and works for primitive types only (and plain Objects, without circular references). We may take a look at how Node.js have implemented it.

Copied from original issue: NativeScript/cross-platform-modules#281

Localization and internationalization framework

Provide a cross-platform way for describing app resources for a given country, locale, language, or culture.
The following should be localizable:

strings,
images, videos, etc.,
styles,
layout and text direction.
If you are interested in this feature please add comments below with specific scenarios/requirements and vote for this feature in our ideas portal.

Last character doesn't get picked up in the tasks tutorial

I just copy and pasted the three files as the tutorial suggested but the last character doesn't get picked up :(

See screencast:
untitled

For reference, here's the xml and js:

<Page loaded="onPageLoaded">
    <GridLayout rows="auto, *">
        <StackLayout orientation="horizontal" row="0">
            <TextField width="200" text="{{ task }}" hint="Enter a task" id="task" />
            <Button text="Add" tap="add"></Button>
        </StackLayout>

        <ListView items="{{ tasks }}" row="1">
            <ListView.itemTemplate>
                <Label text="{{ name }}" />
            </ListView.itemTemplate>
        </ListView>
    </GridLayout>
</Page>
var observableModule = require("data/observable");
var observableArray = require("data/observable-array");
var viewModule = require("ui/core/view");

var tasks = new observableArray.ObservableArray([]);
var pageData = new observableModule.Observable();
var page;

exports.onPageLoaded = function(args) {
    page = args.object;
    pageData.set("task", "");
    pageData.set("tasks", tasks);
    page.bindingContext = pageData;
};

exports.add = function() {
    tasks.push({ name: pageData.get("task") });
    pageData.set("task", "");
    viewModule.getViewById( page, "task" ).dismissSoftInput();
};

tns platform add ios doesn't work

I'm trying to add iOS platform to my project, but without success.
I have no problem using the command "tns platform add android" in the terminal, but when i try to add iOS platform, it returns this error:

ENOENT, open '/Users/myuserfolder/.npm/tns-ios/0.9.1/package/package.json'

PS: I'm using a Mac.

Runtime error when using require("net"); Mac OS/xcode

When I try use node module "net" in main-page.js like this
var net = require("net");
I get runtime error. As I wrote in issues here I still cant run app with tns run ios --emulator but i can run it in xcode from xcodeproject file in platforms/ios. So I see this error only in debug mode in xcode (while app in emulator show me start screen with "NativeScreen" icon). In xcode debug screen with assembler-like view i see this:
Thread 1: EXC_BAD_ACCESS (code=1, address=0xbbadveef)
When I delete statement 'var net = require("net");` app works fine.
So whats wrong here?

Circle element using border

From @MiroValchev on April 23, 2015 14:6

I wanted to show user's avatar in circle. To do this I tried using image nested in border.

  1. I succeeded creating the circle, but the nested image was showing outside the boundaries of the border. Is this the desired behavior for border?
  2. If you don't set a color for border, an exception is thrown. In the above example I want to use the border just for the rounded shape so a transparent default color sounds legit?

Copied from original issue: NativeScript/cross-platform-modules#313

Rotating the device makes ListView desappear (iOS)

While completing the in-browser AppBuilder tutorial and testing in both platforms, I noticed that in iOS the list - or its contents - desappears quite frequently when you rotate the device.

If you try to scroll, the list re-appears.

Tested on Ipod 5 running iOS 7.0.4

Remove bootstrap.js

The current logic of the runtimes for starting an application is searching for a bootstrap.js, that can have the starting code. Due to the possibility of having the main application code file specified by the package.json (searched by default), the bootstrap simply has a require("./") statement, which makes it useless.

Let's default to the package.json file.

How about falling back to app.js if package.json not found?

Allow more flexible composition and navigation with Frame, Page and TabView

From @PanayotCankov on April 17, 2015 10:38

It would be nice if we had a way to declaratively describe some of the app properties that are currently set in the main page's onLoaded, such as the ios navBarVisibility, as well as the app type - single screen, tabbed or with navigation.

For example It would be nice if we could define app.xml as:

<!-- Displays the main-screen page for example in UINavigationController in iOS -->
<NavigationFrame
    xmlns="http://www.nativescript.org/tns.xsd"
    mainPage="app/main-screen">
</NavigationFrame>
<TabFrame
    xmlns="http://www.nativescript.org/tns.xsd">
    <!-- Eventually tab bar pages are specified here along with titles and images. -->
</TabFrame>
<!-- Displays a single page without navigation. -->
<SingleScreenFrame
    xmlns="http://www.nativescript.org/tns.xsd"
    mainPage="app/main-screen">
</SingleScreenFrame>

Copied from original issue: NativeScript/cross-platform-modules#287

No error message when CSS parsing fail

I used the wrong way to comment in CSS. Unfortunately, there was no error, no stack trace, no file/line number. It successfully built, start to open the app and insta crashed. Would be nice to have an error message saying why.

.message {
    font-size: 20px;
    color: #284848;
//    horizontal-align: center;
}
** BUILD SUCCEEDED **

Project successfully built
Using  /Users/vjeux/random/hello-world/platforms/ios/build/emulator/hello-world.app
Cleaning up before starting the iOS Simulator
Starting iOS Simulator
Specify the timeout in number of seconds to wait. It should be greater than 0. Default value 90 seconds will be used.
Session started without errors.

install nativescript on mac error.

when I install the nativescript, the final step appear the follow errors, and stop this step forever:
[email protected] install /usr/local/lib/node_modules/nativescript/node_modules/node-inspector/node_modules/ws

(node-gyp rebuild 2> builderror.log) || (exit 0)

I try node.js 0.10.33 and 0.10.28(my windows all is ok), also install node-gyp and upgrade npm to 2.7.

thanks for your reply.

iOS - Swipe Backwards Navigation - Half Swipe

If you begin to swipe backward in ios to go to the previous page, but then stay on the current page it will lock / freeze the app. This happens for all the sample applications as well. I am using appbuilder companion app, iphone 6 - ios 8.2

NativeScript Plugins

State of affairs

Currently NativeScript provides support for what we call modules. Those are CommonJS compatible JavaScript modules that usually expose underlying native platform APIs by providing a common JavaScript hat on top of them. Out of the box we provide support for all platform stock APIs (part of the native SDKs) and we do have the option to reference a 3rd party libraries via the tns library add command.

Introducing NativeScript Plugins (Modules ++)

Writing real world application requires much more than what we currently provide in the form of NativeScript modules. A common use case is that a module usage it will require a change in a platform specific configuration file. Here are a two examples that illustrates this:

  • The canonical one is geolocation which requires adding permissions in AndroidManifest.xml as well as a key in the Info.plist file for iOS.
  • Another example is adding a chart component to your application. Charts are usually not available in the stock SDKs so you will be required to use a 3rd party library and here comes the problem if you want to go cross-platform. You will have to add each platform library separately and then expose a common JavaScript API. What if you want to share this with someone else?

There are a lot of other examples that can be given to proof that we need something more than what we currently have in the form of modules. We want a common abstraction that will allow us to easily package and redistribute those extended modules. We want to call this NativeScript Plugin.

What is a NativeScript plugin?

NativeScript plugin is a package that consist of the following:

  • Metadata about the package itself: name, version, supported runtime versions, etc.
  • CommonJS module (one or many) that expose the native API via a single JavaScript API.
  • Declarative way of defining transformations for platform specific configuration files.
  • Native libraries and resources.

The package format should be extensible so we can add new capabilities in the future.

Implementation details

The key thing about the implementation is that we will strive to sit on top of existing standards and we will use conventions over configurations.

Packing and distribution

We are already discussing that we want to standardize on NPM as distribution platform. It is logical that we want to use it for NativeScript plugins as well.

We can use an upcoming feature of NPM called ecosystems by adding ecosystem:nativescript in the keywords section of the plugin's package.json. Eventually NPM will provide dedicated search and package weighting for the ecosystem. More info on ecosystems can be found here.

We can use the engines key to designate which version of the runtime the plugin supports:

{ "engines" : { "nativescript" : ">=0.9 <0.10" } }

or

{  
  "engines" : { 
    "nativescript-android" : "0.9.0",
    "nativescript-ios" : "0.9.3" 
  }   
}

JavaScript module

The JavaScript module loading will use the same technique we are currently using in the runtimes when a module is required. If a JavaScript file is specified in the package.json's main key we will load that otherwise we will look for index.js file in the root.

Native libraries

For referencing native libraries we can use a convention we are currently using in the CLI. We can have a platforms folder with sub-folder for each platform. We can then search the platform specific folders and execute add library upon installation of the plugin. Here is an example of a sample chart plugin's file structure:

nativescript-charts/
|-- platforms/
|-- |-- Android/
|-- |-- `-- charts.jar
|-- |-- iOS/
|-- |-- `-- ChartKit.framework
`-- index.js/
`-- package.json

Platform configuration files transformations

Usually those platform configuration files are XML based (AndroidManifest.xml, Info.plist, etc.) which can be tricky to incorporate in our JavaScript/JSON based tooling. Here are two possible ways we can approach this.

Incorporate the transformations in package.json

We can use the package.json file to declare the required transformation we want to apply. For example we can have the following:

{
  "name": "nativescript-geolocation",
  "version": "0.9",
  "nativescript": {
    "android": {
      "permissions" : [
        "android.permission.ACCESS_COARSE_LOCATION",
        "android.permission.ACCESS_FINE_LOCATION"
      ]
    }
  }
}

The problem with such definition is that it is is not general purpose and is very platform specific. We will have to embed the knowledge that the permissions has to go in AndroidManifest.xml and also that they will have to be inserted as <uses-permission> tags in the XML. The same goes if we want to insert other elements.
In order to make this more generic we will have to tweak the JSON a little bit:

{
  "name": "nativescript-geolocation",
  "version": "0.9",
  "nativescript": {
    "android": {
      "AndroidManifest" : {
        "uses-permissions" : [
          { "android:name" : "android.permission.ACCESS_COARSE_LOCATION" },
          { "android:name" : "android.permission.ACCESS_FINE_LOCATION" }
        ]
      }
    }
  }
}

Having this structure we can transform the JSON to XML in a generic way and just merge the transformed XML segments into the AndroidManifest.xml file. The downside of this is that the JSON becomes more verbose and the processing itself can be more complex.
Note: For plist files we will have to create a separate output generator due to the strange structure of the property list.

Provide XML segments in designated file per platform

We can use /platforms structure of the plugin and place platform specific XML files in each platform directory. Here is an example:

nativescript-geolocation/
|-- platforms/
|-- |-- Android/
|-- |-- `-- AndroidManifest.xml
|-- |-- iOS/
|-- |-- `-- Info.plist
`-- ...

The XML files will contain just the segments we want to merge in the final configuration file. This technique give us better flexibility but will require a little bit more setup from plugin developers.

Update : There is an agreement that the approach with separate config files and merging is the one we should go after.

Other use cases

Here are some other use cases that can be considered for future implementation.

Including native source code files

There might be cases when we need to package native source code files. These cases should really be rare ones as by definition the native code should be able to be expressed in JavaScript but nevertheless. By convention those could go into the specific platform sub-folder of /platforms and will be included in the native projects for compilation.

Using packages from the platform's package manager

Each platform has its own package (dependency) manager and it would be good if we can declaratively include packages from them to be used from JavaScript. The de-facto package managers are Cocoa Pods for iOS and jCenter (Maven Central) for Android. Here is a an example of a possible package.json declaration of those:

{
  "name": "nativescript-http",
  "version": "0.9",
  "nativescript": {
    "android": {
      "dependencies": {
        "com.github.kevinsawicki:http-request" : "6.0"
      }
    },
    "ios" : {
      "pods" : {
        "AFNetworking" : ">=2.0"
      }
    }
  }
}

Note: In order to support Android packages we will have to migrate the Android tooling to Gradle.

Prior art

Apache Cordova's plugin format

Cordova uses a single plugin.xml file for its plugins definition. It is very verbose but handles most of the cases described above. Cordova is also moving to NPM for package distribution.

Telerik AppBuilder's .abproject file

AppBuilder uses JSON based project definition which includes Android, iOS and Windows Phone specific properties. Those are processed in a custom way for each platform and there is no generic way to define a platform specific property if it is not part of the JSON schema format defined for the project.

Button tap action not firing under GridLayout

I'm trying to setup a simple UI using the GridLayout and I came across something odd (the whole project is based on HelloWorld example). In some setups the Button is not firing the tap action.
For instance, the following setup is working correctly, i.e. the tapAction function is called.

<Page xmlns="http://www.nativescript.org/tns.xsd" loaded="pageLoaded">
  <GridLayout rows="auto, auto, *" columns="*">
    <Label text="Tap the button" cssClass="title" row="1"/>
    <Button text="TAP" tap="{{ tapAction }}" />
    <Label text="{{ message }}" cssClass="message" textWrap="true" row="2"/>
  </GridLayout>
</Page>

However, if I add the row="0" attribute to the Button, the tapAction function is not being called. Same goes for setting any other row value.

<Page xmlns="http://www.nativescript.org/tns.xsd" loaded="pageLoaded">
  <GridLayout rows="auto, auto, *" columns="*">
    <Label text="Tap the button" cssClass="title" row="1"/>
    <Button text="TAP" tap="{{ tapAction }}" row="0"/>
    <Label text="{{ message }}" cssClass="message" textWrap="true" row="2"/>
  </GridLayout>
</Page>

Is this a bug or am I doing something wrong?

Where does console.log go?

In many places in the docs you use console.log but I can't find where the output goes. It isn't in the terminal after I type tns run ios --emulator, nor in the simulator.

Error with "tns run ios --emulator" on mac os 10.10.2

When I run command "tns run ios --emulator" from demo project directory, ios simulator running but has not demo application inside. Its just iPhone/iPad desktop inside with Safari icon on bottom screen, and its also has second screen with 2 icons of my xcode project. So in mac terminal i got this error after waiting about minute:

Starting iOS Simulator (after this message simulator starts and nothing happend more about 1.5 minute, and after i got this -> )

Session started with error Error Domain=DTiPhoneSimulatorErrorDomain Code=2 "Timed out waiting for device boot" UserInfo=0x100b9b190 {NSLocalizedDescription=Timed out waiting for device boot}

Why come up with a different http request api?

I wonder why you implemented a new API to do http request instead of picking one that already exist? Also, require('http') conflicts with node require('http') and doesn't have the same interface.

how to use UI widget?

1, NativeScript no toolbar widget? how to implement a toolbar?
2, Button,how to set focus and normal icon?
3, I write a TabView Demo, https://github.com/bitcard/NSTabView, but run it on iPhone emulator and android device crash. what's wrong with it?
thanks for reply.

demo app doesn't start on android

I ran the demo app out of the box
ios runs ok, but android version gives problems on both android+simulator

➜  blox  tns run android           
shell.js: internal error
Error: ENOENT, no such file or directory '/Users/dc/dev/shumi/blox/platforms/android/assets/app'
    at Object.fs.mkdirSync (fs.js:642:18)
    at /usr/local/lib/node_modules/nativescript/node_modules/shelljs/src/cp.js:174:14
    at Array.forEach (native)
    at Object._cp (/usr/local/lib/node_modules/nativescript/node_modules/shelljs/src/cp.js:157:11)
    at Object.cp (/usr/local/lib/node_modules/nativescript/node_modules/shelljs/src/common.js:186:23)
    at /usr/local/lib/node_modules/nativescript/lib/services/platform-service.js:122:19
    at Function.settle (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:220:26)
    at FiberFuture.Future.wait (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:487:10)
    at /usr/local/lib/node_modules/nativescript/lib/services/platform-service.js:158:45
    at Function.settle (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:220:26)


css 3 and animations

hi

have you any plan to implement some css3 features like ?
Gradients - Rounded Corners - Shadow Effects

how implement animation to move element into widget ?

thanks

E

Wrong content with textfield

Hi there,

It's my first steps with NativeScript, so i followed your "Getting started" documentation.
I'm encountered an issue with task list.
The line pageData.get("task") always give me strlen - 1 chars, "test" become "tes".
I tried with another ios device with tns run ios --emulator --device iPhone-5s, nothing change.

Don't know if i'm in the good place to open this issue, sorry guys.

Work with Maps

Hello,

How to create Maps widget on platform and set Mark and etc?

Thanx.

Drawer widget

Hi there, I'm having a hard time trying to find examples on implementing a drawer menu. I found a post "http://www.telerik.com/forums/drawers" where you could use a "custom NativeScript component", but I couldnt get it to work. In this page, Vlad's second reply said you'd need to use telerik's native components as libraries for the code to work. The problem is that this components is about $200, and I'm totally avoiding it.

Is there a nativescript way to solve this? Is there missing documentation?

Console.log

please tell me where to see information output from console.log

library "exports" don't work as expected.

If I create a file "mymodule.js"

var someFunction = function() { console.log("MyModule"); }
exports = someFunction;

// In another file

var someFunction = require('mymodule')
var a = new someFunction();

This will crash on "new someFunction" as it throws an error "TypeError: object is not a function"

This does work in node.js and allows simpler modules...

Do typescript files need to be compiled to js before they work?

I'm following the getting started tutorial.

  1. Created the project using tns and it runs fine on the android device
  2. Opened the folder as a website in visual studio and added a few files (sighnpView.xml and signUpView.ts). The .ts files do not compile on save.
  3. I run the project and the alert statement in the onLoad function does not fire.
  4. I added a new file "signupView.js" and it works just fine.

Is nativescript supposed to compile the typescript files or I'll have to make sure the correct js files exist? Not sure if I should add a gulp task to do the compilation.

Thanks.

Instant reload?

The big feature of the web and JavaScript is that refreshing after a code change is extremely fast. I was surprised that you still had to compile using xcode after every single change, basically negating the big developer velocity aspect of the web. Are you planning to support this?

'background-image' property options

From @MiroValchev on April 23, 2015 14:1

We need to be able to set options to the css 'background-image' property - for example no-repeat.

Copied from original issue: NativeScript/cross-platform-modules#312

topmost().navigate always creates a header bar

We need a way to change the mainModule, for example initially your mainModule is the login screen, but once the user is logged in you want the home screen to be the mainModule.

I haven't figured out a way to be able to do this...

Be CSS standard compliant?

The filename is .css and it has the same parser but it is not compatible with CSS.

  • horizontal-align doesn't exist
  • font-size and margin need px at the end

I wonder what motivated the deviation? It is certainly easier to write but at the same time it's not CSS anymore. It is likely to cause many confusion.

.title {
    font-size: 30;
    horizontal-align: center;
    margin:20;
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.