Proof of concept: simple hot reloading#2304
Proof of concept: simple hot reloading#2304gaearon wants to merge 19 commits intofacebook:masterfrom
Conversation
There was a problem hiding this comment.
This is simpler to do with "templates".
|
That looks nice! Did you have more time to work on it? |
|
@marcofugaro we're currently waiting on some browser bugs to be fixed. |
still waiting ? |
|
Could someone please explain how to get HMR (even though it may still be a bit buggy) |
We should not support it since by default it's an aggressive and flaky HMR handler. Where it says it can handle more file changes than it actually can. Developers usually learn not to trust it and refresh manually. It also breaks JS error handling in arrow functions: gaearon/react-proxy#76 After this change, HMR is still properly configured, including the module.hot api and client/server communications. By default JS changes refresh and CSS changes appear without refresh. For the future, we should monitor the progress of this PR: facebook/create-react-app#2304
|
Hopefully @aslushnikov will be able to updated on the source map bug in Chrome DevTools. Once thats fixed it should be ready to merge. |
|
@ro-savage: the fix for |
|
This is amazing, thank you @aslushnikov! We should start getting this up to date. |
|
Curious, is this working now? Happy to help if someone can please point me in the right direction. |
|
Hi @gaearon, any news regarding the hot reloading integration progress? |
|
There are things with higher priority that are currently being worked on and are blockers for v2. |
ff00a57 to
2d8eb24
Compare
|
@gaearon this still on track for this year? |
|
This pull request has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs. |
|
Please bot do not stale 🙏🤖 |
|
Fingers crossed 🤞 |
|
This is the most annoying to me "Editing after compile error should still be hot". |
|
Ok so I have something you can try. https://twitter.com/dan_abramov/status/1139876172903395329 https://twitter.com/dan_abramov/status/1139699841204809729 (But use 0.0.5 rather than 0.0.3) |
|
Closing in favour of #5958. |



Couldn't resist. Integrated with our error handling. (So errors cause refresh on next save.)
This would need a Babel transform, for now I just hardcoded what it would doOnly works if you have DevTools installed/enabled./packages/react-scripts/template/src/Logo.js?989a:5. Need to figure out where that?989acomes from, it doesn't make sense (all edits after the first one get that name in Sources pane). Even changingdevtoolFallbackModuleFilenameTemplateto repeatdevtoolModuleFilenameTemplatedidn't help: webpack still tries to give different source names to the same file on first reload.I only want to enable this for files that export a single functional component defined with JSX.
The goal is not to be comprehensive but to always work well, and create trust.