You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Calling import.meta.hot.decline() clearly indicates that a change to the module should result in a full page reload.
What about a file that doesn't call any APIs on import.meta.hot?
Because HMR usually requires cooperation of the module to work, it seems like a module should by default behave as though it called import.meta.hot.decline(), so that changes to it result in a full page refresh.
The text was updated successfully, but these errors were encountered:
So what I've learned since starting this: the trickiest part of HMR is event bubbling. If a file changes, an "update" event is kicked off that starts to bubble up your import graph. If the changed file itself has an accept handler, then great! That handler gets called, and the update is complete.
If the changed file doesn't have an accept handler, then that update event bubbles up to all of changed files dependents. And so on up the import graph until every update event as been accepted, or one event has bubbled up past a root node (no imports) unhandled, in which case a full page reload is triggered.
decline() is a way to tell the HMR client: if I ever get hit with an update event (due to this file changing or an event bubbling up to this file) then stop with the bubbling logic and just reload the whole page.
Calling import.meta.hot.decline() clearly indicates that a change to the module should result in a full page reload.
What about a file that doesn't call any APIs on import.meta.hot?
Because HMR usually requires cooperation of the module to work, it seems like a module should by default behave as though it called
import.meta.hot.decline()
, so that changes to it result in a full page refresh.The text was updated successfully, but these errors were encountered: