In-Depth With NativeScript 2.0
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.
Join the DZone community and get the full member experience.Join For Free
- 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?
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.”
“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.”
Opinions expressed by DZone contributors are their own.