Skip to content

feat: add support for debug with hmr #244

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
Mar 22, 2019
Merged

Conversation

rosen-vladimirov
Copy link
Contributor

@rosen-vladimirov rosen-vladimirov commented Mar 22, 2019

Add support for Debug + HMR - currently it is not working, as when a hot-module is applied, VSCode does not know that the current hot-module is mapped to the actual changed file (main-view-model) for example.
To fix this, add SourceMapTransformer and plug in the scriptParsed method. When breakpoint is set, cache it (in nativeScriptDebugAdapter), so once hot-module is applied, set the breakpoints from its original file (i.e. main-view-model) in the newly applied hot module.
This is exactly how Chrome works.

Also, add logic in pathTransformer to map files from platforms dir when debugging on iOS.

Related to: #221

Add support for Debug + HMR - currently it is not working, as when a hot-module is applied, VSCode does not know that the current hot-module is mapped to the actual changed file (main-view-model) for example.
To fix this, add SourceMapTransformer and plug in the scriptParsed method. When breakpoint is set, cache it (in nativeScriptDebugAdapter), so once hot-module is applied, set the breakpoints from its original file (i.e. main-view-model) in the newly applied hot module.
This is exactly how Chrome works.

Also, add logic in pathTransformer to map files from `platforms` dir when debugging on iOS.
@cla-bot cla-bot bot added the cla: yes label Mar 22, 2019
Copy link
Contributor

@DimitarTachev DimitarTachev left a comment

Choose a reason for hiding this comment

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

🥇

@DimitarTachev DimitarTachev self-requested a review March 22, 2019 11:56
@DimitarTachev DimitarTachev merged commit de7e5cb into master Mar 22, 2019
@DimitarTachev DimitarTachev deleted the vladimirov/support-hmr branch March 22, 2019 11:57
@ghost ghost removed the new PR label Mar 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants