Skip to content
This repository was archived by the owner on Nov 3, 2021. It is now read-only.

Commit cce5f34

Browse files
committed
Merge pull request #27 from twitter-fabric/react-0.14
Updates to React 0.14
2 parents ac502a9 + ad6544f commit cce5f34

7 files changed

+34
-13
lines changed

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
### v1.1.0 (2015-10-08):
2+
3+
Updated peerDependencies and requires to React 0.14.
4+
5+
If you need to work with React 0.13, use v1.0.1.
6+
7+
Special thanks to @jmfurlott for help updating everything that needed updating.
8+
19
### v1.0.1 (2015-10-05):
210

311
#### Bug fixes

README.md

+8-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
Read our [announcement blog post](https://fabric.io/blog/introducing-the-velocityreact-library) for
77
details about why and how we built this.
88

9-
**Latest version:** 1.0.1 shims out Velocity to be compatible with server-side rendering
9+
**Latest version:** 1.1.0 is updated to require React 0.14
1010

1111
## Running the demo
1212

@@ -36,8 +36,8 @@ utilities, are distributed as ES5-compatible JavaScript files with [CommonJS](ht
3636
This package depends directly on Velocity, as well as [lodash](https://lodash.com/) for a handful
3737
of utility functions (which are required individually to try and keep bundle size down).
3838

39-
It is assumed that your application already depends on React 0.13. Support for React 0.14
40-
release candidates is coming soon.
39+
It is assumed that your application already depends on `react` and `react-dom` at v0.14. If you're
40+
still at React 0.13, use v1.0.1 of this package. Other than dependencies, it is the same as v1.1.0.
4141

4242
## Usage
4343

@@ -146,6 +146,11 @@ You will need to manually register the UI Pack with the global Velocity in your
146146
require('velocity-animate/velocity.ui');
147147
```
148148

149+
If, even with the above statements, you see errors like `Velocity: First argument
150+
(transition.shrinkIn) was not a property map, a known action, or a registered redirect. Aborting.`
151+
it is likely that there are 2 copies of `velocity-animate` in your `node_modules`. Use `npm dedupe`
152+
to collapse them down to one.
153+
149154
See: http://julian.com/research/velocity/#uiPack
150155

151156
### Server-side rendering

demo/app.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
var React = require('react');
2+
var ReactDOM = require('react-dom');
23
var MainComponent = require('./main');
34

4-
React.render(React.createElement(MainComponent), document.body);
5+
ReactDOM.render(React.createElement(MainComponent), document.getElementById('app'));

demo/index.html

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
</head>
3232

3333
<body>
34+
<div id="app"></div>
3435
<script type="text/javascript" src="bundle.js" charset="utf-8"></script>
3536
</body>
3637
</html>

package.json

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "velocity-react",
3-
"version": "1.0.1",
3+
"version": "1.1.0",
44
"description": "React components to wrap Velocity animations",
55
"main": "index.js",
66
"scripts": {
@@ -23,16 +23,19 @@
2323
"homepage": "https://github.com/crashlytics/velocity-react#readme",
2424
"dependencies": {
2525
"lodash": "^3.10.1",
26+
"react-addons-transition-group": "^0.14.0",
2627
"velocity-animate": "^1.2.3"
2728
},
2829
"peerDependencies": {
29-
"react": "^0.13.0"
30+
"react": "^0.14.0",
31+
"react-dom": "^0.14.0"
3032
},
3133
"devDependencies": {
3234
"babel-core": "^5.8.25",
3335
"babel-loader": "^5.3.2",
3436
"css-loader": "^0.19.0",
35-
"react": "^0.13.3",
37+
"react": "^0.14.0",
38+
"react-dom": "^0.14.0",
3639
"react-hot-loader": "^1.2.9",
3740
"react-tween-state": "^0.1.3",
3841
"style-loader": "^0.12.3",

velocity-component.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ var _ = {
3939
omit: require('lodash/object/omit'),
4040
};
4141
var React = require('react');
42+
var ReactDOM = require('react-dom');
4243
var Velocity = require('./lib/velocity-animate-shim');
4344

4445
var VelocityComponent = React.createClass({
@@ -122,7 +123,7 @@ var VelocityComponent = React.createClass({
122123
// because of difficulty in tracking what animations are currently being animated, due to both
123124
// chained animations and the need to be able to "stop" an animation before it begins.)
124125
_getDOMTarget: function () {
125-
var node = React.findDOMNode(this);
126+
var node = ReactDOM.findDOMNode(this);
126127

127128
if (this.props.targetQuerySelector === 'children') {
128129
return node.children;

velocity-transition-group.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ var _ = {
3939
omit: require('lodash/object/omit'),
4040
pluck: require('lodash/collection/pluck'),
4141
};
42-
var React = require('react/addons');
42+
var React = require('react');
43+
var ReactDOM = require('react-dom');
44+
var ReactTransitionGroup = require('react-addons-transition-group');
4345
var Velocity = require('./lib/velocity-animate-shim');
4446

4547
// Internal wrapper for the transitioned elements. Delegates all child lifecycle events to the
@@ -55,15 +57,15 @@ var VelocityTransitionGroupChild = React.createClass({
5557
},
5658

5759
componentWillAppear: function (doneFn) {
58-
this.props.willAppearFunc(React.findDOMNode(this), doneFn);
60+
this.props.willAppearFunc(ReactDOM.findDOMNode(this), doneFn);
5961
},
6062

6163
componentWillEnter: function (doneFn) {
62-
this.props.willEnterFunc(React.findDOMNode(this), doneFn);
64+
this.props.willEnterFunc(ReactDOM.findDOMNode(this), doneFn);
6365
},
6466

6567
componentWillLeave: function (doneFn) {
66-
this.props.willLeaveFunc(React.findDOMNode(this), doneFn);
68+
this.props.willLeaveFunc(ReactDOM.findDOMNode(this), doneFn);
6769
},
6870

6971
render: function () {
@@ -114,7 +116,7 @@ var VelocityTransitionGroup = React.createClass({
114116
transitionGroupProps.childFactory = this._wrapChild;
115117
}
116118

117-
return React.createElement(React.addons.TransitionGroup, transitionGroupProps, this.props.children);
119+
return React.createElement(ReactTransitionGroup, transitionGroupProps, this.props.children);
118120
},
119121

120122
childWillAppear: function (node, doneFn) {

0 commit comments

Comments
 (0)