LiveSync to sync .js files without restarting the app
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.
why can't just like RN?
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
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.
Updates?
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.
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).
Has this issue been addressed? tns run android --live-edit doesn't seem to take --live-edit into account.
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.