-
Notifications
You must be signed in to change notification settings - Fork 14.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable hot module replacement for React via react-hot-loader #5841
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5841 +/- ##
=========================================
- Coverage 63.73% 63.64% -0.1%
=========================================
Files 368 374 +6
Lines 23219 23252 +33
Branches 2600 2600
=========================================
Hits 14799 14799
- Misses 8405 8438 +33
Partials 15 15
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!!!
thanks for making the dev env better for everyone 🙏
Thank you! This one is ready to merge. |
LGTM. Well done! |
…5841) * Install react-hot-loader * enable react-hot-reload for Explore, Dashboard, Profile and Sqllab * enable hmr for welcome page * enable hmr for welcome page * enable react hot module replacement for addSlice * fix lint * fix Welcome test * remove eslint comment
…5841) * Install react-hot-loader * enable react-hot-reload for Explore, Dashboard, Profile and Sqllab * enable hmr for welcome page * enable hmr for welcome page * enable react hot module replacement for addSlice * fix lint * fix Welcome test * remove eslint comment
What were changed?
react-hot-loader
and configure it to work with babelindex.jsx
are renamed toApp.jsx
and exported as hot module.index.jsx
are thin shells that callsReactDOM.render
to render<App />
Why?
Hot module replacement for react will enable us to develop the UI faster because when we make changes, the page keeps UI state and only replace the UI code affected by the change instead of reloading the entire page.
For example, you open an SQL editor, look up a few schema, switch tabs. When you modify code for one button and save, everything stays the same. Only the button will be changed.
Reference
Installed based on instruction here
https://github.com/gaearon/react-hot-loader
From the instruction page
@williaster @graceguo-supercat @xtinec @conglei