Implement React hot loading
Closed this issue · 4 comments
As suggested by @muyaszed in #1. For more about hot loading see the React hot loader documentation.
Hi, I would like to put a note on what is being done here. Basically there are 2 item that were installed and configured.
- Webpack Hot Module replacement(HMR)
-
This was done by utilising Webpack-dev-server which will change how we build and run the webserver of the app.
-
HMR will automatically update the latest version of all component without refreshing the browser whenever any component is edited and save. However, if only using this, the any latest state will not be maintained whenever there is an update. To maintain the state we will require React Hot Loader.
- React Hot Loader
- This will eventually help to maintain any current states after HMR automatically update during any component changes. For this to work a new entry point is created.
The branch is ready for review and merge to the master #9
So as I understand it the hot loader allows preserving React state between updates. But is this for production as well or just during development?
I guess point 1 is just for development. If so, should we continue to use the old build process during production?
Yes, basically that is what it is and it is for development only. As for the build process I am not very sure on how react is build during production, let say using heroku for example. anyways, i think it should be fine if the old process is used.