Summary: Added support for WebViews to take in an onContentSizeChange prop, which will return a native event that contains the width and height of the html content in the WebView. Also moved the ContentSizeChangeEvent from the recyclerview dir to the uimanager/events dir
Reviewed By: andreicoman11
Differential Revision: D3775399
fbshipit-source-id: 19a0579f8345e5853cc7311b80f1f1393c77ab58
Summary:
**Motivation:** We have a project that dynamically changes classes in runtime. This component is initialised within the React Native context. Therefor `RCTBatchedBridge` copies the classes before changes are made to them. While React Native is running, changes are made to the classes dynamically. When the project reloads the `RCTBatchedBridge`, it now has an invalid list of classes containing trash pointers. This causes the project to crash on https://github.com/facebook/react-native/blob/master/React/Base/RCTBatchedBridge.m#L288 with EXC_BAD_ACCESS in the DEBUG-mode.
**Solution:** Copy the class list on each reload to get the current state. Since this is only a DEBUG-feature the overhead of this should not be a major issue.
Closes https://github.com/facebook/react-native/pull/9541
Differential Revision: D3775012
Pulled By: javache
fbshipit-source-id: d55fa0742ca100d8018c73080230cf718aa5a7e9
Summary:
Provide a sample new issue template to encourage people to provide additional detail as needed. This should help us reduce the number of new issues that are opened without sufficient information or actionable requests.
The minimal use of markdown is intentional, as these guidelines are more likely to be found in raw text inside the [new issue composer](https://github.com/facebook/react-native/issues/new) rather than rendered to HTML.
Closes https://github.com/facebook/react-native/pull/9074
Differential Revision: D3785606
Pulled By: hramos
fbshipit-source-id: 9982566a0f0d86c71eeface33bd0624a4a9935b2
Summary: added API to in UIManager to find the rootTag/View of any reactTag based on its layout (shadow views) hierarchy (not to be used by JS)
Reviewed By: javache
Differential Revision: D3750410
fbshipit-source-id: 68611e39930d53ece478f25245ddc7f7838daaa6
Summary:
The MessageQueue has a _debugInfo object where it stores debug information associated with each callback. The size of this structure is currently unbounded.
It looks like the code attempted to restrict _debugInfo to a fixed number of entries but due to a logic bug, it leaked around 30 entries for every 1 entry it cleaned up.
This change limits the _debugInfo object to around 30 entries.
**Test plan (required)**
This change is currently being used in my team's app.
Adam Comella
Microsoft Corp.
Closes https://github.com/facebook/react-native/pull/9611
Differential Revision: D3781875
fbshipit-source-id: 58c645c52c3e295fe571b7ca7e0d882169c301ef
Summary:
Running the command `./gradlew clean` resulted in the following error:
```
./node_modules/react-native/ReactAndroid/src/main/jni//xreact/jni/Android.mk:42: *** Android NDK: Aborting. . Stop.
Android NDK: ./node_modules/react-native/ReactAndroid/src/main/jni//xreact/jni/Android.mk: Cannot find module with tag 'cxxreact' in import path
Android NDK: Are you sure your NDK_MODULE_PATH variable is properly defined ?
Android NDK: The following directories were searched:
```
The problem was that `REACT_COMMON_DIR` wasn't defined.
**Test plan (required)**
Running `./gradlew clean` now works.
Adam Comella
Microsoft Corp.
Closes https://github.com/facebook/react-native/pull/9607
Differential Revision: D3780364
fbshipit-source-id: 2b45d538413f7ee2cf0b36a1fa33287f0b1bf23f
Summary:
This adds cookie clearing support for iOS to match the existing support on Android. Helpful for resetting the app to a clean state (say, when logging a user out).
Closes https://github.com/facebook/react-native/pull/9264
Differential Revision: D3776492
Pulled By: javache
fbshipit-source-id: 59ae19ac09d3cf0d0e229cd9e8e30865e65ca96c
Summary:
This is a revised follow up version from #8574 ( originally implemented in `objc` )
This PR change the implementation in JS suggested by javache
**motivation**
To supports vibration pattern like android.
The [iOS vibration implementation link](http://stackoverflow.com/questions/12966467/are-there-apis-for-custom-vibrations-in-ios/13047464#13047464) mentioned by skv-headless at https://github.com/facebook/react-native/pull/6061#discussion_r54062592, which will not be accepted by apple since that implementation uses a private API. Thus, I use pure public API `NSTimer` to implement it.
**Note**
Since vibration time on iOS is not configurable, there are slightly differences with android.
for example:
**Android Usage:**
`Vibration.vibrate([0, 500, 200, 500])`
==> V(0.5s) --wait(0.2s)--> V(0.5s)
`Vibration.vibrate([300, 500, 200, 500])`
==> --wait(0.3s)--> V(0.5s) --wait(0.2s)--> V(0.5s)
**iOS Usage:**
if first argument is 0, it will not be included in pattern array.
( vibration
Closes https://github.com/facebook/react-native/pull/9233
Differential Revision: D3775085
Pulled By: javache
fbshipit-source-id: 370495857d5581399de32d2bed1ea1bcce193e9d
Summary:
Due to an earlier commit, we now have to use the full path for requiring `performanceNow`.
**Test plan (required)**
Verified that the IncrementalExample works when adding it to UIExplorer.
Closes https://github.com/facebook/react-native/pull/9595
Differential Revision: D3775101
Pulled By: javache
fbshipit-source-id: 6252ce8c872896f4cfdb9a31bdbc79d6aaf4684d
Summary:
This adds support for a controlled `selection` prop on `TextInput` on iOS (Android PR coming soon). This is based on the work by ehd in #2668 which hasn't been updated for a while, kept the original commit and worked on fixing what was missing based on the feedback in the original PR.
What I changed is:
- Make the prop properly controlled by JS
- Add a RCTTextSelection class to map the JS object into and the corresponding RCTConvert category
- Make sure the selection change event is properly triggered when the input is focused
- Cleanup setSelection
- Changed TextInput to use function refs to appease the linter
** Test plan **
Tested using the TextInput selection example in UIExplorer on iOS.
Also tested that it doesn't break Android.
Closes https://github.com/facebook/react-native/pull/8958
Differential Revision: D3771229
Pulled By: javache
fbshipit-source-id: b8ede46b97fb3faf3061bb2dac102160c4b20ce7
Summary:
fontVariant implemented in #9045. Appears to have lost platform annotation. Also fixes indentation.
Closes https://github.com/facebook/react-native/pull/9587
Differential Revision: D3774192
Pulled By: javache
fbshipit-source-id: 9bce0b9c39fa31ef40d01e94b699b1299914b67b
Summary:
Linkify the blog post title when the excerpt is displayed in the blog index.
Update Facebook OpenGraph meta tags for individual blog posts to fix sharing previews.
Closes https://github.com/facebook/react-native/pull/9590
Differential Revision: D3771630
Pulled By: bestander
fbshipit-source-id: dc428ecc2d7939c143f000b8af9d4df9b512d0fc
Summary:
Revised the Activity implementation
- added flow annotations
- fixed some lint warnings
- added event `options`, specifically a `telemetric` option which indicates that events tagged in this manner are relevant for telemetry. The duration of these events is now highlighted in the Activity log
Reviewed By: bestander, kentaromiura
Differential Revision: D3770753
fbshipit-source-id: 6976535fd3bf5269c6263d825d657ab0805ecaad
Summary:
Not seeing a hairline thick line is a common source of confusion with a simple cause. Let's warn about it.
Closes https://github.com/facebook/react-native/pull/9589
Differential Revision: D3770879
Pulled By: mkonicek
fbshipit-source-id: f1637e17832982fa8fb9b7f485056c452b38b3db
Summary:
I wasn't able to run Android instrumentation tests locally from Android Studio without bumping the gradle plugin version and gradle version.
I know that Facebook is planning to move away from Gradle into BUCK only, but this is a pretty straightforward change that seemed to fix it for me.
Closes https://github.com/facebook/react-native/pull/9573
Differential Revision: D3770659
Pulled By: bestander
fbshipit-source-id: 14cefef6071c4ade985a9b3b27cf37d16d670520
Summary:
Setting the line height with the help of Android-provided StaticLayout is incorrect. A
simple example app will display the following when `setLineSpacing(50.f, 0.f)`
is set: {F62987699}. You'll notice that the height of the first line is a few
pixels shorter than the other lines.
So we use a custom LineHeightSpan instead, which needs to be applied to the text
itself, and no height-related attributes need to be set on the TextView itself.
Reviewed By: lexs
Differential Revision: D3751097
fbshipit-source-id: 6c5a8d01a6dca4ff6eef9c3aadd1b550054432d2
Summary:
> Thousands of applications use React Native
🎉
> To be useful to someone looking through the showcase, either the app must be something that most readers would recognise
* Artsy is known in the art world.
* Artsy is known to Apple customers as both the site and the iOS app have been featured by Apple in marketing materials and presentations various times.
* Artsy is known to developers for its many open-source contributions.
> or the makers of the application must have posted useful technical content about the making of the app
We’re writing [a series](http://artsy.github.io/series/react-native-at-artsy/) of posts related to RN on our engineering blog, of which the initial one can be found [here](http://artsy.github.io/blog/2016/08/15/React-Native-at-Artsy/). In `showcase.js` I link to the series overview, though.
> So, each app in the showcase should link to either:
>
> 1. An English-language news article discussing the app, built either by a funded startup or for a public company
Closes https://github.com/facebook/react-native/pull/9569
Differential Revision: D3765119
Pulled By: hramos
fbshipit-source-id: a2b6fbe4c0a01292ecbd7104d14b6bd4645e70eb
Summary:
Setting the line height with the help of Android-provided StaticLayout is incorrect. A
simple example app will display the following when `setLineSpacing(50.f, 0.f)`
is set: {F62987699}. You'll notice that the height of the first line is a few
pixels shorter than the other lines.
So we use a custom LineHeightSpan instead, which needs to be applied to the text
itself, and no height-related attributes need to be set on the TextView itself.
Reviewed By: lexs
Differential Revision: D3751097
fbshipit-source-id: c3574a1080efec26436a5c61afbff89afa8679e7
Summary:
An attempt to address https://github.com/facebook/react-native/issues/9156.
cc grabbou Kureev
**Test plan (required)**
1. Added the following to the `package.json` of a `react-native-plugin`
```
"rnpm": {
"commands": {
"preunlink": "node node_modules/react-native-plugin/scripts/preunlink"
"postunlink": "node node_modules/react-native-plugin/scripts/postunlink"
}
}
```
2. Added files, `scripts/preunlink.js` and `scripts/postunlink.js` to the plugin. Each of them simply logs a string to the console.
3. Ran `react-native unlink react-native-plugin` to verify that those logs get printed.
Closes https://github.com/facebook/react-native/pull/9157
Differential Revision: D3749434
fbshipit-source-id: 40b94c9026db4f11e8f5be4a417a0670e8069be6
Summary:
Change & motivation:
Added an environment variable, RCT_NO_LAUNCH_PACKAGER, that when set
Xcode not the launch the packager when building. This switch is needed
for CI builds, where launching the packager, which stays running, causes
the build to hang; port conflicts can be an issue as well. Really the
packager is only appropriate for interactive developer builds. This
is a problem for Visual Studio Team Services where we just added
React Native CI build support with a React Native build extension and
surely a problem for all CI systems. This fix is simple, and now if
the build machine sets RCT_NO_LAUNCH_PACKAGER globally or passes
it as an arg to xcodebuild, the packager won't launch and all is well.
Testing:
I tested by building both with & without the environment variable defined, ensuring
things work probably in both cases. I also added support to our VSTS build ask to use
this and verified it works as expected too, when setting the variable..
Closes https://github.com/facebook/react-native/pull/6180
Differential Revision: D3764648
Pulled By: sahrens
fbshipit-source-id: b41cc06152aec271bbfdb2bd52d4b83a5f9c09a7
Summary:
Thanks for submitting a pull request! Please provide enough information so that others can review your pull request:
> **Unless you are a React Native release maintainer and cherry-picking an *existing* commit into a current release, ensure your pull request is targeting the `master` React Native branch.**
Explain the **motivation** for making this change. What existing problem does the pull request solve?
Prefer **small pull requests**. These are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it.
**Test plan (required)**
Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI.
Make sure tests pass on both Travis and Circle CI.
**Code formatting**
Look around. Match the style of the rest of the codebase. See also the simple [style guide](https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md#style-guide).
For more info, see
Closes https://github.com/facebook/react-native/pull/9556
Differential Revision: D3764387
fbshipit-source-id: 71cc80eff351298c1b3ac5a134191a7b64ea649c
Summary:
Currently, text inputs do not scroll when inside other components like scroll
views. This fixes it by blocking any parent native component from taking the
responder when the text input is focused and is being scrolled. This fixes the
previous implementation, where the scroll view was not able to scroll on top of
other text inputs, even though they were not focused.
This makes the component similar to it's ios counterpart.
Reviewed By: foghina
Differential Revision: D3735237
fbshipit-source-id: 724f94a6e7332d03261a80f63ffa60d0e5846932
Summary:
Thanks for submitting a pull request! Please provide enough information so that others can review your pull request:
> **Unless you are a React Native release maintainer and cherry-picking an *existing* commit into a current release, ensure your pull request is targeting the `master` React Native branch.**
Explain the **motivation** for making this change. What existing problem does the pull request solve?
Prefer **small pull requests**. These are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it.
**Test plan (required)**
Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI.
Make sure tests pass on both Travis and Circle CI.
**Code formatting**
Look around. Match the style of the rest of the codebase. See also the simple [style guide](https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md#style-guide).
For more info, see
Closes https://github.com/facebook/react-native/pull/9560
Differential Revision: D3763027
Pulled By: hramos
fbshipit-source-id: 3d60833fde92a30658f3d9f108708b41ce859a13
Summary: Runtime annotation processing uses reflection which is slow. We'll use build time annotation processing instead and create at build time static ModuleInfo classes which have "name", "canOverrideExistingModule", "supportsWebWorkers", "needsEagerInit".
Reviewed By: lexs
Differential Revision: D3752243
fbshipit-source-id: 3518c6f38087d8799a61410864007041389c0e15
Summary:
JSC's utf16 -> utf8 conversion crashes on encountering bad utf16. Instead, use our own conversion (conveniently copied from fbjni).
Original fix thanks to rigdern (https://github.com/facebook/react-native/pull/9302)
Reviewed By: mhorowitz
Differential Revision: D3746947
fbshipit-source-id: 29887ca720f6a2b074f01f853bad28a083b273bc
Summary:
This adds a new type of node that clamps an animated value between 2 values with a special twist, it is based on the difference between the previous value so getting far from a bound doesn't matter and as soon as we start getting closer again the value will start changing. The main use case for this node is to create a collapsible navbar when scrolling a scrollview. This is a pretty in apps (fb, youtube, twitter, all use something like this).
It updates using the following: `value = clamp(value + diff, min, max)` where `diff` is the difference with the previous value.
This gives the following output for parameters min = 0, max = 30:
```
in out
0 0
15 15
30 30
100 30
90 20
30 0
50 20
```
One issue I see is that this node is pretty specific to this use case but I can't see another simple way to do this with Animated that can also be offloaded to native easily. I'd be glad to discuss other solutions if some
Closes https://github.com/facebook/react-native/pull/9419
Differential Revision: D3753920
fbshipit-source-id: 40a749d38fd003aab2d3cb5cb8f0535e467d8a2a
Summary:
Updated the blog's styling to make it more readable.
* BlogPageLayout (blog index) - Only excerpts from each article are now shown, as opposed to the entire article.
* BlogPost - Broken up into headers, footers. Reorder header so that the blog post title is closer to the content. Adds support for hero images (visible from the blog index). Adds Facebook, Twitter social share buttons. List items are properly spaced now.
Blog index:
![screencapture-localhost-8079-react-native-blog-1471905976431](https://cloud.githubusercontent.com/assets/165856/17874405/4ee4fc22-6880-11e6-8344-2ed823f6000e.png)
Single blog post:
![screencapture-localhost-8079-react-native-blog-2016-08-12-react-native-meetup-san-francisco-html-1471905997923](https://cloud.githubusercontent.com/assets/165856/17874407/52af9e7a-6880-11e6-99f0-91f90331aced.png)
Closes https://github.com/facebook/react-native/pull/9532
Differential Revision: D3758524
Pulled By: bestander
fbshipit-source-id: 6385a3e98a3a44343c3b1d3105a32023b748c2c6