In-Depth With NativeScript 2.0

DZone 's Guide to

In-Depth With NativeScript 2.0

An interview with Todd Anglin, Chief Evangelist, VP Technology at Progress, and one of the main voices of the NativeScript team.

· Mobile Zone ·
Free Resource

Back on May 4th, Progress released 2.0 of it’s open source JavaScript framework NativeScript, adding a plethora of features to improve cross-platform development. According to Todd Anglin, Chief Evangelist and VP Technology at Progress, who I spoke with regarding the announcement, the main goal of NativeScript has been to help developers do get their applications on multiple platforms in an easy way, without resorting to hybrid or web apps. This main mission was expanded on with some key updates, including:

  • Angular integration
  • Support for 3rd-party iOS and Android libraries
  • Support for user-created plugins
  • Support for TypeScript
  • Improved CSS support (animations)

On Angular integration

“Over the past year, we’ve been working with Google’s Angular 2 team in order to bake deep integration between Angular 2 and NativeScript. It’s not an add-on. Not only allows devs to reuse code created in NativeScript across iOS/Android/Windows, but will allow them to use their exact same set of Angular skills to create apps for the web and native mobile platforms. Hybrid apps used to just share web code between phones and desktop browsers, but a big point of Angular 2 was allowing that framework to target more than just the web browser. Google spent a lot of time engineering the Angular framework to target different rendering engines. And to prove how this is baked-in integration with NativeScript, we worked with Kiva to show how Angular and NativeScript come together to build cross platform apps quickly with code that can be easily shared with everyone.”

What was the catalyst to work with Google so closely as opposed to a simple plugin?

“Well Google actually reached out to us, and they knew that, with Angular 2’s concept of a framework going beyond the browser, they needed a rendering engine to prove that it can work. They saw that NativeScript was a great tool for JavaScript developers to access native APIs. NativeScript was small enough that we were still figuring out how to steer developers down a particular framework path, and deciding whether Angular should be built into the framework itself. Overall, we were in the right time and place. We helped them prove their vision for Angular 2 while at the same time getting NativeScript developers a robust, proven framework to structure their apps in a more predictable way by making them more easily maintainable with the ability to share code. Angular also has a huge community. jQuery was the last great web community, and Angular is on the path to be the next universal ‘everyone uses this’ framework like jQuery was. That same community can use NativeScript with their Angular skills to deploy native apps.”

What’s the future of the cross platform space?

“Each platform is different, and everyone wants to reach as many of them as quickly as possible. Everyone wants ‘write once run anywhere,’ and we want to know how close NativeScript can get to that. The main mission is to give developers portable code to get onto mobile platforms. Management has started to see native app development as too expensive (due to the cost of building and maintaining 3 different versions of their applications). Cross platform is inevitable; the question is “what approach are you going to take?”

Any NS features that the community has been asking for that you’d like to address or are particularly cool improvements?

“One of the most highly requested things (in part because of enterprise interest) is Windows 10 support. Everyone accepts Windows Phone is dead, but more people care about Windows Universal. The team is working on Windows support for Angular, looking to work with Microsoft. We don’t intend to just stop at iOS/Android/Windows support. We’re imagining support for Mac OS desktop, Linux, etc., anywhere native performance is still valuable but developers want portable code and to reuse their existing skills.”

The importance of background threads

“Another important feature is the ability to execute code in a background process. The question is, ‘how do I make code, heavy, and expensive and let it run somewhere else so it doesn’t slow down an app?’ For example, accessing a database or processing an image takes more CPU time, but can be pushed into a background process to reduce application downtime. We’re projecting the implementation of background threads to be released this summer. We’re also working on supporting CSS animation, which will deliver native animation to users. We want to minimize the learning curve for making native mobile apps. That’s the main goal and influences all of our decisions.”

Thoughts on TypeScript?

“It’s a great tool, and we love TypeScript. Angular’s codebase was actually created in TypeScript, and so is some of NativeScript. TypeScript is a first class citizen, and we want to steer developers to use TypeScript not only because it’s compatible with Angular 2 and a lot of the plugins used by NativeScript, but also has a lot of benefits for all developers. A really useful feature is how TypeScript helps developers catch issues before they’re shipped to users through tools like Visual Studio Code. NativeScript benefits if developers are more productive, and TypeScript helps them do that.”

What’s an engineering challenge you had to face, and how did you overcome it?

“We want to make NativeScript comfortable for web developers, but it’s not a browser. We didn’t know if it a problem for our users to make something look like something it’s not. Would it set unrealistic expectations, or is it a benefit and it’ll help people feel like they know what they’re doing? There was a big debate about that early on, and we landed on starting with something familiar, especially when it comes to API design. We are continuing to refine the system to make it feel more like the way you do things on the web.”

Closing remarks

“Clearly NativeScript is not in a vacuum, there are other options (e.g. Xamarin, React Native, Ionic), but all the projects in the ring are all open source, so it’s a battle of equals in that sense, and developers will pick the technology based on merit.”

angular, mobile, native, nativescript, web

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}