Improve the performance of livesync for iOS, particularly for typescript/angular2 apps.
Angular livesync is slow because it always restart the app.
The problem with angular apps is that they are using TypeScript. When any .ts file is changed, TypeScript watcher transpiles all .ts files to .js files. When this happens, CLI detects _all_ .js files as modified. In fact only one of them is really modified. For Android we are using the shasums of each file, and when we detect change, we calculate the new shasum of the "modified" file and compare it with the shasum of the same file on the device. In case they match, we do not livesync the file.
When you stop the livesync --watch process, apply some changes in your code and call livesync --watch again, CLI will send only the modified files, not the full app (again changes are based on shasums of the files).
We should do the same for iOS, this will speed up the process of livesyncing not only Angular apps, it will boost the livesync of all huge applications.
This would be very helpful @rosen-vladimirov. I've currently been struggling a bit with debugging a {N} + ng2 app I'm working on due to livesync performance being a bit slow here.
I've noticed it's pretty slow also with Android so I don't think this ticket should be limited to iOS.
Hey @sipacate,
Are you using our latest version (2.0.1)?
We've managed to improve the performance with these pull requests:
https://github.com/NativeScript/nativescript-cli/pull/1858
https://github.com/telerik/mobile-cli-lib/pull/719
https://github.com/NativeScript/ios-runtime/pull/584
Most helpful comment
The problem with angular apps is that they are using TypeScript. When any
.tsfile is changed, TypeScript watcher transpiles all.tsfiles to.jsfiles. When this happens, CLI detects _all_.jsfiles as modified. In fact only one of them is really modified. For Android we are using the shasums of each file, and when we detect change, we calculate the new shasum of the "modified" file and compare it with the shasum of the same file on the device. In case they match, we do not livesync the file.When you stop the
livesync --watchprocess, apply some changes in your code and calllivesync --watchagain, CLI will send only the modified files, not the full app (again changes are based on shasums of the files).We should do the same for iOS, this will speed up the process of livesyncing not only Angular apps, it will boost the livesync of all huge applications.