Skip to content

Fix execution of before-prepare hooks in a long living process #3140

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

Merged
merged 1 commit into from
Sep 29, 2017

Conversation

rosen-vladimirov
Copy link
Contributor

When LiveSync operation is started we set usbLiveSyncService.isInitialized to true. This variable is used in several before-prepare hooks.
For example nativescript-dev-typescript has the following logic:

  • When before-prepare hook is executed it checks if the usbLiveSyncService.isInitialized property is set to true. In this case it does nothing. The idea is that when LiveSync watch process is started, the plugin has started tsc --watch process, so there's no need to do anything on before-prepare.
    However, in a long living process, where the project may be changed, whenever we stop LiveSync process, we must set usbLiveSyncService to false. In case we do not do it, the property remains true and the before-prepare hook of the other project does nothing and the project is not transpiled.

When LiveSync operation is started we set `usbLiveSyncService.isInitialized` to true. This variable is used in several `before-prepare` hooks.
For example `nativescript-dev-typescript` has the following logic:
- When before-prepare hook is executed it checks if the `usbLiveSyncService.isInitialized` property is set to true. In this case it does nothing. The idea is that when LiveSync watch process is started, the plugin has started `tsc --watch` process, so there's no need to do anything on `before-prepare`.
However, in a long living process, where the project may be changed, whenever we stop LiveSync process, we must set usbLiveSyncService to false. In case we do not do it, the property remains true and the before-prepare hook of the other project does nothing and the project is not transpiled.
Copy link
Contributor

@Mitko-Kerezov Mitko-Kerezov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks okay to me

@rosen-vladimirov
Copy link
Contributor Author

run ci

@rosen-vladimirov rosen-vladimirov merged commit f36f0e6 into master Sep 29, 2017
@rosen-vladimirov rosen-vladimirov deleted the vladimirov/livesync-stop branch September 29, 2017 10:46
@dtopuzov dtopuzov added this to the 3.3.0 milestone Oct 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants