Skip to content

Commit

Permalink
2015-02-03 updates
Browse files Browse the repository at this point in the history
- Add back providesModule transform to JSAppServer | Joseph Savona
- [ReactKit] fix open source performance issue | John Harper
- [ReactKit] improve ReactIOSEventEmitter logics | Andrew Rasmussen
- [reactkit] fix web view JS executor and bind it to Command-d | John Harper
- Removed hardcoded RCTModuleIDs | Nick Lockwood
- [ReactKit] Animated GIF support | Alex Akers
- [ReactKit] Update RCTBridge to support non-`id` argument types | Alex Akers
- [reactkit] fix typo in RCTCopyProperty() change | John Harper
- [reactkit] fix shadow view crash on missing properties | John Harper
- [reactkit] fix transform keypath | John Harper
  • Loading branch information
vjeux committed Feb 4, 2015
1 parent ccd8f18 commit 6153fff
Show file tree
Hide file tree
Showing 46 changed files with 719 additions and 506 deletions.
16 changes: 13 additions & 3 deletions Examples/TicTacToe/TicTacToeApp.js
Expand Up @@ -9,6 +9,7 @@
var React = require('react-native');
var {
Bundler,
Image,
StyleSheet,
Text,
TouchableHighlight,
Expand Down Expand Up @@ -118,13 +119,22 @@ var Cell = React.createClass({
}
},

imageContents() {
switch (this.props.player) {
case 1:
return 'http://www.picgifs.com/alphabets/alphabets/children-5/alphabets-children-5-277623.gif';
case 2:
return 'http://www.picgifs.com/alphabets/alphabets/children-5/alphabets-children-5-730492.gif';
default:
return '';
}
},

render() {
return (
<TouchableHighlight onPress={this.props.onPress} underlayColor={'clear'} activeOpacity={0.5}>
<View style={[styles.cell, this.cellStyle()]}>
<Text style={[styles.cellText, this.textStyle()]}>
{this.textContents()}
</Text>
<Image source={{uri: this.imageContents()}} />
</View>
</TouchableHighlight>
);
Expand Down
16 changes: 12 additions & 4 deletions Libraries/ReactIOS/ReactIOSEventEmitter.js
Expand Up @@ -169,12 +169,20 @@ var ReactIOSEventEmitter = merge(ReactEventEmitterMixin, {
var target = nativeEvent.target;
if (target !== null && target !== undefined) {
if (target < ReactIOSTagHandles.tagsStartAt) {
// When we get multiple touches at the same time, only the first touch
// actually has a view attached to it. The rest of the touches do not.
// This is presumably because iOS doesn't want to send touch events to
// two views for a single multi touch. Therefore this warning is only
// appropriate when it happens to the first touch. (hence jj === 0)
if (__DEV__) {
warning(
false,
'A view is reporting that a touch occured on tag zero.'
);
if (jj === 0) {
warning(
false,
'A view is reporting that a touch occured on tag zero.'
);
}
}
continue;
} else {
rootNodeID = NodeHandle.getRootNodeID(target);
}
Expand Down
14 changes: 8 additions & 6 deletions Libraries/Utilities/createStrictShapeTypeChecker.js
Expand Up @@ -37,12 +37,14 @@ function createStrictShapeTypeChecker(shapeTypes) {
var allKeys = merge(props[propName], shapeTypes);
for (var key in allKeys) {
var checker = shapeTypes[key];
invariant(
checker,
`Invalid props.${propName} key \`${key}\` supplied to \`${componentName}\`.` +
`\nBad object: ` + JSON.stringify(props[propName], null, ' ') +
`\nValid keys: ` + JSON.stringify(Object.keys(shapeTypes), null, ' ')
);
if (!checker) {
invariant(
false,
`Invalid props.${propName} key \`${key}\` supplied to \`${componentName}\`.` +
`\nBad object: ` + JSON.stringify(props[propName], null, ' ') +
`\nValid keys: ` + JSON.stringify(Object.keys(shapeTypes), null, ' ')
);
}
var error = checker(propValue, key, componentName, location);
if (error) {
invariant(
Expand Down
5 changes: 2 additions & 3 deletions ReactKit/Base/RCTBridge.h
Expand Up @@ -33,10 +33,9 @@ static inline NSDictionary *RCTAPIErrorObject(NSString *msg)
*/
@interface RCTBridge : NSObject <RCTInvalidating>

- (instancetype)initWithJavaScriptExecutor:(id<RCTJavaScriptExecutor>)javaScriptExecutor
javaScriptModulesConfig:(NSDictionary *)javaScriptModulesConfig;
- (instancetype)initWithJavaScriptExecutor:(id<RCTJavaScriptExecutor>)javaScriptExecutor;

- (void)enqueueJSCall:(NSUInteger)moduleID methodID:(NSUInteger)methodID args:(NSArray *)args;
- (void)enqueueJSCall:(NSString *)moduleDotMethod args:(NSArray *)args;
- (void)enqueueApplicationScript:(NSString *)script url:(NSURL *)url onComplete:(RCTJavaScriptCompleteBlock)onComplete;

@property (nonatomic, readonly) RCTEventDispatcher *eventDispatcher;
Expand Down

0 comments on commit 6153fff

Please sign in to comment.