It has been a long road getting to this point; but I'm happy to see that the NativeScript team released The final piece of the 5.0. The CLI tool which was the final piece was finally released on Nov 2nd; the rest of the pieces have been released for a couple days.
5.0 adds a whole lot of new awesome features; however since several pieces have changed; I would highly recommend before uploading a 5.0 app to the app stores you do another full test of your application; testing everything as several low level framework items changed for both iOS and Android.
The quick list of some of the new features in 5.0
The cli now will prompt you for input; so when you type "tns create ProjectName" you will see something like this:
HMR - Hot Module Replacement
This is the feature most NativeScript developers have been waiting for; this is awesome. You know the silly change a file app restarts; change another file app restarts livesync? Now you can do this: tns run --hmr
Preview allows you to preview the application without having xcode or android tools installed and building it. It uses the already built playground preview application to preview the app so that you can see the app on your mobile phone. It has the same limitations as the playground site; but for most developers getting started it is a quick and easy way to start playing around with programming application. When you type:
you will then see the qr code in your console. Point the playground app's qr scanner at it and then your app will start running on your phone. Please note the entire application is uploaded to the cloud; which then your phone links to. So if this is an issue with your company don't use this feature.
Android Core modules is now descended from the Google Support libraries; this opens up many more visual plugins and makes the app a lot more modern and compatible. One word of caution this did require them to do a bit of reworking of several parts of the base code for android. Their is the likely potential for new bugs to appears in areas that were bug free before. So heavily test your app before releasing it to the stores.
iOS Core modules now have a new way to do the safe areas; this also has required a lot of reworking and so the same warning applies. Test your app thoroughly to make sure that something in this area won't cause you any issues.
Other android specific changes:
- now using the v8 engine, v6.9.427.23.
- before-plugins.gradle support
- SBG will fail if their is a JSParser issue
- JSParser fix for Decorators
- Runtime issue fix with support > 26 on devices < 23.
- Gradle is now using 3.2
- Building is even faster now
Other iOS specific changes:
- Typing generation improvements
- Webkit is now using 11.4
- Several marshalling to native from JS issues fixed.
Other specific changes:
- Many bugs fixed
- Webpack Vue bundling support
- Angular memory leak fixed
- Styling changes to support dynamic theming
- tslib helpers now global
- appSettings now supports allKeys method
- Touch event pass through now supported
To get updated; you first need to do:
npm i -g nativescript@latest
That will get you the latest version of NativeScript CLI; once you have it; do a "tns --version" and verify it prints out "5.x.x". Then do a "tns doctor" to verify your environment is up to date and has all the newest support tools you need for a successful build.
To update a project; you need to do the following:
tns platform remove android && tns platform add android@latest
tns platform remove ios && tns platform add ios@latest
Latest Core modules:
npm r tns-core-modules --save
npm i tns-core-modules@latest --save
To install Webpack & HMR support:
npm i nativescript-dev-webpack@latest --save-dev
Note: you need to have nativescript-dev-webpack as a development dependency for HMR to work.
To install latest NativeScript Angular plugin
npm i nativescript-angular@latest --save
You will then need to install the actual angular bits; which as of this post v6 is currently supported.
- Doing a tns preview and then trying to do a tns add platforms will fail, you will need to manually delete the platforms to eliminate the preview build files so that you can actually add the platform.
- HMR does NOT currently work with local plugin development out of the box. (See: https://github.com/NativeScript/nativescript-dev-webpack/issues/656)
- HMR does NOT work with Angular application out of the box (See: https://github.com/NativeScript/nativescript-angular/wiki/HMR)
- HMR requires each of your pages to end with
-pagefor it to consider it for HMR. So if your app is like "main-screen", "cool-screen", those files will be ignored. (For more Webpack and/or HMR gotcha's, see: https://www.nativescript.org/blog/upgrading-to-nativescript-webpack-0.12.0 as it has a lot of excellent information)
- Android TabView has a couple nasty crashing issues; see (https://github.com/NativeScript/NativeScript/pull/6467 & https://github.com/NativeScript/NativeScript/pull/6495)