Skip to content

Commit 620bfb6

Browse files
committed
[ReactNative] rename Animation to AnimationExperimental with warning docs
1 parent 8a8244a commit 620bfb6

10 files changed

Lines changed: 99 additions & 73 deletions

File tree

Examples/2048/2048.xcodeproj/project.pbxproj

Lines changed: 35 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,30 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10-
13ACB6741AC2117000FF4204 /* libRCTAnimation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 13ACB6711AC2113600FF4204 /* libRCTAnimation.a */; };
1110
13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
1211
13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; };
1312
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
1413
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
1514
1461632D1AC3E23900C2F5AD /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1461632C1AC3E22900C2F5AD /* libReact.a */; };
15+
58C1E40E1ACF54E9006D1A47 /* libRCTAnimationExperimental.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 58C1E40B1ACF54B4006D1A47 /* libRCTAnimationExperimental.a */; };
1616
832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; };
1717
/* End PBXBuildFile section */
1818

1919
/* Begin PBXContainerItemProxy section */
20-
13ACB6701AC2113600FF4204 /* PBXContainerItemProxy */ = {
21-
isa = PBXContainerItemProxy;
22-
containerPortal = 13ACB66C1AC2113500FF4204 /* RCTAnimation.xcodeproj */;
23-
proxyType = 2;
24-
remoteGlobalIDString = 134814201AA4EA6300B7C361;
25-
remoteInfo = RCTAnimation;
26-
};
2720
1461632B1AC3E22900C2F5AD /* PBXContainerItemProxy */ = {
2821
isa = PBXContainerItemProxy;
2922
containerPortal = 146163271AC3E22900C2F5AD /* React.xcodeproj */;
3023
proxyType = 2;
3124
remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192;
3225
remoteInfo = React;
3326
};
27+
58C1E40A1ACF54B4006D1A47 /* PBXContainerItemProxy */ = {
28+
isa = PBXContainerItemProxy;
29+
containerPortal = 13ACB66C1AC2113500FF4204 /* RCTAnimationExperimental.xcodeproj */;
30+
proxyType = 2;
31+
remoteGlobalIDString = 134814201AA4EA6300B7C361;
32+
remoteInfo = RCTAnimationExperimental;
33+
};
3434
832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */ = {
3535
isa = PBXContainerItemProxy;
3636
containerPortal = 832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */;
@@ -41,7 +41,7 @@
4141
/* End PBXContainerItemProxy section */
4242

4343
/* Begin PBXFileReference section */
44-
13ACB66C1AC2113500FF4204 /* RCTAnimation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAnimation.xcodeproj; path = ../../Libraries/Animation/RCTAnimation.xcodeproj; sourceTree = "<group>"; };
44+
13ACB66C1AC2113500FF4204 /* RCTAnimationExperimental.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAnimationExperimental.xcodeproj; path = ../../Libraries/Animation/RCTAnimationExperimental.xcodeproj; sourceTree = "<group>"; };
4545
13B07F961A680F5B00A75B9A /* 2048.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = 2048.app; sourceTree = BUILT_PRODUCTS_DIR; };
4646
13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = 2048/AppDelegate.h; sourceTree = "<group>"; };
4747
13B07FB01A68108700A75B9A /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppDelegate.m; path = 2048/AppDelegate.m; sourceTree = "<group>"; };
@@ -59,22 +59,14 @@
5959
buildActionMask = 2147483647;
6060
files = (
6161
1461632D1AC3E23900C2F5AD /* libReact.a in Frameworks */,
62-
13ACB6741AC2117000FF4204 /* libRCTAnimation.a in Frameworks */,
62+
58C1E40E1ACF54E9006D1A47 /* libRCTAnimationExperimental.a in Frameworks */,
6363
832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */,
6464
);
6565
runOnlyForDeploymentPostprocessing = 0;
6666
};
6767
/* End PBXFrameworksBuildPhase section */
6868

