Summary: In React, ReactCompoundView is supposed to be implemented by a View, but there is no ViewGroup counterpart that allows mixing virual nodes and non-virtual ones (Views) in the same parent. This is needed because TouchTargetHelper always considers child Views when looking for touch target before falling back to View/ReactCompoundView. This works incorrectly for e.g. layout-only / flattened nodes. ReactCompoundViewGroup allow intercepting touch event before it is dispatched to its children. In that sense, ReactCompoundView.reactTagForTouch() is like View.onTouchEvent() whereas ReactCompoundViewGroup.interceptsTouchEvent() is like ViewGroup.onInterceptTouchEvent().
Differential Revision: D3018028
fb-gh-sync-id: d2c70a55afb9ce9823275e7483d72e0ebedf52e4
shipit-source-id: d2c70a55afb9ce9823275e7483d72e0ebedf52e4
Summary:025281230de2e316f2770a2db71f8bec6fe43a07 changed `WebSocket` to fire both `onerror` and `onclose`.
However, `setupDevtools` assumed that only one of the two handlers would ever be invoked. When the handler is invoked, it re-invokes itself to keep a socket open. But since both handelrs are invoked, a series of closed or failed sockets can cause an exponential increase in sockets opened.
Symptoms of this bug include eventually reaching the maximum number of file descriptors allowed by the operating system, or a non-responsive system. Within React Native applications, symptoms include a failure to load resources from the React Native server or application crashes.
Reviewed By: frantic
Differential Revision: D3022697
fb-gh-sync-id: 8131ecbd6d8ba30281253340d30370ff511a5efd
shipit-source-id: 8131ecbd6d8ba30281253340d30370ff511a5efd
Summary:I updated the Network documentation to not lead users to use Parse, since its service is shutting down.
Closes https://github.com/facebook/react-native/pull/6140
Differential Revision: D2974665
fb-gh-sync-id: 2a784ad00f742f9f2e2ce369f8b3e1eaab0e2ad4
shipit-source-id: 2a784ad00f742f9f2e2ce369f8b3e1eaab0e2ad4
Summary:Adds a generic close command to the issue bot and add myself to the task force list.
Closes https://github.com/facebook/react-native/pull/6349
Reviewed By: mkonicek
Differential Revision:D3021271
Ninja: RN GitHub bot only
Pulled By: mkonicek
fb-gh-sync-id: dbdce129c4287173a4c16889c16bb5ed9ded5f79
shipit-source-id: dbdce129c4287173a4c16889c16bb5ed9ded5f79
Summary:When running `react-native run-ios`, this feature allows a user to specify which scheme to run.
My project's scheme name is not the same as the xcode project name. Running `react-native run-ios` would error with the following:
```
± |master ↓95 ✓| → react-native run-ios
Found Xcode workspace Poot.xcworkspace
Launching iPhone 6 (9.2)...
Building using "xcodebuild -workspace Poot.xcworkspace -scheme Poot -destination id=2B3E8AAC-DD61-414C-95BD-F4829A8F7CE6 -derivedDataPath build"
User defaults from command line:
IDEDerivedDataPathOverride = /Users/mrickert/Documents/project/ios/build
xcodebuild: error: The workspace named "Poot" does not contain a scheme named "Poot". The "-list" option can be used to find the names of the schemes in the workspace.
Installing build/Build/Products/Debug-iphonesimulator/Poot.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
Failed to install the requested application
An application bundle was n
Closes https://github.com/facebook/react-native/pull/6157
Differential Revision: D3020313
Pulled By: frantic
fb-gh-sync-id: 9d99fa382b3f50045759acea18eff418b15d511d
shipit-source-id: 9d99fa382b3f50045759acea18eff418b15d511d
Summary:After adding support for `XMLHttpRequest#response`, the `fetch` polyfill detects buffer support when debugging in Chrome and sets `responseType` to `'blob'`.
In that case, the response was always empty.
This change will construct a blob if `responseType` has been set to `'blob'` in order to avoid that problem
Reviewed By: steveluscher
Differential Revision: D3018884
fb-gh-sync-id: 4ade0413de67242c3565d95c2880d4a981ba2342
shipit-source-id: 4ade0413de67242c3565d95c2880d4a981ba2342
Summary:Fixes #6281
The JS executor is invalidated from `[RCTBatchedBridger stopLoadingWithError:]`
which prevented another blocks that depended on the executor to run in the bridge
invalidation.
Reviewed By: javache
Differential Revision: D3018299
fb-gh-sync-id: 4f482b9b697bfabd24b405398d25c72b9e1a3c84
shipit-source-id: 4f482b9b697bfabd24b405398d25c72b9e1a3c84
Summary: This diff adds support for initializing the bridge on an arbitrary thread. This is helpful if you want to defer bridge creation, or prevent it from delaying your app startup.
Reviewed By: javache
Differential Revision: D2965725
fb-gh-sync-id: 8065fa89e850031c72ee4427351300986985e9de
shipit-source-id: 8065fa89e850031c72ee4427351300986985e9de
Summary:3 small changes
Added a published android app to the showcase.
Modified the rendering of the apps.
When there's a _source_ property on the app object, the link will show up as shown in this screenshot.
![screen shot 2016-02-04 at 9 13 31 am](https://cloud.githubusercontent.com/assets/5065940/12823220/a79bafcc-cb1f-11e5-8cf5-03b03ecadc45.png)
Also, external links have the _blank target and not just blank (without the underscore), so a new tab/window will always be opened.
Closes https://github.com/facebook/react-native/pull/5761
Differential Revision: D2943464
fb-gh-sync-id: 18c88a90fc7c477730a78442ab0ab45733676dea
shipit-source-id: 18c88a90fc7c477730a78442ab0ab45733676dea
Summary:Motivation: After second navigation event in UIExplorer, content in main page always stayed the same.
Fix: For second and future navigation events use stack.index to retrieve state from stack.children.
Closes https://github.com/facebook/react-native/pull/6312
Differential Revision: D3018119
Pulled By: andreicoman11
fb-gh-sync-id: 4c502c42a0cb7b240e558515fb8fd766d6e1f856
shipit-source-id: 4c502c42a0cb7b240e558515fb8fd766d6e1f856
Summary:Explain the **motivation** for making this change. What existing problem does the pull request solve?
Fixes https://github.com/facebook/react-native/issues/6203
> SyntaxError: Use of const in strict mode.
- The rest of the file isn't using es6 anyway and babel-register is run on the file it's included in
**Test plan (required)**
Shouldn't have issues replacing it since it's used right after one time.
Closes https://github.com/facebook/react-native/pull/6329
Differential Revision: D3017697
Pulled By: martinbigio
fb-gh-sync-id: 42ee011d032a4bae3409b8e7793c9eb508719964
shipit-source-id: 42ee011d032a4bae3409b8e7793c9eb508719964
Summary:The "Android Support Library" package is now named "Local Maven repository for Support Libraries", so this updates the docs and screenshot accordingly.
Closes https://github.com/facebook/react-native/pull/6185
Reviewed By: mkonicek
Differential Revision:D3017638
Ninja: oss only (rn website)
Pulled By: mkonicek
fb-gh-sync-id: 3559a9f09930e7606af7912e7aaee3c4215c1b03
shipit-source-id: 3559a9f09930e7606af7912e7aaee3c4215c1b03
Summary:Motivation: Developer expects `onclose` to be called before/during close of the websocket. The `websocketFailed` event triggers a close but does not invoke onclose.
Testplan: Connect to a websocket server from android, terminate the server, observe that onerror is called, the websocket is closed, but onclose is not called.
Note: the observed bug is in android only because in iOS the underlying websocket implementation fires the `websocketClosed` rather than `websocketFailed` event when the server terminates. Nevertheless, the justification for this change stands that regardless of the cause of the close, if `this.close` is called it is expected this.onclose should be called as well.
Closes https://github.com/facebook/react-native/pull/6307
Differential Revision: D3017458
fb-gh-sync-id: c9e2dfefa597b4e99ee85eaa991667c347f86d83
shipit-source-id: c9e2dfefa597b4e99ee85eaa991667c347f86d83
Summary:Should be self-explanatory.
__Edit__: oh turns out I fixed a memory leak too because of a typo of the typo on teardown.
cc ericvicenti
Closes https://github.com/facebook/react-native/pull/6309
Differential Revision: D3016576
fb-gh-sync-id: 608a39ad293154e47480003bc9b450b521cddbb1
shipit-source-id: 608a39ad293154e47480003bc9b450b521cddbb1
Summary:This commit makes a change to a comment in `Text.md` related to documenting that all text nodes must be wrapped in a `<Text />` component.
I know this is super small, but it was so easy to handle this on Github that I went ahead and did it.
Closes https://github.com/facebook/react-native/pull/6310
Differential Revision: D3016460
Pulled By: vjeux
fb-gh-sync-id: 9cf861c44961c285971ec22489fbf48c16620a5f
shipit-source-id: 9cf861c44961c285971ec22489fbf48c16620a5f
Summary:- Motivation: The WebSocket implementation on Android crashes the app when an attempt is made to write on a web socket that was closed due to a spotty connection. We found this issue by using Pusher, which is built on WebSockets. The following stack trace reveals that the WebSocketModule doesn't catch the case of a closed connection, when a consumer attempts to write:
```sh
Fatal Exception: java.lang.IllegalStateException: closed
at com.squareup.okhttp.internal.ws.RealWebSocket.sendMessage(RealWebSocket.java:109)
at com.facebook.react.modules.websocket.WebSocketModule.send(WebSocketModule.java:176)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.facebook.react.bridge.BaseJavaModule$JavaMethod.invoke(BaseJavaModule.java:249)
at com.facebook.react.bridge.NativeModuleRegistry$ModuleDefinition.call(NativeModuleRegistry.java:158)
at com.facebook.react.bridge.NativeModuleRegistry.call(NativeModuleReg
Closes https://github.com/facebook/react-native/pull/6301
Differential Revision: D3016099
fb-gh-sync-id: 838dd9d2e5e5b7a4e2242fa6de5658dfdaf24f55
shipit-source-id: 838dd9d2e5e5b7a4e2242fa6de5658dfdaf24f55
Summary:Main goal is to get this passed for OSX. I assume this works for linux; please verify. Also if specs need to be added, please suggest
an implementation as there is no __test__ dir for andriod.
using yargs (already a dependency) to allow other terminals besides OSX crummy default terminal. Like (iterm) :)
main use case:
` react-native run-android --open iterm`
The nice thing about this in ITERM is it opens another tab by default which is way less intrusive then OSX default term.
Closes https://github.com/facebook/react-native/pull/5232
Differential Revision: D3011590
Pulled By: mkonicek
fb-gh-sync-id: 7e2a004b3018b4d70aafadf4e9be9682561d7919
shipit-source-id: 7e2a004b3018b4d70aafadf4e9be9682561d7919
Summary:This small update to runAndroid.js allows to specify product flavor as optional argument, like that:
`react-native run-android --option-flavor=staging`
This option is useful when developing complex applications that require some flavor-specific functionality. More information about productFlavors can be found here: http://developer.android.com/intl/ru/tools/building/configuring-gradle.html
Closes https://github.com/facebook/react-native/pull/6010
Differential Revision: D3011662
Pulled By: mkonicek
fb-gh-sync-id: ce730a17340c1f21b5d75f28a784db4d6fd99725
shipit-source-id: ce730a17340c1f21b5d75f28a784db4d6fd99725
Summary:This commit modifies the jsSchedulingOverhead warning to only fire if the JS clock is more than 5 seconds ahead of the native clock. This fixes the issue in #1598 for the common case when there's only a minor difference between the two clocks, while still keeping a sanity check if they're extremely off.
cc nicklockwood tadeuzagallo
Closes https://github.com/facebook/react-native/pull/5731
Differential Revision: D3014985
Pulled By: tadeuzagallo
fb-gh-sync-id: bf57e48b7d97ad02d2aefb6e5aac845824a6fdb0
shipit-source-id: bf57e48b7d97ad02d2aefb6e5aac845824a6fdb0
Summary: Blacklisting is no longer necessary, as fbjs is not used for haste module resolution any longer
Reviewed By: yungsters
Differential Revision: D3014257
fb-gh-sync-id: 39a0397e6b07bdff3dba9d48d58f4254c43eb6b6
shipit-source-id: 39a0397e6b07bdff3dba9d48d58f4254c43eb6b6
Summary: Split dispatchViewUpdates into two methods, which enables subclasses to commit pending ui operations, even when no root node is present.
Differential Revision: D3011191
fb-gh-sync-id: a3491179441223aeffe21ff483dda582053768e7
shipit-source-id: a3491179441223aeffe21ff483dda582053768e7
Summary:Shelling out on win32 does not properly escape the command due to c3bb4b1aa5/lib/child_
This patch ensures a proper lineNumber before continuing, similar to how we check that the fileName passed exists.
**Test plan**
On platform `win32` or given appropriate testing changes to `launchEditor.js`...
With the following `request-bad` file:
```
GET /open-stack-frame HTTP/1.1
Host: 127.0.0.1:8081
Proxy-Connection: keep-alive
Cache-Control: max-age=0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36
Accept-Encoding: gzip, deflate, sdch
Accept-Language: en-US,en;q=0.8
Content-Length: 64
{"file":"C:\\Windows\\system.ini","lineNumber":"123\" && calc"}
```
`$ nc localhost 8081 < request-bad`
Observe that before this patch `calc` would launch and afte
Closes https://github.com/facebook/react-native/pull/6299
Differential Revision: D3012074
Pulled By: davidaurelio
fb-gh-sync-id: cbc7b6e5c60529a289c0989a95593a322333ba5d
shipit-source-id: cbc7b6e5c60529a289c0989a95593a322333ba5d
Summary: Calling setTimeout(f, 0) will currently schedule f to be called the next frame instead of immediately (which is how it behaves on iOS). This immediately calls back to JS and invokes the function.
Reviewed By: astreet, tadeuzagallo
Differential Revision: D3006125
fb-gh-sync-id: 9fa109ed82836a718cbb2e8cb21da4943d96f5f6
shipit-source-id: 9fa109ed82836a718cbb2e8cb21da4943d96f5f6
Summary:Motivation: Catch packager breakages (such as bad shrinkwrap, package.json) quickly and reliably. This is also done as part of the e2e test on Travis. Having an isolated packager test as well makes it easier to see there's a problem with the packager, running in on CircleCI helps detect issues even if the Travis e2e test gets ever broken (have some redundancy, these breakages are pretty painful to fix so we want to detect them as reliably as possible).
**Test plan (required)**
Ran this locally:
git checkout master
./scripts/e2e-test.sh --packager # The packager created the bundle, exit code was 0
# Made the packager fail on bad JS
./scripts/e2e-test.sh --packager # Exit code was 1
Closes https://github.com/facebook/react-native/pull/6294
Differential Revision: D3011910
fb-gh-sync-id: 20e8eb29f6aeb3a494a7ef1dbf9cb08fa4e18e27
shipit-source-id: 20e8eb29f6aeb3a494a7ef1dbf9cb08fa4e18e27
Summary:- Simplified the PR and Issue template to make them easier to read.
- Add a very simple guide for reviewing PRs (cc bestander, feel free to add to this)
Closes https://github.com/facebook/react-native/pull/6295
Differential Revision: D3011905
fb-gh-sync-id: 4929921690a6996e574e6b152a9dd41087cfffdc
shipit-source-id: 4929921690a6996e574e6b152a9dd41087cfffdc
Summary:Adding Veggies, a simple app to help you find fruits and vegetables in season right now. It is entirely built in React Native.
Closes https://github.com/facebook/react-native/pull/6289
Differential Revision: D3011711
Pulled By: mkonicek
fb-gh-sync-id: d3f43e13fdcd9dd277aaa7aeead45a46b4b63b42
shipit-source-id: d3f43e13fdcd9dd277aaa7aeead45a46b4b63b42
Summary:Making buck rebundle the worker script on every JS change is insanely slow. This allows the script to be downloaded for debug builds.
The plan is to couple this with an implementation of `require.resolve` which will automatically insert the correct packager network path in DEV builds and the correct local path in release builds.
e.g.
var worker = new Worker(require.resolve('WebWorkerSample_getPrimesBetween.js'));
Reviewed By: lexs
Differential Revision: D2939279
fb-gh-sync-id: fbf64bbf1df1649b44e4b98ac504d095c10104a6
shipit-source-id: fbf64bbf1df1649b44e4b98ac504d095c10104a6
Summary:When using the `Image` component with a `src` property instead of `source` the component fails silently. vjeux suggested to add a warning (https://twitter.com/Vjeux/status/704509214937317378).
Tested with the UIExplorer example on iOS and Android simulators.
Closes https://github.com/facebook/react-native/pull/6221
Differential Revision: D3011659
Pulled By: mkonicek
fb-gh-sync-id: c9bae6c802c173ef85d9c4552747db994c58906e
shipit-source-id: c9bae6c802c173ef85d9c4552747db994c58906e
Summary:There was a deadlock in the bridge if a native module tried to dispatch an event through EventDispatcher (that thread would hold the mTeardownLock and want the mEventStaging lock) at the same time the EventDispatcher callback was triggered and tried to dispatch a call through JS (that thread would hold the mEventStaging lock and want the mTeardownLock).
Now there are two locks (lol). In the scenario above, the native module would hold the mJSToJavaTeardownLock and want the mEventStaging lock, while the EventDispatcher callback would hold the mEventStaging lock and want the mJavaToJSTeardownLock.
Reviewed By: lexs
Differential Revision: D3011526
fb-gh-sync-id: c3ebd5c14a6370d73caebf6c99fcba18a86c6ac1
shipit-source-id: c3ebd5c14a6370d73caebf6c99fcba18a86c6ac1
Summary:PR does as it says -- updates Babel dependencies to latest versions.
In general, this changes nothing for 99.9% of users (everyone that isn't FB). If they were to `npm install react-native` right now, they would get all of these dependencies anyway.
However, this does revert a previous change where we were using "~" instead of "^" in front of the Babel deps in order to attempt to lock them to minor dependencies. However, due to the fact that each Babel package uses "^", and there are so many interdependencies, this actually would cause an issue where multiple versions of babel-core, et. al. to be installed.
*Edit* - In addition, we add React to `devDependencies` so that it behaves properly in testing, now that it's a peer dependency.
Closes https://github.com/facebook/react-native/pull/5811
Reviewed By: davidaurelio
Differential Revision: D2931184
Pulled By: martinbigio
fb-gh-sync-id: 7b9fc640d37fb2d98fc1808860f9f64074aff475
shipit-source-id: 7b9fc640d37fb2d98fc1808860f9f64074aff475
Summary: I think we should dispose events in FIFO order
Reviewed By: fkgozali
Differential Revision: D2987425
fb-gh-sync-id: a4ad256512725d0bed0086b642e10fe7e7715070
shipit-source-id: a4ad256512725d0bed0086b642e10fe7e7715070