3 ms·
>For example, hot module replacement allows you to change a module and update the existing instance live. This is the juice within react-hot-loader and this is
by danabramov 12y ago
>For example, hot module replacement allows you to change a module and update the existing instance live. This is the juice within react-hot-loader and this is the kind of stuff we need to be building. You'll never look back after experiencing this.
I second this. (Disclaimer: I wrote React Hot Loader.)
Webpack's live reloading system is not browser-specific, does not depend on attaching debuggers or doing anything else invasive.
All it does is represent module cache as (id) -> (function) map and give you the tools to “handle” module updates, as if modules were Observables and you subscribed to “new versions” of them. If update is unhandled, it bubbles.
This is what allows Hot Module Replacement to work for React components, CSS and Markdown files, and even classes on backend.