fix(hmr): set isSelfAccepting unless it is delayed#8898
fix(hmr): set isSelfAccepting unless it is delayed#8898patak-cat merged 1 commit intovitejs:mainfrom
Conversation
| if (updates.length === 0) { | ||
| debugHmr(colors.yellow(`no update happened `) + colors.dim(file)) | ||
| return | ||
| } |
There was a problem hiding this comment.
When updates was [] the config.logger.info below was outputing 22:42:33 [vite] .
✅ Deploy Preview for vite-docs-main ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
|
This is a lot safer, thanks Sapphi. @brillout, you may also want to review in case there is a regression here. |
|
Looks good 👍. I'll test it on vite-plugin-ssr's HMR test suite as soon as it's released. |
|
Released as v3.0.0-beta.6 @brillout |
|
HMR tests are still green with |
|
I really don't like the naming used here.. 😬 As I understand it, we are setting If so, maybe |
| // up-to-date version of this module. | ||
| try { | ||
| const depModule = await moduleGraph.ensureEntryFromUrl(url, ssr) | ||
| // delay setting `isSelfAccepting` until the file is actually used (#7870) |
There was a problem hiding this comment.
This comment is a little confusing. We should move it closer to what it's referencing (above the canSkipImportAnalysis call) and explain why it's necessary.
|
I think Maybe the parameter should be called |
👍 |
Exactly. |
|
@aleclarson PR refactoring from |
Description
In the following situation, a full reload should happen.
main.cssdepends onindex.liquidby tailwind.index.liquid's hmr is not handled by anythingindex.liquidThe full reload was not happening because
isSelfAcceptingwasundefined.This PR changes
isSelfAcceptingto be set unlessensureEntryFromUrlis called fromimport-analysis.The old behavior is to set
isSelfAcceptingifisHTMLRequest(url) || canSkipImportAnalysis(url)istrue.refs #7561 #7895 #7898
Additional context
Found while checking #8890.
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123).