You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CLI: When sending xml and css files to the device, do not restart the app
CLI: When syncing JS, images, fonts, or other resources - restart the entire app
CLI: Implement a dedicated tcp socket as communication channel between it and the runtimes
CLI: Notify runtimes after the files are on the device that the change had happened
CLI: Research if we can fast sync for other file types (mostly images)
CLI: Lower batch time in the cli to 250ms
CLI: Implement together batch livesync/restart with fast livesync
Android runtime: spike tcp socket as communication channel between it and the CLI.
Android: notify modules when files are changed and the current page must be reloaded - see bellow
iOS: notify modules when files are changed and the current page must be reloaded - see bellow
Modules: implement a global function (tentative name: __nativeScriptLiveSyncCallback). The run times will call it whenever the current page needs to be reloaded
I think Nathanael solution is pretty good in Android.the ios simulator version is already pretty fast, maybe Android is urgently need the update or just use Nathanael solution
Thank you for sharing your research about fonts! Did you verify this behavior on both iOS and Android?
Please bear in mind that this issue focuses only on the changes which we are introducing in NativeScript 1.5. We will continue improving LiveSync in the following releases. We need more time to discover and fix all the edge cases on both platforms.
There's a separate issue about linting. We think it is a very good idea and needs to be done at first opportunity.
Yes livesync from an HTTP server would be great for Native Script @x4080@teobugslayer
This feature is a requirement of many projects I have coming up and is the only reason React Native is still an option for me. They already have the feature but I prefer Native Script for everything else.
The release of this feature I think would greatly improve Native Script's popularity because it enables devs to support customer deployments in a much faster and efficient way.
I am willing to contribute in any way I can to the expedition of the implementation of this feature.
consoloe.log() will be supported with LiveSync in {N} version 1.5.0 (NativeScript/nativescript-cli#1130) for Android device/emulator and iOS device - iOS simulator will be added in the next versions.
Are there any special requirements to make the new LiveSync work in {N} 1.5.0? I'm using the iOS Simulator and running tns livesync ios still causes the app to reload.
FWIW, the terminal shows this error when running livesync with the iOS simulator: Unable to start service com.apple.mobile.house_arrest. Result code is: 3892314239
Simulator still loads fine, so not sure the implication of this error. Looked at trace logs, but few obvious errors there. Only error that occurs in logs before one above is this:
stderr:
Transferring project files...
Transferring project files...
Multiple exceptions were thrown:
at FiberFuture.Future.wait (/usr/local/lib/node_modules/nativescript/node_modules/fibers/future.js:535:15)
...
It seems that you have connected device and running simulator. In order to livesync to iOS simulator execute tns livesync ios --emulator command. If you change .xml or .css file the application will not restart but if you change .js file the application will restart.
Thanks, @Fatme. I actually don't have any other iOS devices physically connected...but tns device does show additional iOS devices. Not sure if that's bad caching of previously connected devices OR if somehow the devices are being detected over WiFi.
Either way, the tns livesync ios --emulator command eliminates the error, BUT...
The iOS simulator is still restarting every time I issue the livesync command. Here is the last part of the log trace when I run tns livesync ios --emulator:
@toddanglin,
could you please make sure that you upgraded the tns-core-modules package in your app? If you open the package.json file of your app, under dependencies the record for tns-core-modules should point to 1.5.0.
I just created a brand new hello world app and the smart livesync works just fine...
after running "tns install typescript" every XML/CSS change triggers a restart of the app. :(
@vchimev Yes, I can confirm that tns-core-modules has been upgraded to 1.5.0. In fact, I deleted the entire tns-core-modules directory and then let npm re-install the latest version to be sure all modules were 100% fresh/upgraded.
@ignaciofuentes That's interesting. To test, I created a brand new project and smart livesync still restarts the app with each update (no TypeScript). I'm testing against iOS simulator on OS X.
At the moment, I'm seeing a pretty poor livesync experience with ios. The app fully restarts, and requires a 5-10 second reload time, losing state in the process.
I'm not 100% sure, but due to the existence of this project https://github.com/NathanaelA/nativescript-liveedit and that React Native seems to have a lot swifter reloading, is this something that NativeScript is going to be pushing to achieve (ie hot reloading of as much of the app as possible, without a full rebuild/restart, particularly for JS / logic files)?
@chrisbarry Sorry to hear you're having that much trouble. Not normally the livesync experience.
That said, the 2.1 release is aiming to make hot reloading in NativeScript even more robust/faster. Definitely something the core team is continuing to invest a lot of time in improving. You can see it on the high-level roadmap here: https://www.nativescript.org/roadmap
The goal is to support the hot reloading experience you describe: fast, reload all assets, retain state
Activity
NathanaelA commentedon Oct 22, 2015
x4080 commentedon Oct 23, 2015
I think Nathanael solution is pretty good in Android.the ios simulator version is already pretty fast, maybe Android is urgently need the update or just use Nathanael solution
teobugslayer commentedon Oct 23, 2015
Thank you for sharing your research about fonts! Did you verify this behavior on both iOS and Android?
Please bear in mind that this issue focuses only on the changes which we are introducing in NativeScript 1.5. We will continue improving LiveSync in the following releases. We need more time to discover and fix all the edge cases on both platforms.
There's a separate issue about linting. We think it is a very good idea and needs to be done at first opportunity.
NathanaelA commentedon Oct 23, 2015
x4080 commentedon Oct 23, 2015
And how about a feature to load script from http server? I think about for development and easy update for production purposes. It will be awesome
kaydevdev commentedon Oct 26, 2015
Yes livesync from an HTTP server would be great for Native Script @x4080 @teobugslayer
This feature is a requirement of many projects I have coming up and is the only reason React Native is still an option for me. They already have the feature but I prefer Native Script for everything else.
The release of this feature I think would greatly improve Native Script's popularity because it enables devs to support customer deployments in a much faster and efficient way.
I am willing to contribute in any way I can to the expedition of the implementation of this feature.
amjd commentedon Nov 12, 2015
It would be awesome if support for
console.log()is added in LiveSync mode too. Or any other way to debug apps while in LiveSync mode.vchimev commentedon Nov 23, 2015
Hi @amjd,
consoloe.log()will be supported with LiveSync in {N} version 1.5.0 (NativeScript/nativescript-cli#1130) for Android device/emulator and iOS device - iOS simulator will be added in the next versions.vchimev commentedon Nov 23, 2015
Please refer to https://github.com/NativeScript/nativescript-cli/issues for any LiveSync related issues.
toddanglin commentedon Nov 24, 2015
Are there any special requirements to make the new LiveSync work in {N} 1.5.0? I'm using the iOS Simulator and running
tns livesync iosstill causes the app to reload.FWIW, the terminal shows this error when running
livesyncwith the iOS simulator:Unable to start service com.apple.mobile.house_arrest. Result code is: 3892314239
Simulator still loads fine, so not sure the implication of this error. Looked at trace logs, but few obvious errors there. Only error that occurs in logs before one above is this:
GitCharm commentedon Nov 25, 2015
Issue with Android- calling "tns livesync android" with my connected Android device and am getting the following error:
Project successfully prepared
Transferring project files...
spawn ENAMTOOLONG
Thanks in advance for assistance on this
Fatme commentedon Nov 25, 2015
Hi @toddanglin,
It seems that you have connected device and running simulator. In order to livesync to iOS simulator execute
tns livesync ios --emulatorcommand. If you change.xmlor.cssfile the application will not restart but if you change.jsfile the application will restart.Fatme commentedon Nov 25, 2015
Hi @GitCharm,
Can you execute
tns livesync android --log traceand send us the produced log output.toddanglin commentedon Nov 25, 2015
Thanks, @Fatme. I actually don't have any other iOS devices physically connected...but
tns devicedoes show additional iOS devices. Not sure if that's bad caching of previously connected devices OR if somehow the devices are being detected over WiFi.Either way, the
tns livesync ios --emulatorcommand eliminates the error, BUT...The iOS simulator is still restarting every time I issue the
livesynccommand. Here is the last part of the log trace when I runtns livesync ios --emulator:Seems
livesyncis doing akillallevery time I run it (regardless of what files do/don't change).ignaciofuentes commentedon Nov 25, 2015
I am having the same experience as @toddanglin
I can actually see the visual change right before the app restarts.
I suspect it's related to the typescript compilation step.
vchimev commentedon Nov 25, 2015
@toddanglin,
could you please make sure that you upgraded the tns-core-modules package in your app? If you open the package.json file of your app, under dependencies the record for tns-core-modules should point to 1.5.0.
ignaciofuentes commentedon Nov 25, 2015
I just created a brand new hello world app and the smart livesync works just fine...
after running "tns install typescript" every XML/CSS change triggers a restart of the app. :(
toddanglin commentedon Nov 27, 2015
@vchimev Yes, I can confirm that tns-core-modules has been upgraded to 1.5.0. In fact, I deleted the entire tns-core-modules directory and then let npm re-install the latest version to be sure all modules were 100% fresh/upgraded.
@ignaciofuentes That's interesting. To test, I created a brand new project and smart livesync still restarts the app with each update (no TypeScript). I'm testing against iOS simulator on OS X.
chrisbarry commentedon May 31, 2016
At the moment, I'm seeing a pretty poor livesync experience with ios. The app fully restarts, and requires a 5-10 second reload time, losing state in the process.
I'm not 100% sure, but due to the existence of this project https://github.com/NathanaelA/nativescript-liveedit and that React Native seems to have a lot swifter reloading, is this something that NativeScript is going to be pushing to achieve (ie hot reloading of as much of the app as possible, without a full rebuild/restart, particularly for JS / logic files)?
toddanglin commentedon May 31, 2016
@chrisbarry Sorry to hear you're having that much trouble. Not normally the livesync experience.
That said, the 2.1 release is aiming to make hot reloading in NativeScript even more robust/faster. Definitely something the core team is continuing to invest a lot of time in improving. You can see it on the high-level roadmap here: https://www.nativescript.org/roadmap
The goal is to support the hot reloading experience you describe: fast, reload all assets, retain state
chrisbarry commentedon Jun 1, 2016
@toddanglin many thanks for the response, NativeScript does seem to be one of the cleanest cross platform tools available today.
2.1 sounds exciting, looking forward to trying that out once it's ready!
lock commentedon Aug 30, 2019
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.