Skip to content

Commit 37efee7

Browse files
committed
Update to React 0.14
Enable Babel optimisations for the production build
1 parent ec784b9 commit 37efee7

File tree

5 files changed

+14
-5
lines changed

5 files changed

+14
-5
lines changed

.babelrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@
2020
}]
2121
}
2222
}
23+
},
24+
"production": {
25+
"optional": [
26+
"optimisation.react.inlineElements",
27+
"optimisation.react.constantElements"
28+
]
2329
}
2430
}
2531
}

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-hn",
3-
"version": "1.2.1",
3+
"version": "1.3.0",
44
"description": "React-powered frontend for Hacker News using its Firebase API",
55
"author": "Jonny Buchanan",
66
"license": "MIT",
@@ -16,7 +16,8 @@
1616
"dependencies": {
1717
"events": "1.1.0",
1818
"firebase": "2.3.1",
19-
"react": "0.13.3",
19+
"react": "0.14.0",
20+
"react-dom": "0.14.0",
2021
"react-router": "1.0.0-rc1",
2122
"react-timeago": "2.2.1",
2223
"reactfire": "0.5.1",
@@ -39,6 +40,6 @@
3940
"redbox-react": "1.1.1",
4041
"webpack": "1.12.2",
4142
"webpack-dev-middleware": "1.2.0",
42-
"webpack-hot-middleware": "2.3.0"
43+
"webpack-hot-middleware": "2.4.1"
4344
}
4445
}

src/Settings.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var SettingsStore = require('./stores/SettingsStore')
44

55
var Settings = React.createClass({
66
componentDidMount() {
7-
this.refs.container.getDOMNode().focus()
7+
this.refs.container.focus()
88
},
99

1010
onChange(e) {

src/app.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
require('setimmediate')
22

33
var React = require('react')
4+
var ReactDOM = require('react-dom')
45
var {IndexRoute, Link, Route, Router} = require('react-router')
56

67
var StoryStore = require('./stores/StoryStore')
@@ -120,4 +121,4 @@ var routes = <Route path="/" component={App}>
120121
<Route path="*" component={NotFound}/>
121122
</Route>
122123

123-
React.render(<Router routes={routes}/>, document.getElementById('app'))
124+
ReactDOM.render(<Router routes={routes}/>, document.getElementById('app'))

webpack.production.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ module.exports = {
2424
'setimmediate',
2525
'events',
2626
'react',
27+
'react-dom',
2728
'react-router',
2829
'react-timeago',
2930
'firebase',

0 commit comments

Comments
 (0)