-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
refactor: consolidate HMR code #19629
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
Conversation
CodSpeed Performance ReportMerging #19629 will degrade performances by 72.06%Comparing Summary
Benchmarks breakdown
|
@hai-x Weird codecov report... |
Template.getFunctionContent( | ||
require("../hmr/JavascriptHotModuleReplacement.runtime.js") | ||
) | ||
.replace(/\$key\$/g, "jsonp") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before we have jsonp
, now module
, is it expected change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it is just $key, so I think it is fine to change
/cc @xiaoxiaojx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. I think so.
@@ -407,7 +389,7 @@ class ModuleChunkLoadingRuntimeModule extends RuntimeModule { | |||
`var loadScript = ${runtimeTemplate.basicFunction( | |||
"url, onResolve, onReject", | |||
[ | |||
`return ${importFunctionName}(/* webpackIgnore: true */ url).then(onResolve).catch(onReject)` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove? If we try to bundle already bundled webpack without it will output an error/warning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. Thank you. I will revert it.
@hai-x let's rebase and we can merge |
What kind of change does this PR introduce?
Extract duplicate HMR logic into
helper
module.We currently rely on the
fetch
API to get the HMR manifest, limiting support to browser environments, so Improve the error message for better understanding.Did you add tests for your changes?
Existing
Does this PR introduce a breaking change?
No
What needs to be documented once your changes are merged?
Nothing