Skip to content

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.

3 participants