git ssb

1+

dinoworm ๐Ÿ› / catstack



Commit 82a40a4cb073f093a6a898da0a5394f59757ed59

hot reloading!

Michael Williams committed on 12/26/2015, 5:24:30 AM
Parent: ec8f9a99f86cc12ccc1b98d421015bf52931db07

Files changed

.babelrcchanged
app/containers/dev-root.jsadded
app/containers/root.jsdeleted
package.jsonchanged
.babelrcView
@@ -5,6 +5,22 @@
55 ],
66 "plugins": [
77 "transform-runtime",
88 "transform-object-rest-spread"
9- ]
9+ ],
10+ "env": {
11+ "hot": {
12+ "plugins": [
13+ ["react-transform", {
14+ "transforms": [{
15+ "transform": "react-transform-hmr",
16+ "imports": ["react"],
17+ "locals": ["module"]
18+ }, {
19+ "transform": "react-transform-catch-errors",
20+ "imports": ["react", "redbox-react"]
21+ }]
22+ }]
23+ ]
24+ }
25+ }
1026 }
app/containers/dev-root.jsView
@@ -1,0 +1,31 @@
1+const React = require('react')
2+const { Provider } = require('react-redux')
3+const { ReduxRouter } = require('redux-router')
4+
5+const routes = require('app/routes')
6+
7+if (process.env.NODE_ENV === 'development') {
8+ var DevTools = require('app/components/dev-tools')
9+}
10+
11+class Root extends React.Component {
12+ render() {
13+ const { store } = this.props;
14+
15+ return (
16+ <Provider store={store}>
17+ <div>
18+ <ReduxRouter>
19+ { routes }
20+ </ReduxRouter>
21+ {
22+ (process.env.NODE_ENV === 'development') ?
23+ <DevTools /> : null
24+ }
25+ </div>
26+ </Provider>
27+ )
28+ }
29+}
30+
31+module.exports = Root
app/containers/root.jsView
@@ -1,31 +1,0 @@
1-const React = require('react')
2-const { Provider } = require('react-redux')
3-const { ReduxRouter } = require('redux-router')
4-
5-const routes = require('app/routes')
6-
7-if (process.env.NODE_ENV === 'development') {
8- var DevTools = require('app/components/dev-tools')
9-}
10-
11-class Root extends React.Component {
12- render() {
13- const { store } = this.props;
14-
15- return (
16- <Provider store={store}>
17- <div>
18- <ReduxRouter>
19- { routes }
20- </ReduxRouter>
21- {
22- (process.env.NODE_ENV === 'development') ?
23- <DevTools /> : null
24- }
25- </div>
26- </Provider>
27- )
28- }
29-}
30-
31-module.exports = Root
package.jsonView
@@ -9,9 +9,9 @@
99 "format": "snazzy --format",
1010 "test": "npm-run-all -p test:*",
1111 "test:spec": "node spec",
1212 "test:feature": "node feature",
13- "dev:client": "watchify client -o assets/bundle.js -dv",
13+ "dev:client": "BABEL_ENV=hot watchify client -o assets/bundle.js -dv -p browserify-hmr",
1414 "dev:assets": "cpx \"app/assets/**/*\" assets -w",
1515 "dev:server": "node-dev server",
1616 "prod:client": "browserify client -o assets/bundle.js -g envify -g uglifyify",
1717 "prod:assets": "cpx \"app/assets/**/*\" assets",
@@ -46,11 +46,16 @@
4646 "node": "^4.0.0",
4747 "npm": "^3.0.0"
4848 },
4949 "devDependencies": {
50+ "babel-plugin-react-transform": "github:ahdinosaur/babel-plugin-react-transform#tjk/babel-6",
51+ "browserify-hmr": "^0.3.1",
5052 "cuke-tap": "^1.0.2",
5153 "jsdom": "^7.1.0",
5254 "node-dev": "^2.7.1",
55+ "react-transform-catch-errors": "^1.0.0",
56+ "react-transform-hmr": "^1.0.1",
57+ "redbox-react": "^1.2.0",
5358 "redux-devtools": "^3.0.0-beta-3",
5459 "redux-devtools-dock-monitor": "^1.0.0-beta-3",
5560 "redux-devtools-log-monitor": "^1.0.0-beta-3",
5661 "redux-logger": "^2.0.4",

Built with git-ssb-web