From 642c13e3e3a2d6581288c649479605b86f12dc06 Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Thu, 12 Mar 2015 12:51:44 -0700 Subject: [PATCH] Updates from Thu Mar 12 - Fixed sticky section headers in ListView | Nick Lockwood - [ReactNative] AppState cleanup, remove Subscribable, add in OSS examples | Eric Vicenti - [react-packager] package.json cleanup (seperate packager into it's own package) | Amjad Masad - [ReactNative] Move PushNotificationIOS to oss | Tadeu Zagallo - [ReactNative] Fix shake gesture after RedBox is dismissed | Alex Kotliarskyi - [catlyst|madman] fix prop type warning | Jiajie Zhu - [ReactNative] Remove Subscribable from TextInput | Eric Vicenti - Unforked ExceptionsManager, AlertManager and AppState | Nick Lockwood - [ReactNative|MAdMan] Notification Subscribable | Eric Vicenti - [ReactNative] OSS AsyncStorage with example | Spencer Ahrens --- Examples/2048/AppDelegate.m | 2 +- Examples/Movies/AppDelegate.m | 2 +- Examples/TicTacToe/AppDelegate.m | 2 +- Examples/UIExplorer/AppStateExample.js | 60 ++++ Examples/UIExplorer/AppStateIOSExample.js | 69 +++++ Examples/UIExplorer/AsyncStorageExample.js | 103 ++++++ Examples/UIExplorer/UIExplorerApp.js | 4 +- Examples/UIExplorer/UIExplorerList.js | 3 + Libraries/AppState/AppState.js | 46 +++ Libraries/AppStateIOS/AppStateIOS.android.js | 24 ++ Libraries/AppStateIOS/AppStateIOS.ios.js | 55 ++++ Libraries/Components/ListView/ListView.js | 4 +- Libraries/Components/ScrollView/ScrollView.js | 8 +- .../Components/TextInput/TextInput.ios.js | 22 +- Libraries/Image/Image.ios.js | 2 +- .../RCTNetwork.xcodeproj/project.pbxproj | 6 + Libraries/Network/RCTReachability.h | 11 + Libraries/Network/RCTReachability.m | 85 +++++ Libraries/ReactIOS/renderApplication.js | 12 +- Libraries/Storage/AsyncStorage.ios.js | 193 ++++++++++++ Libraries/Utilities/PushNotificationIOS.js | 74 +++++ Libraries/react-native/react-native.js | 7 +- ReactKit/Base/RCTRedBox.m | 2 + ReactKit/Base/RCTUtils.h | 5 + ReactKit/Base/RCTUtils.m | 19 ++ ReactKit/Modules/RCTAppState.h | 7 + ReactKit/Modules/RCTAppState.m | 105 +++++++ ReactKit/Modules/RCTAsyncLocalStorage.h | 24 ++ ReactKit/Modules/RCTAsyncLocalStorage.m | 292 ++++++++++++++++++ ReactKit/Modules/RCTExceptionsManager.h | 10 +- ReactKit/Modules/RCTExceptionsManager.m | 22 +- ReactKit/ReactKit.xcodeproj/project.pbxproj | 26 +- ReactKit/Views/RCTPicker.h | 3 + package.json | 16 +- packager/blacklist.js | 10 +- packager/package.json | 45 +++ 36 files changed, 1329 insertions(+), 51 deletions(-) create mode 100644 Examples/UIExplorer/AppStateExample.js create mode 100644 Examples/UIExplorer/AppStateIOSExample.js create mode 100644 Examples/UIExplorer/AsyncStorageExample.js create mode 100644 Libraries/AppState/AppState.js create mode 100644 Libraries/AppStateIOS/AppStateIOS.android.js create mode 100644 Libraries/AppStateIOS/AppStateIOS.ios.js create mode 100644 Libraries/Network/RCTReachability.h create mode 100644 Libraries/Network/RCTReachability.m create mode 100644 Libraries/Storage/AsyncStorage.ios.js create mode 100644 Libraries/Utilities/PushNotificationIOS.js create mode 100644 ReactKit/Modules/RCTAppState.h create mode 100644 ReactKit/Modules/RCTAppState.m create mode 100644 ReactKit/Modules/RCTAsyncLocalStorage.h create mode 100644 ReactKit/Modules/RCTAsyncLocalStorage.m create mode 100644 packager/package.json diff --git a/Examples/2048/AppDelegate.m b/Examples/2048/AppDelegate.m index 76172139c..32d9dd85c 100644 --- a/Examples/2048/AppDelegate.m +++ b/Examples/2048/AppDelegate.m @@ -20,7 +20,7 @@ // // To run on device, change `localhost` to the IP address of your computer, and make sure your computer and // iOS device are on the same Wi-Fi network. - jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/Examples/2048/Game2048.includeRequire.runModule.bundle?dev=true"]; + jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/Examples/2048/Game2048.includeRequire.runModule.bundle"]; // OPTION 2 // Load from pre-bundled file on disk. To re-generate the static bundle, run diff --git a/Examples/Movies/AppDelegate.m b/Examples/Movies/AppDelegate.m index c53f8edc4..c01fc2ca9 100644 --- a/Examples/Movies/AppDelegate.m +++ b/Examples/Movies/AppDelegate.m @@ -20,7 +20,7 @@ // // To run on device, change `localhost` to the IP address of your computer, and make sure your computer and // iOS device are on the same Wi-Fi network. - jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/Examples/Movies/MoviesApp.includeRequire.runModule.bundle?dev=true"]; + jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/Examples/Movies/MoviesApp.includeRequire.runModule.bundle"]; // OPTION 2 // Load from pre-bundled file on disk. To re-generate the static bundle, run diff --git a/Examples/TicTacToe/AppDelegate.m b/Examples/TicTacToe/AppDelegate.m index d2add4fac..52e682752 100644 --- a/Examples/TicTacToe/AppDelegate.m +++ b/Examples/TicTacToe/AppDelegate.m @@ -20,7 +20,7 @@ // // To run on device, change `localhost` to the IP address of your computer, and make sure your computer and // iOS device are on the same Wi-Fi network. - jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/Examples/TicTacToe/TicTacToeApp.includeRequire.runModule.bundle?dev=true"]; + jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/Examples/TicTacToe/TicTacToeApp.includeRequire.runModule.bundle"]; // OPTION 2 // Load from pre-bundled file on disk. To re-generate the static bundle, run diff --git a/Examples/UIExplorer/AppStateExample.js b/Examples/UIExplorer/AppStateExample.js new file mode 100644 index 000000000..ea6400b91 --- /dev/null +++ b/Examples/UIExplorer/AppStateExample.js @@ -0,0 +1,60 @@ +/** + * Copyright 2004-present Facebook. All Rights Reserved. + */ +'use strict'; + +var React = require('react-native'); +var { + AppState, + StyleSheet, + Text, + TouchableHighlight, + View, +} = React; + +var Button = React.createClass({ + render: function() { + return ( + + + {this.props.label} + + + ); + } +}); + +var styles = StyleSheet.create({ + button: { + padding: 10, + alignItems: 'center', + justifyContent: 'center', + }, + buttonLabel: { + color: 'blue', + }, +}); + +exports.title = 'AppState'; +exports.description = 'App background status and badge value'; +exports.examples = [ +{ + title: 'Set Badge Number', + render: function() { + return ( + +