Summary: If you use a ShakeDetector, you can specify the minimum number of shakes required to trigger a shake handler. Otherwise, the minimum number of required shakes is set to 1 by default.
Reviewed By: achen1
Differential Revision: D5155604
fbshipit-source-id: 5073fa37d4c223eb18e85b5e850b95d37136e3d2
Summary:
Thanks for submitting a PR! Please read these instructions carefully:
- [x] Explain the **motivation** for making this change.
- [x] Provide a **test plan** demonstrating that the code is solid.
- [x] Match the **code formatting** of the rest of the codebase.
- [x] Target the `master` branch, NOT a "stable" branch.
This change allows app code to access the 'category' property of incoming iOS remote push notifications. Currently the property is not made available.
Create a test application which:
- registers for remote notifications with APNs
- passes the returned token to your push notification service provider
- displays the contents of the notification, including the 'category'
Send a remote push notification including a value for the category property in the payload. Check that the category is displayed in the application.
I considered updating RNTester but I couldn't for the life of me figure out how to get it to compile on my machine, sorry ;-) I can confirm my change works when applied directly in the node_modules of an existing RN project.
I've signed the CLA. Hope this is enough info to go on, please let me know if not!
Closes https://github.com/facebook/react-native/pull/14322
Differential Revision: D5184941
Pulled By: javache
fbshipit-source-id: b69decedafac37a5212efcf32faf858aa67ed691
Summary:
Fixes#13691.
Prior to this change, VoiceOver generally didn't say anything when selecting a multiline TextInput. The only exception was VoiceOver would announce the TextInput's placeholder if it had one set.
After this change, VoiceOver announces the following for multiline TextInputs:
- The TextInput's content.
- The TextInput's placeholder if the TextInput doesn't have any content in it.
- The fact that the TextInput is a textfield.
- The cursor position if the TextInput is being edited.
This is similar to the behavior of single line TextInputs.
This change achieves this by disabling `RCTTextView` as an accessibility element. `RCTTextView` is a subclass of `RCTView` so VoiceOver doesn't recognize this as a textfield. Instead, VoiceOver now sees the child `RCTUITextView` which is a subclass of `UITextView` so VoiceOver does recognize it as a textfield. Additionally, an `accessibilityLabel` implementation was added to `RCTUITextView` in order to take the value of the placeholder into account.
Verified the announcements of TextInputs with various props:
- No placeholder and no content
- Just a placeholder
- Just content
- Both a placeholder and content
Did this for both singe line inputs and multiline inputs. For setting content in multiline inputs, I tested both using the `value` prop and passing children. All other props being equal, these configurations resulted in similar announcements.
I verified that the following accessibility props work the same on singleline and multiline TextInputs:
- `accessible`
- `accessibilityLabel`
- `accessibilityTraits`
- `accessibilityViewIsModal`
- `onAccessibilityTap`
- `onMagicTap`
Additionally, my team has been using this change in our app.
Adam Comella
Microsoft Corp.
Closes https://github.com/facebook/react-native/pull/14200
Differential Revision: D5185727
Pulled By: shergin
fbshipit-source-id: 94271e6c8b089eb82006b52fe7917649d69e74af
Summary:
Circle only runs the commands under "deployment" if all tests pass. As a result, website deploys tend to get blocked unnecessarily when Circle is red, even when the website has no issues.
As every command under "overrride" is run independently even if other commands fail, the result of this PR is that the website will be deployed on every Circle run on `master` or any of the `-stable` branches.
Note that the "deployment" section is only executed when Circle is run against the master/-stable branch, and Circle is configured to not run deployments on forks. Since "override" does not have these protections in place, I've added some guards to ensure that a web deploy only occurs on runs triggered by commits to master/-stable on the main `facebook/react-native` repo.
This PR assumes the following are correct:
- `CI_PULL_REQUEST` and `CIRCLE_PR_USERNAME` are only set when [run on a fork](https://circleci.com/docs/1.0/environment-variables/#building-pull-requests-that-come-from-forks).
- `CIRCLE_PROJECT_USERNAME ` is only set to "facebook" when the run is triggered by a commit on the main `facebook/react-native` repo, and not a fork.
* Configuring circle.yml: https://circleci.com/docs/1.0/configuration/
* Environment Variables: https://circleci.com/docs/1.0/environment-variables/
None, aside from checking that bash can handle these conditionals. We need to trial this on Circle. Great attention needs to be paid to the conditionals, to ensure we do not allow forks to deploy the official website. We also need to make sure we are not leaking the GitHub access token accidentally.
Closes https://github.com/facebook/react-native/pull/14310
Differential Revision: D5179748
Pulled By: hramos
fbshipit-source-id: 405963f7e3bf2c1969e3e9a282781ce72c04e2d7
Summary:
Sometimes, when we implement some custom RN view, we have to proxy all accessible atributes directly to some subview which actually has accesible content. So, in other words, this allows bypass some axillary views in terms of accessibility.
Concreate example which this approach supposed to fix:
https://github.com/facebook/react-native/pull/14200/files#diff-e5f6b1386b7ba07fd887bca11ec828a4R208
Reviewed By: mmmulani
Differential Revision: D5143860
fbshipit-source-id: 6d7ce747f28e5a31d32c925b8ad8fd4b98ce1de1
Summary: This is a basic README for the new repo. We'll eventually expand on this as more pieces get open sourced and we'll evolve the three identifying tags over time.
Reviewed By: jeanlauliac
Differential Revision: D5172314
fbshipit-source-id: 8e5dd8567eadbcb839ee9860a22929fd6a77ee2e
Summary:
Thanks for submitting a PR! Please read these instructions carefully:
- [x] Explain the **motivation** for making this change.
- [ ] Provide a **test plan** demonstrating that the code is solid.
- [ ] Match the **code formatting** of the rest of the codebase.
- [ ] Target the `master` branch, NOT a "stable" branch.
InspectorPackagerConnection now creates a new OkHttpClient when previous connection fails. If the failures occur frequently, many Threads are created in `WebSocketCall.enqueue()`. On my Pixel phone, I have seen up to 260 Threads named "OkHttp ConnectionPool" alive at the same time. So, why don't we consider reusing the existing OkHttpClient instance ?
N/A
Sign the [CLA][2], if you haven't already.
Small pull requests are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it.
Make sure all **tests pass** on both [Travis][3] and [Circle CI][4]. PRs that break tests are unlikely to be merged.
For more info, see the ["Pull Requests"][5] section of our "Contributing" guidelines.
[1]: https://medium.com/martinkonicek/what-is-a-test-plan-8bfc840ec171#.y9lcuqqi9
[2]: https://code.facebook.com/cla
[3]: https://travis-ci.org/facebook/react-native
[4]: http://circleci.com/gh/facebook/react-native
[5]: https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md#pull-requests
Closes https://github.com/facebook/react-native/pull/14301
Differential Revision: D5172277
Pulled By: javache
fbshipit-source-id: 7d417fa0675eb627f0b1ca41847b75686c8d1f3e
Summary: It can be useful when you want to setup `tintColor` for the image or get a reference to call `setNativeProps` then.
Reviewed By: ericvicenti
Differential Revision: D5158908
fbshipit-source-id: 873c1cae9bd0af711a42016dcc548231e3cf89e7
Summary:
The packager dependencies CLI command always operates on --dev=true today. This means any tooling that needs to get the production dependencies (--dev=false) will always get the dev-mode list instead. For instance:
```
if (__DEV__) {
require('Foobar');
}
```
Previously, `Foobar.js` will always be listed in the CLI output. With this change, setting `--dev false` option will correctly skip `Foobar.js` in the output.
Reviewed By: cpojer
Differential Revision: D5163184
fbshipit-source-id: 203221ee5d6ecb7df575442f12f6c4c489bfbd46
Summary:
The `requestIdleCallback` sometimes doesn't work in `Debug JS Remotely` mode if I use real device, the callback will never called. I guess it may be debugger worker and device caused by the time gap, or some cause websocket blocking, so it's just sometimes happening.
I think we can support [options](https://developer.mozilla.org/zh-TW/docs/Web/API/Window/requestIdleCallback#Parameters) for that.
Added an example `Run requestIdleCallback with timeout option` for Timers of UIExplorer, it use `{ timeout: 100 }` option with burn CPU 100ms, we can see `didTimeout` is true.
Closes https://github.com/facebook/react-native/pull/13116
Differential Revision: D4894348
Pulled By: hramos
fbshipit-source-id: 29c4c2fe5634b30a8bf8d3495305cd8f635ed922
Summary: This should fix the e2e test for OSS.
Reviewed By: cpojer
Differential Revision: D5164267
fbshipit-source-id: d858b4811f0eb80ca7363177f4f384b66af13994
Summary:
This is a fix on top of 56b10fc. It takes the case into account were you have `wrap-reverse` and `align-items: flex-end` set.
Closes https://github.com/facebook/yoga/pull/568
Differential Revision: D5155521
Pulled By: emilsjolander
fbshipit-source-id: 7e5fcfa2fbb48b6c6279da46cc648a071ff2b079
Summary:
minor spelling error fix
Thanks for submitting a PR! Please read these instructions carefully:
- [ Found this small spelling error while reading thought of reporting it ] Explain the **motivation** for making this change.
- [ Test not required ] Provide a **test plan** demonstrating that the code is solid.
- [ ] Match the **code formatting** of the rest of the codebase.
- [ ] Target the `master` branch, NOT a "stable" branch.
What existing problem does the pull request solve?
A good test plan has the exact commands you ran and their output, provides screenshots or videos if the pull request changes UI or updates the website. See [What is a Test Plan?][1] to learn more.
If you have added code that should be tested, add tests.
Sign the [CLA][2], if you haven't already.
Small pull requests are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it.
Make sure all **tests pass** on both [Travis][3] and [Circle CI][4]. PRs that break tests are unlikely to be merged.
For more info, see the ["Pull Requests"][5] section of our "Contributing" guidelines.
[1]: https://medium.com/martinkonicek/what-is-a-test-plan-8bfc840ec171#.y9lcuqqi9
[2]: https://code.facebook.com/cla
[3]: https://travis-ci.org/facebook/react-native
[4]: http://circleci.com/gh/facebook/react-native
[5]: https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md#pull-requests
Closes https://github.com/facebook/react-native/pull/14273
Differential Revision: D5160964
Pulled By: hramos
fbshipit-source-id: 3142cc511476e8b494576b8e31faf43eb97b40c5
Summary:
When trying to mock an Image on Android, this error occurs referencing the ImageLoader mock in setup.js:
```
/Users/.../node_modules/react-native/jest/setup.js:120
return success(320,240);
^
TypeError: success is not a function
at /Users/.../node_modules/react-native/jest/setup.js:120:8
at _combinedTickCallback (internal/process/next_tick.js:73:7)
at process._tickCallback (internal/process/next_tick.js:104:9)
```
- Mocking Images works for iOS but not Android.
- Since Image.android.js uses ImageLoader vs ImageViewManager, the code cannot be carried over from iOS.
Since this is code within the testing framework, the existing tests should test this. If there is no existing test coverage, then this would need to be done.
Closes https://github.com/facebook/react-native/pull/14262
Differential Revision: D5162640
Pulled By: shergin
fbshipit-source-id: 5b1efbbb685b767e09b5c7fb05f073445c94a3aa
Summary:
Thanks for submitting a PR! Please read these instructions carefully:
- [x] Explain the **motivation** for making this change.
- [ ] Provide a **test plan** demonstrating that the code is solid.
- [ ] Match the **code formatting** of the rest of the codebase.
- [ ] Target the `master` branch, NOT a "stable" branch.
What existing problem does the pull request solve?
Wrong URL
A good test plan has the exact commands you ran and their output, provides screenshots or videos if the pull request changes UI or updates the website. See [What is a Test Plan?][1] to learn more.
If you have added code that should be tested, add tests.
Sign the [CLA][2], if you haven't already.
Small pull requests are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it.
Make sure all **tests pass** on both [Travis][3] and [Circle CI][4]. PRs that break tests are unlikely to be merged.
For more info, see the ["Pull Requests"][5] section of our "Contributing" guidelines.
[1]: https://medium.com/martinkonicek/what-is-a-test-plan-8bfc840ec171#.y9lcuqqi9
[2]: https://code.facebook.com/cla
[3]: https://travis-ci.org/facebook/react-native
[4]: http://circleci.com/gh/facebook/react-native
[5]: https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md#pull-requests
Closes https://github.com/facebook/react-native/pull/14179
Differential Revision: D5159951
Pulled By: shergin
fbshipit-source-id: fd2ef3d4dbcdc4bd5dfecdf8180a9f4da4f29602