Skip to content

Commit 85e1ad6

Browse files
committed
Updates from Mon 6 Apr
- [ReactNative] Revert D1965911 | Christopher Chedeau - [ReactNative] Remove experimental Portal only needed for android right now. | Spencer Ahrens - [ReactNative] rename Animation to AnimationExperimental with warning docs | Spencer Ahrens - navigator.getCurrentRoutes() | Eric Vicenti - Fixing jsdoc parsing of functions that are defined over multiple lines (Fixes facebook#410) | Christopher Chedeau - Added constraint of child type to touchablewithoutfeedback | Christopher Chedeau - [react-packager] Deprecate global image namespace in favor of CommonJS resolution | Amjad Masad - [react-packager] Don't cache rejected promise | Amjad Masad - [ReactNative] Start Navigator gesture config, disable gesture in AdsManager | Eric Vicenti - [Flow] Clean react-native-github for Flow v0.8.0 | Gabe Levi - add maximumValue and minimumValue as valid attributes for native Slider | Christopher Chedeau - react-packager: Add ES6 import statement support to DependencyGraph. | Amjad Masad - Remove false annotation | Christopher Chedeau - [madman] prevent pulling the content down inconsistently when the keyboard shows up | Kevin Gozali - add @flow back to View.js | Basil Hosmer - [ReactNative] Turn of lint warning for constant conditions | Eric Vicenti - [UIExplorer] Fixed 'Push View Example' in NavigatorIOS example | Christopher Chedeau - SliderIOS.js comments - grammar correction | Christopher Chedeau
1 parent 12698ed commit 85e1ad6

File tree

32 files changed

+965
-463
lines changed

32 files changed

+965
-463
lines changed

.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"rules": {
3838
"no-cond-assign": 1, // disallow assignment in conditional expressions
3939
"no-console": 0, // disallow use of console (off by default in the node environment)
40-
"no-constant-condition": 1, // disallow use of constant expressions in conditions
40+
"no-constant-condition": 0, // disallow use of constant expressions in conditions
4141
"no-comma-dangle": 0, // disallow trailing commas in object literals
4242
"no-control-regex": 1, // disallow control characters in regular expressions
4343
"no-debugger": 1, // disallow use of debugger

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() {

Examples/UIExplorer/Navigator/JumpingNavSample.js

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -52,26 +52,45 @@ var ROUTE_STACK = [
5252
var INIT_ROUTE_INDEX = 1;
5353

5454
class JumpingNavBar extends React.Component {
55+
constructor(props) {
56+
super(props);
57+
this.state = {
58+
tabIndex: props.initTabIndex,
59+
};
60+
}
61+
handleWillFocus(route) {
62+
var tabIndex = ROUTE_STACK.indexOf(route);
63+
this.setState({ tabIndex, });
64+
}
5565
render() {
5666
return (
5767
<View style={styles.tabs}>
5868
<TabBarIOS>
5969
<TabBarIOS.Item
6070
icon={require('image!tabnav_notification')}
61-
selected={this.props.tabIndex === 0}
62-
onPress={() => { this.props.onTabIndex(0); }}>
71+
selected={this.state.tabIndex === 0}
72+
onPress={() => {
73+
this.props.onTabIndex(0);
74+
this.setState({ tabIndex: 0, });
75+
}}>
6376
<View />
6477
</TabBarIOS.Item>
6578
<TabBarIOS.Item
6679
icon={require('image!tabnav_list')}
67-
selected={this.props.tabIndex === 1}
68-
onPress={() => { this.props.onTabIndex(1); }}>
80+
selected={this.state.tabIndex === 1}
81+
onPress={() => {
82+
this.props.onTabIndex(1);
83+
this.setState({ tabIndex: 1, });
84+
}}>
6985
<View />
7086
</TabBarIOS.Item>
7187
<TabBarIOS.Item
7288
icon={require('image!tabnav_settings')}
73-
selected={this.props.tabIndex === 2}
74-
onPress={() => { this.props.onTabIndex(2); }}>
89+
selected={this.state.tabIndex === 2}
90+
onPress={() => {
91+
this.props.onTabIndex(2);
92+
this.setState({ tabIndex: 2, });
93+
}}>
7594
<View />
7695
</TabBarIOS.Item>
7796
</TabBarIOS>
@@ -81,12 +100,6 @@ class JumpingNavBar extends React.Component {
81100
}
82101

83102
var JumpingNavSample = React.createClass({
84-
getInitialState: function() {
85-
return {
86-
tabIndex: INIT_ROUTE_INDEX,
87-
};
88-
},
89-
90103
render: function() {
91104
return (
92105
<Navigator
@@ -98,23 +111,19 @@ var JumpingNavSample = React.createClass({
98111
initialRoute={ROUTE_STACK[INIT_ROUTE_INDEX]}
99112
initialRouteStack={ROUTE_STACK}
100113
renderScene={this.renderScene}
114+
configureScene={() => ({
115+
...Navigator.SceneConfigs.HorizontalSwipeJump,
116+
})}
101117
navigationBar={
102118
<JumpingNavBar
119+
ref={(navBar) => { this.navBar = navBar; }}
120+
initTabIndex={INIT_ROUTE_INDEX}
103121
routeStack={ROUTE_STACK}
104-
tabIndex={this.state.tabIndex}
105122
onTabIndex={(index) => {
106-
this.setState({ tabIndex: index }, () => {
107-
this._navigator.jumpTo(ROUTE_STACK[index]);
108-
});
123+
this._navigator.jumpTo(ROUTE_STACK[index]);
109124
}}
110125
/>
111126
}
112-
onWillFocus={(route) => {
113-
this.setState({
114-
tabIndex: ROUTE_STACK.indexOf(route),
115-
});
116-
}}
117-
shouldJumpOnBackstackPop={true}
118127
/>
119128
);
120129
},

Examples/UIExplorer/NavigatorIOSExample.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
var React = require('react-native');
1919
var ViewExample = require('./ViewExample');
20+
var createExamplePage = require('./createExamplePage');
2021
var {
2122
PixelRatio,
2223
ScrollView,
@@ -77,7 +78,7 @@ var NavigatorIOSExample = React.createClass({
7778
{this._renderRow('Push View Example', () => {
7879
this.props.navigator.push({
7980
title: 'Very Long Custom View Example Title',
80-
component: ViewExample,
81+
component: createExamplePage(null, ViewExample),
8182
});
8283
})}
8384
{this._renderRow('Custom Right Button', () => {

Examples/UIExplorer/ResponderExample.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ var NavigatorIOSExample = React.createClass({
3838
_previousLeft: 0,
3939
_previousTop: 0,
4040
_circleStyles: {},
41-
circle: (null : ?React.Element),
41+
circle: (null : ?{ setNativeProps(props: Object): void }),
4242

4343
componentWillMount: function() {
4444
this._panResponder = PanResponder.create({

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;

0 commit comments

Comments
 (0)