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(hmr): never invalidate an accepting importer #2457

Merged
merged 1 commit into from
Mar 15, 2021

Conversation

aleclarson
Copy link
Member

@aleclarson aleclarson commented Mar 10, 2021

A module that uses hot.accept for a dependency should not be invalidated when that dependency is hot-reloaded. Otherwise, the accepting module will be reloaded by its own importers (but only when an importer is reloaded), which is both unnecessary and unexpected.

This behavior led to a bug in a PR to vite-plugin-react-pages where HMR updates to a virtual module are merged intelligently to avoid a full page reload. vitejs/vite-plugin-react-pages#11

@yyx990803 yyx990803 merged commit 63bd250 into vitejs:main Mar 15, 2021
This was referenced Mar 15, 2021
@aleclarson aleclarson deleted the fix/hmr-invalidate branch June 24, 2021 23:57
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.

None yet

2 participants