Skip to content

fix: external files are not livesynced #5250

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 3 commits into from
Feb 18, 2020

Conversation

rosen-vladimirov
Copy link
Contributor

@rosen-vladimirov rosen-vladimirov commented Feb 17, 2020

In case you have external files set in the webpack.config.js (or resources copied with CopyWebpackPlugin), the tns run ... command does not LiveSync them to device. Webpack compilation is triggered, but as the emitted files are not hot updates, the hot update hash of the compilation is the same as the previous one. In this case CLI decides there's nothing to sync.
To fix this extend the check in webpack-compiler-service to be based not only on the comparison between previous and current hash, but on the emitted files as well - if there are files which are not hot updates, continue the execution even if the previous and current hash are the same. That's exactly the case with externals.

PR Checklist

What is the current behavior?

What is the new behavior?

Fixes issue #5251

NOTE: Current changes may cause regression for issues described in #5105 They should be checked as well.

@rosen-vladimirov rosen-vladimirov self-assigned this Feb 17, 2020
@cla-bot cla-bot bot added the cla: yes label Feb 17, 2020
@rosen-vladimirov
Copy link
Contributor Author

test cli-smoke cli-run cli-templates cli-preview

In case you have external files set in the webpack.config.js (or resources copied with CopyWebpackPlugin), the `tns run ...` command does not LiveSync them to device. Webpack compilation is triggered, but as the emitted files are not hot updates, the hot update hash of the compilation is the same as the previous one. In this case CLI decides there's nothing to sync.
To fix this extend the check in webpack-compiler-service to be based not only on the comparison between previous and current hash, but on the emitted files as well - if there are files which are not hot updates, continue the execution even if the previous and current hash are the same. That's exactly the case with externals.
@rosen-vladimirov rosen-vladimirov force-pushed the vladimirov/fix-livesync-externals branch from 7f3443f to a9e1cf0 Compare February 17, 2020 11:55
@rosen-vladimirov
Copy link
Contributor Author

test cli-smoke cli-run cli-templates cli-preview

@rosen-vladimirov rosen-vladimirov merged commit 687dde2 into release Feb 18, 2020
@rosen-vladimirov rosen-vladimirov deleted the vladimirov/fix-livesync-externals branch February 18, 2020 13:25
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