We are super excited to announce the immediate availability of the NativeScript 3.0 Release Candidate! This is a major milestone for the project and the team - who worked hard to prototype, implement, and stabilize the new bits. As you may have already read in this post, the 3.0 release introduces many performance improvements and some breaking changes. We believe that every single change introduced makes the NativeScript framework more stable, valuable, and performant.
To ease the migration path we have prepared a comprehensive document to explain the changes, why they were needed, and what value they add. We've also compiled a complete migration guide that will help you with upgrading your apps to 3.0.
Here is an overview of what's included in the 3.0 RC.
livesync
command is removed in favor of tns run
which now automatically performs livesync --watch
under the hood;plugin find/search
command is removed as it was not used;emulate
command is now deprecated and its functionality has been exposed through the run
command and its --emulate
option;run --device <Device Identifier>
command now starts an emulator if one is not started already. Prior to 3.0 the --device
option worked only with physical devices.You can install the new NativeScript package from npm (behind the RC tag):
npm install -g nativescript@rc
You can create a new project based on the new 3.0 templates:
tns create MyApp --template tns-template-hello-world@rc
tns create MyApp --template tns-template-hello-world-ts@rc
tns create MyApp --template tns-template-hello-world-ng@rc
These commands will create a project and the 3.0 RC tns-core-modules@rc
will be added.
At this point, you may add the RC bits of the platform you are targeting:
tns platform add android@rc
and tns platform add ios@rc
That's it! You can now start the project with with tns run <platform-name>
.
In order to update existing projects, you will have to update the tns-core-modules
and platforms for your app:
tns plugin remove tns-core-modules
tns plugin add tns-core-modules@rc
tns platform remove <platform-name>
tns platform add <platform-name>@rc
For both TypeScript and Angular applications you should also update the TypeScript plugin:
npm uninstall nativescript-dev-typescript --save-dev
npm uninstall typescript --save-dev
npm install [email protected] --save-dev
Finally, for Angular projects, you need to do the following:
1) Update the nativescript-angular
plugin:
tns plugin remove nativescript-angular
tns plugin add nativescript-angular@rc
2) Update to Angular 4 by opening the package.json
file of your project and update the various Angular packages to 4.0.0. Additionally, the zone.js
dependency should now be listed as a dependency rather than a devDependency and updated to 0.8.2.
As a result your package.json
should look like this:
"dependencies": {
"nativescript-theme-core": "~1.0.2",
"nativescript-angular": "rc",
"tns-core-modules": "rc",
"@angular/animations": "4.0.0",
"@angular/core": "4.0.0",
"@angular/common": "4.0.0",
"@angular/compiler": "4.0.0",
"@angular/http": "4.0.0",
"@angular/platform-browser": "4.0.0",
"@angular/platform-browser-dynamic": "4.0.0",
"@angular/forms": "4.0.0",
"@angular/router": "4.0.0",
"rxjs": "~5.2.0",
"reflect-metadata": "~0.1.8",
"zone.js": "~0.8.2"
},
"devDependencies": {
"typescript": "~2.2.1",
"nativescript-dev-typescript": "~0.4.0",
"nativescript-dev-android-snapshot": "^0.*.*"
}
There are some known limitations that the team is currently fixing. However, we wanted to release the new bits today as we believe they are stable enough to allow for early experimentation. Here are the limitations we are aware of:
--syncAllFiles
option is specifiedWe plan on releasing a new RC version once these issues are resolved. We may have several RC releases prior to the official release, to ensure critical issues are resolved as soon as possible and not force our users wait 4 weeks for a fix!
Please let us know of any issues that you find with this release candidate, so that we may address them prior to the official release.
While we believe only a small subset of all the existing NativeScript plugins will be affected by the changes (mainly those which provide a custom UI), we do want to make sure issues are identified and fixed as soon as possible!
We are aiming for April 26th, 2017 as the official 3.0 release date. In the four week period between the RC and the official release date, we will dedicate ourselves to fix any issues that may arise, help authors migrate their plugins to 3.0, and update the documentation and getting started materials.