Forgive me if the question is too subjective.
I do understand what it is. No need to explain that, please.
I just don't get why people find it useful. Same for live reload. The act of pressing CMD+R isn't something that takes time. If the actual refresh takes significant time, seems like one should just fix their dev environment.
I have a trust problem with such things. Seems too likely that they'll end up causing bugs. I fear that I'd spend an hour tracking down a bug only to find it was hot-module-reloading's fault. Or that everything is working in dev, but breaks in prod because prod isn't using hot-module-reloading and dev is. Perhaps this fear is misplaced.
I also find it tricky to know when the changes have taken effect. Seems simpler to just know that once you press CMR+R, your changes are there.
It's an efficiency thing. No matter how fast your dev environment is, when you press Refresh, it's going to take a second or two, since by definition things won't be coming from cache, and we're talking dev so there could be a bunch of HTTP requests that would be consolidated into a just a couple of HTTP requests in production. So if your workflow is save, switch to browser, hit refresh, you're sitting there for a couple of seconds. Every time.
With live-reload, hit save in your editor, and by the time you've switched over to your browser, the refresh is already completed or at least underway.
I was skeptical about the value of it until I started using it. Definitely noticed cycles were a little bit faster, sometimes markedly faster depending on what I changed and whether I flipped to the browser right away or not.
I haven't had trouble with it causing bugs. YMMV.
HMR relies on the maintaining of state. For a simple web app the reload may only take seconds. For a complex web app the steps required to get to a state may be long and complex, open to mistakes along the way. So you do your long list of steps, get to the bit you are testing and smack, a silly typo means you have to start over again. All that unnecessary repetitive work can be avoided, changing a job from hours to tens of minutes by using HMR. I have no problems trusting it for what it is designed to do.
You would never release without testing, and you would never test with HMR. HMR is for development, you only need to trust it to maintain a state while work through a module.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With