6969
/* Begin PBXGroup section */
70-
13ACB66D1AC2113500FF4204 /* Products */ = {
71-
isa = PBXGroup;
72-
children = (
73-
13ACB6711AC2113600FF4204 /* libRCTAnimation.a */,
74-
);
75-
name = Products;
76-
sourceTree = "<group>";
77-
};
7870
13B07FAE1A68108700A75B9A /* 2048 */ = {
7971
isa = PBXGroup;
8072
children = (
@@ -96,12 +88,20 @@
9688
name = Products;
9789
sourceTree = "<group>";
9890
};
91+
58C1E4071ACF54B4006D1A47 /* Products */ = {
92+
isa = PBXGroup;
93+
children = (
94+
58C1E40B1ACF54B4006D1A47 /* libRCTAnimationExperimental.a */,
95+
);
96+
name = Products;
97+
sourceTree = "<group>";
98+
};
9999
832341AE1AAA6A7D00B99B32 /* Libraries */ = {
100100
isa = PBXGroup;
101101
children = (
102102
146163271AC3E22900C2F5AD /* React.xcodeproj */,
103103
832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */,
104-
13ACB66C1AC2113500FF4204 /* RCTAnimation.xcodeproj */,
104+
13ACB66C1AC2113500FF4204 /* RCTAnimationExperimental.xcodeproj */,
105105
);
106106
name = Libraries;
107107
sourceTree = "<group>";
@@ -175,8 +175,8 @@
175175
projectDirPath = "";
176176
projectReferences = (
177177
{
178-
ProductGroup = 13ACB66D1AC2113500FF4204 /* Products */;
179-
ProjectRef = 13ACB66C1AC2113500FF4204 /* RCTAnimation.xcodeproj */;
178+
ProductGroup = 58C1E4071ACF54B4006D1A47 /* Products */;
179+
ProjectRef = 13ACB66C1AC2113500FF4204 /* RCTAnimationExperimental.xcodeproj */;
180180
},
181181
{
182182
ProductGroup = 832341B11AAA6A8300B99B32 /* Products */;
@@ -195,18 +195,18 @@
195195
/* End PBXProject section */
196196

197197
/* Begin PBXReferenceProxy section */
198-
13ACB6711AC2113600FF4204 /* libRCTAnimation.a */ = {
198+
1461632C1AC3E22900C2F5AD /* libReact.a */ = {
199199
isa = PBXReferenceProxy;
200200
fileType = archive.ar;
201-
path = libRCTAnimation.a;
202-
remoteRef = 13ACB6701AC2113600FF4204 /* PBXContainerItemProxy */;
201+
path = libReact.a;
202+
remoteRef = 1461632B1AC3E22900C2F5AD /* PBXContainerItemProxy */;
203203
sourceTree = BUILT_PRODUCTS_DIR;
204204
};
205-
1461632C1AC3E22900C2F5AD /* libReact.a */ = {
205+
58C1E40B1ACF54B4006D1A47 /* libRCTAnimationExperimental.a */ = {
206206
isa = PBXReferenceProxy;
207207
fileType = archive.ar;
208-
path = libReact.a;
209-
remoteRef = 1461632B1AC3E22900C2F5AD /* PBXContainerItemProxy */;
208+
path = libRCTAnimationExperimental.a;
209+
remoteRef = 58C1E40A1ACF54B4006D1A47 /* PBXContainerItemProxy */;
210210
sourceTree = BUILT_PRODUCTS_DIR;
211211
};
212212
832341B51AAA6A8300B99B32 /* libRCTText.a */ = {
@@ -266,6 +266,10 @@
266266
);
267267
INFOPLIST_FILE = "$(SRCROOT)/2048/Info.plist";
268268
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
269+
LIBRARY_SEARCH_PATHS = (
270+
"$(inherited)",
271+
"/Users/sahrens/src/fbobjc-hg/Libraries/FBReactKit/js/react-native-github/Libraries/Animation/build/Debug-iphoneos",
272+
);
269273
OTHER_LDFLAGS = "-ObjC";
270274
PRODUCT_NAME = 2048;
271275
};
@@ -282,6 +286,10 @@
282286
);
283287
INFOPLIST_FILE = "$(SRCROOT)/2048/Info.plist";
284288
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
289+
LIBRARY_SEARCH_PATHS = (
290+
"$(inherited)",
291+
"/Users/sahrens/src/fbobjc-hg/Libraries/FBReactKit/js/react-native-github/Libraries/Animation/build/Debug-iphoneos",
292+
);
285293
OTHER_LDFLAGS = "-ObjC";
286294
PRODUCT_NAME = 2048;
287295
};

Examples/2048/Game2048.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818

1919
var React = require('react-native');
2020
var {
21-
Animation,
2221
AppRegistry,
2322
StyleSheet,
2423
Text,
2524
View,
2625
} = React;
2726

27+
var AnimationExperimental = require('AnimationExperimental');
2828
var GameBoard = require('GameBoard');
2929
var TouchableBounce = require('TouchableBounce');
3030

@@ -77,17 +77,15 @@ class Tile extends React.Component {
7777
animationPosition(tile.toColumn()),
7878
animationPosition(tile.toRow()),
7979
];
80-
Animation.startAnimation(this.refs['this'], 100, 0, 'easeInOutQuad', {position: point});
80+
AnimationExperimental.startAnimation(this.refs['this'], 100, 0, 'easeInOutQuad', {position: point});
8181
}
8282

8383
return offset;
8484
}
8585

86+
8687
componentDidMount() {
87-
setTimeout(() => {
88-
Animation.startAnimation(this.refs['this'], 300, 0, 'easeInOutQuad', {scaleXY: [1, 1]});
89-
Animation.startAnimation(this.refs['this'], 100, 0, 'easeInOutQuad', {opacity: 1});
90-
}, 0);
88+
AnimationExperimental.startAnimation(this.refs['this'], 100, 0, 'easeInOutQuad', {opacity: 1});
9189
}
9290

9391
render() {

Libraries/Animation/Animation.js renamed to Libraries/Animation/AnimationExperimental.js

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,25 @@
66
* LICENSE file in the root directory of this source tree. An additional grant
77
* of patent rights can be found in the PATENTS file in the same directory.
88
*
9-
* @providesModule Animation
9+
* @providesModule AnimationExperimental
1010
* @flow
1111
*/
1212
'use strict';
1313

14-
var RCTAnimationManager = require('NativeModules').AnimationManager;
14+
var RCTAnimationManager = require('NativeModules').AnimationExperimentalManager;
1515
var AnimationUtils = require('AnimationUtils');
1616

1717
type EasingFunction = (t: number) => number;
1818

19-
var Animation = {
20-
Mixin: require('AnimationMixin'),
19+
/**
20+
* This is an experimental module that is under development, incomplete,
21+
* potentially buggy, not used in any production apps, and will probably change
22+
* in non-backward compatible ways.
23+
*
24+
* Use at your own risk.
25+
*/
26+
var AnimationExperimental = {
27+
Mixin: require('AnimationExperimentalMixin'),
2128

2229
startAnimation: function(
2330
node: any,
@@ -28,7 +35,14 @@ var Animation = {
2835
): number {
2936
var nodeHandle = +node.getNodeHandle();
3037
var easingSample = AnimationUtils.evaluateEasingFunction(duration, easing);
31-
var tag: number = RCTAnimationManager.startAnimation(nodeHandle, AnimationUtils.allocateTag(), duration, delay, easingSample, properties);
38+
var tag: number = RCTAnimationManager.startAnimation(
39+
nodeHandle,
40+
AnimationUtils.allocateTag(),
41+
duration,
42+
delay,
43+
easingSample,
44+
properties
45+
);
3246
return tag;
3347
},
3448

@@ -37,4 +51,4 @@ var Animation = {
3751
},
3852
};
3953

40-
module.exports = Animation;
54+
module.exports = AnimationExperimental;

Libraries/Animation/AnimationMixin.js renamed to Libraries/Animation/AnimationExperimentalMixin.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,26 @@
66
* LICENSE file in the root directory of this source tree. An additional grant
77
* of patent rights can be found in the PATENTS file in the same directory.
88
*
9-
* @providesModule AnimationMixin
9+
* @providesModule AnimationExperimentalMixin
1010
* @flow
1111
*/
1212
'use strict';
1313

1414
var AnimationUtils = require('AnimationUtils');
15-
var RCTAnimationManager = require('NativeModules').AnimationManager;
15+
var RCTAnimationManager = require('NativeModules').AnimationExperimentalManager;
1616

1717
var invariant = require('invariant');
1818

1919
type EasingFunction = (t: number) => number;
2020

21-
var AnimationMixin = {
21+
/**
22+
* This is an experimental module that is under development, incomplete,
23+
* potentially buggy, not used in any production apps, and will probably change
24+
* in non-backward compatible ways.
25+
*
26+
* Use at your own risk.
27+
*/
28+
var AnimationExperimentalMixin = {
2229
getInitialState: function(): Object {
2330
return {};
2431
},
@@ -48,4 +55,4 @@ var AnimationMixin = {
4855
},
4956
};
5057

51-
module.exports = AnimationMixin;
58+
module.exports = AnimationExperimentalMixin;

0 commit comments

Comments
 (0)