4 ms·
Did you even read the docs for this project? In my opinion, this pulls together different tools that improve developer experience dramatically. For me personall
by peternicky 10y ago
Did you even read the docs for this project? In my opinion, this pulls together different tools that improve developer experience dramatically. For me personally, hot reloading is quite useful.
- juandazapata 10y agoHot reloading is not exclusive to react. Live reloading has been around for about a decade and is compatible with everything that renders to a web browser.
- peternicky 10y agoNot sure what your point is since I never claimed react invented hot reloading.
- morgante 10y ago> Live reloading has been around for about a decade and is compatible with everything that renders to a web browser. I have not seen any evidence of that being true. To be clear, React reloading doesn't reload the whole bundle. Only the specific module modified is updated and re-executed. It's a major improvement over normal reloading techniques which typically either reload the whole page or the whole bundle.
- gedy 10y agoWebpack hot module does this for any framework, and afaik is what react reloading is built on: http://webpack.github.io/docs/hot-module-replacement-with-webpack.html http://webpack.github.io/docs/hot-module-replacement-with-we...
- juandazapata 10y agoThat feature must be super useful for a static website generator.
- spdustin 10y agoWhat you're calling a module is, in a static site, a page or (maybe) a partial. Livereloading the HTML isn't an expensive operation, and while one might argue that, by shipping the whole page HTML, you're using a chainsaw when a scalpel would suffice, I would argue back: Chainsaws make short work of (DOM) trees when you're tearing it down wholesale and delivering a new one, but delicately carving out the part of the tree you want to replace and grafting on its replacement is, really, showboating, especially when you're talking about replacing 90% of the DOM tree (rough estimate of content vs. "chrome" as a percentage of the DOM tree) in one shot.
- morgante 10y ago> What you're calling a module is, in a static site, a page or (maybe) a partial. Maybe that's how you develop sites. I would decompose even a simple blog into at least half a dozen different components. First of all, I'm not making abstract arguments. I have direct experience with developing a static site using Jekyll vs. React. React with HMR is infinitely more pleasurable and faster. Being able to update the site instantly makes development very different. As I'm scrolling through the site, I notice that a pixel in the footer is off by a little bit. So I tweak the relevant CSS and it instantly updates in front of me. With a traditional static setup, I have to reload the whole page and wait for it to re-render. It's a difference of a few ms vs a second or more. You're also incorrectly assuming that tweaks would require reloading 90% of the DOM tree which is fundamentally wrong. I can decompose a static site into many small components and each one can be reloaded individually. Not to mention that if I make a CSS tweak it doesn't require reloading the DOM at all. Honestly, I have no vested interest in convincing you that hot module reloading is helpful for even the simplest of sites. Feel free to not use it. All I know is that having used both I will never go back.
- juandazapata 10y agoYour local development machine takes one second or more to reload a static html page? Oh wow.
- savolai 10y ago
- armandososa 10y agoHot reloading != live reloading. With hot reloading all your local state is saved after the code changes.
- cjjuice 10y agoYes, I read the docs on the project. How hard is it to hit cmd-R? Or install a browser extension that reloads every n seconds? Do we really need to add complexity for this? If it works for you, go for it! Call me lazy, but unless I can see a substantial, measurable increase to either the user or my experience without tradeoffs, I am not going to invest the time.
- ht85 10y agoLooking at your last sentence, I don't think you've developed a real project using hot reloading. When you're debugging an action that is behind several other steps (eg: scroll, click something, fill something, click something), hot reloading feels amazing compared to reloading and performing those steps over and over again (or emulating them by changing the code or pre-filling forms and having to cleanup after). It might not be impressive in terms of absolute time saved, but I know that for me the "wow this feels amazing" feeling of it makes me much more motivated, focused and productive.