Skip to content

Start LiveSync watcher earlier during run #3404

Closed
@Mitko-Kerezov

Description

@Mitko-Kerezov

Currently whenever tns run <platform> is executed the logic in CLI is as follows:

  1. Prepare the project if needed (this process includes moving files around in platforms, LiveSyncing files if needed, building and installing if required)
  2. Start watching the project files for changes. Whenever changes occur CLI triggers the whole logic in 1.

This logic leads to some issues:

  • Some plugins have before-prepare hooks which trigger some compilation for example and before-watch hook, which starts some other watch process and the project files end up undergoing the same process twice

The proposed solution to this is to invert the logic and start the watcher initially and then force the first preparation. This will eliminate the aforementioned issues in all plugins (nativescript-dev-typescript, nativescript-dev-sass, nativescript-dev-webpack, etc.). There is also an additional benefit to be gained with this approach - during the very first build of the project the user may make changes to the project files, which will be taken into account and LiveSynced - this functionality is currently missing.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions