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
Currently, when we execute livesync command with --watch option, if our project's app directory contains any symlinked folder, its content is not getting watched. So even if we do any changes in any file of such symlinked folder, it will not be transferred to the device. Due to that we need to always execute tns livesync ios --watch after every change in such symlinked files. This is impacting the development experience for cross platform (web and mobile) apps.
I tried to find the root cause of the issue and I found that issue is at partialSync function of lib/services/livesync/livesync-service.js file.
Currently the code is as shown below:
LiveSyncService.prototype.partialSync = function (syncWorkingDirectory, onChangedActions) {
var that = this;
var gazeWatcher = gaze("**/*", { cwd: syncWorkingDirectory}, function(err, watcher) {
...
});
...
}
Here, gaze package internally uses glob package and in documentation of glob package, it is mentioned that when globstar(**) pattern is used, it does not crawl symlinked directories.
If we want to make it crawl the symlinked directories, we need to pass follow:true option in gaze options as shown below:
LiveSyncService.prototype.partialSync = function (syncWorkingDirectory, onChangedActions) {
var that = this;
var gazeWatcher = gaze("**/*", { cwd: syncWorkingDirectory, follow: true}, function(err, watcher) {
...
});
...
}
By passing follow:true, we can make the files of symlinked directories to be livesynced to device. This improves the development experience and speed of development of cross platform (web and mobile) apps by great amount.
It will be great if follow:true is set in options by default or if we can pass an option in CLI like tns livesync ios --watch --follow to have symlinked files to be livesynced.
Let me know if there is already some solution for this issue or you want any other information.
Thanks.
The text was updated successfully, but these errors were encountered:
Currently, when we execute
livesync
command with--watch
option, if our project'sapp
directory contains any symlinked folder, its content is not getting watched. So even if we do any changes in any file of such symlinked folder, it will not be transferred to the device. Due to that we need to always executetns livesync ios --watch
after every change in such symlinked files. This is impacting the development experience for cross platform (web and mobile) apps.I tried to find the root cause of the issue and I found that issue is at
partialSync
function oflib/services/livesync/livesync-service.js
file.Currently the code is as shown below:
Here,
gaze
package internally usesglob
package and in documentation ofglob
package, it is mentioned that when globstar(**) pattern is used, it does not crawl symlinked directories.If we want to make it crawl the symlinked directories, we need to pass
follow:true
option ingaze
options as shown below:By passing
follow:true
, we can make the files of symlinked directories to be livesynced to device. This improves the development experience and speed of development of cross platform (web and mobile) apps by great amount.It will be great if
follow:true
is set in options by default or if we can pass an option in CLI liketns livesync ios --watch --follow
to have symlinked files to be livesynced.Let me know if there is already some solution for this issue or you want any other information.
Thanks.
The text was updated successfully, but these errors were encountered: