Skip to content
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

Sidekick restarts DevTools during debug when change in .xml/.css/.html file is applied #4222

Closed
rosen-vladimirov opened this issue Dec 12, 2018 · 0 comments
Assignees
Labels
Milestone

Comments

@rosen-vladimirov
Copy link
Contributor

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: 5.1.0
  • Cross-platform modules: Not applicable
  • Android Runtime: Not applicable
  • iOS Runtime: Not applicable
  • Plugin(s): Not applicable

Describe the bug
In {N} 5.1.0 a new feature for debug had been introduced - debug session (and application itself) should not be restarted in case a change is applied in .xml/.css/.html file. What happens in this situation in case you use tns debug <platform> command is that the application is refreshed, but it is not restarted. The debug session is also not restarted, so you can continue the debug in the already opened Chrome DevTools.
However, in NativeScript Sidekick, this does not work in a similar manner - application is not restarted, but the DevTools are refreshed.

To Reproduce

  1. Open any project in Sidekick.
  2. Check the Start Debugger checkbox.
  3. Click on the Run button.
  4. Once DevTools are opened, change something in .xml/.css/.html file in your application.
  5. You'll notice app is not restarted on device, but DevTools are refreshed.

Expected behavior
When a change in .xml/.css/.html file is applied, the DevTools should not be refreshed.

Additional context
Sidekick relies on the debuggerAttached event raised by CLI. The problem is that even when the application is not restarted on a change, CLI prints the same Chrome URL and emits debuggerAttached event. Once Sidekick sees it, it refreshes DevTools.

NOTE: This also breaks the behavior of debugging with HMR enabled (currently available only for Android).

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

3 participants