Updates Thu, 25 Jun

This commit is contained in:
Alex Kotliarskyi
2015-06-25 09:37:02 -07:00
39 changed files with 1814 additions and 1477 deletions

View File

@@ -7,8 +7,6 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import <AdSupport/ASIdentifierManager.h>
#import "RCTBridgeModule.h"
@interface RCTAdSupport : NSObject <RCTBridgeModule>

View File

@@ -7,6 +7,8 @@
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import <AdSupport/ASIdentifierManager.h>
#import "RCTAdSupport.h"
@implementation RCTAdSupport

View File

@@ -217,6 +217,11 @@ RCT_EXPORT_METHOD(startAnimation:(NSNumber *)reactTag
}
NSValue *fromValue = [view.layer.presentationLayer valueForKeyPath:keypath];
#if !CGFLOAT_IS_DOUBLE
if ([fromValue isKindOfClass:[NSNumber class]]) {
fromValue = [NSNumber numberWithFloat:[(NSNumber *)fromValue doubleValue]];
}
#endif
CGFloat fromFields[count];
[fromValue getValue:fromFields];

View File

@@ -50,6 +50,7 @@ var AndroidTextInputAttributes = {
multiline: true,
password: true,
placeholder: true,
placeholderTextColor: true,
text: true,
testID: true,
underlineColorAndroid: true,
@@ -514,6 +515,7 @@ var TextInput = React.createClass({
onLayout={this.props.onLayout}
password={this.props.password || this.props.secureTextEntry}
placeholder={this.props.placeholder}
placeholderTextColor={this.props.placeholderTextColor}
text={this.state.bufferedValue}
underlineColorAndroid={this.props.underlineColorAndroid}
children={children}

View File

@@ -0,0 +1,55 @@
/**
* Copyright (c) 2015-present, 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.
*
* Utility class to provide the component owner hierarchy to native code for
* debugging purposes.
*
* @providesModule RCTDebugComponentOwnership
* @flow
*/
'use strict';
var DebugComponentOwnershipModule = require('NativeModules').DebugComponentOwnershipModule;
var InspectorUtils = require('InspectorUtils');
var ReactNativeTagHandles = require('ReactNativeTagHandles');
function componentToString(component) {
return component.getName ? component.getName() : 'Unknown';
}
function getRootTagForTag(tag: number): ?number {
var rootNodeID = ReactNativeTagHandles.tagToRootNodeID[tag];
if (!rootNodeID) {
return null;
}
var rootID = ReactNativeTagHandles.getNativeTopRootIDFromNodeID(rootNodeID);
if (!rootID) {
return null;
}
return ReactNativeTagHandles.rootNodeIDToTag[rootID];
}
module.exports = {
/**
* Asynchronously returns the owner hierarchy as an array of strings. Request id is
* passed along to the native module so that the native module can identify the
* particular call instance.
*
* Example returned owner hierarchy: ['RootView', 'Dialog', 'TitleView', 'Text']
*/
getOwnerHierarchy: function(requestID: number, tag: number) {
var rootTag = getRootTagForTag(tag);
var instance = InspectorUtils.findInstanceByNativeTag(rootTag, tag);
var ownerHierarchy = instance ?
InspectorUtils.getOwnerHierarchy(instance).map(componentToString) :
null;
DebugComponentOwnershipModule.receiveOwnershipHierarchy(requestID, tag, ownerHierarchy);
},
};

View File

@@ -23,6 +23,7 @@
/* globals GLOBAL: true, window: true */
// Just to make sure the JS gets packaged up.
require('RCTDebugComponentOwnership');
require('RCTDeviceEventEmitter');
require('PerformanceLogger');

View File

@@ -285,7 +285,7 @@ RCT_EXPORT_MODULE()
}];
id<RCTURLRequestHandler> handler = [handlers lastObject];
if (!handler) {
RCTLogError(@"No suitable request handler found for %@", request);
RCTLogError(@"No suitable request handler found for %@", request.URL);
}
return handler;
}
@@ -322,6 +322,9 @@ RCT_EXPORT_MODULE()
NSURLRequest *request = [RCTConvert NSURLRequest:query[@"uri"]];
if (request) {
id<RCTURLRequestHandler> handler = [self handlerForRequest:request];
if (!handler) {
return;
}
(void)[[RCTDataLoader alloc] initWithRequest:request handler:handler callback:^(NSData *data, NSString *MIMEType, NSError *error) {
if (data) {
callback(nil, @{@"body": data, @"contentType": MIMEType});

View File

@@ -99,7 +99,14 @@ RCT_NOT_IMPLEMENTED(-init)
error = [[RCTRedBox sharedInstance] currentErrorMessage];
}
[rootView removeFromSuperview];
RCTAssert(vc.view.subviews.count == 0, @"There shouldn't be any other views: %@", vc.view);
NSArray *nonLayoutSubviews = [vc.view.subviews filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(id subview, NSDictionary *bindings) {
return ![NSStringFromClass([subview class]) isEqualToString:@"_UILayoutGuide"];
}]];
RCTAssert(nonLayoutSubviews.count == 0, @"There shouldn't be any other views: %@", nonLayoutSubviews);
vc.view = nil;
[[RCTRedBox sharedInstance] dismiss];
if (expectErrorBlock) {