Skip to content
This repository has been archived by the owner on Aug 7, 2021. It is now read-only.

fix: fix hmr for platform specific files in linked plugins #946

Merged
merged 3 commits into from
Jun 21, 2019

Conversation

Fatme
Copy link
Contributor

@Fatme Fatme commented Jun 21, 2019

Currently hmr for platform specific files in linked plugins work only in intervals of 60 seconds. This is due to the fact that CachedInputFileSystem of webpack has a cache that is invalidated on every 60seconds. We used ExtaWatchPlugin in order to add platform specific files to the webpack's compilation. This plugin doesn't follow symlinks and this led to the different problems when applying changes from platform specific files. So we decided to remove it and to override correctly watch's file system from webpack. We have a logic for overriding webpack's watchFileSystem but this logic doesn't work as it seems it is not compatible with webpack v4.0.

Currently compiler.watchFileSystem.watch has 2 callbacks - callback and callbackUndelayed. The callbackUndelayed is executed on every file's change as we can see here. We override this callback and purge the file's cache on callbackUndelayed. This way we ensure the cache is invalided for the changed file and hmr after that will work.

Rel to: #942

PR Checklist

What is the current behavior?

hmr doesn't work for platform specific files in linked plugins.

What is the new behavior?

hmr works for platform specific files in linked plugins.

Fixes/Implements/Closes #[Issue Number].

@cla-bot cla-bot bot added the cla: yes label Jun 21, 2019
@rosen-vladimirov rosen-vladimirov merged commit 9e8c921 into master Jun 21, 2019
@rosen-vladimirov rosen-vladimirov deleted the fatme/fix-hmr branch June 21, 2019 11:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants