Skip to content

Update to React 0.14 #365

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

Closed
wants to merge 1 commit into from
Closed
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
8 changes: 7 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,17 @@ namespace :react do
FileUtils.rm_f('vendor/react/.bower.json')
`bower install react`
assets_path = Pathname.new(File.dirname(__FILE__)).join('lib/assets/')
copy_react_asset('JSXTransformer.js', assets_path.join('javascripts/JSXTransformer.js'))
copy_react_asset('react.js', assets_path.join('react-source/development/react.js'))
copy_react_asset('react.min.js', assets_path.join('react-source/production/react.js'))
copy_react_asset('react-with-addons.js', assets_path.join('react-source/development-with-addons/react.js'))
copy_react_asset('react-with-addons.min.js', assets_path.join('react-source/production-with-addons/react.js'))

copy_react_asset('react-dom.js', assets_path.join('react-source/development/react-dom.js'))
copy_react_asset('react-dom.min.js', assets_path.join('react-source/production/react-dom.js'))
# Make sure it's also present when addons: true
copy_react_asset('react-dom.js', assets_path.join('react-source/development-with-addons/react-dom.js'))
copy_react_asset('react-dom.min.js', assets_path.join('react-source/production-with-addons/react-dom.js'))

end

def copy_react_asset(source, destination)
Expand Down
2 changes: 1 addition & 1 deletion VERSIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ You can control what version of React.js (and JSXTransformer) is used by `react-

| Gem | React.js |
|----------|----------|
| master | 0.13.3 |
| master | 0.14.0 |
| 1.3.1 | 0.13.3 |
| 1.3.0 | 0.13.3 |
| 1.2.0 | 0.13.3 |
Expand Down
4 changes: 2 additions & 2 deletions lib/assets/javascripts/react_ujs.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
var propsJson = node.getAttribute(window.ReactRailsUJS.PROPS_ATTR);
var props = propsJson && JSON.parse(propsJson);

React.render(React.createElement(constructor, props), node);
ReactDOM.render(React.createElement(constructor, props), node);
}
},

Expand All @@ -63,7 +63,7 @@
for (var i = 0; i < nodes.length; ++i) {
var node = nodes[i];

React.unmountComponentAtNode(node);
ReactDOM.unmountComponentAtNode(node);
}
}
};
Expand Down
42 changes: 42 additions & 0 deletions lib/assets/react-source/development-with-addons/react-dom.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/**
* ReactDOM v0.14.0
*
* Copyright 2013-2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
// Based off https://github.com/ForbesLindesay/umd/blob/master/template.js
;(function(f) {
// CommonJS
if (typeof exports === "object" && typeof module !== "undefined") {
module.exports = f(require('react'));

// RequireJS
} else if (typeof define === "function" && define.amd) {
define(['react'], f);

// <script>
} else {
var g
if (typeof window !== "undefined") {
g = window;
} else if (typeof global !== "undefined") {
g = global;
} else if (typeof self !== "undefined") {
g = self;
} else {
// works providing we're not in "use strict";
// needed for Java 8 Nashorn
// see https://github.com/facebook/react/issues/3037
g = this;
}
g.ReactDOM = f(g.React);
}

})(function(React) {
return React.__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
});
Loading