fix(hmr): track original __vapor state during component mode switching#14187
fix(hmr): track original __vapor state during component mode switching#14187edison1105 merged 2 commits intominorfrom
__vapor state during component mode switching#14187Conversation
|
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.
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.