refactor: HMR and webpack improvements#7462
Merged
Merged
Conversation
vchimev
reviewed
Jul 5, 2019
vchimev
reviewed
Jul 5, 2019
| @@ -35,7 +36,7 @@ export function convertString(value: any): any { | |||
| export function getModuleName(path: string): string { | |||
Contributor
There was a problem hiding this comment.
It looks like sanitizeModuleName() eliminates the need for getModuleName() - it is not used anymore and could be deleted.
Contributor
Author
There was a problem hiding this comment.
Yup - it was released "officially" in 5.4 though - do you think it's OK to remove it?
vchimev
approved these changes
Jul 5, 2019
f377963 to
fa56ad7
Compare
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
In this PR:
global.loadModule. Modules loaded from builder are loaded withglobal.loadModule(moduleName, true). This will make theglobal._isModuleLoadedForUI()function returntruefor this module. The webpack hot-loader inserts a check for each module and enables self-accept (module.hot.accept()) if this module was loaded form the builder. This means that all modules can be processed build-time by thehmr-loaderbut only those that were loaded (runtime) by the builder will be self-accepted and will trigger HMR logic.