moduleGraph.invalidateModule() softInvalidate can be optimizing #15607
Labels
contribution welcome
feat: hmr
p3-minor-bug
An edge case that only affects very specific usage (priority)
Describe the bug
in sourcecode, importer's softInvalidate state are defined by importer.staticImportedUrls or current softInvalidate
but it fails sometimes, in next case app.vue imports a.ts
after first init vite program, app.vue moduleNode's staticImportedUrls containsa.ts(like /src/a.ts), when i change a.ts, it match a.ts moduleNode's url, so app.vue will softInvalidate itself, this is ok.
but after change app.vue, app.vue will load and transform its content, its moduleNode's staticImportedUrls contains a.ts with timestamps(like /src/a.ts?v=xxx), so next time i just change a.ts,
importer.staticImportedUrls?.has(mod.url)
will be false, app.vue will never softInvalidate itself.Reproduction
https://github.com/YellRes/soft-invalidate-fail
Steps to reproduce
run
pnpm run dev
System Info
Used Package Manager
pnpm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: