Skip to content

Improve hmr development experience #617

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

libondev
Copy link

This plugin has been used in many of my projects and feels good, but the only problem is that I need to manually manage my hmr (import.meta.hot). This pr converts this operation to internal processing and provides a new createRouter method inside the vue-router/auto-routes module to simplify the problem of developers needing to manually manage hmr (internal processing occurs inside this function).

I don't know if this change is reasonable. I hope to get your correction opinion, because you are a professional in this regard. : )

… `createRouter`

NOTE: `handleHotUpdate` parameter is valid only when createRouter exported in `vue-router/auto-routes` is used.
Copy link
Owner

@posva posva left a comment

Choose a reason for hiding this comment

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

It could be great to automatically add the HMR code but createRouter must be imported from vue-router for everything to work well. Maybe a solution is to automatically add the HMR code like in vuejs/pinia#2954

@github-project-automation github-project-automation bot moved this from 🆕 New to 👀 In review in unplugin-vue-router Apr 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 👀 In review
Development

Successfully merging this pull request may close these issues.

2 participants