The latest release of NativeScript includes a number of changes, such as improved support for Vue.js, better developer experience, and more native features. Additionally, NativeScript 5.0 includes the new NativeScript-Schematics, an Angular extension helping developers to build web and mobile versions of an app from a single project.
On the front of developer experience, the major improvements in NativeScript 5.0 are the following:
Hot Module Replacement (HMR), aiming to shorten development cycles by enabling hot reload of modified modules without requiring application restarts and keeping the current state of your app. HRM can be enabled using the
--hrmcommand line flag to
tns run ios|android –hmr
(Image from NativeScript blog)
Plugin creation from the CLI, using
tns plugin create, which represents a great improvement over having to clone the NativeScript plugin seed repository.
Better code-test-debug cycle, through LiveSync and debug improvements. LiveSync, a tool to live update your app on a physical device, should reduce launch time by 20–30%. Related to this, app preview in the Playground Preview app can be now triggered from the CLI.
As mentioned, NativeScript 5.0 also improves native features:
- iOS Safe Area is now supported, thus enabling full use of display on the iPhone X series of devices without user content interfering with the “notch”.
- Android Support library has been brought to v28 from v26-alpha. This will require developer to install v28 on their development devices.
Another notable change in NativeScript 5.0 is better support for Vue.js, thanks to improved wrappers of all NativeScript UI components.
The NativeScript team also announced their plans for the next release, 5.1, expected for Christmas. Main highlights of the coming version are support for Angular 7, and more improvements to hot module replacement.