nativescript-cli icon indicating copy to clipboard operation
nativescript-cli copied to clipboard

LiveSync to sync .js files without restarting the app

Open vchimev opened this issue 10 years ago • 8 comments

Currently in NativeScript 2.0.0 when you make a change in .js files during livesync, the app gets restarted in order the change to be applied.

vchimev avatar Apr 27 '16 11:04 vchimev

why can't just like RN?

kunl avatar May 16 '16 17:05 kunl

Hey folks,

We restart the app since you may change the entire app logic from .js files and the current running app will be in completely invalid state.

Hey @atanasovg @slavchev @blagoev @hdeshev @hshristov @PanayotCankov, do you have any comments?

Thanks

enchev avatar Jun 06 '16 10:06 enchev

The Runtime teams are currently researching/implementing the LiveEdit functionality for JavaScript and how the embedded JS virtual machines may handle such scenario. Probably we will have better idea in about 2-3 weeks.

atanasovg avatar Jun 06 '16 10:06 atanasovg

Updates?

clocksmith avatar Oct 18 '16 01:10 clocksmith

Hey @clocksmith, We've released a proof of concept for iOS in our latest release with this PR - https://github.com/NativeScript/ios-runtime/pull/614 Since it covers only the basic scenarios it is hidden behind the --live-edit flag, so to use it you should execute the following command tns livesync ios --watch --live-edit Keep in mind that the current version supports modifying the source of callbacks and functions that are already existing. Introducing new functions/callbacks is not yet supported. Since we are currently gathering feedback it would be great if you share your experience with us.

KristinaKoeva avatar Oct 18 '16 11:10 KristinaKoeva

Thanks! I just tried it out on the grocery app (I do not have my own app to use yet), and it seems to work as expected. It would be nice if there was some sort of toast/notification on the app screen that indicates when the changes have been pushed and when the app is "ready" with the new changes (sort of like how the Android hot swapping notification works).

clocksmith avatar Oct 18 '16 16:10 clocksmith

Has this issue been addressed? tns run android --live-edit doesn't seem to take --live-edit into account.

otaran avatar May 09 '17 15:05 otaran

No, --live-edit was experimental feature available only for livesync command, only for ios.

It might work in some of the cases, but it is error prone and we are not sure that existing --live-edit is the way to go for our sync story.

dtopuzov avatar May 09 '17 19:05 dtopuzov