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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently
hmr
for platform specific files in linked plugins work only in intervals of 60 seconds. This is due to the fact thatCachedInputFileSystem
ofwebpack
has a cache that is invalidated on every 60seconds. We usedExtaWatchPlugin
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
andcallbackUndelayed
. ThecallbackUndelayed
is executed on every file's change as we can see here. We override this callback and purge the file's cache oncallbackUndelayed
. This way we ensure the cache is invalided for the changed file andhmr
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].