-
-
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): clean importers in module graph when file is deleted #14315
Conversation
Run & review this pull request in StackBlitz Codeflow. |
69c6f2e
to
fa8ed2a
Compare
'count is 2!', | ||
) | ||
|
||
// remove unused file, page reload because it's considered entry point now |
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.
would it be possible to avoid page reload or hmr when removing re-export.js
, ideally re-export.js
should be removed from moduleGraph
when replacing from './re-export.js'
with from './display.js'
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.
After investigation it seems unsafe to remove the entry when it has no importer left without knowing if the node was present before because it's referenced from the update module or maybe also from an html file.
fa8ed2a
to
3b0bcdd
Compare
3b0bcdd
to
40a4382
Compare
Before this PR, any update to
display.js
afterre-export.js
was deleted triggered a full page reload.Actually because we don't (or maybe we have?) an exhaustive list of modules considered as entrypoints, the current heuristic of
no impoters
->entrypoint
make the hmr 'buggy' (ie unneeded page reload) in other situations: