-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
fix(plugin-vue): invalidate script module cache when it changed in hot update #11059
Conversation
@sapphi-red cc |
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.
Thanks! I think the code makes sense.
Would you add a test for this?
@@ -66,7 +66,7 @@ export async function handleHotUpdate( | |||
// binding metadata. However, when reloading the template alone the binding | |||
// metadata will not be available since the script part isn't loaded. | |||
// in this case, reuse the compiled script from previous descriptor. | |||
if (mainModule && !affectedModules.has(mainModule)) { | |||
if (mainModule && !scriptChanged) { |
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.
For reviewers: In the past, this part was like:
const scriptChanged = hasScriptChanged(prevDescriptor, descriptor)
if (scriptChanged) {
affectedModules.add(mainModule)
}
if (!isEqualBlock(descriptor.template, prevDescriptor.template)) {
if (!scriptChanged) {
7883fb2#diff-9fd57831c2dc5be7b6feb11f8f80bfeca59da8226fac808425dd5460fce7e380R51-R65
Done |
Description
fixes #11008
Additional context
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).