Skip to content

Instantly share code, notes, and snippets.

@arafeek
Last active January 20, 2016 14:59
Show Gist options
  • Save arafeek/c6862f2b4ff5c1067138 to your computer and use it in GitHub Desktop.
Save arafeek/c6862f2b4ff5c1067138 to your computer and use it in GitHub Desktop.
My feelings on trying to use NativeScript with Angular2 to build a simple app

The Framework:

  • The documentation for using NativeScript with Angular 2 is pretty sparse. A lot of what I learned came from various repository readme's and logged GitHub Issues. For the most part however, it's quite similar to regular Angular2 development except that instead of using HTML to template UI elements, you now have to use NativeScript's XML templating language.

  • NativeScript itself has decent documentation so it wasn't difficult to use it's provided APIs. In terms of application structure, it feels as if it plays pretty well with Angular2 and I would imagine that you could keep a lot of the same structure between a web and native Angular2 application. NativeScript also seems to provide a more bare bones approach to bridging native mobile APIs. Personally I felt like this could be a positive, as some of the abstraction with react-native can make it difficult to get fine tuned control over components. NativeScript has the benefit of being a 'write once, run anywhere' framework, much like Ionic. With react-native, some components and APIs are specific to a particular platform and cannot be reused.

Development Flow:

  • The NativeScript CLI provides commands to easily set up a seed project (much like react-native), however it still feels like a lot of features could be added to improve developer experience. For example:
    • The auto-reload (they call it livesync) feature is very spotty. Often times I would make large code changes and it would not register them in my app. Also, from what I read of the documentation, it seems like you can't console.log() when using the auto-reload. This isn't a huge deal, but I've found it to be extremely useful both in web and react-native debugging.
    • Error reporting leaves much to be desired. Due to the additional step of compiling TypeScript sometimes errors would not propagate properly. A lot of the times my project would compile, and then I would get unexpected behaviour in my app with no errors showing.
  • Overall I think some work needs to be done on the Angular2/NativeScript developer workflow front from their end, or at least have it better documented.

Miscellaneous / Performance:

  • I checked out a few of the NativeScript apps for android that were on their featured page: https://www.nativescript.org/app-samples-with-code
    • A lot of the reviews for the apps claimed they felt sluggish and dropped frames often. Personally, I would put their performance somewhere between that of an Ionic app and a true native app.
  • There seems to only be one developer working on the Angular2/NativeScript repositories. I felt like this was a bit of a red flag.
  • There are some concerning GitHub issues like: NativeScript/nativescript-angular#23 which implies that their rendering performance is actually below that of the browser.

Overall it felt like a few things still need to be fleshed out with the framework especially with Angular2 still in beta. Let me know if you wanted to know about any aspects more specifically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment