Skip to content
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

fix: handle HMR for Vue SFC with query parameters (fix #9341) #10794

Merged
merged 1 commit into from
Nov 15, 2022

Conversation

brillout
Copy link
Contributor

@brillout brillout commented Nov 5, 2022

Description

See #9341.

Additional context

Currently, HMR is broken for users using vite-plugin-ssr in SPA mode with Vue. Most users use vite-plugin-ssr in SSR mode but I expect the number of SPA users to increase.


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 Commit 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.

Copy link
Member

@haoqunjiang haoqunjiang left a comment

Choose a reason for hiding this comment

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

Looks good to me.
Not a perfectly elegant solution but I don't see any downsides.

@patak-dev
Copy link
Member

Let's merge this, but I think long term we should find a better solution.
@brillout if you would like, you can cherry-pick this one into the v3 branch. If not, it will be out in v4 alpha.3 soon

@patak-dev patak-dev merged commit 6462ab0 into vitejs:main Nov 15, 2022
@brillout
Copy link
Contributor Author

Yea, I agree, it's dirty. In principle, the cleanest would be to pick the module that doesn't have any query while ignoring the Vue SFC queries. But I'm not all too familiar with SFC's transformation.

While it's dirty, it does go into the right direction.

If not, it will be out in v4 alpha.3 soon

👍 That's good enough. It isn't urgent.

Thanks for merging.

@brillout brillout deleted the fix/vue-sfc-hmr branch September 18, 2024 08:14
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.

3 participants