Skip to content

Commit 3a8ba2d

Browse files
committed
Merge pull request #83 from TechnologyAdvice/feature/upgrade-react-14
update to react 14
2 parents 184c11f + 1732ec6 commit 3a8ba2d

26 files changed

Lines changed: 13930 additions & 14844 deletions

File tree

dist/dependencies.js

Lines changed: 13841 additions & 14679 deletions
Large diffs are not rendered by default.

dist/stardust.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ return webpackJsonpstardust([1],{
265265
this.handleAbort = function () {
266266
// Promise is resolved, confirmation is false
267267
_this.deferred.resolve(false);
268+
// TODO: as of React 0.14, refs returns the DOM node, not the component, his may not work anymore
268269
_this.refs.modal.hideModal();
269270
};
270271

@@ -1059,7 +1060,7 @@ return webpackJsonpstardust([1],{
10591060
_get(Object.getPrototypeOf(Form.prototype), 'constructor', this).apply(this, arguments);
10601061

10611062
this.serializeJson = function () {
1062-
var form = _react2['default'].findDOMNode(_this.refs.form);
1063+
var form = _this.refs.form;
10631064
var json = {};
10641065

10651066
_lodash2['default'].each(['input', 'textarea', 'select'], function (tag) {
@@ -1533,7 +1534,7 @@ return webpackJsonpstardust([1],{
15331534
_createClass(Message, [{
15341535
key: 'componentDidMount',
15351536
value: function componentDidMount() {
1536-
this.messageElm = (0, _jquery2['default'])((0, _react.findDOMNode)(this.refs.message));
1537+
this.messageElm = (0, _jquery2['default'])(this.refs.message);
15371538
}
15381539
}, {
15391540
key: 'render',
@@ -2798,8 +2799,8 @@ return webpackJsonpstardust([1],{
27982799
_createClass(Checkbox, [{
27992800
key: 'componentDidMount',
28002801
value: function componentDidMount() {
2801-
this.container = (0, _jquery2['default'])(_react2['default'].findDOMNode(this.refs.container));
2802-
this.input = (0, _jquery2['default'])(_react2['default'].findDOMNode(this.refs.input));
2802+
this.container = (0, _jquery2['default'])(this.refs.container);
2803+
this.input = (0, _jquery2['default'])(this.refs.input);
28032804

28042805
this.container.checkbox({
28052806
onChange: this.props.onChange,
@@ -2942,7 +2943,7 @@ return webpackJsonpstardust([1],{
29422943
_createClass(Dropdown, [{
29432944
key: 'componentDidMount',
29442945
value: function componentDidMount() {
2945-
this.element = (0, _jquery2['default'])((0, _react.findDOMNode)(this.refs.select));
2946+
this.element = (0, _jquery2['default'])(this.refs.select);
29462947
this.element.dropdown();
29472948
}
29482949
}, {

docs/app/DocsApp.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import React, {Component, render} from 'react';
1+
import React, {Component} from 'react';
2+
import {render} from 'react-dom';
23
import stardust, {Grid, Column} from 'stardust';
34

45
import ComponentDoc from 'docs/app/Components/ComponentDoc/ComponentDoc';
@@ -30,4 +31,4 @@ class DocsApp extends Component {
3031
}
3132
}
3233

33-
render(<DocsApp />, document.body);
34+
render(<DocsApp />, document.getElementById('root'));

docs/app/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
</head>
2121
<body>
22+
<div id="root"></div>
2223
<script src="vendor.js"></script>
2324
<script src="app.js"></script>
2425
</body>

gulp/tasks/watch.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import paths from '../../paths';
1010
gulp.task('watch', 'watch and build docs', cb => {
1111
gulp.watch([paths.src + '/**/*.js'], [
1212
'build', // rebuild the library
13-
'generate-doc-json', // rebuild doc info
13+
'generate-docs-json', // rebuild doc info
1414
]);
15-
gulp.watch([paths.docsRoot + '/**/*.html'], ['build-doc-html']);
15+
gulp.watch([paths.docsRoot + '/**/*.html'], ['build-docs-html']);
1616
cb();
1717
});

karma.conf.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import paths from './paths';
22
import statConfig from './webpack-stats';
33
import friendlyFormatter from 'eslint-friendly-formatter';
44
import exitPlugin from './webpack-exit-plugin';
5+
import ENV from './ENV';
56

67
/**
78
* This config is for running tests on the command line and will fail on errors.
@@ -10,11 +11,9 @@ import exitPlugin from './webpack-exit-plugin';
1011
*/
1112
export default config => {
1213
config.set({
13-
browsers: [
14-
'PhantomJS'
15-
],
16-
singleRun: true,
17-
reporters: ['dots'],
14+
browsers: ['PhantomJS'],
15+
singleRun: !ENV.isDevelopment(),
16+
reporters: ['mocha'],
1817
files: [
1918
'./node_modules/phantomjs-polyfill/bind-polyfill.js',
2019
'./test/tests.bundle.js'
@@ -66,9 +65,9 @@ export default config => {
6665
stardust: `${paths.src}/index.js`,
6766
},
6867
},
69-
plugins: [
70-
exitPlugin
71-
],
68+
plugins: !ENV.isDevelopment()
69+
? [exitPlugin]
70+
: [],
7271
},
7372
webpackServer: {
7473
progress: false,

package.json

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,22 @@
2727
"url": "https://github.com/TechnologyAdvice/stardust/issues"
2828
},
2929
"homepage": "https://github.com/TechnologyAdvice/stardust#readme",
30+
"engines": {
31+
"node": "0.12.7",
32+
"npm": "3.3.5"
33+
},
3034
"dependencies": {
31-
"bluebird": "^2.10.2",
32-
"classnames": "^2.1.5",
33-
"jquery": "^2.1.4",
34-
"lodash": "^3.10.1",
35-
"react": "^0.13.3"
35+
"react-hot-loader": "^1.3.0",
36+
"watch": "^0.16.0",
37+
"webpack-dev-server": "^1.12.0"
3638
},
3739
"devDependencies": {
3840
"babel-core": "^5.8.25",
3941
"babel-eslint": "^4.1.3",
4042
"babel-loader": "^5.3.2",
43+
"bluebird": "^2.10.2",
4144
"chai": "^3.3.0",
45+
"classnames": "^2.1.5",
4246
"del": "^2.0.2",
4347
"doctrine": "^0.7.0",
4448
"eslint": "^1.5.1",
@@ -57,27 +61,31 @@
5761
"highlight.js": "^8.9.1",
5862
"imports-loader": "^0.6.4",
5963
"json-loader": "^0.5.3",
60-
"karma": "^0.13.10",
64+
"jquery": "^2.1.4",
65+
"karma": "^0.13.13",
66+
"karma-cli": "^0.1.1",
6167
"karma-mocha": "^0.2.0",
68+
"karma-mocha-reporter": "^1.1.1",
6269
"karma-phantomjs-launcher": "^0.2.1",
6370
"karma-sourcemap-loader": "^0.3.5",
6471
"karma-webpack": "^1.7.0",
72+
"lodash": "^3.10.1",
6573
"mocha": "^2.3.3",
6674
"mocha-loader": "^0.7.1",
6775
"phantomjs": "^1.9.18",
6876
"phantomjs-polyfill": "0.0.1",
6977
"pre-commit": "^1.1.2",
7078
"raw-loader": "^0.5.1",
79+
"react": "^0.14.0",
80+
"react-addons-test-utils": "^0.14.0",
7181
"react-docgen": "^2.2.0",
82+
"react-dom": "^0.14.0",
7283
"react-highlight": "^0.5.1",
73-
"react-hot-loader": "^1.3.0",
7484
"require-dir": "^0.3.0",
7585
"run-sequence": "^1.1.4",
7686
"sinon": "git://github.com/cjohansen/Sinon.JS#b672042043517b9f84e14ed0fb8265126168778a",
7787
"sinon-chai": "^2.8.0",
7888
"through2": "^2.0.0",
79-
"watch": "^0.16.0",
80-
"webpack": "^1.12.2",
81-
"webpack-dev-server": "^1.12.0"
89+
"webpack": "^1.12.2"
8290
}
8391
}

src/addons/Confirm/Confirm.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export default class Confirm extends Component {
3434
handleAbort = () => {
3535
// Promise is resolved, confirmation is false
3636
this.deferred.resolve(false);
37+
// TODO: as of React 0.14, refs returns the DOM node, not the component, his may not work anymore
3738
this.refs.modal.hideModal();
3839
};
3940

src/collections/Form/Form.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default class Form extends Component {
1010
};
1111

1212
serializeJson = () => {
13-
const form = React.findDOMNode(this.refs.form);
13+
const form = this.refs.form;
1414
const json = {};
1515

1616
_.each(['input', 'textarea', 'select'], (tag) => {

src/collections/Message/Message.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import _ from 'lodash';
2-
import React, {Component, findDOMNode, PropTypes} from 'react';
2+
import React, {Component, PropTypes} from 'react';
33
import classNames from 'classnames';
44
import $ from 'jquery';
55
import META from 'src/utils/Meta';
@@ -14,7 +14,7 @@ export default class Message extends Component {
1414
};
1515

1616
componentDidMount() {
17-
this.messageElm = $(findDOMNode(this.refs.message));
17+
this.messageElm = $(this.refs.message);
1818
}
1919

2020
handleDismiss = e => {

0 commit comments

Comments
 (0)