Граф коммитов

18610 Коммитов

Автор SHA1 Сообщение Дата
Nick Gerleman 1796bc5927 Add Visual Studio and VSCode files to .gitignore (#27132)
Summary:
These files are currently seen by Git if opening the project in Visual Studio or VSCode.

## Changelog
[Internal] [Fixed] - Add Visual Studio files to .gitignore
Pull Request resolved: https://github.com/facebook/react-native/pull/27132

Differential Revision: D18346486

Pulled By: cpojer

fbshipit-source-id: e1ff752790d46455e85b13f2508cd0286d6bdde2
2019-11-06 03:26:59 -08:00
Frieder Bluemle b41b5ce8ae Update Android Gradle plugin to 3.5.2 (#27125)
Summary:
Android Studio 3.5.2 is now available in the stable channel

https://androidstudio.googleblog.com/2019/11/android-studio-352-available.html

## Changelog

[Android] [Changed] - Update Android Gradle plugin to 3.5.2
Pull Request resolved: https://github.com/facebook/react-native/pull/27125

Test Plan: Build project

Differential Revision: D18346480

Pulled By: cpojer

fbshipit-source-id: 92121406e91dc66146a1ff2125942355d188e6e4
2019-11-06 02:26:55 -08:00
Ramanpreet Nara 97a4b9b691 Fix RCTNetwork podspec
Summary:
RCTNetwork files require the `MobileCoreServices` framework. This diff adds the spec to the Podfile

Changelog:
[iOS][Fixed] - Fix RCTNetwork podspec

Reviewed By: PeteTheHeat

Differential Revision: D18331084

fbshipit-source-id: 0de9e6d5e2ad2a24ba0cfdecd4a8a18419acf042
2019-11-05 19:14:39 -08:00
Emily Janzer f3b3d777ab Add view config for AndroidHorizontalScrollContentView
Summary:
Add handwritten view config for AndroidHorizontalScrollContentView. Same as RCTScrollContentView, this native component has no props of its own other than what View accepts. It's simply used as a container for the horizontal ScrollView on Android.

Changelog: [Internal]

Reviewed By: rickhanlonii

Differential Revision: D18284673

fbshipit-source-id: 8cd6282a3b2e5c9876da5cc0e068b12dd56acfd8
2019-11-05 19:09:03 -08:00
Emily Janzer b7fac14b64 Add view config for AndroidHorizontalScrollView
Summary:
Adding a handwritten view config for AndroidHorizontalScrollView, the native component that's used with `<ScrollView horizontal={true} />` on Android. Native props are the same as `RCTScrollView`, so I'm reusing the type for that.

Changelog: [Internal]

Reviewed By: rickhanlonii

Differential Revision: D18284517

fbshipit-source-id: 7c81f72440b93d611f9574ad2c01a96530d07bf7
2019-11-05 19:09:03 -08:00
Emily Janzer 1f2dc8997f Add (empty?) view config for RCTScrollContentView
Summary:
Adding a handwritten view config for RCTScrollContentView. This host component doesn't actually have any props of its own separate from View; it's just a container for a ScrollView.

Changelog: [Internal]

Reviewed By: rickhanlonii

Differential Revision: D18283792

fbshipit-source-id: db95e981f54bef7c068b907c5d1fa52774dad147
2019-11-05 19:09:02 -08:00
Emily Janzer da39b07298 Add handwritten view config for RCTScrollView
Summary:
Adding a handwritten view config for RCTScrollView, to be used in DEV only (for now).

Changelog: [Internal]

Reviewed By: rickhanlonii

Differential Revision: D18263203

fbshipit-source-id: 975499f030c7caed9851bcde0be42c5058911ad5
2019-11-05 19:09:02 -08:00
Emily Janzer 6598292ede Add a field + getter for instanceKey to ReactContext
Summary:
Adding a new String field for `instanceKey` to ReactContext, which is set via a new constructor on ReactApplicationContext. Also adding getters to ReactContext and ThemedReactContext so that it's accessible from any instance/subclass of ReactContext.

This will only be used in bridgeless mode.

Reviewed By: mdvacca

Differential Revision: D18316556

fbshipit-source-id: 9757da72fde4ba36034c1e129326461fed496229
2019-11-05 19:01:53 -08:00
Joshua Gross f77abc583c Add UI asserts and logs to a few more places
Summary:
Add UI asserts to ensure thread safety of some operations.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D18339981

fbshipit-source-id: 9162b6351f40bdd543d3e255691e9f54d1934589
2019-11-05 18:20:01 -08:00
Jordan Brown 93e58b2c96 Suppressions for 0.111
Summary:
still some generated files in www that need to land before we can release 0.111 here.

drop-conflicts

Changelog: [Internal]

(Note: this ignores all push blocking failures!)

Reviewed By: dsainati1

Differential Revision: D18278838

fbshipit-source-id: b20c3fefb3aab7c5fb614b33d846c7548184f49a
2019-11-05 17:36:23 -08:00
Sidharth Guglani 5ee365f0b5 Use double for YGRoundValueToPixelGrid calculations
Summary:
Use double for YGRoundValueToPixelGrid calculations as we were losing some precision in float operations

#Changelog:
[Internal][Yoga] Use double for YGRoundValueToPixelGrid calculations

Reviewed By: astreet

Differential Revision: D18225999

fbshipit-source-id: 69c05f56a0e0f3433bf0bd958aa07d26dd83fe02
2019-11-05 17:14:39 -08:00
Joshua Gross b1b97b8b45 UiThreadUtil.assertX should only throw in DEBUG mode
Summary:
Turns out that `SoftAssertions.java` has always been a lie - it actually always throws exceptions. Migrate it to using `ReactSoftException`.

This file hasn't been touched at all since it was originally open-sourced, besides codemods!

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D18336020

fbshipit-source-id: cba3db25a9f9d61325dd3f7843e92e984ae56281
2019-11-05 15:36:29 -08:00
David Vacca e885ddedb9 Fix crash when using TextInput.FontVariant prop in Android API level < 26
Summary:
This diff fixes a crash when using TextInput.FontVariant prop in Android API level < 26

Changelog: Fix TextInput.FontVariant prop in Android API level < 26 (related to PR https://github.com/facebook/react-native/pull/27006)

Reviewed By: JoshuaGross

Differential Revision: D18331807

fbshipit-source-id: 5eac4d9e38eb099fae1287d128f3f8c249b0b8bc
2019-11-05 14:40:19 -08:00
Joshua Gross a7f56e73e4 Add UI-Thread assertions in methods that mutate Views
Summary:
As part of `T54997838` we're auditing where removeView could possibly be called in a background thread, and adding annotations to indicate places where we don't think it's possible.

Changelog: [internal]

Reviewed By: makovkastar

Differential Revision: D18320461

fbshipit-source-id: 84b6b9e293d903f835fc42bc98614efb54158986
2019-11-05 13:18:59 -08:00
David Vacca 3281714312 Ensure that ReactInstanceManager is still alive when animation system updates views in Fabric
Summary:
This diff ensures that ReactInstanceManager has a valid catalystInstance when updating views as part of the animation system.
This also force the update of views to be posted in the UI Thread

Changelog: [internal]

Reviewed By: JoshuaGross

Differential Revision: D18311782

fbshipit-source-id: 1f1e7b0d34346f34b3607e5b75e5c14cda3f4861
2019-11-05 12:33:07 -08:00
Samuel Susla c6b16ecc41 Interop: move event interceptor lifecycle into separate class
Summary:
In next diff Coordinator will have get more responsibilities therefore it's better to separate the concerns to different class

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D18304834

fbshipit-source-id: 168a68969ed9da5772895f2da87e5273dccbaf30
2019-11-05 12:33:06 -08:00
Samuel Susla 6fb5f81193 Use commands instead of setNativeProps in DatePicker
Summary:
Changelog: DatePicker now uses commands instead of `setNativeProps`

We are moving away from `setNativeProps` in favour of commands API.

Reviewed By: shergin

Differential Revision: D17787870

fbshipit-source-id: aa532cbb7bfb3031c085e5122ab808522c437901
2019-11-05 10:41:41 -08:00
Rick Hanlon 1fb815ed43 LogBox - hotfix for opening logs
Summary:
`fatalIndex` is never null, we switched it to go to -1 when it's not set

Changelog: [Internal}

Reviewed By: cpojer

Differential Revision: D18324666

fbshipit-source-id: 04d4cca9923af2a91ceec03f8314dead4681e526
2019-11-05 07:14:27 -08:00
Frieder Bluemle 1c7cd129f1 Update eslint-plugin-react-native to 3.8.1 (#27114)
Summary:
This updates [`eslint-plugin-react-native`](https://github.com/intellicode/eslint-plugin-react-native) to `3.8.1`.

Includes some minor updates and fixes, and avoids errors related to incorrect peer dependencies when using ESLint 6+

```
error "react-native#eslint-plugin-react-native#eslint@^3.17.0 || ^4 || ^5" doesn't satisfy found match of "eslint@6.6.0"
```

## Changelog

[Internal] [Changed] - Update eslint-plugin-react-native to 3.8.1
Pull Request resolved: https://github.com/facebook/react-native/pull/27114

Test Plan: Check that ESlint and CI passes.

Differential Revision: D18323510

Pulled By: cpojer

fbshipit-source-id: 0257eaebe295fec4b0e52b2f08cf62336fc147a3
2019-11-05 05:39:21 -08:00
Jorge Bernal a6fc0898de Add support for native pseudo-OS to Platform.select (#26966)
Summary:
When you write platform-specific code using [file extensions](https://facebook.github.io/react-native/docs/platform-specific-code#platform-specific-extensions), you can specify `.ios.js`, `.android.js`, or the catch-all `.native.js` when you are sharing code with a web project.

This `native` shortcut is missing for the `Platform.select` method, and this PR is adding support for that.

## Changelog

[General] [Added] - Platform.select now supports native as an option.
Pull Request resolved: https://github.com/facebook/react-native/pull/26966

Test Plan: Added relevant passing unit tests for Platform module.

Differential Revision: D18323670

Pulled By: cpojer

fbshipit-source-id: 7524c1914beab4f86041dcf8e60875380ebf7e02
2019-11-05 05:39:20 -08:00
Radek Czemerys e1d03b4cc0 Reverts "Timing: Fixes timer when app get into background (#24649)" (#27073)
Summary:
This PR reverts commit 338298417f that is causing https://github.com/facebook/react-native/issues/26696 #26995.
> app would be closed immediately after going to background on iOS 13.1/13.2 and was investigated by minhtc https://github.com/facebook/react-native/issues/26696#issuecomment-548056694. The commit that is being reverted is apparently causing the app to be closed immediately. This has to be reverted in master separately as the file differs there.

Similar PR for 0.61. branch https://github.com/facebook/react-native/pull/27065

## Changelog

[iOS] [Fixed] - Fix apps crashing on iOS 13.x when running timer in the background
Pull Request resolved: https://github.com/facebook/react-native/pull/27073

Test Plan: Try [this](338298417f (commitcomment-35745287)) snippet on iOS 13.1/13.2, the app should not crash anymore

Differential Revision: D18323679

Pulled By: cpojer

fbshipit-source-id: 3af7036a0e1d3811924e581c649b16e5a4667e83
2019-11-05 03:32:55 -08:00
Vincent Cheung 1df8bd4932 Fix multiple `set-cookie` not aggregated correctly in response headers (#27066)
Summary:
Multiple `set-cookie` headers should be aggregated as one `set-cookie` with values in a comma separated list. It is working as expected on iOS but not on Android. On Android, only the last one is preserved

The problem arises because `NetworkingModule.translateHeaders()` uses `WritableNativeMap` as the translated headers but uses both native and non-native methods. The mixup causes out of sync data that both sets of methods do no agree. A simple fix is to use `Bundle` as the storage and only convert it to `WritableMap` at the end in one go

Related issues: https://github.com/facebook/react-native/issues/26280, https://github.com/facebook/react-native/issues/21795, https://github.com/facebook/react-native/issues/23185

## Changelog

[Android] [Fixed] - Fix multiple headers of the same name (e.g. `set-cookie`) not aggregated correctly
Pull Request resolved: https://github.com/facebook/react-native/pull/27066

Test Plan:
A mock api, https://demo6524373.mockable.io/, will return 2 `set-cookie` as follows:
```
set-cookie: cookie1=value1
set-cookie: cookie2=value2
```

Verify the following will print the `set-cookie` with a value `cookie1=value1, cookie2=value2`
```javascript
  fetch('https://demo6524373.mockable.io/')
    .then(response => {
      console.log(response.headers);
    });
```
On iOS, `set-cookie` will have `cookie1=value1, cookie2=value2` while on Android it will have `cookie2=value2` (preserving only the last one)

Differential Revision: D18298933

Pulled By: cpojer

fbshipit-source-id: ce53cd41d7c6de0469700617900f30a7d0914c26
2019-11-05 03:30:02 -08:00
Kacper Wiszczuk a3b0804867 fix: Bundle assets in monorepo (#26940)
Summary:
In monorepo environment, `metro` isn't able to resolve `react-native` because the path to it is hardcoded.

I've also added `packagingOptions` to RNTester to make Android builds work for me. Let me know if this is something that is only specific to my setup, and shouldn't be added.

## Changelog

[Android] [Fixed] - Fix `bundleReleaseJsAndAssets` in monorepo env
Pull Request resolved: https://github.com/facebook/react-native/pull/26940

Test Plan:
- [x] - Works in monorepo setup on MacOS
- [x] - Works with RNTester app

Differential Revision: D18323703

Pulled By: cpojer

fbshipit-source-id: b8eb15dfd8a32ae11fd862fc725af9cffea2cf96
2019-11-05 03:08:12 -08:00
Frieder Bluemle 928f4434b9 Update Gradle wrapper to 5.6.4 (#27092)
Summary:
Gradle wrapper `5.6.4`

See [release notes](https://docs.gradle.org/5.6.4/release-notes.html) for list of fixes/improvements.

## Changelog

[Android] [Changed] - Gradle wrapper 5.6.4
Pull Request resolved: https://github.com/facebook/react-native/pull/27092

Test Plan: Builds successfully.

Differential Revision: D18323675

Pulled By: cpojer

fbshipit-source-id: c96fddbfba4b3598ea88997ac66349c83c6ceca7
2019-11-05 02:59:49 -08:00
Samuel Susla 254f0e4c01 Use generated interface for commands in Switch component
Summary:
Use codegened native commands in Switch

changelog: [internal]

Reviewed By: TheSavior

Differential Revision: D18266849

fbshipit-source-id: a2de0e7342619c437f6d34f8dbf413f2f2888548
2019-11-05 02:12:11 -08:00
Kevin Gozali dd06f85bd0 TM JS: cleaned up TurboModuleRegistry types [2]
Summary:
Changelog: [Internal]

Moved the imports for `TurboModuleRegistry` and `TurboModule` from `react-native`. This was a jscodeshift with the script: P120688078

Reviewed By: yungsters

Differential Revision: D18262538

fbshipit-source-id: 48fac15229c897408928511c5ecbb42f17ec7b42
2019-11-04 18:51:05 -08:00
Kevin Gozali e40aa7922e TM JS: cleaned up TurboModuleRegistry types [1]
Summary:
Changelog: [Internal]

* The original intention was to export both `get()` and `getEnforcing()` from TurboModuleRegistry.js, so define export default there
* Exposes `TurboModule` type on the top-level `'react-native'` import
* Tried this out on `NativeSegmentFetcher`

Reviewed By: yungsters

Differential Revision: D18262535

fbshipit-source-id: a46f2b8b6147531998efac8aa3b8259885224902
2019-11-04 18:51:05 -08:00
Valentin Shergin 89add2582d Fabric: Collecting mounting time inside `MountingTelemetry`
Summary:
Now we also collect mounting time inside MountingTelemetry.
We will use it soon.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: mdvacca

Differential Revision: D18285826

fbshipit-source-id: 512fc62c210a111614b0defb0d76cbd6228fe89f
2019-11-04 18:21:13 -08:00
Valentin Shergin 2690e7363c Fabric: Cross-platform implementation of `monotonicTimeInMilliseconds`
Summary:
Now the function supports iOS.
We will use it soon.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: mdvacca

Differential Revision: D18285828

fbshipit-source-id: b9c16433e9c75ab4c071e4bd55074757372f6c0a
2019-11-04 18:21:12 -08:00
Ramanpreet Nara 6f54f00e0d Make RCTDataRequestHandler, RCTFileRequestHandler, and RCTHTTPRequestHandler TurboModule-compatible
Summary:
See title.

Changelog:
[iOS][Added] - Make RCTDataRequestHandler, RCTFileRequestHandler, and RCTHTTPRequestHandler TurboModule-compatible

Reviewed By: PeteTheHeat

Differential Revision: D18093611

fbshipit-source-id: dad4e04104a9a5fc8e70a17ef0bdf7b29bff9171
2019-11-04 16:07:25 -08:00
Ramanpreet Nara ffb8191a51 Make RCTNetworking TurboModule-compatible
Summary:
See title.

Changelog:
[iOS][Added] - Make RCTNetworking TurboModule-compatible

Reviewed By: PeteTheHeat

Differential Revision: D18087243

fbshipit-source-id: 81bbf77d603e96fa94ad219e5ed68f42bb7e7dc5
2019-11-04 16:07:25 -08:00
Ramanpreet Nara 1d315608ef Make RCTCameraRollManager TurboModule-compatible
Summary:
See title.

Changelog:
[iOS][Added] - Make RCTCameraRollManager TurboModule-compatible

Reviewed By: PeteTheHeat

Differential Revision: D18148892

fbshipit-source-id: de49e368615032b2c4de129dc55191c562cbdfbe
2019-11-04 16:07:24 -08:00
Ramanpreet Nara c29ec64d94 Implement RCTConvertOptionalVecToArray(const folly::Optional<ContainerT> &vec)
Summary:
There are two implementations of `RCTConvertVecToArray`. The first implementation:

```
template<typename ContainerT>
NSArray *RCTConvertVecToArray(const ContainerT &vec, id (^convertor)(typename ContainerT::value_type element))
{
  NSMutableArray *array = [NSMutableArray new];
  for (size_t i = 0, size = vec.size(); i < size; ++i) {
    id object = convertor(vec[i]);
    array[i] = object ?: (id)kCFNull;
  }
  return array;
}
```
The purpose of the second implementation is to default the convertor function to the identify function:
```
template<typename ContainerT>
NSArray *RCTConvertVecToArray(const ContainerT &vec)
{
  return RCTConvertVecToArray(vec, ^id(typename ContainerT::value_type element) { return element; });
}
```

Meanwhile, there's only one implementation of `RCTConvertOptionalVecToArray`:

```
template<typename ContainerT>
NSArray *RCTConvertOptionalVecToArray(const folly::Optional<ContainerT> &vec, id (^convertor)(typename ContainerT::value_type element))
{
  return vec.hasValue() ? RCTConvertVecToArray(vec.value(), convertor) : nil;
}
```

In this diff, I overload `RCTConvertOptionalVecToArray` to default the convertor to the identify function.

Changelog:

[iOS][Added] - Added RCTConvertOptionalVecToArray with default converter

Reviewed By: PeteTheHeat

Differential Revision: D18148891

fbshipit-source-id: d7d5f05cda06c9fa5374334ec4e9dbbd8b6d2eba
2019-11-04 16:07:24 -08:00
Ramanpreet Nara 3beb8341fd Make RCTTVNavigationEventEmitter TurboModule-compatible
Summary:
See title.

Changelog:
[iOS][Added] - Make RCTTVNavigationEventEmitter TurboModule-compatible

Reviewed By: shergin

Differential Revision: D18142252

fbshipit-source-id: c633a5a0abd9e980346379921b34219228153348
2019-11-04 16:07:24 -08:00
Ramanpreet Nara 7e5de4e241 Make RedBox TurboModule-compatible
Summary:
See title.

Changelog:
[iOS][Added] - Make RedBox TurboModule-compatible

Reviewed By: PeteTheHeat

Differential Revision: D18142255

fbshipit-source-id: 2d130aca93a88ac7c983ce0e4848955ffb0be518
2019-11-04 16:07:23 -08:00
Ramanpreet Nara fe3ae9dce8 Make RCTDevMenu and RCTDevSettings TurboModule-compatible
Summary:
Changelog:
[iOS][Added] - Make RCTDevMenu and RCTDevSettings TurboModule-compatible

Reviewed By: shergin

Differential Revision: D18148890

fbshipit-source-id: bd4f0b2797e299cd963e34fa47044a9e1232efe0
2019-11-04 16:07:23 -08:00
Janic Duplessis 686ab49107 Don't restore default values when components unmount (#26978)
Summary:
There are some cases where restoring default values on component unmount is not desirable. For example in react-native-screens we want to keep the native view displayed after react has unmounted them. Restoring default values causes an issue there because it will change props controlled my native animated back to their default value instead of keeping whatever value they had been animated to.

Restoring default values is only needed for updates anyway, where removing a prop controlled by native animated need to be reset to its default value since react no longer tracks its value.

This splits restoring default values and disconnecting from views in 2 separate native methods, this way we can restore default values only on component update and not on unmount. This takes care of being backwards compatible for JS running with the older native code.

## Changelog

[General] [Fixed] - NativeAnimated - Don't restore default values when components unmount
Pull Request resolved: https://github.com/facebook/react-native/pull/26978

Test Plan:
- Tested in an app using react-native-screens to make sure native views that are kept after their underlying component has been unmount don't change. Also tested in RNTester animated example.

- Tested that new JS works with old native code

Reviewed By: mmmulani

Differential Revision: D18197735

Pulled By: JoshuaGross

fbshipit-source-id: 20fa0f31a3edf1bc57ccb03df9d1486aba83edc4
2019-11-04 15:40:09 -08:00
Eli White e9b4928311 TextInput: Don't do an extra round trip to native on focus/blur
Summary:
I wrote up a bunch of context for this in response to #27038 by fat. That comment is reproduced here in this commit message. You can see it in it's original contxt here: https://github.com/facebook/react-native/pull/27038

Okay, here is what I think is happening. For context, here is a diagram I have of how focus and blur propagates through the system. This might be interesting to refer back to as you go through the rest of my explanation.

![graphviz (12)](https://user-images.githubusercontent.com/249164/67992345-982c9d80-fbf9-11e9-96ea-b091210dddbe.png)

ScrollView's scrollResponder is responsible for blurring text inputs when a touch occurs in the ScrollView but outside of the currently focused TextInput. The code for that is here:
6ba2769f0f/Libraries/Components/ScrollResponder.js (L301-L314)

This happens on `scrollResponderHandleResponderRelease` aka, touch up.

It checks for what the currently focused textinput is by calling `TextInputState.currentlyFocusedField()`.

That function is a JS variable that is being updated by calls to `TextInputState.focusTextInput` and `TextInputState.blurTextInput`:

6ba2769f0f/Libraries/Components/TextInput/TextInputState.js (L36-L71)

I added some console logs to those methods to see which ones are being called when running your repro (thanks for the repro!). **This is without your fix**

Click on and off:
```
// Click on input 1
focusTextInput input1
TextInput's _onFocus called

// Click on blank space
scrollResponderHandleResponderRelease blur input1
blurTextInput input1
TextInput's _onBlur called
```

Click on input1, then input 2, then off
```
// Click on input 1
focusTextInput input1
TextInput's _onFocus called for input1

// Click on input 2
focusTextInput input2
TextInput's _onBlur called for input1
TextInput's _onFocus called for input2

// Click on blank space
scrollResponderHandleResponderRelease blur input2
blurTextInput input2
TextInput's _onBlur called for input2
```

And now for the bug. Click on input 1, tab to 2, then off
```
// Click on input 1
focusTextInput input1
TextInput's _onFocus called for input1

// Tab to input 2
TextInput's _onBlur called for input1
TextInput's _onFocus called for input2

// Click on blank space
scrollResponderHandleResponderRelease blur input1
blurTextInput input1
```

Notice how `focusTextInput` was never called with input2 in the last example. Since this is the function that sets the `currentlyFocusedField` when we click on the blank space RN is trying to blur the first input instead of the second.

# The root cause
We are tracking the state of which field is focused in JS which has to stay in sync with what native knows is focused. We [listen to _onPress](6ba2769f0f/Libraries/Components/TextInput/TextInput.js (L1103-L1107)) and call `TextInputState.focusTextInput` in that handler. However, we don't currently have anything listening to other ways for an input to become focused (like tabbing) so it doesn't end up updating the `currentlyFocusedField`.

We have the same problem with blur that we actually fixed the same way you did here in this PR:
6ba2769f0f/Libraries/Components/TextInput/TextInput.js (L1182-L1189)

If you look back at my diagram at the beginning of this post, you'll notice the missing edge from `TextInput._onFocus` to `TextInputState.focusTextInput`. That's the problem. :)

The reason this solution works is because this function **is** the notification from native that an input was focused or blurred. This solution is *fine* because this updates the `currentlyFocusedID` but isn't great because it both sets that value and **calls the native code to focus or blur again**. Luckily the native code doesn't send an event back to JS if you try to blur an already blurred TextInput otherwise we'd have an infinite loop.

# The correct solution
The correct thing would probably be to have all of this tracking in native code and not in JavaScript code. That's a pretty big change though and very out of scope. Something for our team to keep in mind for the future.

A short term term solution would be to refactor `focusTextInput` and `blurTextInput` to pull out the part that sets the `currentlyFocusedID` that we could call from `TextInput` directly from `_onFocus` and `_onBlur`.

# ^This short term term solution is what this commit is doing.

Changelog:
[General][Changed] TextInput no longer does an extra round trip to native on focus/blur

Reviewed By: RSNara

Differential Revision: D18278359

fbshipit-source-id: 417566f25075a847b0f4bac2888f92fbac934096
2019-11-04 14:42:44 -08:00
Peter Argany dfba3129f4 CoreFoundation memory management in RCTImageStoreManager
Summary:
I recently learned that CoreFoundation object lifecycle is not managed automatically by ARC.

RN appears to be leaking a few refs, this small stack of diffs cleans them up.

Changelog: [Internal][Fixed] Fixed memory management of CF objects in RCTImageStoreManager

Reviewed By: fkgozali

Differential Revision: D18308313

fbshipit-source-id: 35c1152753578825871c28e1070599cd409b3a34
2019-11-04 14:42:43 -08:00
David Vacca 595f5ac64d Fix Collapsing of Delete-Create mounting instructions
Summary:
This diff fixes the Collapsing of Delete-Create mounting instructions algorithm. By mistake I switch the conditions before landing the original diff.

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D18306616

fbshipit-source-id: 50cd8ca67adcaf172ce51896df684fed270b2d51
2019-11-04 14:34:33 -08:00
Oleksandr Melnykov 8d31e38966 Integrate StickerInputView into Fabric on Android
Summary:
This diff integrates `StickerInputView` into Fabric on Android.

Changelog: [Internal]

Reviewed By: mdvacca, cpojer

Differential Revision: D18029223

fbshipit-source-id: 2e412b83f9af347e01606d526c04e13d1f2bfbb8
2019-11-04 12:42:26 -08:00
Luna Wei 8e55e9ab1b TouchableNativeFeedback.android use codegenNativeCommands
Summary: Changelog: [Internal] Use `findHostInstance_DEPRECATED` for TouchableNativeFeedback

Reviewed By: TheSavior

Differential Revision: D18285029

fbshipit-source-id: 1c19c35e660519bee450e4fd37f18c03ec1883e0
2019-11-04 12:31:20 -08:00
Eli White 0799910705 React partial sync for 15ed22757...2cfa5ea92
Summary:
This sync includes these changes:

- **[2cfa5ea92](https://github.com/facebook/react/commit/2cfa5ea92 )**: Types: findHostInstance_DEPRECATED returns React.ElementRef<HostComponent<mixed>> (#17265) //<Eli White>//

Changelog:
[General][Changed] React partial sync for 15ed22757...2cfa5ea92

Reviewed By: lunaleaps

Differential Revision: D18302477

fbshipit-source-id: a8198ec7f39ab86aed2a1d3077187fc50d0f38e9
2019-11-04 12:22:53 -08:00
Eli White 88f64a5782 Slider: Inline default props
Summary:
Instead of defining the default props as a property on the forwardRef, we can just inline it into the destructure.

Changelog:
[Internal]

Reviewed By: yungsters

Differential Revision: D18296180

fbshipit-source-id: c9e85a9869648983a01d84c36a5c581b357b427f
2019-11-04 12:16:38 -08:00
Eli White 1de94060c7 Refactor RNTester SliderExample to use Hooks
Summary:
Changelog:
[Internal]

Reviewed By: yungsters

Differential Revision: D18296146

fbshipit-source-id: 0572c3069add6efcc3dfdc3fac3e6569df1970b8
2019-11-04 12:16:37 -08:00
Eli White f19112f46f Tighten Slider Flow type
Summary:
Changelog:
[Internal]

Reviewed By: yungsters

Differential Revision: D18295806

fbshipit-source-id: b2cb4d84bbcddbac83baaab9ea2af3e1c87150a9
2019-11-04 12:16:37 -08:00
Samuel Susla 1cfa1e6fa2 Remove -Wno-unguarded-availability from ReactInternal
Summary:
This will allow us to catch cases where we use iOS 10-only APIs on iOS 9

Changelog: [Internal]

Reviewed By: TheSavior, mmmulani

Differential Revision: D18275225

fbshipit-source-id: dc9c515415208db40750be997173ce5bd6eb494f
2019-11-04 12:03:10 -08:00
Eli White 8f6fa42503 TextInput: Remove legacy iOS implementation
Summary:
This implementation was replaced in January of 2018 by shergin. I believe everyone should have `RCTVirtualText` at this point, which should make this safe to remove.

Changelog:
[Internal][TextInput] Remove deprecated and unused legacyIOS implementation

Reviewed By: shergin

Differential Revision: D18296981

fbshipit-source-id: b5d5756e7bbc8141f1b826ab07c76a781ab03edc
2019-11-04 11:51:12 -08:00
Eli White 1804e7cbea Remove TextInput's `inputView` prop
Summary:
This if statement is older than June 2015. This prop is undocumented, not part of the flow type, not on our public docs, not in the flow type, not in typescript types, and I can't find any blog posts about it.

Changelog:
[Breaking][TextInput] Removing undocumented `inputView` prop. Use children instead.

Reviewed By: yungsters

Differential Revision: D18296894

fbshipit-source-id: 95373d24659e6f06e212095b57e8f6d713323c11
2019-11-04 11:51:12 -08:00
Samuel Susla 7ef252bcb3 Export native commands codegen classes and fix build issue
Summary:
1. Generated `RCTComponentViewHelpers.h` file was not being exported.
2. argument declaration was within `if RCT_DEBUG` directive which meant in production it was stripped.

changelog: [internal]

Reviewed By: TheSavior

Differential Revision: D18266846

fbshipit-source-id: 4c13b8ee9cf4cb3b7486ba7cfef0c64bc46b2360
2019-11-04 11:17:42 -08:00