From aba148061f2308c72dde4bddb39de6d5e3b53d20 Mon Sep 17 00:00:00 2001 From: Alex Akers Date: Mon, 6 Jul 2015 02:52:38 -0700 Subject: [PATCH 01/11] [React Native] Re-alphabetize file names in Xcode projects Summary: Fixes my OCD problems. --- Libraries/ART/ART.xcodeproj/project.pbxproj | 4 +- .../Image/RCTImage.xcodeproj/project.pbxproj | 4 +- .../RCTNetwork.xcodeproj/project.pbxproj | 4 +- .../RCTTest/RCTTest.xcodeproj/project.pbxproj | 2 +- .../RCTWebSocket.xcodeproj/project.pbxproj | 4 +- React/React.xcodeproj/project.pbxproj | 68 +++++++++---------- 6 files changed, 43 insertions(+), 43 deletions(-) diff --git a/Libraries/ART/ART.xcodeproj/project.pbxproj b/Libraries/ART/ART.xcodeproj/project.pbxproj index 70371e318..1f98a6155 100644 --- a/Libraries/ART/ART.xcodeproj/project.pbxproj +++ b/Libraries/ART/ART.xcodeproj/project.pbxproj @@ -96,6 +96,8 @@ 0CF68AB81AF0540F00FF9E5C = { isa = PBXGroup; children = ( + 0CF68AEA1AF0549300FF9E5C /* Brushes */, + 0CF68AF81AF0549300FF9E5C /* ViewManagers */, 0CF68ADB1AF0549300FF9E5C /* ARTCGFloatArray.h */, 0CF68ADC1AF0549300FF9E5C /* ARTContainer.h */, 0CF68ADD1AF0549300FF9E5C /* ARTGroup.h */, @@ -111,10 +113,8 @@ 0CF68AE71AF0549300FF9E5C /* ARTText.h */, 0CF68AE81AF0549300FF9E5C /* ARTText.m */, 0CF68AE91AF0549300FF9E5C /* ARTTextFrame.h */, - 0CF68AEA1AF0549300FF9E5C /* Brushes */, 0CF68AF61AF0549300FF9E5C /* RCTConvert+ART.h */, 0CF68AF71AF0549300FF9E5C /* RCTConvert+ART.m */, - 0CF68AF81AF0549300FF9E5C /* ViewManagers */, 0CF68AC21AF0540F00FF9E5C /* Products */, ); sourceTree = ""; diff --git a/Libraries/Image/RCTImage.xcodeproj/project.pbxproj b/Libraries/Image/RCTImage.xcodeproj/project.pbxproj index 1e3cf75c8..1735f33b4 100644 --- a/Libraries/Image/RCTImage.xcodeproj/project.pbxproj +++ b/Libraries/Image/RCTImage.xcodeproj/project.pbxproj @@ -69,14 +69,14 @@ 58B511541A9E6B3D00147676 = { isa = PBXGroup; children = ( - 143879361AAD32A300F088A5 /* RCTImageLoader.h */, - 143879371AAD32A300F088A5 /* RCTImageLoader.m */, 143879331AAD238D00F088A5 /* RCTCameraRollManager.h */, 143879341AAD238D00F088A5 /* RCTCameraRollManager.m */, 1304D5B01AA8C50D0002E2BE /* RCTGIFImage.h */, 1304D5B11AA8C50D0002E2BE /* RCTGIFImage.m */, 58B511891A9E6BD600147676 /* RCTImageDownloader.h */, 58B5118A1A9E6BD600147676 /* RCTImageDownloader.m */, + 143879361AAD32A300F088A5 /* RCTImageLoader.h */, + 143879371AAD32A300F088A5 /* RCTImageLoader.m */, 137620331B31C53500677FF0 /* RCTImagePickerManager.h */, 137620341B31C53500677FF0 /* RCTImagePickerManager.m */, 1345A8371B26592900583190 /* RCTImageRequestHandler.h */, diff --git a/Libraries/Network/RCTNetwork.xcodeproj/project.pbxproj b/Libraries/Network/RCTNetwork.xcodeproj/project.pbxproj index 48b84fd03..2a3262871 100644 --- a/Libraries/Network/RCTNetwork.xcodeproj/project.pbxproj +++ b/Libraries/Network/RCTNetwork.xcodeproj/project.pbxproj @@ -48,10 +48,10 @@ 58B511D21A9E6C8500147676 = { isa = PBXGroup; children = ( - 58B512061A9E6CE300147676 /* RCTNetworking.h */, - 58B512071A9E6CE300147676 /* RCTNetworking.m */, 352DA0B71B17855800AA15A8 /* RCTHTTPRequestHandler.h */, 352DA0B81B17855800AA15A8 /* RCTHTTPRequestHandler.m */, + 58B512061A9E6CE300147676 /* RCTNetworking.h */, + 58B512071A9E6CE300147676 /* RCTNetworking.m */, 1372B7351AB03E7B00659ED6 /* RCTReachability.h */, 1372B7361AB03E7B00659ED6 /* RCTReachability.m */, 58B511DC1A9E6C8500147676 /* Products */, diff --git a/Libraries/RCTTest/RCTTest.xcodeproj/project.pbxproj b/Libraries/RCTTest/RCTTest.xcodeproj/project.pbxproj index f1165171f..24ffac392 100644 --- a/Libraries/RCTTest/RCTTest.xcodeproj/project.pbxproj +++ b/Libraries/RCTTest/RCTTest.xcodeproj/project.pbxproj @@ -58,11 +58,11 @@ 580C37661AB104AF0015E709 = { isa = PBXGroup; children = ( + 58E64FE31AB964CD007446E2 /* FBSnapshotTestCase */, 585135331AB3C56F00882537 /* RCTTestModule.h */, 585135341AB3C56F00882537 /* RCTTestModule.m */, 585135351AB3C56F00882537 /* RCTTestRunner.h */, 585135361AB3C56F00882537 /* RCTTestRunner.m */, - 58E64FE31AB964CD007446E2 /* FBSnapshotTestCase */, 580C37701AB104AF0015E709 /* Products */, ); indentWidth = 2; diff --git a/Libraries/WebSocket/RCTWebSocket.xcodeproj/project.pbxproj b/Libraries/WebSocket/RCTWebSocket.xcodeproj/project.pbxproj index d1c691d0f..817cf7fd8 100644 --- a/Libraries/WebSocket/RCTWebSocket.xcodeproj/project.pbxproj +++ b/Libraries/WebSocket/RCTWebSocket.xcodeproj/project.pbxproj @@ -36,12 +36,12 @@ 3C86DF3D1ADF2C930047B81A = { isa = PBXGroup; children = ( - 3C86DF7A1ADF695F0047B81A /* RCTWebSocketManager.h */, - 3C86DF7B1ADF695F0047B81A /* RCTWebSocketManager.m */, 1338BBDC1B04ACC80064A9C9 /* RCTSRWebSocket.h */, 1338BBDD1B04ACC80064A9C9 /* RCTSRWebSocket.m */, 1338BBDE1B04ACC80064A9C9 /* RCTWebSocketExecutor.h */, 1338BBDF1B04ACC80064A9C9 /* RCTWebSocketExecutor.m */, + 3C86DF7A1ADF695F0047B81A /* RCTWebSocketManager.h */, + 3C86DF7B1ADF695F0047B81A /* RCTWebSocketManager.m */, 3C86DF471ADF2C930047B81A /* Products */, ); indentWidth = 2; diff --git a/React/React.xcodeproj/project.pbxproj b/React/React.xcodeproj/project.pbxproj index 54261357d..4ca739182 100644 --- a/React/React.xcodeproj/project.pbxproj +++ b/React/React.xcodeproj/project.pbxproj @@ -277,14 +277,16 @@ 13B07FE01A69315300A75B9A /* Modules */ = { isa = PBXGroup; children = ( - 1372B7081AB030C200659ED6 /* RCTAppState.h */, - 1372B7091AB030C200659ED6 /* RCTAppState.m */, 13B07FE71A69327A00A75B9A /* RCTAlertManager.h */, 13B07FE81A69327A00A75B9A /* RCTAlertManager.m */, + 1372B7081AB030C200659ED6 /* RCTAppState.h */, + 1372B7091AB030C200659ED6 /* RCTAppState.m */, 58114A4F1AAE93D500E7D092 /* RCTAsyncLocalStorage.h */, 58114A4E1AAE93D500E7D092 /* RCTAsyncLocalStorage.m */, 13B07FE91A69327A00A75B9A /* RCTExceptionsManager.h */, 13B07FEA1A69327A00A75B9A /* RCTExceptionsManager.m */, + 63F014BE1B02080B003B75D2 /* RCTPointAnnotation.h */, + 63F014BF1B02080B003B75D2 /* RCTPointAnnotation.m */, 000E6CE91AB0E97F000CDF4D /* RCTSourceCode.h */, 000E6CEA1AB0E980000CDF4D /* RCTSourceCode.m */, 13723B4E1A82FD3C00F88898 /* RCTStatusBarManager.h */, @@ -293,8 +295,6 @@ 13B07FEE1A69327A00A75B9A /* RCTTiming.m */, 13E067481A70F434002CDEE1 /* RCTUIManager.h */, 13E067491A70F434002CDEE1 /* RCTUIManager.m */, - 63F014BE1B02080B003B75D2 /* RCTPointAnnotation.h */, - 63F014BF1B02080B003B75D2 /* RCTPointAnnotation.m */, ); path = Modules; sourceTree = ""; @@ -302,16 +302,18 @@ 13B07FF31A6947C200A75B9A /* Views */ = { isa = PBXGroup; children = ( + 13B080181A69489C00A75B9A /* RCTActivityIndicatorViewManager.h */, + 13B080191A69489C00A75B9A /* RCTActivityIndicatorViewManager.m */, 13442BF21AA90E0B0037E5B0 /* RCTAnimationType.h */, 13C325261AA63B6A0048765F /* RCTAutoInsetsProtocol.h */, 13CC8A801B17642100940AE7 /* RCTBorderDrawing.h */, 13CC8A811B17642100940AE7 /* RCTBorderDrawing.m */, - 58C571C01AA56C1900CDF9C8 /* RCTDatePickerManager.h */, - 58C571BF1AA56C1900CDF9C8 /* RCTDatePickerManager.m */, 13456E911ADAD2DE009F94A7 /* RCTConvert+CoreLocation.h */, 13456E921ADAD2DE009F94A7 /* RCTConvert+CoreLocation.m */, 13456E941ADAD482009F94A7 /* RCTConvert+MapKit.h */, 13456E951ADAD482009F94A7 /* RCTConvert+MapKit.m */, + 58C571C01AA56C1900CDF9C8 /* RCTDatePickerManager.h */, + 58C571BF1AA56C1900CDF9C8 /* RCTDatePickerManager.m */, 14435CE11AAC4AE100FC20F4 /* RCTMap.h */, 14435CE21AAC4AE100FC20F4 /* RCTMap.m */, 14435CE31AAC4AE100FC20F4 /* RCTMapManager.h */, @@ -331,15 +333,15 @@ 13442BF31AA90E0B0037E5B0 /* RCTPointerEvents.h */, 13513F3A1B1F43F400FCE529 /* RCTProgressViewManager.h */, 13513F3B1B1F43F400FCE529 /* RCTProgressViewManager.m */, - 131B6AF01AF1093D00FFC3E0 /* RCTSegmentedControl.h */, - 131B6AF11AF1093D00FFC3E0 /* RCTSegmentedControl.m */, - 131B6AF21AF1093D00FFC3E0 /* RCTSegmentedControlManager.h */, - 131B6AF31AF1093D00FFC3E0 /* RCTSegmentedControlManager.m */, + 13C325271AA63B6A0048765F /* RCTScrollableProtocol.h */, 13B07FF61A6947C200A75B9A /* RCTScrollView.h */, 13B07FF71A6947C200A75B9A /* RCTScrollView.m */, 13B07FF81A6947C200A75B9A /* RCTScrollViewManager.h */, 13B07FF91A6947C200A75B9A /* RCTScrollViewManager.m */, - 13C325271AA63B6A0048765F /* RCTScrollableProtocol.h */, + 131B6AF01AF1093D00FFC3E0 /* RCTSegmentedControl.h */, + 131B6AF11AF1093D00FFC3E0 /* RCTSegmentedControl.m */, + 131B6AF21AF1093D00FFC3E0 /* RCTSegmentedControlManager.h */, + 131B6AF31AF1093D00FFC3E0 /* RCTSegmentedControlManager.m */, 13E0674B1A70F44B002CDEE1 /* RCTShadowView.h */, 13E0674C1A70F44B002CDEE1 /* RCTShadowView.m */, 13AF20431AE707F8005F5298 /* RCTSlider.h */, @@ -362,8 +364,6 @@ 13B080151A69489C00A75B9A /* RCTTextField.m */, 13B080161A69489C00A75B9A /* RCTTextFieldManager.h */, 13B080171A69489C00A75B9A /* RCTTextFieldManager.m */, - 13B080181A69489C00A75B9A /* RCTActivityIndicatorViewManager.h */, - 13B080191A69489C00A75B9A /* RCTActivityIndicatorViewManager.m */, 13E0674F1A70F44B002CDEE1 /* RCTView.h */, 13E067501A70F44B002CDEE1 /* RCTView.m */, 13442BF41AA90E0B0037E5B0 /* RCTViewControllerProtocol.h */, @@ -415,54 +415,54 @@ 83CBBA491A601E3B00E9B192 /* Base */ = { isa = PBXGroup; children = ( - 1345A83A1B265A0E00583190 /* RCTURLRequestDelegate.h */, - 1345A83B1B265A0E00583190 /* RCTURLRequestHandler.h */, - 14200DA81AC179B3008EE6BA /* RCTJavaScriptLoader.h */, - 14200DA91AC179B3008EE6BA /* RCTJavaScriptLoader.m */, 83CBBA4A1A601E3B00E9B192 /* RCTAssert.h */, 83CBBA4B1A601E3B00E9B192 /* RCTAssert.m */, + 14C2CA771B3ACB0400E6CBB2 /* RCTBatchedBridge.m */, 83CBBA5E1A601EAA00E9B192 /* RCTBridge.h */, 83CBBA5F1A601EAA00E9B192 /* RCTBridge.m */, 830213F31A654E0800B993E6 /* RCTBridgeModule.h */, 83CBBACA1A6023D300E9B192 /* RCTConvert.h */, 83CBBACB1A6023D300E9B192 /* RCTConvert.m */, 13AF1F851AE6E777005F5298 /* RCTDefines.h */, + 00C1A2B11AC0B7E000E89A1C /* RCTDevMenu.h */, + 00C1A2B21AC0B7E000E89A1C /* RCTDevMenu.m */, 83CBBA651A601EF300E9B192 /* RCTEventDispatcher.h */, 83CBBA661A601EF300E9B192 /* RCTEventDispatcher.m */, + 146459241B06C49500B389AA /* RCTFPSGraph.h */, + 146459251B06C49500B389AA /* RCTFPSGraph.m */, + 1436DD071ADE7AA000A5ED7D /* RCTFrameUpdate.h */, + 14C2CA751B3AC64F00E6CBB2 /* RCTFrameUpdate.m */, 83CBBA4C1A601E3B00E9B192 /* RCTInvalidating.h */, 83CBBA631A601ECA00E9B192 /* RCTJavaScriptExecutor.h */, 783ABB341B38A9D3003FFD95 /* RCTJavaScriptExecutor.m */, + 14200DA81AC179B3008EE6BA /* RCTJavaScriptLoader.h */, + 14200DA91AC179B3008EE6BA /* RCTJavaScriptLoader.m */, 13A1F71C1A75392D00D3D453 /* RCTKeyCommands.h */, 13A1F71D1A75392D00D3D453 /* RCTKeyCommands.m */, 83CBBA4D1A601E3B00E9B192 /* RCTLog.h */, 83CBBA4E1A601E3B00E9B192 /* RCTLog.m */, + 14C2CA721B3AC64300E6CBB2 /* RCTModuleData.h */, + 14C2CA731B3AC64300E6CBB2 /* RCTModuleData.m */, + 14C2CA6F1B3AC63800E6CBB2 /* RCTModuleMethod.h */, + 14C2CA701B3AC63800E6CBB2 /* RCTModuleMethod.m */, + 142014181B32094000CC17BA /* RCTPerformanceLogger.h */, + 142014171B32094000CC17BA /* RCTPerformanceLogger.m */, + 1403F2B11B0AE60700C2A9A4 /* RCTPerfStats.h */, + 1403F2B21B0AE60700C2A9A4 /* RCTPerfStats.m */, + 14F4D3891AE1B7E40049C042 /* RCTProfile.h */, + 14F4D38A1AE1B7E40049C042 /* RCTProfile.m */, 83CBBA581A601E9000E9B192 /* RCTRedBox.h */, 83CBBA591A601E9000E9B192 /* RCTRedBox.m */, 830A229C1A66C68A008503DA /* RCTRootView.h */, 830A229D1A66C68A008503DA /* RCTRootView.m */, - 00C1A2B11AC0B7E000E89A1C /* RCTDevMenu.h */, - 00C1A2B21AC0B7E000E89A1C /* RCTDevMenu.m */, 83BEE46C1A6D19BC00B5863B /* RCTSparseArray.h */, 83BEE46D1A6D19BC00B5863B /* RCTSparseArray.m */, 83CBBA961A6020BB00E9B192 /* RCTTouchHandler.h */, 83CBBA971A6020BB00E9B192 /* RCTTouchHandler.m */, + 1345A83A1B265A0E00583190 /* RCTURLRequestDelegate.h */, + 1345A83B1B265A0E00583190 /* RCTURLRequestHandler.h */, 83CBBA4F1A601E3B00E9B192 /* RCTUtils.h */, 83CBBA501A601E3B00E9B192 /* RCTUtils.m */, - 1436DD071ADE7AA000A5ED7D /* RCTFrameUpdate.h */, - 14F4D3891AE1B7E40049C042 /* RCTProfile.h */, - 14F4D38A1AE1B7E40049C042 /* RCTProfile.m */, - 146459241B06C49500B389AA /* RCTFPSGraph.h */, - 146459251B06C49500B389AA /* RCTFPSGraph.m */, - 1403F2B11B0AE60700C2A9A4 /* RCTPerfStats.h */, - 1403F2B21B0AE60700C2A9A4 /* RCTPerfStats.m */, - 142014171B32094000CC17BA /* RCTPerformanceLogger.m */, - 142014181B32094000CC17BA /* RCTPerformanceLogger.h */, - 14C2CA6F1B3AC63800E6CBB2 /* RCTModuleMethod.h */, - 14C2CA701B3AC63800E6CBB2 /* RCTModuleMethod.m */, - 14C2CA721B3AC64300E6CBB2 /* RCTModuleData.h */, - 14C2CA731B3AC64300E6CBB2 /* RCTModuleData.m */, - 14C2CA751B3AC64F00E6CBB2 /* RCTFrameUpdate.m */, - 14C2CA771B3ACB0400E6CBB2 /* RCTBatchedBridge.m */, ); path = Base; sourceTree = ""; From f5ad9c21038651409d1f95a98e4745703654d1f6 Mon Sep 17 00:00:00 2001 From: James Ide Date: Mon, 6 Jul 2015 03:15:10 -0700 Subject: [PATCH 02/11] [Crashfix] Replace dispatch_get_current_queue with DISPATCH_CURRENT_QUEUE_LABEL Summary: I encountered a crash when `RCTCurrentThreadName` called `dispatch_get_current_queue`. There are reports of it crashing e.g. https://github.com/CocoaLumberjack/CocoaLumberjack/issues/108 so better not to call it at all, plus it is deprecated. Since we still want helpful debugging information, use `DISPATCH_CURRENT_QUEUE_LABEL` instead. It's kind of strange that this constant is defined to be NULL and the docs for `dispatch_get_queue_label` say not to pass in NULL, but in practice `DISPATCH_CURRENT_QUEUE_LABEL` is provided by the iOS SDK and works correctly. Closes https://github.com/facebook/react-native/pull/1868 Github Author: James Ide --- React/Base/RCTAssert.m | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/React/Base/RCTAssert.m b/React/Base/RCTAssert.m index 72aa0420a..78506f7ce 100644 --- a/React/Base/RCTAssert.m +++ b/React/Base/RCTAssert.m @@ -75,19 +75,12 @@ NSString *RCTCurrentThreadName(void) NSThread *thread = [NSThread currentThread]; NSString *threadName = [thread isMainThread] ? @"main" : thread.name; if (threadName.length == 0) { -#if DEBUG // This is DEBUG not RCT_DEBUG because it *really* must not ship in RC -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - const char *label = dispatch_queue_get_label(dispatch_get_current_queue()); + const char *label = dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL); if (label && strlen(label) > 0) { threadName = @(label); } else { threadName = [NSString stringWithFormat:@"%p", thread]; } -#pragma clang diagnostic pop -#else - threadName = [NSString stringWithFormat:@"%p", thread]; -#endif } return threadName; } From b4cd019f393369939902cb86ca68154a18ed2e16 Mon Sep 17 00:00:00 2001 From: Alex Akers Date: Mon, 6 Jul 2015 04:03:12 -0700 Subject: [PATCH 03/11] [React Native] Remove animated GIFs from TicTacToe example --- .../TicTacToe.xcodeproj/project.pbxproj | 30 +++++++++++++++ Examples/TicTacToe/TicTacToeApp.js | 38 ++----------------- 2 files changed, 33 insertions(+), 35 deletions(-) diff --git a/Examples/TicTacToe/TicTacToe.xcodeproj/project.pbxproj b/Examples/TicTacToe/TicTacToe.xcodeproj/project.pbxproj index 96c29bc3a..61e817e2b 100644 --- a/Examples/TicTacToe/TicTacToe.xcodeproj/project.pbxproj +++ b/Examples/TicTacToe/TicTacToe.xcodeproj/project.pbxproj @@ -14,6 +14,7 @@ 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 144C5F691AC3E5E300B004E7 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 144C5F681AC3E5D800B004E7 /* libReact.a */; }; 58C572511AA6229D00CDF9C8 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 58C5724D1AA6224400CDF9C8 /* libRCTText.a */; }; + 832044981B492C2500E297FC /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832044951B492C1E00E297FC /* libRCTSettings.a */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -38,6 +39,13 @@ remoteGlobalIDString = 58B5119B1A9E6C1200147676; remoteInfo = RCTText; }; + 832044941B492C1E00E297FC /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 8320448F1B492C1E00E297FC /* RCTSettings.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 134814201AA4EA6300B7C361; + remoteInfo = RCTSettings; + }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ @@ -51,6 +59,7 @@ 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = TicTacToe/main.m; sourceTree = ""; }; 144C5F631AC3E5D800B004E7 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = ../../React/React.xcodeproj; sourceTree = ""; }; 587650DA1A9EB0DB008B8F17 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = ../../Libraries/Text/RCTText.xcodeproj; sourceTree = ""; }; + 8320448F1B492C1E00E297FC /* RCTSettings.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTSettings.xcodeproj; path = ../../Libraries/Settings/RCTSettings.xcodeproj; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -61,6 +70,7 @@ 144C5F691AC3E5E300B004E7 /* libReact.a in Frameworks */, 1341803E1AA91802003F314A /* libRCTImage.a in Frameworks */, 58C572511AA6229D00CDF9C8 /* libRCTText.a in Frameworks */, + 832044981B492C2500E297FC /* libRCTSettings.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -101,6 +111,7 @@ children = ( 144C5F631AC3E5D800B004E7 /* React.xcodeproj */, 134180381AA917ED003F314A /* RCTImage.xcodeproj */, + 8320448F1B492C1E00E297FC /* RCTSettings.xcodeproj */, 587650DA1A9EB0DB008B8F17 /* RCTText.xcodeproj */, ); name = Libraries; @@ -114,6 +125,14 @@ name = Products; sourceTree = ""; }; + 832044901B492C1E00E297FC /* Products */ = { + isa = PBXGroup; + children = ( + 832044951B492C1E00E297FC /* libRCTSettings.a */, + ); + name = Products; + sourceTree = ""; + }; 83CBB9F61A601CBA00E9B192 = { isa = PBXGroup; children = ( @@ -178,6 +197,10 @@ ProductGroup = 134180391AA917ED003F314A /* Products */; ProjectRef = 134180381AA917ED003F314A /* RCTImage.xcodeproj */; }, + { + ProductGroup = 832044901B492C1E00E297FC /* Products */; + ProjectRef = 8320448F1B492C1E00E297FC /* RCTSettings.xcodeproj */; + }, { ProductGroup = 58C572481AA6224300CDF9C8 /* Products */; ProjectRef = 587650DA1A9EB0DB008B8F17 /* RCTText.xcodeproj */; @@ -216,6 +239,13 @@ remoteRef = 58C5724C1AA6224400CDF9C8 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + 832044951B492C1E00E297FC /* libRCTSettings.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libRCTSettings.a; + remoteRef = 832044941B492C1E00E297FC /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ diff --git a/Examples/TicTacToe/TicTacToeApp.js b/Examples/TicTacToe/TicTacToeApp.js index 92775f78d..15652ee4d 100755 --- a/Examples/TicTacToe/TicTacToeApp.js +++ b/Examples/TicTacToe/TicTacToeApp.js @@ -19,7 +19,6 @@ var React = require('react-native'); var { AppRegistry, - Image, StyleSheet, Text, TouchableHighlight, @@ -118,17 +117,6 @@ var Cell = React.createClass({ } }, - imageStyle() { - switch (this.props.player) { - case 1: - return styles.imageX; - case 2: - return styles.imageO; - default: - return {}; - } - }, - textContents() { switch (this.props.player) { case 1: @@ -140,17 +128,6 @@ 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 ( - + + {this.textContents()} + ); @@ -304,17 +283,6 @@ var styles = StyleSheet.create({ color: '#b9dc2f', }, - // CELL IMAGE - - imageX: { - width: 34, - height: 42, - }, - imageO: { - width: 45, - height: 41, - }, - // GAME OVER overlay: { From 7e70ee2e0391e2d32d5f9e202f3a8b2d21598e2d Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Mon, 6 Jul 2015 04:40:11 -0700 Subject: [PATCH 04/11] Check for RCTSettingsManager in Settings.ios --- Libraries/Settings/Settings.ios.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/Settings/Settings.ios.js b/Libraries/Settings/Settings.ios.js index 89388be57..73d66ca58 100644 --- a/Libraries/Settings/Settings.ios.js +++ b/Libraries/Settings/Settings.ios.js @@ -19,7 +19,7 @@ var invariant = require('invariant'); var subscriptions: Array<{keys: Array; callback: ?Function}> = []; var Settings = { - _settings: RCTSettingsManager.settings, + _settings: RCTSettingsManager && RCTSettingsManager.settings, get(key: string): mixed { return this._settings[key]; From ca791dfe6f3a4f4d495346474774e827fddbbe59 Mon Sep 17 00:00:00 2001 From: Alex Akers Date: Mon, 6 Jul 2015 10:22:02 -0700 Subject: [PATCH 05/11] [React Native] Update RCTAdSupport Summary: No longer check for the `ASIdentifierManager` class. Since we only target iOS 7.0 and up, this is unnecessary. Instead, we should check for whether the `advertisingIdentifier` is non-nil. If it is, we send it; otherwise we send an error. --- Libraries/AdSupport/RCTAdSupport.m | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/Libraries/AdSupport/RCTAdSupport.m b/Libraries/AdSupport/RCTAdSupport.m index dff794e34..2e270b035 100644 --- a/Libraries/AdSupport/RCTAdSupport.m +++ b/Libraries/AdSupport/RCTAdSupport.m @@ -18,22 +18,18 @@ RCT_EXPORT_MODULE() RCT_EXPORT_METHOD(getAdvertisingId:(RCTResponseSenderBlock)callback withErrorCallback:(RCTResponseSenderBlock)errorCallback) { - if ([ASIdentifierManager class]) { - callback(@[[[[ASIdentifierManager sharedManager] advertisingIdentifier] UUIDString]]); + NSUUID *advertisingIdentifier = [ASIdentifierManager sharedManager].advertisingIdentifier; + if (advertisingIdentifier) { + callback(@[advertisingIdentifier.UUIDString]); } else { - return errorCallback(@[@"as_identifier_unavailable"]); + errorCallback(@[@"as_identifier_unavailable"]); } } RCT_EXPORT_METHOD(getAdvertisingTrackingEnabled:(RCTResponseSenderBlock)callback - withErrorCallback:(RCTResponseSenderBlock)errorCallback) + withErrorCallback:(__unused RCTResponseSenderBlock)errorCallback) { - if ([ASIdentifierManager class]) { - BOOL hasTracking = [[ASIdentifierManager sharedManager] isAdvertisingTrackingEnabled]; - callback(@[@(hasTracking)]); - } else { - return errorCallback(@[@"as_identifier_unavailable"]); - } + callback(@[@([ASIdentifierManager sharedManager].advertisingTrackingEnabled)]); } @end From c045c566e9922b04c6a0a8054a1c7a753719dbab Mon Sep 17 00:00:00 2001 From: Brent Vatne Date: Mon, 6 Jul 2015 10:58:46 -0700 Subject: [PATCH 06/11] Remove unnecessary imports for RCTHTTPRequestHandler to fix Cocoapods build Summary: @tadeuzagallo - We discussed this ~a week ago when I was putting together the 0.7.0-rc release, only got around to creating the PR for it now so it's properly sync'd. Closes https://github.com/facebook/react-native/pull/1865 Github Author: Brent Vatne --- Libraries/Network/RCTHTTPRequestHandler.m | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Libraries/Network/RCTHTTPRequestHandler.m b/Libraries/Network/RCTHTTPRequestHandler.m index 7c1a5ac68..6a6b385af 100644 --- a/Libraries/Network/RCTHTTPRequestHandler.m +++ b/Libraries/Network/RCTHTTPRequestHandler.m @@ -9,13 +9,6 @@ #import "RCTHTTPRequestHandler.h" -#import "RCTAssert.h" -#import "RCTConvert.h" -#import "RCTEventDispatcher.h" -#import "RCTImageLoader.h" -#import "RCTLog.h" -#import "RCTUtils.h" - @interface RCTHTTPRequestHandler () @end From c065d98112de24acc6995ac9057c9313143b9f9f Mon Sep 17 00:00:00 2001 From: Alex Akers Date: Mon, 6 Jul 2015 11:19:02 -0700 Subject: [PATCH 07/11] [React Native] Change `nil` to `Nil` because it's more correct Summary: #OCD --- React/Base/RCTUtils.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/React/Base/RCTUtils.m b/React/Base/RCTUtils.m index 7de19b51b..0cee88ce9 100644 --- a/React/Base/RCTUtils.m +++ b/React/Base/RCTUtils.m @@ -249,12 +249,12 @@ NSDictionary *RCTMakeAndLogError(NSString *message, id toStringify, NSDictionary BOOL RCTRunningInTestEnvironment(void) { - static BOOL _isTestEnvironment = NO; + static BOOL isTestEnvironment = NO; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ - _isTestEnvironment = (NSClassFromString(@"SenTestCase") != nil || NSClassFromString(@"XCTest") != nil); + isTestEnvironment = NSClassFromString(@"SenTestCase") || NSClassFromString(@"XCTest"); }); - return _isTestEnvironment; + return isTestEnvironment; } BOOL RCTImageHasAlpha(CGImageRef image) From 3955236b0ff3e48891a55bcb01303a298f6a134b Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Mon, 6 Jul 2015 15:00:17 -0700 Subject: [PATCH 09/11] Update StaticContainer from static_upstream --- .../StaticContainer/StaticContainer.js | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/Libraries/vendor/react_contrib/StaticContainer/StaticContainer.js b/Libraries/vendor/react_contrib/StaticContainer/StaticContainer.js index e37d0aaa4..9165576d7 100644 --- a/Libraries/vendor/react_contrib/StaticContainer/StaticContainer.js +++ b/Libraries/vendor/react_contrib/StaticContainer/StaticContainer.js @@ -1,5 +1,5 @@ /** - * @generated SignedSource<> + * @generated SignedSource<<2a163cdb088fb963f941e627fd89ce11>> * * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! * !! This file is a check-in of a static_upstream project! !! @@ -12,8 +12,11 @@ * !! static_upstream. !! * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! * + * Copyright 2004-present Facebook. All Rights Reserved. + * * @providesModule StaticContainer.react - * @jsx React.DOM + * @typechecks + * @flow */ var React = require('React'); @@ -35,16 +38,17 @@ var onlyChild = require('onlyChild'); * Typically, you will not need to use this component and should opt for normal * React reconciliation. */ -var StaticContainer = React.createClass({ +class StaticContainer extends React.Component { - shouldComponentUpdate: function(nextProps) { - return nextProps.shouldUpdate; - }, - - render: function() { - return onlyChild(this.props.children); + shouldComponentUpdate(nextProps: Object): boolean { + return !!nextProps.shouldUpdate; } -}); + render() { + var child = this.props.children; + return (child === null || child === false) ? null : onlyChild(child); + } + +} module.exports = StaticContainer; From 65027e8e29d9e2f837b0f60f0a96a8b50bad1d64 Mon Sep 17 00:00:00 2001 From: Eric Vicenti Date: Mon, 6 Jul 2015 14:59:53 -0700 Subject: [PATCH 10/11] [ReactNative] Fix timeout edge-case in POPAnimation hack --- Libraries/Animation/POPAnimationMixin.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Libraries/Animation/POPAnimationMixin.js b/Libraries/Animation/POPAnimationMixin.js index bf95f41bf..0e109062c 100644 --- a/Libraries/Animation/POPAnimationMixin.js +++ b/Libraries/Animation/POPAnimationMixin.js @@ -36,6 +36,7 @@ var POPAnimationMixin = { AnimationProperties: POPAnimation.Properties, getInitialState: function(): Object { + this._popAnimationEnqueuedAnimationTimeouts = []; return { _currentAnimationsByNodeHandle: {}, }; @@ -120,10 +121,11 @@ var POPAnimationMixin = { } doneCallback && doneCallback(finished); }; - // Hack to aviod race condition. This delay should be imperceptible: - setTimeout(() => { + // Hack to aviod race condition in POP: + var animationTimeoutHandler = setTimeout(() => { POPAnimation.addAnimation(nodeHandle, animID, cleanupWrapper); - }, 10); + }, 1); + this._popAnimationEnqueuedAnimationTimeouts.push(animationTimeoutHandler); }, /** @@ -254,6 +256,10 @@ var POPAnimationMixin = { // Cleanup any potentially leaked animations. componentWillUnmount: function() { this.stopAllAnimations(); + this._popAnimationEnqueuedAnimationTimeouts.forEach(animationTimeoutHandler => { + clearTimeout(animationTimeoutHandler); + }); + this._popAnimationEnqueuedAnimationTimeouts = []; } }; From 0f2d8e662ec0452d5781ef240ec913addc802747 Mon Sep 17 00:00:00 2001 From: Param Aggarwal Date: Mon, 6 Jul 2015 17:29:30 -0700 Subject: [PATCH 11/11] [ScrollView] Pick data from older event on coalescing. Summary: The `ScrollView` sends important `updatedChildFrames` data to the `ListView` to be able to implement `onChangeVisibleRows` method. Coalescing operates very strongly on older devices like the iPhone 4s where this data is then lost. Fixes #1782. `ListView` has a method called `onChangeVisibleRows` that is called whenever the rows visible on screen change. This method is critical to be able to implement deletion/creation of views and hence be conservative in memory usage. I have an infinite scrolling view which uses this method to only render the full rows for what is visible on screen and put placeholders for everything else. In the `RCTEventDispatcher`, we [coalesce events](https://github.com/facebook/react-native/blob/522fd33d6f3c8fb339b0dde35b05df34c1233306/React/Base/RCTEventDispatcher.m#L135-L152) that are meant to be sent across the bridge. They are [dequeued](https://github.com/facebook/react-native/blob/522fd33d6f3c8fb339b0dde35b05df34c1233306/React/Base/RCTEventDispatcher.m#L180-L188) on each Closes https://github.com/facebook/react-native/pull/1783 Github Author: Param Aggarwal --- React/Views/RCTScrollView.m | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/React/Views/RCTScrollView.m b/React/Views/RCTScrollView.m index 6c3f5d519..252867849 100644 --- a/React/Views/RCTScrollView.m +++ b/React/Views/RCTScrollView.m @@ -114,8 +114,16 @@ RCT_NOT_IMPLEMENTED(-init) return YES; } -- (id)coalesceWithEvent:(id)newEvent +- (RCTScrollEvent *)coalesceWithEvent:(RCTScrollEvent *)newEvent { + NSArray *updatedChildFrames = [_userData[@"updatedChildFrames"] arrayByAddingObjectsFromArray:newEvent->_userData[@"updatedChildFrames"]]; + + if (updatedChildFrames) { + NSMutableDictionary *userData = [newEvent->_userData mutableCopy]; + userData[@"updatedChildFrames"] = updatedChildFrames; + newEvent->_userData = userData; + } + return newEvent; }