Created by: gaearon
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 do -
Only works if you have DevTools installed/enabled -
This is annoying https://github.com/facebookincubator/create-react-app/issues/1880 -
Editing after initial error should refresh -
Editing after compile error should still be hot -
Chrome sourcemaps don't update https://github.com/facebookincubator/create-react-app/issues/2407 -
TESTS -
"Click to source" breaks in overlay because after first edit, path looks like ./packages/react-scripts/template/src/Logo.js?989a:5
. Need to figure out where that?989a
comes from, it doesn't make sense (all edits after the first one get that name in Sources pane). Even changingdevtoolFallbackModuleFilenameTemplate
to repeatdevtoolModuleFilenameTemplate
didn'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.