-
-
Notifications
You must be signed in to change notification settings - Fork 9k
fix(hmr): track original __vapor state during component mode switching
#14187
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
base: minor
Are you sure you want to change the base?
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
Size ReportBundles
Usages
|
@vue/compiler-core
@vue/compiler-dom
@vue/compiler-sfc
@vue/compiler-ssr
@vue/compiler-vapor
@vue/reactivity
@vue/runtime-core
@vue/runtime-dom
@vue/runtime-vapor
@vue/server-renderer
@vue/shared
vue
@vue/compat
commit: |
4f4d13c to
9870a55
Compare
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.
Pull request overview
This PR fixes an HMR bug where switching components between Vapor and VDOM modes caused incorrect behavior during unmount/move operations. The fix introduces a tracking mechanism to preserve the original __vapor state of components before they are mutated during HMR reload.
- Adds
hmrDirtyComponentsModeMap to track original vapor state of dirty components - Introduces
isVaporComponent()helper function to check component vapor state with HMR awareness - Replaces direct
__vaporproperty access withisVaporComponent()in operations on existing VNodes
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/runtime-core/src/hmr.ts | Adds hmrDirtyComponentsMode Map to track original __vapor state before mutation, populates it during component reload, and clears it post-update |
| packages/runtime-core/src/renderer.ts | Implements isVaporComponent() helper that checks the HMR tracking map during reload, and updates move, unmount, deactivate, and getNextHostNode functions to use it |
| packages/runtime-core/src/components/BaseTransition.ts | Updates recursiveGetSubtree and setTransitionHooks to use isVaporComponent() instead of direct __vapor access |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
__vapor state of components during HMR reload__vapor state during component mode switching
No description provided.