From c65d90426413c8c3f03a1de6942e64886f55a8d7 Mon Sep 17 00:00:00 2001 From: Rafael Oleza Date: Fri, 1 Sep 2017 08:44:50 -0700 Subject: [PATCH 001/297] Improve HMR performance by allowing to specify bundlingOptions to getShallowDependencies() method Reviewed By: jeanlauliac Differential Revision: D5745205 fbshipit-source-id: a69ac40bb676a809e3786681179e2b4bac392ce6 --- local-cli/server/util/attachHMRServer.js | 2 ++ local-cli/server/util/getInverseDependencies.js | 1 + 2 files changed, 3 insertions(+) diff --git a/local-cli/server/util/attachHMRServer.js b/local-cli/server/util/attachHMRServer.js index 50c7f096007986..b9502893c274ee 100644 --- a/local-cli/server/util/attachHMRServer.js +++ b/local-cli/server/util/attachHMRServer.js @@ -39,6 +39,7 @@ type DependencyOptions = {| +platform: ?string, +recursive: boolean, +rootEntryFile: string, + +bundlingOptions?: Object, |}; /** @@ -144,6 +145,7 @@ function attachHMRServer( minify: false, platform: platform, recursive: true, + bundlingOptions: response.options, }); return { diff --git a/local-cli/server/util/getInverseDependencies.js b/local-cli/server/util/getInverseDependencies.js index 2c568cb4a1e4da..927af924672998 100644 --- a/local-cli/server/util/getInverseDependencies.js +++ b/local-cli/server/util/getInverseDependencies.js @@ -27,6 +27,7 @@ export type ResolutionResponse = { getResolvedDependencyPairs( module: TModule, ): $ReadOnlyArray<[string, TModule]>, + options: Object, }; function resolveModuleRequires( From 4cba3abf06d133607aa3b67d743c2d48f066c965 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Gregorczyk?= Date: Fri, 1 Sep 2017 09:01:17 -0700 Subject: [PATCH 002/297] Fix NPE in ReactInstaceManager.setupReactContext Reviewed By: AaaChiuuu, mhorowitz Differential Revision: D5724464 fbshipit-source-id: 80d0b97f4294f6894e0d034dda6dd1a3db4b1341 --- .../facebook/react/ReactInstanceManager.java | 39 ++++++++++--------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java b/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java index 52e44d387269ec..29c9394d5b5376 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java @@ -903,25 +903,28 @@ public void run() { }); Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE); ReactMarker.logMarker(SETUP_REACT_CONTEXT_END); - mCurrentReactContext.runOnJSQueueThread(new Runnable() { - @Override - public void run() { - Process.setThreadPriority(Process.THREAD_PRIORITY_DEFAULT); - } - }); - mCurrentReactContext.runOnNativeModulesQueueThread(new Runnable() { - @Override - public void run() { - Process.setThreadPriority(Process.THREAD_PRIORITY_DEFAULT); - } - }); + reactContext.runOnJSQueueThread( + new Runnable() { + @Override + public void run() { + Process.setThreadPriority(Process.THREAD_PRIORITY_DEFAULT); + } + }); + reactContext.runOnNativeModulesQueueThread( + new Runnable() { + @Override + public void run() { + Process.setThreadPriority(Process.THREAD_PRIORITY_DEFAULT); + } + }); if (mUseSeparateUIBackgroundThread) { - mCurrentReactContext.runOnUiBackgroundQueueThread(new Runnable() { - @Override - public void run() { - Process.setThreadPriority(Process.THREAD_PRIORITY_DEFAULT); - } - }); + reactContext.runOnUiBackgroundQueueThread( + new Runnable() { + @Override + public void run() { + Process.setThreadPriority(Process.THREAD_PRIORITY_DEFAULT); + } + }); } } From 8ffe131dad9e1f24877b2a44477017b036fcb839 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Gregorczyk?= Date: Fri, 1 Sep 2017 09:01:26 -0700 Subject: [PATCH 003/297] Do not let macros mess with shape of JSExecutor's vtable Reviewed By: mhorowitz Differential Revision: D5750246 fbshipit-source-id: b9b428bb301abe208075d409b1a08cde070b17d8 --- ReactCommon/cxxreact/JSExecutor.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/ReactCommon/cxxreact/JSExecutor.h b/ReactCommon/cxxreact/JSExecutor.h index 40a0e16a901a7c..8299d5d39d2b77 100644 --- a/ReactCommon/cxxreact/JSExecutor.h +++ b/ReactCommon/cxxreact/JSExecutor.h @@ -73,9 +73,7 @@ class JSExecutor { return nullptr; } - #ifdef WITH_JSC_MEMORY_PRESSURE virtual void handleMemoryPressure(int pressureLevel) {} - #endif virtual void destroy() {} virtual ~JSExecutor() {} From 9f76e9d374f4e84a5a4cdfc10a3bb838f441a5bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Gregorczyk?= Date: Fri, 1 Sep 2017 09:01:27 -0700 Subject: [PATCH 004/297] Test for non-JSC JavaScriptExecutor Reviewed By: mhorowitz Differential Revision: D5746286 fbshipit-source-id: 5bc5d5fcbc9e3ab7de0153145b1276edd3f3aa13 --- ReactAndroid/src/main/jni/react/jni/BUCK | 1 + 1 file changed, 1 insertion(+) diff --git a/ReactAndroid/src/main/jni/react/jni/BUCK b/ReactAndroid/src/main/jni/react/jni/BUCK index 4d0b6fcc2541d9..6ab552e094da60 100644 --- a/ReactAndroid/src/main/jni/react/jni/BUCK +++ b/ReactAndroid/src/main/jni/react/jni/BUCK @@ -6,6 +6,7 @@ EXPORTED_HEADERS = [ "CxxModuleWrapperBase.h", "CxxSharedModuleWrapper.h", "JavaModuleWrapper.h", + "JavaScriptExecutorHolder.h", "JSLoader.h", "MethodInvoker.h", "ModuleRegistryBuilder.h", From 24d789deb6f0ee74ff7058bc6f132f8187317954 Mon Sep 17 00:00:00 2001 From: Mike Grabowski Date: Fri, 1 Sep 2017 10:56:27 -0700 Subject: [PATCH 005/297] Add missing links to blog article Summary: When copying meeting notes from Google Docs, I missed some of the links. Closes https://github.com/facebook/react-native/pull/15737 Differential Revision: D5756005 Pulled By: hramos fbshipit-source-id: fbaf6469168cff116a839549897029eb33b568ab --- blog/2017-08-30-react-native-monthly-3.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/blog/2017-08-30-react-native-monthly-3.md b/blog/2017-08-30-react-native-monthly-3.md index 0321507f7d6677..c46cdd463c4cdd 100644 --- a/blog/2017-08-30-react-native-monthly-3.md +++ b/blog/2017-08-30-react-native-monthly-3.md @@ -34,7 +34,7 @@ Here are the notes from each team: - Released support for installing npm packages on [Snack](https://snack.expo.io). Usual Expo restrictions apply -- packages can't depend on custom native APIs that aren't already included in Expo. We are also working on supporting multiple files and uploading assets in Snack. [Satyajit](https://github.com/satya164) will talk about Snack at [React Native Europe](https://react-native.eu/). - Released SDK20 with camera, payments, secure storage, magnetometer, pause/resume fs downloads, and improved splash/loading screen. -- Continuing to work with [Krzysztof](https://github.com/kmagiera/react-native-gesture-handler) on [react-native-gesture-handler](https://github.com/kmagiera/react-native-gesture-handler). Please give it a try, rebuild some gesture that you have previously built using PanResponder or native gesture recognizers and let us know what issues you encounter. +- Continuing to work with [Krzysztof](https://github.com/kmagiera) on [react-native-gesture-handler](https://github.com/kmagiera/react-native-gesture-handler). Please give it a try, rebuild some gesture that you have previously built using PanResponder or native gesture recognizers and let us know what issues you encounter. - Experimenting with JSC debugging protocol, working on a bunch of feature requests on [Canny](https://expo.canny.io/feature-requests). ### Facebook @@ -46,14 +46,14 @@ Here are the notes from each team: ### Microsoft - The new Skype app is built on top of React Native in order to facilitate sharing as much code between platforms as possible. The React Native-based Skype app is currently available in the iOS and Android app stores. -- While building the Skype app on React Native, we send pull requests to React Native in order to address bugs and missing features that we come across. So far, we've gotten about 70 pull requests merged. -- React Native enabled us to power both the iOS and Android Skype apps from the same codebase. We also want to use that codebase to power the Skype web app. To help us achieve that goal, we built and open sourced a thin layer on top of React/React Native called ReactXP. ReactXP provides a set of cross platform components that get mapped to React Native when targeting iOS/Android and to react-dom when targeting the web. ReactXP's goals are similar to another open source library called React Native for Web. There's a brief description of how the approaches of these libraries differ in the ReactXP FAQ. +- While building the Skype app on React Native, we send pull requests to React Native in order to address bugs and missing features that we come across. So far, we've gotten about [70 pull requests merged](https://github.com/facebook/react-native/pulls?utf8=%E2%9C%93&q=is%3Apr%20author%3Arigdern%20). +- React Native enabled us to power both the iOS and Android Skype apps from the same codebase. We also want to use that codebase to power the Skype web app. To help us achieve that goal, we built and open sourced a thin layer on top of React/React Native called [ReactXP](https://microsoft.github.io/reactxp/blog/2017/04/06/introducing-reactxp.html). ReactXP provides a set of cross platform components that get mapped to React Native when targeting iOS/Android and to react-dom when targeting the web. ReactXP's goals are similar to another open source library called React Native for Web. There's a brief description of how the approaches of these libraries differ in the [ReactXP FAQ](https://microsoft.github.io/reactxp/docs/faq.html). ### Shoutem -- We are continuing are efforts on improving and simplifying the developer experience when building apps using Shoutem. +- We are continuing our efforts on improving and simplifying the developer experience when building apps using [Shoutem](https://shoutem.github.io/). - Started migrating all our apps to react-navigation, but we ended postponing this until a more stable version is released, or one of the native navigation solutions becomes stable. -- Updating all our extensions and most of our open source libraries (animation, theme, ui) to React Native 0.47.1. +- Updating all our [extensions](https://github.com/shoutem/extensions) and most of our open source libraries ([animation](https://github.com/shoutem/animation), [theme](https://github.com/shoutem/theme), [ui](https://github.com/shoutem/ui)) to React Native 0.47.1. ## Next session From 91c52af083a06becd13a91c5828ad2d3baff848a Mon Sep 17 00:00:00 2001 From: Shiva Pandey Date: Fri, 1 Sep 2017 11:29:08 -0700 Subject: [PATCH 006/297] Example of getPhotos Method Summary: Example for loading Media using CameraRoll getPhotos method The cameraRoll API doesn't have a proper example of how to use the methods. So, I decided to provide a basic example with a use case. (Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Bonus points for screenshots and videos!) Closes https://github.com/facebook/react-native/pull/15647 Differential Revision: D5748965 Pulled By: hramos fbshipit-source-id: df8ad50d597dcc745a7f6abcc52839695ffe452c --- Libraries/CameraRoll/CameraRoll.js | 37 ++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/Libraries/CameraRoll/CameraRoll.js b/Libraries/CameraRoll/CameraRoll.js index e4a22a460f25c1..b33e57085a5a2d 100644 --- a/Libraries/CameraRoll/CameraRoll.js +++ b/Libraries/CameraRoll/CameraRoll.js @@ -217,6 +217,43 @@ class CameraRoll { * - `has_next_page`: {boolean} * - `start_cursor`: {boolean} * - `end_cursor`: {boolean} + * + * Loading images: + * ``` + * _handleButtonPress = () => { + * CameraRoll.getPhotos({ + * first: 20, + * assetType: 'All', + * }) + * .then(r => { + * this.setState({ photos: r.edges }); + * }) + * .catch((err) => { + * //Error Loading Images + * }); + * }; + * render() { + * return ( + * + *