Skip to content

Remove the requirement for external watchers #1338

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
hdeshev opened this issue Dec 11, 2015 · 0 comments
Closed

Remove the requirement for external watchers #1338

hdeshev opened this issue Dec 11, 2015 · 0 comments
Labels
Milestone

Comments

@hdeshev
Copy link
Contributor

hdeshev commented Dec 11, 2015

The way live sync watch works now is to watch for file changes, and when that happens:

  1. Trigger a platform prepare.
  2. Sync files to the device.

The problem is that step #2 doesn't wait for #1 to complete, and doesn't detect any files changed by platform prepare (before-prepare) hooks where we usually register compilers (typescript, etc). We handle this with a hack that:

  1. Excludes source files (e.g. *.ts from triggering a live sync).
  2. Start another file system watcher (or three, when speaking of the nativescript-dev-typescript plugin), and compile files when we detect changes.
  3. Modify before-prepare hooks, detect "live sync" preparation invocations, and do nothing in that case.
  4. Wait for livesync to sync generated files using the "regular" work flow.

This manifests into all sorts of problems like:

  1. Endless prepare-compile-prepare loops caused by omissions in ignore lists or hooks that don't detect live sync runs..
  2. Unnecessary double compiles (a milder version of Package skeleton, typescript support and entry point for the cli #1 above).
  3. Requiring to compiler and code generator hooks to implement their logic in two places: both in their before-prepare hook and a file system watcher.

All that goes away with PR #1335 which waits for prepare hooks to run, collects changed files, and removes the need for additional file system watchers.

@hdeshev hdeshev added this to the 1.5.2 milestone Dec 11, 2015
@vchimev vchimev modified the milestones: 1.6.0 (Under consideration), 1.5.2 Dec 11, 2015
@dtopuzov dtopuzov removed the 3 - Done label Jan 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants