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
Hey guys, does anyone understand how ES Module's HMR works under-the-hood (for example in Vite or React Fast Refresh)? i.e. How is it able to swap out a modified module at runtime?
Usually, every time you change a module, browser will refetch that module via HTTP.
But after that, how does the browser replace the old module, and have the new code take into effect?
It uses module versioning and dynamic imports to "reload" modules without deleting the module cache. The loaded content is then passed to import.meta.hot.accept for consumption.
Hey guys, does anyone understand how ES Module's HMR works under-the-hood (for example in Vite or React Fast Refresh)? i.e. How is it able to swap out a modified module at runtime?
Usually, every time you change a module, browser will refetch that module via HTTP.
But after that, how does the browser replace the old module, and have the new code take into effect?
The only thing I found is https://itnext.io/hot-reloading-native-es2015-modules-dc54cd8cca01, is this the solution we're taking?
The text was updated successfully, but these errors were encountered: