6 ms·
F5ing to refresh is a heavier workflow than the hot-reload/refresh you get with every modern web framework.
by CipherThrowaway 3y ago
F5ing to refresh is a heavier workflow than the hot-reload/refresh you get with every modern web framework.
- phist_mcgee 3y agoFor sure. Ever had to debug a bug deep inside of a webpage's code that relied on 5-10 preconditions to get it to appear? Without HMR, you're spending a lot of time F5ing and navigating to reproduce/fix it.
- loloquwowndueo 3y agoIf only there was a way to programmatically reproduce the conditions under which the problem appears and then exercise the behaviour that triggers the bug. Then some code could verify whether the problem still appears. Once the problem is fixed this same “test” dark magic could help ensure the problem does not occur again. Pipe dreams, my friends. Pipe dreams.
- sodapopcan 3y ago“That’s just not, like, how my brain works, man. I have a different development ‘style’, ok?”
- peteradio 3y agoWhy tempt us with such far out propositions?
- phist_mcgee 3y ago`git bisect` with an integration test suite of the backend running in a test environment can get you pretty close.
- pc86 3y agoThat seems completely unrelated to "have a unit test" which is what they're saying.
- loloquwowndueo 3y agoYeah I was being sarcastic :)
- satvikpendem 3y agoYou can add a test after debugging, no one's stopping you. But yes, it's annoying to debug some UI issue and having to set up an entire integration test for an issue you already know is there and can navigate much more easily via a mouse than via linking through HTML tag ids.
- Cthulhu_ 3y agoI had a tool that would automatically reload the page when files changed, it was great! But I get what you mean; reloading a page is fine for simple pages, anything bookmarkable, but there's heavy weight pages on the one side, and state on the other. With hot reload, we're currently developing a React Native app, we can e.g. type stuff in a form field, update code, and the stuff will still be there while the behaviour around it changed. It's neat. While I miss native iOS development a bit, I don't miss the recompile/relaunch cycles.
- wruza 3y agoFirst, HMR doesn’t magically put you into a specific program state. Second, you can still HMR any website, as it is a feature of a bundler, not a web framework.
- AgentME 3y agoHMR is a feature of bundlers but your frontend code has to specifically interface with it if you want JS changes to live-apply to a running page without losing state instead of refreshing the page. With React, you have to use react-refresh in order to have HMR support. Frameworks like NextJS configure react-refresh and the bundler's HMR features together for you.
- pier25 3y agoHMR etc is nice but if given the choice I'd rather refresh the page manually than deal with all the complexity of modern web dev.