Skip to content

Conversation

@edison1105
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings December 10, 2025 08:02
@coderabbitai
Copy link

coderabbitai bot commented Dec 10, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch edison/hmr/switchMode

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

Size Report

Bundles

File Size Gzip Brotli
compiler-dom.global.prod.js 85.2 kB 29.9 kB 26.4 kB
runtime-dom.global.prod.js 108 kB (+8 B) 40.6 kB (+8 B) 36.6 kB (+99 B)
vue.global.prod.js 166 kB (+8 B) 60.5 kB (+22 B) 53.9 kB (+93 B)

Usages

Name Size Gzip Brotli
createApp (CAPI only) 48.2 kB (+12 B) 18.9 kB (+20 B) 17.3 kB (+7 B)
createApp 57.2 kB (+12 B) 22 kB (+9 B) 20.1 kB (+3 B)
createApp + vaporInteropPlugin 96.1 kB (+12 B) 35.5 kB (+22 B) 32 kB (+64 B)
createVaporApp 42.1 kB 15.5 kB 14.1 kB
createSSRApp 61.6 kB (+12 B) 23.8 kB (+14 B) 21.7 kB (+6 B)
defineCustomElement 63.3 kB (+12 B) 23.9 kB (+10 B) 21.8 kB (+8 B)
overall 71.9 kB (+8 B) 27.2 kB (+11 B) 24.9 kB (+39 B)

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 10, 2025

Open in StackBlitz

@vue/compiler-core

npm i https://pkg.pr.new/@vue/compiler-core@14187

@vue/compiler-dom

npm i https://pkg.pr.new/@vue/compiler-dom@14187

@vue/compiler-sfc

npm i https://pkg.pr.new/@vue/compiler-sfc@14187

@vue/compiler-ssr

npm i https://pkg.pr.new/@vue/compiler-ssr@14187

@vue/compiler-vapor

npm i https://pkg.pr.new/@vue/compiler-vapor@14187

@vue/reactivity

npm i https://pkg.pr.new/@vue/reactivity@14187

@vue/runtime-core

npm i https://pkg.pr.new/@vue/runtime-core@14187

@vue/runtime-dom

npm i https://pkg.pr.new/@vue/runtime-dom@14187

@vue/runtime-vapor

npm i https://pkg.pr.new/@vue/runtime-vapor@14187

@vue/server-renderer

npm i https://pkg.pr.new/@vue/server-renderer@14187

@vue/shared

npm i https://pkg.pr.new/@vue/shared@14187

vue

npm i https://pkg.pr.new/vue@14187

@vue/compat

npm i https://pkg.pr.new/@vue/compat@14187

commit: 945e438

@edison1105 edison1105 force-pushed the edison/hmr/switchMode branch from 4f4d13c to 9870a55 Compare December 10, 2025 08:03
Copy link

Copilot AI left a 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 hmrDirtyComponentsMode Map to track original vapor state of dirty components
  • Introduces isVaporComponent() helper function to check component vapor state with HMR awareness
  • Replaces direct __vapor property access with isVaporComponent() 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.

@edison1105 edison1105 changed the title fix(hmr): track original __vapor state of components during HMR reload fix(hmr): track original __vapor state during component mode switching Dec 10, 2025
@edison1105 edison1105 added the scope: vapor related to vapor mode label Dec 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: vapor related to vapor mode

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants