-
-
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: make addWatchFile()
work (fix #7024)
#9723
Conversation
Now edits to GLSL files will cause dev server to automatically update the page, as expected. Previously only worked for the GLSL files directly imported by JS. Done by patching dependencies; should try to get some version of these changes merged upstream. See vitejs/vite#9723
04f34cd
to
33938a3
Compare
addWatchFile()
workaddWatchFile()
work (fix #7024)
Rebased onto latest |
Co-authored-by: patak <matias.capeletto@gmail.com>
33938a3
to
ce2c9e3
Compare
Rebased again to verify that the fix is still necessary (the added test fails without) and that it still works. I think the failed tests are due to flakiness — different tests fail on the same commit in my fork. @patak-dev could you please take a look at this? I'm worried that this PR has missed the triage process due to lack of labels and wasn't sure how to reach out; apologies if this is already on the radar. Thanks! |
@zqianem thanks for the ping (and for the patience). Looks good to me 👍🏼 |
Co-authored-by: Matt Jones <mattjones701@gmail.com>
Description
fixes #7024 by ensuring
addWatchFile
adds files to the module graphAdditional context
The intention of db4ba56 was to allow plugins to add files to the module graph via
addWatchFile()
so that changes to those files would cause HMR updates. However, for files without any ES imports, the import analysis returns early and the files passed toaddWatchFile()
inthis._addedImports
are never added to the graph. Checking for the existence ofthis._addedImports
fixes this.Additionally, the new
forceSkipImportAnalysis
flag is needed to mark the newly created modules as not needing additional analysis so that the HMR update can propogate (see #8898).I could try to add the tests from #4461 if they are still relevant.Cherry-picked the test from #4461 and verified that it fails without 33938a3.What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).