Skip to content

fix: HMR propagation of HTML changes (fix #7870)#7895

Merged
patak-cat merged 3 commits intovitejs:mainfrom
brillout:fix/hmr-html
Apr 25, 2022
Merged

fix: HMR propagation of HTML changes (fix #7870)#7895
patak-cat merged 3 commits intovitejs:mainfrom
brillout:fix/hmr-html

Conversation

@brillout
Copy link
Contributor

@brillout brillout commented Apr 25, 2022

Description

Fix HMR propogation when HTML file is edited.

Reading recommendation:

  1. The fix: brillout@a066d2c
  2. The test: brillout@e5cc7d2
  3. Little isomorphic refactor: brillout@a7793df

Additional context

close: #7870.

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.

@bluwy bluwy added feat: hmr p3-minor-bug An edge case that only affects very specific usage (priority) labels Apr 25, 2022
@patak-cat patak-cat merged commit 1f7855c into vitejs:main Apr 25, 2022
@patak-cat
Copy link
Member

Are there other cases we should also consider here? Is maybe the other way around safer? As only leave it undefined for JS?

@brillout
Copy link
Contributor Author

Good point.

We can even reuse the logic used by the importAnalysis transformer.

I went ahead and made a PR https://github.com/vitejs/vite/pull/7898/files.

But note that this, AFAICT, won't make a practical difference. I still think we should merge the new PR because it makes reasoning about the code simpler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat: hmr p3-minor-bug An edge case that only affects very specific usage (priority)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Live reload doesn't work with Tailwind

3 participants