Productive development with ReactJs.
How to boost developer’s efficiency and productivity? Boost development productivity with automating routine tasks and keep yourself from stupid mistakes. Make full use of Webpack/React hot reload, Redux dev tools, EsLint, git hooks, useful IDE plugins and CSS preprocessors.
11. Write code in text editor
Reload browser
Bring app to certain state
Iterate
12. Write code in text editor
Reload browser
Bring app to certain state
Iterate
13. Webpack
- Simple configuration
- CommonJS, AMD modules out or the box
- Loaders for anything (ES6, (S)CSS,
Fonts)
- Robust bundle management
- Webpack dev server
- Hot reload with webpack dev server
14. Babel
- Transforms ES6(7) code to ES5
- Robust
- Highly configurable
- Works well with webpack
- https://babeljs.io/
15. Webpack simple config
{
context: __dirname + "/app",
entry: "./index",
output: {
path: __dirname + "/dist",
filename: "bundle.js"
}
}
Starting point if the app
Output bundle
16. Webpack HMR
module: {
loaders: [
{ test: /.jsx?$/, loaders: ['react-hot', 'jsx?harmony'],
include: path.join(__dirname, 'src') }
]
},
plugins: [
new webpack.HotModuleReplacementPlugin()
]
Enable Hot reloader here
Jsx transpiler hereWebpack module
reloader here
17. React Hot Loader
Code changes
Hot Reloader
Proxy
Component A code
Component A new
code
18. React Hot Loader + Webpack HMR
Code changes
Hot Reloader
Proxy
Component A code
Component A new
code
Shipped by Webpack Hot Module
replacement