Permalink
Browse files

Updates from Thu 9 Apr

- [React Native] Fix RCTText crashes | Alex Akers
- Ensure that NSLocationWhenInUseUsageDescription is set, throw error if not | Alex Kotliarskyi
- [ReactNative] fix exception handler method name | Spencer Ahrens
- [ReactNative] Re-configure horizontal swipe animations | Eric Vicenti
- [ReactNative] <Text>: apply the fontWeight correctly if fontFamily style is also present | Kevin Gozali
- [MAdMan] Dimensions.get('window') considered harmful | Philipp von Weitershausen
- Navigator: Changed transitioner background color to 'transparent' | Eric Vicenti
- [react-native] Listen on all IPv6 interfaces | Ben Alpert
- [react-packager] Don't depend on error.stack being available | Amjad Masad
- [ReactNative] fixup AnimationExperimental a bit | Spencer Ahrens
- [react-packager] Implement new style asset packaging (with dimensions) | Amjad Masad
- [React Native] RCT_EXPORT lvl.2 | Alex Akers
- [react_native] Implement TextInput end editing | Andrei Coman
- [react_native] Make TextInput focus, blur, dismiss and show keyboard work | Andrei Coman
- Added non-class-scanning-based approach fror registering js methods | Nick Lockwood
- [ReactNative] Update package.json | Christopher Chedeau
- [ReactNative] Do flow check when running packager | Spencer Ahrens
- [ReactNative] Fix typo/bug in Navigator._completeTransition | Eric Vicenti
- [ReactNative] Fix Navigator exception when touching during transition | Eric Vicenti
- [ReactNative] Remove bridge retaining cycles | Tadeu Zagallo
- [ReactNative] Fix and re-add WebView executor | Tadeu Zagallo
  • Loading branch information...
1 parent 83fbef5 commit 0686b0147c8c8084e4a226b7ea04585362eccea8 @vjeux vjeux committed Apr 9, 2015
Showing with 1,166 additions and 736 deletions.
  1. +18 −8 Examples/2048/Game2048.js
  2. +0 −2 Examples/SampleApp/SampleApp.xcodeproj/project.pbxproj
  3. +2 −0 Examples/SampleApp/iOS/Info.plist
  4. +0 −4 Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj
  5. +4 −2 Examples/UIExplorer/UIExplorer.xcodeproj/xcshareddata/xcschemes/UIExplorer.xcscheme
  6. +12 −13 Libraries/ActionSheetIOS/RCTActionSheetManager.m
  7. +7 −7 Libraries/AdSupport/RCTAdSupport.m
  8. +49 −14 Libraries/Animation/AnimationExperimental.js
  9. +0 −58 Libraries/Animation/AnimationExperimentalMixin.js
  10. +32 −30 Libraries/Animation/AnimationUtils.js
  11. +8 −6 Libraries/Animation/LayoutAnimation.js
  12. +111 −33 Libraries/Animation/RCTAnimationExperimentalManager.m
  13. +12 −4 Libraries/Components/TextInput/TextInput.js
  14. +13 −13 Libraries/Components/Touchable/TouchableBounce.js
  15. +8 −9 Libraries/CustomComponents/Navigator/Navigator.js
  16. +25 −4 Libraries/CustomComponents/Navigator/NavigatorSceneConfigs.js
  17. +3 −5 Libraries/Geolocation/Geolocation.ios.js
  18. +16 −9 Libraries/Geolocation/RCTLocationObserver.m
  19. +9 −7 Libraries/Image/RCTCameraRollManager.m
  20. +2 −0 Libraries/Image/RCTNetworkImageViewManager.m
  21. +2 −0 Libraries/Image/RCTStaticImageManager.m
  22. +7 −9 Libraries/LinkingIOS/RCTLinkingManager.m
  23. +6 −6 Libraries/Network/RCTDataManager.m
  24. +4 −4 Libraries/Network/RCTReachability.m
  25. +6 −13 Libraries/PushNotificationIOS/RCTPushNotificationManager.m
  26. +6 −7 Libraries/RCTTest/RCTTestModule.m
  27. +1 −1 Libraries/RCTWebSocketDebugger/RCTWebSocketExecutor.m
  28. +6 −3 Libraries/RCTWebSocketDebugger/SRWebSocket.m
  29. +2 −0 Libraries/Text/RCTRawTextManager.m
  30. +24 −5 Libraries/Text/RCTText.m
  31. +2 −0 Libraries/Text/RCTTextManager.m
  32. +3 −2 Libraries/Vibration/RCTVibration.m
  33. +25 −9 React/Base/RCTBridge.h
  34. +299 −136 React/Base/RCTBridge.m
  35. +47 −8 React/Base/RCTBridgeModule.h
  36. +21 −9 React/Base/RCTConvert.h
  37. +5 −7 React/Base/RCTConvert.m
  38. +11 −4 React/Base/RCTDevMenu.m
  39. +3 −8 React/Base/RCTEventDispatcher.m
  40. +14 −9 React/Base/RCTJavaScriptLoader.m
  41. +1 −9 React/Base/RCTLog.h
  42. +2 −18 React/Base/RCTLog.m
  43. +2 −1 React/Base/RCTRedBox.m
  44. +5 −10 React/Base/RCTRootView.m
  45. +1 −4 React/Base/RCTTouchHandler.m
  46. +0 −3 React/Base/RCTUtils.h
  47. +0 −25 React/Base/RCTUtils.m
  48. +2 −0 React/Executors/RCTWebViewExecutor.m
  49. +4 −3 React/Modules/RCTAlertManager.m
  50. +4 −4 React/Modules/RCTAppState.m
  51. +10 −15 React/Modules/RCTAsyncLocalStorage.m
  52. +6 −6 React/Modules/RCTExceptionsManager.m
  53. +4 −2 React/Modules/RCTSourceCode.m
  54. +6 −6 React/Modules/RCTStatusBarManager.m
  55. +13 −21 React/Modules/RCTTiming.m
  56. +55 −86 React/Modules/RCTUIManager.m
  57. +1 −3 React/React.xcodeproj/project.pbxproj
  58. +2 −0 React/Views/RCTDatePickerManager.m
  59. +2 −0 React/Views/RCTMapManager.m
  60. +2 −0 React/Views/RCTNavItemManager.m
  61. +5 −5 React/Views/RCTNavigatorManager.m
  62. +2 −0 React/Views/RCTPickerManager.m
  63. +4 −4 React/Views/RCTScrollViewManager.m
  64. +2 −0 React/Views/RCTSliderManager.m
  65. +2 −0 React/Views/RCTSwitchManager.m
  66. +2 −0 React/Views/RCTTabBarItemManager.m
  67. +2 −0 React/Views/RCTTabBarManager.m
  68. +2 −0 React/Views/RCTTextFieldManager.m
  69. +2 −0 React/Views/RCTUIActivityIndicatorViewManager.m
  70. +0 −8 React/Views/RCTViewManager.h
  71. +1 −12 React/Views/RCTViewManager.m
  72. +5 −9 React/Views/RCTWebViewManager.m
  73. +3 −2 package.json
  74. +86 −0 packager/getFlowTypeCheckMiddleware.js
  75. +7 −1 packager/packager.js
  76. +5 −0 packager/react-packager/src/DependencyResolver/ModuleDescriptor.js
  77. +3 −3 ...ger/react-packager/src/DependencyResolver/haste/DependencyGraph/__tests__/DependencyGraph-test.js
  78. +1 −1 packager/react-packager/src/DependencyResolver/haste/DependencyGraph/index.js
  79. +1 −1 packager/react-packager/src/JSTransformer/index.js
  80. +32 −3 packager/react-packager/src/Packager/__tests__/Packager-test.js
  81. +46 −3 packager/react-packager/src/Packager/index.js
  82. +6 −0 packager/react-packager/src/Server/index.js
@@ -73,19 +73,29 @@ class Tile extends React.Component {
if (tile.isNew()) {
offset.opacity = 0;
} else {
- var point = [
- animationPosition(tile.toColumn()),
- animationPosition(tile.toRow()),
- ];
- AnimationExperimental.startAnimation(this.refs['this'], 100, 0, 'easeInOutQuad', {position: point});
+ var point = {
+ x: animationPosition(tile.toColumn()),
+ y: animationPosition(tile.toRow()),
+ };
+ AnimationExperimental.startAnimation({
+ node: this.refs['this'],
+ duration: 100,
+ easing: 'easeInOutQuad',
+ property: 'position',
+ toValue: point,
+ });
}
-
return offset;
}
-
componentDidMount() {
- AnimationExperimental.startAnimation(this.refs['this'], 100, 0, 'easeInOutQuad', {opacity: 1});
+ AnimationExperimental.startAnimation({
+ node: this.refs['this'],
+ duration: 100,
+ easing: 'easeInOutQuad',
+ property: 'opacity',
+ toValue: 1,
+ });
}
render() {
@@ -8,7 +8,6 @@
/* Begin PBXBuildFile section */
00481BE81AC0C86700671115 /* libRCTWebSocketDebugger.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00481BE61AC0C7FA00671115 /* libRCTWebSocketDebugger.a */; };
- 00481BEA1AC0C89D00671115 /* libicucore.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 00481BE91AC0C89D00671115 /* libicucore.dylib */; };
008F07F31AC5B25A0029DE68 /* main.jsbundle in Resources */ = {isa = PBXBuildFile; fileRef = 008F07F21AC5B25A0029DE68 /* main.jsbundle */; };
00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; };
00C302E61ABCBA2D00DB3ED1 /* libRCTAdSupport.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302B41ABCB8E700DB3ED1 /* libRCTAdSupport.a */; };
@@ -116,7 +115,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
- 00481BEA1AC0C89D00671115 /* libicucore.dylib in Frameworks */,
146834051AC3E58100842450 /* libReact.a in Frameworks */,
00481BE81AC0C86700671115 /* libRCTWebSocketDebugger.a in Frameworks */,
00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */,
@@ -36,5 +36,7 @@
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
+ <key>NSLocationWhenInUseUsageDescription</key>
+ <string></string>
</dict>
</plist>
@@ -9,7 +9,6 @@
/* Begin PBXBuildFile section */
004D28A31AAF61C70097A701 /* UIExplorerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 004D28A21AAF61C70097A701 /* UIExplorerTests.m */; };
00D2771A1AB8C3E100DC1E48 /* libRCTWebSocketDebugger.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00D277131AB8C2C700DC1E48 /* libRCTWebSocketDebugger.a */; };
- 00D2771C1AB8C55500DC1E48 /* libicucore.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 00D2771B1AB8C55500DC1E48 /* libicucore.dylib */; };
13417FE91AA91432003F314A /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 13417FE81AA91428003F314A /* libRCTImage.a */; };
134180011AA9153C003F314A /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 13417FEF1AA914B8003F314A /* libRCTText.a */; };
1341802C1AA9178B003F314A /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1341802B1AA91779003F314A /* libRCTNetwork.a */; };
@@ -118,7 +117,6 @@
004D28A11AAF61C70097A701 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
004D28A21AAF61C70097A701 /* UIExplorerTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UIExplorerTests.m; sourceTree = "<group>"; };
00D2770E1AB8C2C700DC1E48 /* RCTWebSocketDebugger.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTWebSocketDebugger.xcodeproj; path = ../../Libraries/RCTWebSocketDebugger/RCTWebSocketDebugger.xcodeproj; sourceTree = "<group>"; };
- 00D2771B1AB8C55500DC1E48 /* libicucore.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libicucore.dylib; path = usr/lib/libicucore.dylib; sourceTree = SDKROOT; };
13417FE31AA91428003F314A /* RCTImage.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTImage.xcodeproj; path = ../../Libraries/Image/RCTImage.xcodeproj; sourceTree = "<group>"; };
13417FEA1AA914B8003F314A /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = ../../Libraries/Text/RCTText.xcodeproj; sourceTree = "<group>"; };
134180261AA91779003F314A /* RCTNetwork.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTNetwork.xcodeproj; path = ../../Libraries/Network/RCTNetwork.xcodeproj; sourceTree = "<group>"; };
@@ -150,7 +148,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
- 00D2771C1AB8C55500DC1E48 /* libicucore.dylib in Frameworks */,
14AADF051AC3DBB1002390C9 /* libReact.a in Frameworks */,
00D2771A1AB8C3E100DC1E48 /* libRCTWebSocketDebugger.a in Frameworks */,
58005BF21ABA80A60062E044 /* libRCTTest.a in Frameworks */,
@@ -207,7 +204,6 @@
13417FEA1AA914B8003F314A /* RCTText.xcodeproj */,
00D2770E1AB8C2C700DC1E48 /* RCTWebSocketDebugger.xcodeproj */,
D85B82911AB6D5CE003F4FE2 /* RCTVibration.xcodeproj */,
- 00D2771B1AB8C55500DC1E48 /* libicucore.dylib */,
);
name = Libraries;
sourceTree = "<group>";
@@ -72,7 +72,8 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
- <BuildableProductRunnable>
+ <BuildableProductRunnable
+ runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
@@ -90,7 +91,8 @@
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
- <BuildableProductRunnable>
+ <BuildableProductRunnable
+ runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
@@ -11,14 +11,17 @@
#import "RCTLog.h"
-@interface RCTActionSheetManager() <UIActionSheetDelegate>
+@interface RCTActionSheetManager () <UIActionSheetDelegate>
@end
-@implementation RCTActionSheetManager {
+@implementation RCTActionSheetManager
+{
NSMutableDictionary *_callbacks;
}
+RCT_EXPORT_MODULE()
+
- (instancetype)init
{
if ((self = [super init])) {
@@ -27,12 +30,10 @@ - (instancetype)init
return self;
}
-- (void)showActionSheetWithOptions:(NSDictionary *)options
- failureCallback:(RCTResponseSenderBlock)failureCallback
- successCallback:(RCTResponseSenderBlock)successCallback
+RCT_EXPORT_METHOD(showActionSheetWithOptions:(NSDictionary *)options
+ failureCallback:(RCTResponseSenderBlock)failureCallback
+ successCallback:(RCTResponseSenderBlock)successCallback)
{
- RCT_EXPORT();
-
dispatch_async(dispatch_get_main_queue(), ^{
UIActionSheet *actionSheet = [[UIActionSheet alloc] init];
@@ -62,12 +63,10 @@ - (void)showActionSheetWithOptions:(NSDictionary *)options
});
}
-- (void)showShareActionSheetWithOptions:(NSDictionary *)options
- failureCallback:(RCTResponseSenderBlock)failureCallback
- successCallback:(RCTResponseSenderBlock)successCallback
+RCT_EXPORT_METHOD(showShareActionSheetWithOptions:(NSDictionary *)options
+ failureCallback:(RCTResponseSenderBlock)failureCallback
+ successCallback:(RCTResponseSenderBlock)successCallback)
{
- RCT_EXPORT();
-
dispatch_async(dispatch_get_main_queue(), ^{
NSMutableArray *items = [NSMutableArray array];
id message = options[@"message"];
@@ -134,7 +133,7 @@ - (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger
#pragma mark Private
-static NSString *keyForInstance(id instance)
+NS_INLINE NSString *keyForInstance(id instance)
{
return [NSString stringWithFormat:@"%p", instance];
}
@@ -11,23 +11,23 @@
@implementation RCTAdSupport
-- (void)getAdvertisingId:(RCTResponseSenderBlock)callback withErrorCallback:(RCTResponseSenderBlock)errorCallback
-{
- RCT_EXPORT();
+RCT_EXPORT_MODULE()
+RCT_EXPORT_METHOD(getAdvertisingId:(RCTResponseSenderBlock)callback
+ withErrorCallback:(RCTResponseSenderBlock)errorCallback)
+{
if ([ASIdentifierManager class]) {
callback(@[[[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString]]);
} else {
return errorCallback(@[@"as_identifier_unavailable"]);
}
}
-- (void)getAdvertisingTrackingEnabled:(RCTResponseSenderBlock)callback withErrorCallback:(RCTResponseSenderBlock)errorCallback
+RCT_EXPORT_METHOD(getAdvertisingTrackingEnabled:(RCTResponseSenderBlock)callback
+ withErrorCallback:(RCTResponseSenderBlock)errorCallback)
{
- RCT_EXPORT();
-
if ([ASIdentifierManager class]) {
- bool hasTracking = [[ASIdentifierManager sharedManager] isAdvertisingTrackingEnabled];
+ BOOL hasTracking = [[ASIdentifierManager sharedManager] isAdvertisingTrackingEnabled];
callback(@[@(hasTracking)]);
} else {
return errorCallback(@[@"as_identifier_unavailable"]);
@@ -16,6 +16,17 @@ var AnimationUtils = require('AnimationUtils');
type EasingFunction = (t: number) => number;
+var Properties = {
+ opacity: true,
+ position: true,
+ positionX: true,
+ positionY: true,
+ rotation: true,
+ scaleXY: true,
+};
+
+type ValueType = number | Array<number> | {[key: string]: number};
+
/**
* This is an experimental module that is under development, incomplete,
* potentially buggy, not used in any production apps, and will probably change
@@ -24,24 +35,34 @@ type EasingFunction = (t: number) => number;
* Use at your own risk.
*/
var AnimationExperimental = {
- Mixin: require('AnimationExperimentalMixin'),
-
startAnimation: function(
- node: any,
- duration: number,
- delay: number,
- easing: (string | EasingFunction),
- properties: {[key: string]: any}
+ anim: {
+ node: any;
+ duration: number;
+ easing: ($Enum<typeof AnimationUtils.Defaults> | EasingFunction);
+ property: $Enum<typeof Properties>;
+ toValue: ValueType;
+ fromValue?: ValueType;
+ delay?: number;
+ },
+ callback?: ?(finished: bool) => void
): number {
- var nodeHandle = +node.getNodeHandle();
- var easingSample = AnimationUtils.evaluateEasingFunction(duration, easing);
- var tag: number = RCTAnimationManager.startAnimation(
+ var nodeHandle = anim.node.getNodeHandle();
+ var easingSample = AnimationUtils.evaluateEasingFunction(
+ anim.duration,
+ anim.easing
+ );
+ var tag: number = AnimationUtils.allocateTag();
+ var props = {};
+ props[anim.property] = {to: anim.toValue};
+ RCTAnimationManager.startAnimation(
nodeHandle,
- AnimationUtils.allocateTag(),
- duration,
- delay,
+ tag,
+ anim.duration,
+ anim.delay,
easingSample,
- properties
+ props,
+ callback
);
return tag;
},
@@ -51,4 +72,18 @@ var AnimationExperimental = {
},
};
+if (__DEV__) {
+ if (RCTAnimationManager && RCTAnimationManager.Properties) {
+ var a = Object.keys(Properties);
+ var b = RCTAnimationManager.Properties;
+ var diff = a.filter((i) => b.indexOf(i) < 0).concat(
+ b.filter((i) => a.indexOf(i) < 0)
+ );
+ if (diff.length > 0) {
+ throw new Error('JS animation properties don\'t match native properties.' +
+ JSON.stringify(diff, null, ' '));
+ }
+ }
+}
+
module.exports = AnimationExperimental;
@@ -1,58 +0,0 @@
-/**
- * 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.
- *
- * @providesModule AnimationExperimentalMixin
- * @flow
- */
-'use strict';
-
-var AnimationUtils = require('AnimationUtils');
-var RCTAnimationManager = require('NativeModules').AnimationExperimentalManager;
-
-var invariant = require('invariant');
-
-type EasingFunction = (t: number) => number;
-
-/**
- * This is an experimental module that is under development, incomplete,
- * potentially buggy, not used in any production apps, and will probably change
- * in non-backward compatible ways.
- *
- * Use at your own risk.
- */
-var AnimationExperimentalMixin = {
- getInitialState: function(): Object {
- return {};
- },
-
- startAnimation: function(
- refKey: string,
- duration: number,
- delay: number,
- easing: (string | EasingFunction),
- properties: {[key: string]: any}
- ): number {
- var ref = this.refs[refKey];
- invariant(
- ref,
- 'Invalid refKey ' + refKey + '; ' +
- 'valid refs: ' + JSON.stringify(Object.keys(this.refs))
- );
-
- var nodeHandle = +ref.getNodeHandle();
- var easingSample = AnimationUtils.evaluateEasingFunction(duration, easing);
- var tag: number = RCTAnimationManager.startAnimation(nodeHandle, AnimationUtils.allocateTag(), duration, delay, easingSample, properties);
- return tag;
- },
-
- stopAnimation: function(tag: number) {
- RCTAnimationManager.stopAnimation(tag);
- },
-};
-
-module.exports = AnimationExperimentalMixin;
Oops, something went wrong.

0 comments on commit 0686b01

Please sign in to comment.