|
| 1 | +# redux-undo-boilerplate |
| 2 | + |
| 3 | + [](https://travis-ci.org/omnidan/redux-undo-boilerplate) [](https://david-dm.org/omnidan/redux-undo-boilerplate) [](https://david-dm.org/omnidan/redux-undo-boilerplate#info=devDependencies) [](http://standardjs.com/) [](https://gratipay.com/omnidan/) |
| 4 | + |
| 5 | +_a magical boilerplate with [hot reloading](#what-happens-if-i-change-some-code) and [awesome error handling™](#what-happens-if-i-make-a-typo--syntax-error) that uses [webpack](https://github.com/webpack/webpack), [redux](https://github.com/rackt/redux), [react](https://github.com/facebook/react) and [redux-undo](https://github.com/omnidan/redux-undo)_ |
| 6 | + |
| 7 | + |
| 8 | +## Installation |
| 9 | + |
| 10 | +You need to have `npm` installed (it comes with [node.js](https://nodejs.org/)). |
| 11 | + |
| 12 | +```sh |
| 13 | +npm install |
| 14 | +``` |
| 15 | + |
| 16 | + |
| 17 | +## Running |
| 18 | + |
| 19 | +During development, run: |
| 20 | + |
| 21 | +```sh |
| 22 | +npm run dev |
| 23 | +``` |
| 24 | + |
| 25 | +Which enables some development tools. |
| 26 | + |
| 27 | +In production, run: |
| 28 | + |
| 29 | +```sh |
| 30 | +npm start |
| 31 | +``` |
| 32 | + |
| 33 | +These commands (unless configured otherwise) start a web server at: [http://localhost:3000](http://localhost:3000) |
| 34 | + |
| 35 | + |
| 36 | +## Demo |
| 37 | + |
| 38 | +[](https://i.imgur.com/M2KR4uo.gif) |
| 39 | + |
| 40 | +### What happens if I change some code? |
| 41 | + |
| 42 | +Save the file in your editor and immediately see the changes reflected in your |
| 43 | +browser - coding has never been more efficient. What a beautiful world we live |
| 44 | +in nowadays. |
| 45 | + |
| 46 | +[](http://i.imgur.com/VCxUA2b.gif) |
| 47 | + |
| 48 | +### What happens if I make a typo / syntax error? |
| 49 | + |
| 50 | +Many of us know this: You accidentally type in the wrong window once, add a |
| 51 | +random character to your code and when you run it again you're like "WTF this |
| 52 | +just worked?!" - let `webpack-hot-middleware` help you out with this: |
| 53 | + |
| 54 | +[](http://i.imgur.com/DTnGNFE.gif) |
| 55 | + |
| 56 | +### What happens if I mutate the state directly? |
| 57 | + |
| 58 | +Mutating the state directly causes lots of bugs with Redux. There are no |
| 59 | +immutables in JavaScript, so we can't make sure this doesn't happen unless we |
| 60 | +use something like [Immutable.js](https://facebook.github.io/immutable-js/). |
| 61 | + |
| 62 | +If you run this boilerplate in dev mode (`npm run dev`), it will tell you when |
| 63 | +you [mutate something directly](https://github.com/omnidan/redux-undo-boilerplate/blob/master/src/reducers/counter.js#L9): |
| 64 | + |
| 65 | +[](https://i.imgur.com/y02EDxc.png) |
| 66 | + |
| 67 | + |
| 68 | +## Testing |
| 69 | + |
| 70 | +```sh |
| 71 | +npm test |
| 72 | +``` |
| 73 | + |
| 74 | + |
| 75 | +## Thanks |
| 76 | + |
| 77 | +Special thanks to these awesome projects/people making this possible :heart: |
| 78 | + |
| 79 | + * [React](https://facebook.github.io/react/) |
| 80 | + * [Redux](https://rackt.github.io/redux/) |
| 81 | + * [Babel](https://babeljs.io/) - for ES6 support |
| 82 | + * [redux-boilerplate](https://github.com/chentsulin/redux-boilerplate) by [chentsulin](https://github.com/chentsulin) - this boilerplate is based off his project |
| 83 | + * [babel-plugin-react-transform](https://github.com/gaearon/babel-plugin-react-transform) by [gaearon](https://github.com/gaearon) - as a base for the hot reloading and error handling |
| 84 | + * [react-transform-catch-errors](https://github.com/gaearon/react-transform-catch-errors) by [gaearon](https://github.com/gaearon) - error handling |
| 85 | + * [react-transform-hmr](https://github.com/gaearon/react-transform-hmr) by [gaearon](https://github.com/gaearon) - hot reloading |
| 86 | + * [redux-devtools](https://github.com/gaearon/redux-devtools) by [gaearon](https://github.com/gaearon) |
| 87 | + * [redux-immutable-state-invariant](https://github.com/leoasis/redux-immutable-state-invariant) by [leoasis](https://github.com/leoasis) - detect state mutations |
| 88 | + |
| 89 | + |
| 90 | +## License |
| 91 | + |
| 92 | +redux-boilerplate: MIT © [C.T. Lin](https://github.com/chentsulin) |
| 93 | + |
| 94 | +redux-undo-boilerplate: MIT © [Daniel Bugl](https://github.com/omnidan) |
0 commit comments