{"id":660,"date":"2019-02-13T18:47:03","date_gmt":"2019-02-13T18:47:03","guid":{"rendered":"http:\/\/fluentreports.com\/blog\/?p=660"},"modified":"2019-02-13T18:47:05","modified_gmt":"2019-02-13T18:47:05","slug":"nativescript-5-2-0-released","status":"publish","type":"post","link":"http:\/\/fluentreports.com\/blog\/?p=660","title":{"rendered":"NativeScript 5.2.0 Released"},"content":{"rendered":"\n<div class=\"wp-block-image\"><figure class=\"alignright\"><img loading=\"lazy\" decoding=\"async\" width=\"395\" height=\"394\" src=\"http:\/\/fluentreports.com\/blog\/wp-content\/uploads\/2019\/02\/ns-520.png\" alt=\"\" class=\"wp-image-662\" srcset=\"http:\/\/fluentreports.com\/blog\/wp-content\/uploads\/2019\/02\/ns-520.png 395w, http:\/\/fluentreports.com\/blog\/wp-content\/uploads\/2019\/02\/ns-520-150x150.png 150w, http:\/\/fluentreports.com\/blog\/wp-content\/uploads\/2019\/02\/ns-520-300x300.png 300w\" sizes=\"auto, (max-width: 395px) 100vw, 395px\" \/><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">NativeScript 5.2 offers a wide number of fixes, and is well worth upgrading to.  Checkout what has now been fixed and\/or enhanced in this awesome release from the NativeScript team.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">One of the more interesting things for iOS is the In App Podfile and Src code support.  Drop your any src code into the <strong>\/App_resources\/ios\/src<\/strong> and\/or a <code>Podfile<\/code> in <strong>\/App_Resources\/ios<\/strong> and your app will automatically build it with your app.  So you don't need to create a plugin to test or embed things in your app anymore.   Plugins still are good for reusable code; but sometimes you might just have a simple function or Podfile that you just want added to your app.   <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Important Depreciation Notice<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In version 5.2 short imports have been depreciated; I do not know when they will no longer actually work; but basically things like  require(\"http\")  are no long valid; you need to do require(\"tns-core-modules\/http\").  The primary reason for this is that webpacking requires the full path; and it has problems with short imports.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Core Modules<font color=\"#191e23\"><span style=\"background-color: rgb(232, 234, 235);\"><b>T<\/b><\/span><\/font><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The core modules offers the following enhancements and fixes...<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Dialog now supports Decimal type<br>ImageCache now has onError exposed<br>onDiscardedError now officially in the typings<br>Android model fixes<br>iOS Flat Actionbar fixes<br>Password hint support<br>Multiple crashes fixes<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Android<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Upgrade to V8 7.1.302 - which offers <br>- Stable Sorting<br>- More bytecode embedded saving 200kb of memory per engine.<br>- Escape analysis improvements (up to 40% faster)<br>- globalThis support<br>- Intl.RelativeTimeFormat support<br>Android X support<br>Ability to free Java memory that is being retained by a JS object<br>Gradle 3.3.1 support.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">iOS<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">OnDiscardedError handler now works properly.<br>Can now manually free OBJC memory that is being retained by a JS object<br>Can now call ObjC methods with the same name but different parameters.  (I've ran into this bug myself -- woohoo!)<a href=\"http:\/\/fluentreports.com\/blog\/?p=581\"><br>GC tuning parameters<br>JSC tuning parameters<\/a><br>Fixes in Exception handling<br>Memory allocation fixes<br>In App Podfile and native Src code support<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">CLI<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Node 11 support<br>Angular HMR support (finally fully working!)<br><code>--debug-brk<\/code> on iOS should be working again.<br>Unit testing should work on Android again.<br>Fixed High CPU usage issue.<br><code>generate splashscreens<\/code> should work again.<br>HMR will now update styles.<br><br><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Updating NativeScript<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To get updated; you first need to do:<br><strong>npm i -g nativescript@latest<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That will get you the latest version of NativeScript CLI; once you have it; do a \"tns --version\" and verify it prints out \"5.2.x\".&nbsp; Then do a \"<strong>tns doctor<\/strong>\" to verify your environment is up to date and has all the newest support tools you need for a successful build.&nbsp;&nbsp; <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To update a project; you need to do the following:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Latest Runtimes:<br><strong>tns platform remove android &amp;&amp; tns platform add android@latest<\/strong><br><strong>tns platform remove ios &amp;&amp; tns platform add ios@latest<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Latest Core modules:<br><strong>npm r tns-core-modules --save<\/strong><br><strong>npm i tns-core-modules@latest --save<\/strong><br><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To install Webpack &amp; HMR support:<br><strong>npm i nativescript-dev-webpack@latest --save-dev<\/strong><br>Note: you need to have nativescript-dev-webpack as a development dependency for HMR to work.&nbsp;&nbsp; <br><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To install latest NativeScript Angular plugin<br><strong>npm i nativescript-angular@latest --save<\/strong><br>You will then need to install the actual angular bits; which as of this post v6 is currently supported.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The addition of all the additional analytics\/tracking to the CLI reminded me; you can disable it permanently; if you value your privacy by doing:<br><strong>tns usage-reporting disable &amp;&amp; tns error-reporting disable<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">Known issues<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>HMR does NOT currently work with local plugin development out of the box. (See: <a href=\"https:\/\/github.com\/NativeScript\/nativescript-dev-webpack\/issues\/656\">https:\/\/github.com\/NativeScript\/nativescript-dev-webpack\/issues\/656<\/a>)<\/li><li>TNS --syncAllFiles still frequently crashes and you have to kill it when it fails.<\/li><li>TNS sometimes can't be stopped with a CTRL-C<br><br><\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>NativeScript 5.2 offers a wide number of fixes, and is well worth upgrading to. Checkout what has now been fixed and\/or enhanced in this awesome release from the NativeScript team. One of the more interesting things for iOS is the In App Podfile and Src code support. Drop your any src code into the \/App_resources\/ios\/src&hellip; <a class=\"more-link\" href=\"http:\/\/fluentreports.com\/blog\/?p=660\">Continue reading <span class=\"screen-reader-text\">NativeScript 5.2.0 Released<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[15],"tags":[16,60],"class_list":["post-660","post","type-post","status-publish","format-standard","hentry","category-nativescript","tag-nativescript","tag-upgrade","entry"],"_links":{"self":[{"href":"http:\/\/fluentreports.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/660","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/fluentreports.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/fluentreports.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/fluentreports.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/fluentreports.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=660"}],"version-history":[{"count":4,"href":"http:\/\/fluentreports.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/660\/revisions"}],"predecessor-version":[{"id":686,"href":"http:\/\/fluentreports.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/660\/revisions\/686"}],"wp:attachment":[{"href":"http:\/\/fluentreports.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=660"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/fluentreports.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=660"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/fluentreports.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=660"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}