Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to react v15.1.0 #1

Merged
merged 2 commits into from
Jun 24, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions home.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
lodash: '//cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash',
jquery: '//code.jquery.com/jquery-1.11.0.min',
firebase: '//cdn.firebase.com/js/client/2.0.5/firebase',
react: '//cdnjs.cloudflare.com/ajax/libs/react/0.13.3/react-with-addons',
react: '//cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react-with-addons',
'react-dom': '//cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react-dom',
//ace: '../ace-builds-1.1.8/src-min/ace',
fiddle: './fiddle',
text: 'libs/requirejs-plugins/text',
Expand All @@ -18,7 +19,8 @@
lodash: {exports: '_'},
firebase: {exports: 'Firebase'},
jquery: {exports: '$'},
react: {exports: 'React'}
react: {exports: 'React'},
'react-dom': {exports: 'ReactDOM'}
},
map: {
'*': {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@
"grunt-tape": "0.0.2",
"istanbul": "^0.4.3",
"json-loader": "^0.5.4",
"react": "^0.14.2",
"react-dom": "^0.14.2",
"react": "^15.1.0",
"react-dom": "^15.1.0",
"react-native": "^0.23.1",
"tape": "^4.5.1",
"webpack": "^1.13.0"
Expand Down
6 changes: 4 additions & 2 deletions playground.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
lodash: '//cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash',
jquery: '//code.jquery.com/jquery-2.1.4.min',
firebase: '//cdn.firebase.com/js/client/2.0.5/firebase',
react: '//cdnjs.cloudflare.com/ajax/libs/react/0.13.3/react-with-addons',
react: '//cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react-with-addons',
'react-dom': '//cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react-dom',
//ace: '../ace-builds-1.1.8/src-min/ace',
fiddle: './fiddle',
text: 'libs/requirejs-plugins/text',
Expand All @@ -18,7 +19,8 @@
lodash: {exports: '_'},
firebase: {exports: 'Firebase'},
jquery: {exports: '$'},
react: {exports: 'React'}
react: {exports: 'React'},
'react-dom': {exports: 'ReactDOM'}
},
map: {
'*': {
Expand Down
6 changes: 3 additions & 3 deletions playground/CodeMirrorEditor.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
define(['react', 'lodash', 'jquery', './libs/codemirror-4.8/lib/codemirror',
define(['react', 'react-dom', 'lodash', 'jquery', './libs/codemirror-4.8/lib/codemirror',
'./CMLint',
'./libs/codemirror-4.8/mode/javascript/javascript',
'./libs/codemirror-4.8/addon/hint/html-hint',
Expand All @@ -10,7 +10,7 @@ define(['react', 'lodash', 'jquery', './libs/codemirror-4.8/lib/codemirror',
//'./libs/codemirror-4.8/mode/css/css',
'./libs/codemirror-4.8/addon/runmode/runmode'
//'./libs/codemirror-4.8/addon/display/placeholder'
], function (React, _, $, CodeMirror, CMLint) {
], function (React, ReactDOM, _, $, CodeMirror, CMLint) {
'use strict';
//codeMirror: 'libs/codemirror-4.8/lib/codemirror',
//htmlmixed: 'libs/codemirror-4.8/mode/htmlmixed/htmlmixed',
Expand Down Expand Up @@ -134,7 +134,7 @@ define(['react', 'lodash', 'jquery', './libs/codemirror-4.8/lib/codemirror',
//options.lint = true;
}

this.editor = CodeMirror.fromTextArea(this.getDOMNode(), options);
this.editor = CodeMirror.fromTextArea(ReactDOM.findDOMNode(this), options);

if (!this.props.readOnly) {
this.editor.on('change', function (/*e*/) {
Expand Down
6 changes: 3 additions & 3 deletions playground/CodeMirrorViewer.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
define(['react', 'lodash', 'jquery', './libs/codemirror-4.8/lib/codemirror',
define(['react', 'react-dom', 'lodash', 'jquery', './libs/codemirror-4.8/lib/codemirror',
'./libs/codemirror-4.8/mode/javascript/javascript',
'./libs/codemirror-4.8/mode/xml/xml',
'./libs/codemirror-4.8/addon/runmode/runmode'
], function (React, _, $, CodeMirror) {
], function (React, ReactDOM, _, $, CodeMirror) {
'use strict';
return React.createClass({
displayName: 'CodeMirrorViewer',
Expand Down Expand Up @@ -37,7 +37,7 @@ define(['react', 'lodash', 'jquery', './libs/codemirror-4.8/lib/codemirror',
if (this.props.mode === 'html') {
mode = 'text/html';
}
this.editor = CodeMirror.runMode(value, mode, this.getDOMNode());
this.editor = CodeMirror.runMode(value, mode, ReactDOM.findDOMNode(this));
},
componentWillUnmount: function () {
this.editor.toTextArea();
Expand Down
10 changes: 6 additions & 4 deletions playground/fiddle-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ requirejs.config({
lodash: '//cdnjs.cloudflare.com/ajax/libs/lodash.js/3.10.0/lodash.min',
jquery: '//code.jquery.com/jquery-2.1.4.min',
firebase: '//cdn.firebase.com/js/client/2.0.5/firebase',
react: '//cdnjs.cloudflare.com/ajax/libs/react/0.13.3/react-with-addons',
react: '//cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react-with-addons',
'react-dom': '//cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react-dom',
fiddle: './fiddle',
text: 'libs/requirejs-plugins/text',
json: 'libs/requirejs-plugins/json',
Expand All @@ -13,15 +14,16 @@ requirejs.config({
lodash: {exports: '_'},
firebase: {exports: 'Firebase'},
jquery: {exports: '$'},
react: {exports: 'React'}
react: {exports: 'React'},
'react-dom': {exports: 'ReactDOM'}
},
map: {
'*': {'react/addons': 'react'}
}
});

requirejs(['fiddle', 'react', 'jquery', 'bootstrap'], function (fiddle, React) {
requirejs(['fiddle', 'react', 'react-dom', 'jquery', 'bootstrap'], function (fiddle, React, ReactDOM) {
'use strict';
var elem = React.createElement(fiddle);
window.fiddle = React.render(elem, document.getElementById('container'));
window.fiddle = ReactDOM.render(elem, document.getElementById('container'));
});
10 changes: 6 additions & 4 deletions playground/home-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ requirejs.config({
lodash: '//cdnjs.cloudflare.com/ajax/libs/lodash.js/3.10.0/lodash.min',
jquery: '//code.jquery.com/jquery-2.1.4.min',
firebase: 'https://cdn.firebase.com/js/client/2.0.5/firebase',
react: '//cdnjs.cloudflare.com/ajax/libs/react/0.13.3/react-with-addons',
react: '//cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react-with-addons',
'react-dom': '//cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react-dom',
text: 'libs/requirejs-plugins/text',
json: 'libs/requirejs-plugins/json'
//examples: './examples'
Expand All @@ -14,15 +15,16 @@ requirejs.config({
lodash: {exports: '_'},
firebase: {exports: 'Firebase'},
jquery: {exports: '$'},
react: {exports: 'React'}
react: {exports: 'React'},
'react-dom': {exports: 'ReactDOM'}
},
map: {
'*': {'react/addons': 'react'}
}
});

requirejs(['./examples', 'react', 'jquery'], function (Examples, React) {
requirejs(['./examples', 'react', 'react-dom', 'jquery'], function (Examples, React, ReactDOM) {
'use strict';
var elem = React.createElement(Examples);
React.render(elem, document.getElementById('home-section'));
ReactDOM.render(elem, document.getElementById('home-section'));
});
14 changes: 7 additions & 7 deletions playground/playground.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*eslint-env browser*/
define(['react', 'jquery', 'lodash', './playground-fiddle.rt', './playground.rt'], function (React, $, _, pgFiddleTemplate, playgroundTemplate) {
define(['react', 'react-dom', 'jquery', 'lodash', './playground-fiddle.rt', './playground.rt'], function (React, ReactDOM, $, _, pgFiddleTemplate, playgroundTemplate) {
'use strict';
//function emptyFunc() {
// return null;
Expand Down Expand Up @@ -171,20 +171,20 @@ define(['react', 'jquery', 'lodash', './playground-fiddle.rt', './playground.rt'
//this.sample = React.createFactory(React.createClass(classBase));
},
showError: function (e, editor) {
var mountNode = this.refs.mount.getDOMNode();
var mountNode = this.refs.mount;
this.setTimeout(function () {
showMessage(editor, e.message);
React.render(
ReactDOM.render(
React.createElement('div', {className: 'playground-error'}, e.toString()),
mountNode
);
}, 500);
},
showErrorAnnotation: function (annot, editor) {
var mountNode = this.refs.mount.getDOMNode();
var mountNode = this.refs.mount;
this.setTimeout(function () {
editor.annotate(annot);
React.render(
ReactDOM.render(
React.createElement('div', {className: 'playground-error'}, annot.message),
mountNode
);
Expand Down Expand Up @@ -233,9 +233,9 @@ define(['react', 'jquery', 'lodash', './playground-fiddle.rt', './playground.rt'
this.renderSample();
},
renderSample: function () {
var mountNode = this.refs.mount.getDOMNode();
var mountNode = this.refs.mount;
if (this.sample) {
React.render(this.sample, mountNode);
ReactDOM.render(this.sample, mountNode);
}
},
componentDidUpdate: function () {
Expand Down