-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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): set isSelfAccepting unless it is delayed #8898
Conversation
if (updates.length === 0) { | ||
debugHmr(colors.yellow(`no update happened `) + colors.dim(file)) | ||
return | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
@@ -356,7 +356,12 @@ export function importAnalysisPlugin(config: ResolvedConfig): Plugin { | |||
// its last updated timestamp to force the browser to fetch the most | |||
// 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.css
depends onindex.liquid
by tailwind.index.liquid
's hmr is not handled by anythingindex.liquid
The full reload was not happening because
isSelfAccepting
wasundefined
.This PR changes
isSelfAccepting
to be set unlessensureEntryFromUrl
is called fromimport-analysis
.The old behavior is to set
isSelfAccepting
ifisHTMLRequest(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
).