Skip to content

Conversation

@edison1105
Copy link
Member

Description

Additional context


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the PR Title Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 9, 2025

Open in StackBlitz

npm i https://pkg.pr.new/@vitejs/plugin-vue@714
npm i https://pkg.pr.new/@vitejs/plugin-vue-jsx@714

commit: c9e8df8

@edison1105 edison1105 changed the title fix(plugin-vue): ensure template-only components hmr correctly switch between vapor and vdom fix(hmr): reload when template-only components switch between vapor and vdom Dec 9, 2025
@edison1105 edison1105 changed the title fix(hmr): reload when template-only components switch between vapor and vdom fix(hmr): reload when components switch between vapor and vdom Dec 9, 2025
@edison1105 edison1105 marked this pull request as ready for review December 12, 2025 05:40
Copilot AI review requested due to automatic review settings December 12, 2025 05:40
@edison1105 edison1105 merged commit 6c45fe5 into main Dec 12, 2025
16 of 17 checks passed
@edison1105 edison1105 deleted the edison/fix/templateOnlyComponentHMR branch December 12, 2025 05:41
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 pull request fixes an HMR (Hot Module Replacement) issue by ensuring that Vue components fully reload when switching between vapor and vdom compilation modes, rather than attempting a hot update which could cause inconsistencies.

  • Adds a vapor mode check to hasScriptChanged function to detect mode transitions
  • Uses @ts-expect-error directive consistent with the codebase pattern for forward compatibility with Vue 3.6
  • Ensures components trigger a full reload when the vapor property changes between updates

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +299 to +300
// @ts-expect-error TODO remove when 3.6 is out
if (prev.vapor !== next.vapor) return true
Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new vapor mode detection logic lacks test coverage. While the playground has HMR tests for various scenarios, there are no tests verifying that the component reloads correctly when switching between vapor and vdom modes. Consider adding a test case that validates this behavior by toggling a component between vapor and non-vapor modes and verifying that HMR triggers a full reload rather than just a hot update.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants