Nativescript-cli: [Angular] Improve livesync performance for iOS

Created on 27 Apr 2016  路  6Comments  路  Source: NativeScript/nativescript-cli

Improve the performance of livesync for iOS, particularly for typescript/angular2 apps.

bug livesync

Most helpful comment

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.

All 6 comments

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)?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

erjdriver picture erjdriver  路  3Comments

NickIliev picture NickIliev  路  3Comments

trodellez picture trodellez  路  3Comments

ZMW9 picture ZMW9  路  3Comments

MrCroft picture MrCroft  路  3Comments