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

5947 Коммитов

Автор SHA1 Сообщение Дата
Pieter De Baets 64720ab14a Improve typing of Animated component wrappers
Summary:
Provides flow-types for callers of AnimatedScrollView etc

Changelog: [Internal] [Fixed] Fixed flow types of Animated components

Reviewed By: cpojer

Differential Revision: D20158990

fbshipit-source-id: 3d06a89086629eb9f9d2cc0f3e7a819a80456fb0
2020-02-28 09:31:12 -08:00
Arjan Zuidema 0a9cc34dd8 Added userInterfaceStyle prop to ActionSheetmanager to override user interface style for iOS 13 (#26401)
Summary:
Support to override actionsheet and share interface style to match your app. For example, when your app has it's own theming you want to match the stying on actionsheet and the share menu.

## Changelog

[iOS] [Added] - Added userInterfaceStyle for ActionSheetIOS and Share to override user interface style on IOS 13
Pull Request resolved: https://github.com/facebook/react-native/pull/26401

Test Plan:
Set dark style
![dark](https://user-images.githubusercontent.com/30040390/64685321-12a53080-d487-11e9-8846-f2ef89e114a2.jpg)
Set light style
![light](https://user-images.githubusercontent.com/30040390/64685322-12a53080-d487-11e9-9dfd-1e07b9fe0ce2.jpg)

Differential Revision: D17314080

Pulled By: hramos

fbshipit-source-id: f84278ca99ba20347d17e27295f661d6690fa68c
2020-02-28 00:08:54 -08:00
Eli White 9fdb96eec7 Partial React Sync from 241c4467e...00d8e5b80
Summary:
- **[00d8e5b80](https://github.com/facebook/react/commit/00d8e5b80 )**: [Fabric] Fix targetAsInstance dispatchEvent "cannot read property of null" (#18156) //<Joshua Gross>//
- **[ad84625f8](https://github.com/facebook/react/commit/ad84625f8 )**: [Native] Migrate focus/blur to call TextInputState with the host component (#18068) //<Eli White>//
- **[edab5c074](https://github.com/facebook/react/commit/edab5c074 )**: Re-throw errors thrown by the renderer at the root in the complete phase (#18029) //<Andrew Clark>//
- **[a6dfe9aa4](https://github.com/facebook/react/commit/a6dfe9aa4 )**: [Native] Delete NativeComponent and NativeMethodsMixin (#18036) //<Eli White>//

Changelog:
[General][React] Partial React Sync from 241c4467e...00d8e5b80

Reviewed By: JoshuaGross

Differential Revision: D20153744

fbshipit-source-id: 09c5fec620370f1844a89af1c6ba2d487020216d
2020-02-27 19:39:26 -08:00
Ramanpreet Nara 6a9a76e420 Make RCTDevLoadingView TurboModule-compatible
Summary:
This is a redo of D16969764, with a few extensions.

## Changes
1. Move `RCTDevLoadingView.{h,m}` to `CoreModuels/RCTDevLoadingView.{h,mm}`
2. Extract ObjC API of `RCTDevLodingView` into `RCTDevLoadingViewProtocol` in `ReactInternal`.
3. Create API `RCTDevLoadingViewSetEnabled.h` in `ReactInternal` to enable/disable `RCTDevLoadingView`

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

Reviewed By: PeteTheHeat

Differential Revision: D18642554

fbshipit-source-id: 6b62e27e128d98254b7a6d018399ec1c06e274fc
2020-02-27 17:06:13 -08:00
Hans Halverson a3d9e91203 Move suppression to primary locations in xplat/js
Summary:
We will soon be enforcing that flow suppressions will only apply when on an error's primary location ([post](https://fb.workplace.com/groups/179614562644215/permalink/559286354677032/)). This diff uses the codemod created in D20008770 to move all suppression comments to their primary locations in the  `xplat/js` flow root, and deletes suppression comments that are not on any primary locations.

This diff was generated with:
```
~/fbsource/fbcode/flow/packages/flow-dev-tools/bin/tool suppression-primary-locations --json-file ~/www/errors.json  ~/fbsource/xplat/js
hg st -n | xargs grep -l -P '@(partially-)?generated' | xargs hg revert
hg st -n | xargs grep -l 'format' | xargs prettier --write
```

Changelog: [Internal]

bypass-lint

Reviewed By: dsainati1

Differential Revision: D20122544

fbshipit-source-id: d94e409aadb18bb399a1ddbf9f3f2494fe4fb54c
2020-02-27 12:14:57 -08:00
Samuel Susla d33ead3f16 Fix matricesDiffer ignoring first value of matrix
Summary:
Changelog: [internal]

# Problem

Implementation of `matricesDiffer` was ignoring first element in the matrix, therefore two matrixes that were different were actually evaluated as same and React didn't pass value to native.

# Solution

Take first element in the matrix into account when comparing matrices.

Reviewed By: cpojer

Differential Revision: D20117210

fbshipit-source-id: 84c3b4e580da44bda4fc8bd8669318282ae9aa32
2020-02-27 05:43:02 -08:00
Nikita Kraev 79efa43428 Update ImageEditingManager to use internal storage before falling back to external for cache
Summary:
Changelog: [Android] [Changed] - Internal storage now will be preferred for caching images from ImageEditor.

Now we try to write to internal cache directory first.
If that fails (due to no memory error or other IOException), we attempt to write to external storage (if that is allowed).

I introduced additional configuration flag, `allowExternalStorage` which is true by default.
And i updated documentation for new behaviour - see
 `ImageEditor.cropImage(..)` comment.

Reviewed By: makovkastar

Differential Revision: D19878158

fbshipit-source-id: 7e338ce68f535f74c62b5eecd5a94af7e7396f8b
2020-02-25 05:46:59 -08:00
Rick Hanlon 956359bee6 Handle errors in Metro by showing a code frame
Summary:
Right now the code frame and stack trace for metro errors are useless. This diff improved these errors by showing the metro code frame for the source of the issue, and stripping the stack trace.

Ideally we could show the metro stack trace as well, but since stack traces are tightly coupled to symbolication (and metro source code does not need symbolicated, nor could it be), this is an acceptable incremental improvement.

Arguably, even showing the code frame is inappropriate and we should show a generic crash screen with reload and report buttons.

Changelog: [Internal]

Reviewed By: cpojer

Differential Revision: D20057353

fbshipit-source-id: 5e999cea14c1cbd2f69737e3992a3e8d159fdf89
2020-02-25 04:34:38 -08:00
Joshua Gross ed5f9eeb2a TextInput: use commands instead of setNativeProps on Android
Summary:
Use codegen'd ViewCommands added in previous diff as a replacement for setNativeProps.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D18619298

fbshipit-source-id: 08069e828e92ac3cca9813bbcdca99d99fb50883
2020-02-24 16:19:36 -08:00
Joshua Gross 7f80b1c8c7 TextInput: Fix controlled TextInput selection in Paper
Summary:
The migration from classy to functional component partially broke controlled TextInput selections. This fixes it.

The nuance is that even though we have "event counters" sent from native, "onChange" and "onChangeSelection" are separate events;
so even if you receive new text and a new native event counter, your selection may be out-of-date. Incrementing the event counter
when sending selection events breaks text updates; and adding another native event counter seems like overkill. Instead, in JS, we statefully
keep track of (1) the native event counter, (2) whether or not the selection has been updated for that event counter.

Changelog: [internal]

Reviewed By: mdvacca

Differential Revision: D18867152

fbshipit-source-id: c569ecd03ce0042d6feb5fa8af4c756588607a09
2020-02-24 16:19:35 -08:00
Kacie Bawiec aebeb3b0a9 Add Snapshot Rendering Test to ScrollView
Summary:
As title.

Changelog: [Added] Add snapshot rendering test to ScrollView

Reviewed By: zackargyle, TheSavior

Differential Revision: D20037673

fbshipit-source-id: 4270bc63a6065789f072893756468b67deae169d
2020-02-24 14:48:40 -08:00
Rachel Nabors c0d8c1db90 Updating the URLs to point at new domain name reactnative.dev
Summary:
We recently updated React Native's docs site to have its own domain reactnative.dev and needed to update the URLs in the source code

CHANGELOG:
[INTERNAL]

Reviewed By: hramos

Differential Revision: D20072842

fbshipit-source-id: 1970d9214c872a6e7abf697d99f8f5360b3b308e
2020-02-24 13:09:11 -08:00
generatedunixname89002005287564 796a4ea7e3 Add "complete_nullability = True" to compatible libraries
Reviewed By: natestedman

Differential Revision: D19968574

fbshipit-source-id: cf31e22e4a624f2f2a37bfd1b23ae65ff121f263
2020-02-24 07:38:53 -08:00
Pieter De Baets bcc6f9b5e4 Avoid unneccessary array copies in timer callbacks
Summary:
Removed an array.slice() call in the callImmediatesPass, which seems unnecessary to me, as the variable is immediately re-assigned on the next line.

Also fixed some flow issues, clarified a systrace marker and opensourced the relevant tests.

Changelog: [Internal] [Fixed] Improved JSTimer efficiency

Reviewed By: yungsters

Differential Revision: D20039181

fbshipit-source-id: 9b146980e8fa9f94b2f6153cc67cc7ced58104e5
2020-02-24 03:17:27 -08:00
Rick Hanlon cf20bb8921 Delete YellowBox
Summary:
This diff removes YellowBox (RIP).

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D19949737

fbshipit-source-id: 0b653b128d8fc78255778d424a1c014bf5ddbcd0
2020-02-21 10:34:40 -08:00
Rick Hanlon 64bc400c77 LogBox - Fix code frame whitespace trimming
Summary:
This diff fixes whitespace trimming in codeframes by setting the whitespace size to 0 instead of infinity for lines that's don't have whitespace. This fixes a bug in frames where lines with 0 whitespace would not be considered.

So frames like this, where the common whitespace should be 0:

```
  217 | function Hi(a?: String) {
> 218 |   return Platform.OS === 'android' ? obj.die() : obj.die();
      |                                                  ^
  219 | }
  220 |
  221 | export default CrashReactApp;
```

Are instead trimmed at the second most common whitespace, which is 2. That's because line 217 has a whitespace length of 0, but we consider it as Infinity. When we get to line 218, we set the whitespace to 2. Then on line 19 we consider if 2 < Infinity and decide that the common whitespace is 2 resulting in:

```
  217 | nction Hi(a?: String) {
> 218 | return Platform.OS === 'android' ? obj.die() : obj.die();
      |                                                ^
  219 |
  220 |
  221 | port default CrashReactApp;
```

By setting the whitespace per line to 0 when there's no whitespace match, lines without whitespace can accurately report their size and move the pointer back to the 0 position.

Changelog: [Internal]

Reviewed By: cpojer

Differential Revision: D20030301

fbshipit-source-id: f1dec8cc57479f37ffa8128f93f7c8b3c6baaf91
2020-02-21 10:23:31 -08:00
Rick Hanlon c6d5019573 Interpolate strings before giving them to abd
Summary:
This diff interpolates logs before passing them downstream so that we don't see a bunch of logs with "%s" everywhere.

Changelog: [Internal]

Reviewed By: cpojer

Differential Revision: D20034903

fbshipit-source-id: 966917aa21ba07af3fb114e6a6931d4bbf860040
2020-02-21 09:33:00 -08:00
Pieter De Baets bdafc55f50 Make animation types exact
Summary: Changelog: [General][Changed] Improved flowtype support for Animated

Reviewed By: cpojer

Differential Revision: D20002839

fbshipit-source-id: 537ac00b3fe408585d34a0ffac8adc598e01d1b7
2020-02-21 06:54:03 -08:00
Eli White 3212f7dfe8 Release Pressable!
Summary:
*Pressable* is a component which is intended to replace the Touchable* components such as *TouchableWithoutFeedback* and *TouchableOpacity*. The motivation is to make it easier to create custom visual touch feedback so that React Native apps are not easily identified by the “signature opacity fade” touch feedback.

We see this component as eventually deprecating all of the existing Touchable components.

Changelog:
[Added][General] New <Pressable> Component to make it easier to create touchable elements

Reviewed By: yungsters

Differential Revision: D19674480

fbshipit-source-id: 765d657f023caea459f02da25376e4d5a2efff8b
2020-02-20 19:27:20 -08:00
Vojtech Novak 7f2a79f40b allow custom ripple radius on TouchableNativeFeedback (#28009)
Summary:
motivation: there are cases where one'd like to control the radius of the ripple effect that's present on TouchableNativeFeedback  - in my case, I want to make sure that both icons and text have the same ripple appearance, but that's currently not possible as far as I can tell.

Currently (afaik) the only way to set  (upper) ripple limits is by specifying width, height and border radius ( + `overflow: hidden`), and this works well for icons which can usually be bounded by a square, but not for text which can have rectangular shape.

This PR adds `rippleRadius` parameter to `SelectableBackground()`, `SelectableBackgroundBorderless()` and `Ripple()` static functions present on `TouchableNativeFeedback`. It can make the ripple smaller but also larger. The result looks like this:

added to RNTester:

![SVID_20200219_182027_1](https://user-images.githubusercontent.com/1566403/74858131-147ff380-5345-11ea-8a9e-2730b79eec38.gif)

difference from the other ripples:

![SVID_20200209_110918_1](https://user-images.githubusercontent.com/1566403/74109152-4513a080-4b81-11ea-8ec3-bb5862c57244.gif)

I'm ofc open to changing the api if needed, but I'm not sure there's much space for manoeuvring. While I was at it, I did a slight refactor of the class into several smaller, more focused methods.

It's possible that in some cases, this might help to work around this issue https://github.com/facebook/react-native/issues/6480.

## Changelog

[Android] [Added] - allow setting custom ripple radius on TouchableNativeFeedback
Pull Request resolved: https://github.com/facebook/react-native/pull/28009

Test Plan: I tested this locally using RNTester

Reviewed By: TheSavior

Differential Revision: D20004509

Pulled By: mdvacca

fbshipit-source-id: 10de1754d54c17878f36a3859705c1188f15c2a2
2020-02-20 15:29:07 -08:00
Radek Czemerys 1c5938eae7 chore: tweak missing RCTAnimation warning message (#28139)
Summary:
As we don't link modules manually anymore it's better to point the user in another direction when they face this issue.

## Changelog

[Internal] [Changed] - tweak missing RCTAnimation warning message

Pull Request resolved: https://github.com/facebook/react-native/pull/28139

Reviewed By: cpojer

Differential Revision: D20009264

Pulled By: hramos

fbshipit-source-id: 114cae4fe908186eab3d8d9e79c2016015406821
2020-02-20 14:44:31 -08:00
Janette Cheng a793ed7598 Unbreak the build
Summary:
build-break
overriding_review_checks_triggers_an_audit_and_retroactive_review

fbshipit-source-id: 316b879368503114ea1af16276643301601bcca8
2020-02-20 08:30:46 -08:00
Tom Underhill dbe0d7d4b5 Add NativeColorType opaque type to normalizeColor() ahead of PlatformColor PR. (#28040)
Summary:
The [PlatformColor PR](https://github.com/facebook/react-native/pull/27908) is currently open to implement the [PlatformColor proposal](react-native-community/discussions-and-proposals#126).   When that PR was imported into Facebooks internal builds it was found that the change to the `processColor()` function to return an opaque type or `number` instead of just `number` breaks internal components.

This PR is a simplification of the PlatformColor PR only changing the return type of `processColor()` from `?number` to `?number | NativeColorType` where `NativeColorType` is just an empty but opaque type.   This will allow changes to be made to these internal components but with less risk than the larger PR.

## Changelog

[General] [Changed] - Add NativeColorType opaque type to normalizeColor() ahead of PlatformColor PR
Pull Request resolved: https://github.com/facebook/react-native/pull/28040

Test Plan: Flow checks, Jest test, iOS unit tests, iOS integration tests, and manual testing performed on RNTester for iOS and Android.

Differential Revision: D19860205

Pulled By: TheSavior

fbshipit-source-id: 799662c6621d3974158b375ccccfa136982c43b4
2020-02-19 19:33:27 -08:00
Rick Hanlon 372771dc8c Remove LogBox.ignoreWarnings
Summary:
This method isn't necessary for the migration to LogBox because we have a YellowBoxDeprecated module instructing users to use LogBox.ignoreLogs (so no old code should be calling LogBox.ignoreWarnings).

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D19950302

fbshipit-source-id: 4850884e770f812273978b9a205f5b914e5a9d2f
2020-02-19 18:01:43 -08:00
Rick Hanlon d66169b4fc Deprecate YellowBox and unstable_enableLogBox
Summary:
This diff replaces YellowBox with YellowBoxDeprecated, adding warnings for using the module directly instead of YellowBox. Also adds a no-op message for unstable_enableLogBox.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D19949700

fbshipit-source-id: 269c341a2cedcdb2f7a80947d3239db078238201
2020-02-19 18:01:43 -08:00
Rick Hanlon a83ea6ab8c Switch to LogBox completely
Summary:
This diff replaces YellowBox with LogBox so that it can be deprecated and removed.

After this diff, it will no longer be possible to go back to YellowBox and all paths referencing it will be gone.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D19949695

fbshipit-source-id: 28a55866e514020bdcc6854aae565cffbbe8af58
2020-02-19 18:01:43 -08:00
Eli White da9364fa3e Switch iOS focus/blur calls to use new commands
Summary:
Make iOS use Commands instead of UIManager.{focus,blur}. This makes these apis compatible with Fabric and paper at the same time.

Changelog:
[Internal] Switch iOS focus/blur calls to use new commands

Reviewed By: mdvacca

Differential Revision: D19458995

fbshipit-source-id: 8c4aacd41941f54a887aeec1a17d9ce0b6878ab1
2020-02-19 15:29:00 -08:00
Eli White 147055466a Switch Android focus/blur calls to use new commands
Summary:
This makes Android dispatch focus/blur through the Fabric view manager when running in Fabric.

Changelog:
[Internal] Switch Android focus/blur calls to use new commands

Reviewed By: JoshuaGross, mdvacca

Differential Revision: D19458362

fbshipit-source-id: 23e1d989ec55bc8abff4279e259f4b6c953ac0a3
2020-02-19 15:29:00 -08:00
Eli White 6286270e4c Migrate TextInputState to take a ref instead of a reactTag
Summary:
Changelog:
[General][Breaking] Multiple deprecations and breaking changes to TextInputState. Use native component refs instead of react tags

Reviewed By: JoshuaGross

Differential Revision: D19458214

fbshipit-source-id: f67649657fa44b6c707a0ac91f07d2ceb433bc70
2020-02-19 15:28:59 -08:00
Eli White 862c71908c Partial React Sync from 241c4467...ad84625f8
Summary:
Test sync of https://github.com/facebook/react/pull/18068

- **[ad84625f8](https://github.com/facebook/react/commit/ad84625f8 )**: [Native] Migrate focus/blur to call TextInputState with the host component (#18068) //<Eli White>//
- **[edab5c074](https://github.com/facebook/react/commit/edab5c074 )**: Re-throw errors thrown by the renderer at the root in the complete phase (#18029) //<Andrew Clark>//
- **[a6dfe9aa4](https://github.com/facebook/react/commit/a6dfe9aa4 )**: [Native] Delete NativeComponent and NativeMethodsMixin (#18036) //<Eli White>//

Changelog:
[Changed][General] Partial React Sync from 241c4467...ad84625f8

Reviewed By: mdvacca

Differential Revision: D19459322

fbshipit-source-id: daefcf854e3da1c849f8376671065c53a1319ef9
2020-02-19 15:28:59 -08:00
Eli White 3b813cade1 Enable target as instance experiment
Summary:
This diff is just here to make it easier for me to work on the stack. It needs to be ripped out of the stack before landing

Changelog:
[Breaking][General] The `target` field of events is now a native component, not a react tag

Reviewed By: mdvacca

Differential Revision: D19458361

fbshipit-source-id: 1d03a58553cf96dc72f6d1323dfb37b1a8cdca75
2020-02-19 15:28:58 -08:00
Venits e99800267b - Remove leftover `Incremental` component (#28107)
Summary:
1/4 of https://github.com/facebook/react-native/issues/28103

## Changelog

[JavaScript][Removed] - Remove leftover `Incremental` component.
Pull Request resolved: https://github.com/facebook/react-native/pull/28107

Test Plan: In RNTester `Incremental` component is no longer used so I modified one of existing examples to use it.

Reviewed By: rickhanlonii

Differential Revision: D19960536

Pulled By: TheSavior

fbshipit-source-id: 791bda7138ac23916957577ed5f5c465c5e96299
2020-02-18 20:44:43 -08:00
Eli White 010c9241cb Partial React Sync from 241c4467..edab5c074
Summary:
- **[edab5c074](https://github.com/facebook/react/commit/edab5c074 )**: Re-throw errors thrown by the renderer at the root in the complete phase (#18029) //<Andrew Clark>//

Changelog:
[General][Changed] Partial React Sync from 241c4467..edab5c074

Reviewed By: mdvacca, gaearon

Differential Revision: D19961765

fbshipit-source-id: d4a84a4076da332db76d66ddd7250eaea375f8ff
2020-02-18 19:03:18 -08:00
Eloy Durán a43fd60e18 Fix backgroundColor typing. (#28105)
Summary:
TextInput’s `InputAccessoryView` was using a [deprecated] prop-type as a Flow type, which TheSavior asked me to fix [here](6ba4b28a22 (r37343692)).

## Changelog

[iOS] [Fixed] - Fixes the `InputAccessoryView.backgroundColor` prop’s typing to use `ColorValue`.
Pull Request resolved: https://github.com/facebook/react-native/pull/28105

Test Plan:
Passes:

```bash
yarn flow-check-ios
```

Differential Revision: D19956401

Pulled By: TheSavior

fbshipit-source-id: 0c16f292b0143e83235a23712a0a7a11b8317f4e
2020-02-18 13:53:45 -08:00
Rick Hanlon 96f19a3d89 Replace YellowBox references with LogBox
Summary:
This diff replaces some YellowBox references with LogBox so we can remove it.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D19948126

fbshipit-source-id: b26ad1b78d86a8290f7e08396e4a8314fef7a9f3
2020-02-18 07:51:46 -08:00
Rick Hanlon af710ab177 Switch from YellowBox.ignoreWarnings to LogBox.ignoreLogs
Summary:
Migrates internal calls from ignoreWarnings to ignoreLogs so we can remove YellowBox.

Changelog: [Internal]

Reviewed By: TheSavior

Differential Revision: D19813781

fbshipit-source-id: 16c7b3f2cd38cba1901eccb4d5b9a2396a37ba1b
2020-02-18 06:19:46 -08:00
Rick Hanlon 87f1e22434 Deprecate console.disableYellowBox in favor of LogBox.ignoreAllLogs()
Summary:
We're replacing console.disableYellowBox (untyped, global hack, only warnings) with LogBox.ignoreAllLogs() (typed, local method, handles errors and warnings).

Changelog: [General] [Removed] Replace console.disableYellowBox with LogBox.ignoreAllLogs.

Reviewed By: TheSavior

Differential Revision: D19813775

fbshipit-source-id: ffd33ddbca0276a27d23b5b6023a15aef761934e
2020-02-18 06:19:45 -08:00
Rick Hanlon 40646e8418 LogBox - Move images to files
Summary:
Moves the LogBox images from base64 data to files since base64 is not supported everywhere.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D19879323

fbshipit-source-id: 2dc03eebfc712ed863ed76322e133fcad5b00bb4
2020-02-17 08:17:08 -08:00
Spencer Ahrens 71b8ececf9 Add perf markers in XMLHttpRequest
Summary:
ChangeLog: [Both] Adds perf markers for `XMLHttpRequest`s

Makes it easier to see JS-based network operations in performance traces.

Reviewed By: zackargyle

Differential Revision: D19903143

fbshipit-source-id: c5ce60163569e003830d8079cb2b580469d5bd5d
2020-02-17 07:27:37 -08:00
Eli White 6e3389c82b Partial React Sync from 241c4467...349ff315b
Summary:
Includes these commits:

- **[349ff315b](https://github.com/facebook/react/commit/349ff315b )**: [Native] Delete NativeComponent and NativeMethodsMixin (#18036) //<Eli White>//

Changelog:
[General][Changed] - React Native sync for revisions 241c4467...349ff315b

Reviewed By: zackargyle

Differential Revision: D19893829

fbshipit-source-id: 77f35d6b7a0ddf375941c3185decf3862b6807a7
2020-02-13 19:45:08 -08:00
Eli White 8293e4c301 Remove ReactNative.NativeComponent from React Native
Summary:
This class is no longer used by the core and thus can be removed.

It isn't exposed as part of our public API so this is technically not a breaking change, although it may still cause people trouble if they are reaching into internals. It is expected that people will use forwardRef instead of this class.

I will follow up this diff with a removal from the ReactNativeRenderer as well.

Changelog:
[Internal] Remove ReactNative.NativeComponent from React Native

Reviewed By: JoshuaGross

Differential Revision: D19888400

fbshipit-source-id: 78da51e6c0edf9d8706395d376c3bfe75dabda03
2020-02-13 15:08:27 -08:00
Adam Ernst bcc62a6d17 Clean up misc references to ComponentScript
Summary:
ComponentScript is defunct.

Changelog: [Internal]

(Note: this ignores all push blocking failures!)

Reviewed By: yungsters

Differential Revision: D19883555

fbshipit-source-id: 4459e42518468086489bb5d1470a38710423656a
2020-02-13 14:29:02 -08:00
Jason Safaiyeh 04fed6508b Resolve React-RCTText Xcode warning (#28054)
Summary:
Resolve React-RCTText warning: `'UIKeyboardTypeASCIICapableNumberPad' is only available on iOS 10.0 or newer`

## Changelog

[iOS] [Fixed] - Resolve React-RCTText Xcode warning
Pull Request resolved: https://github.com/facebook/react-native/pull/28054

Test Plan: Build template, React-RCTText should no longer throw a warning.

Differential Revision: D19887063

Pulled By: hramos

fbshipit-source-id: 3437ee993babd7cdaec259af24526e197acb64bb
2020-02-13 12:45:08 -08:00
Dan Abramov aa41fd5e37 React Native sync for revisions 19f6fe1...241c446
Summary:
This sync includes the following changes:
- **[57333ca33](https://github.com/facebook/react/commit/57333ca33 )**: Show first component stack in context warning (#17922) //<Dan Abramov>//
- **[cf0081263](https://github.com/facebook/react/commit/cf0081263 )**: Upgrade to jest 25 (#17896) //<Simen Bekkhus>//
- **[6faf6f5eb](https://github.com/facebook/react/commit/6faf6f5eb )**: Update to flow 0.97 (#17892) //<Nicolas Gallagher>//
- **[81e30c7ff](https://github.com/facebook/react/commit/81e30c7ff )**: Remove unused modules from legacy event responders (#17907) //<Nicolas Gallagher>//
- **[3c713d513](https://github.com/facebook/react/commit/3c713d513 )**: chore: update to latest release of babel (#17897) //<Simen Bekkhus>//
- **[3b3decf87](https://github.com/facebook/react/commit/3b3decf87 )**: add warning when owner and self are different for string refs (#17864) //<Luna Ruan>//
- **[6c00c5bba](https://github.com/facebook/react/commit/6c00c5bba )**: Update to flow-bin@0.89 (#17842) //<Nicolas Gallagher>//
- **[cf7a0c24d](https://github.com/facebook/react/commit/cf7a0c24d )**: Remove dynamic GKs for selective/train (#17888) //<Sebastian Markbåge>//
- **[c322f5913](https://github.com/facebook/react/commit/c322f5913 )**: Add unstable_renderSubtreeIntoContainer and unstable_createPortal feature flags (#17880) //<Dominic Gannaway>//
- **[f2fd484af](https://github.com/facebook/react/commit/f2fd484af )**: Add React.createFactory() deprecation warning (#17878) //<Dominic Gannaway>//
- **[0c04acaf8](https://github.com/facebook/react/commit/0c04acaf8 )**: Remove FB specific build (#17875) //<Sebastian Markbåge>//
- **[9fd760ce7](https://github.com/facebook/react/commit/9fd760ce7 )**: Add disable <textarea/> children flag (#17874) //<Dominic Gannaway>//
- **[a209a97ed](https://github.com/facebook/react/commit/a209a97ed )**: Add feature flag around React.createFactory (#17873) //<Dominic Gannaway>//
- **[95bd7aad7](https://github.com/facebook/react/commit/95bd7aad7 )**: Remove renderPhaseUpdates Map (#17625) //<Andrew Clark>//
- **[b43b36dd9](https://github.com/facebook/react/commit/b43b36dd9 )**: Remove ReactInstanceMap_DO_NOT_USE shim (#17861) //<Dominic Gannaway>//
- **[9e075d16b](https://github.com/facebook/react/commit/9e075d16b )**: [react-interactions] Remove deprecated Scope APIs + update Focus components/docs (#17859) //<Dominic Gannaway>//
- **[b6173e643](https://github.com/facebook/react/commit/b6173e643 )**: [react-interactions] Add DO_NOT_USE to Scope methods (#17835) //<Dominic Gannaway>//
- **[f4ca909e0](https://github.com/facebook/react/commit/f4ca909e0 )**: react-refresh@0.7.2 //<Dan>//
- **[255d9ac5f](https://github.com/facebook/react/commit/255d9ac5f )**: [Fresh] Fix edge case with early function call (#17824) //<Dan Abramov>//
- **[d8570ec6e](https://github.com/facebook/react/commit/d8570ec6e )**: Create ReactFabric.stopSurface and use that for bridgeless mode binding (#16164) //<Emily>//
- **[5d6129b5d](https://github.com/facebook/react/commit/5d6129b5d )**: Update ReactSuspenseList-test.internal.js (#17034) //<Ganapati V S>//
- **[3ac81a57f](https://github.com/facebook/react/commit/3ac81a57f )**: Update create-react-app note for eslint-plugin-react-hooks (#16982) //<Tao>//
- **[e70672149](https://github.com/facebook/react/commit/e70672149 )**: Update Flow to 0.84 (#17805) //<Dan Abramov>//
- **[b979db4e7](https://github.com/facebook/react/commit/b979db4e7 )**: Bump Prettier (#17811) //<Dan Abramov>//

Changelog:
[General][Changed] - React Native sync for revisions 19f6fe1...241c446

Reviewed By: yungsters

Differential Revision: D19623180

fbshipit-source-id: 3cdecb33aa66dfc21a2b347bf7f63a5b27fcf6ea
2020-02-12 14:07:48 -08:00
Josh Leibsly ca431c2179 Remove product/platform/infra layers from ios supermodules
Summary:
Context: https://fb.workplace.com/groups/2116332615111503/permalink/2773825422695549/

build-break
overriding_review_checks_triggers_an_audit_and_retroactive_review
allow-large-files
allow_many_files

Differential Revision:
D19858113
Ninja: master broken

fbshipit-source-id: d9e531f9579bfe7ef87097f0d50512722eb1de5e
2020-02-12 10:25:27 -08:00
Michel Weststrate ffb82cb2f0 Make sure exceptions and console.errors are send to metro
Summary: changelog: [General] `console.error` calls, and uncaught exceptions are now displayed in the Metro logs as well

Reviewed By: passy

Differential Revision: D19743075

fbshipit-source-id: a665a06cfc7854ae785af177af8f2478bb1d76b0
2020-02-12 08:27:04 -08:00
Lukas Weber 0d4b0e9417 Fixes RCTReconnectingWebSocket connecting in infinite loop when stopped before it connects (#26864)
Summary:
When `[RCTReconnectingWebSocket stop]` is called and `[RCTReconnectingWebSocket  reconnect]` is scheduled afterwards (i.e. connection didn't happen before `[RCTReconnectingWebSocket stop]` being invoked), it will keep reconnecting forever.

Also fixes retain loop in block within `[RCTReconnectingWebSocket  reconnect]`. When RCTReconnectingWebSocket is stopped and reference to it set to nil, block in reconnect will still keep self alive and reconnecting forever.

I found this edge case when I tried to stop RCTPackagerConnection after some time, so it doesn't spam with `[] nw_socket_handle_socket_event [C34585.1:1] Socket SO_ERROR [61: Connection refused]` when we don' have Metro running (we have brownfield app, so iOS devs don't need Metro running most of the time).

## Changelog
[iOS] [Fixed] -  RCTReconnectingWebSocket is reconnecting infinitely when stopped before getting connected
Pull Request resolved: https://github.com/facebook/react-native/pull/26864

Test Plan:
- Put breakpoint into `[RCTReconnectingWebSocket  reconnect]`
- Start sample RN app **without having Metro running**
- Into AppDelegate add something like
```objc
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
   [RCTPackagerConnection.sharedPackagerConnection stop]
});
```
- After the previous block is dispatched reconnect should not be invoked anymore

Reviewed By: motiz88

Differential Revision: D19767742

Pulled By: rickhanlonii

fbshipit-source-id: dabb2369b06217b961e9d2611257c106d350f70c
2020-02-11 10:54:39 -08:00
Kacie Bawiec 10254a900a Add innerViewRef prop to ScrollView
Summary:
Right now, people are calling `getInnerViewNode` and `getInnerViewRef` to get the ref of the `View` within `ScrollView`. Instead, this change adds a prop to `ScrollView` to give people direct access to that `View` if they need it.

Previous usage:
```
const myRef = React.createRef<React.ElementRef<typeof ScrollView>>();

<ScrollView ref={myRef} />

const innerViewRef = myRef.current.getInnerViewRef();

innerViewRef.measure();

```

New usage:
```
const myRef = React.createRef<React.ElementRef<typeof View>>();

<ScrollView innerViewRef={myRef} />

// now, myRef.current can be used directly as the ref
myRef.current.measure();
```

Changelog:
[Changed][General] ScrollView: Deprecate getInnerViewNode and getInnerViewRef methods. Use innerViewRef={myRef} prop instead.

Reviewed By: TheSavior

Differential Revision: D19713191

fbshipit-source-id: 3304cb94a253dafb458ef49d6331e0e432693431
2020-02-11 10:39:24 -08:00
Jesse Katsumata 9f8e4accfa chore: add description for rejectResponderTermination prop (#28001)
Summary:
Added description for rejectResponderTermination prop for the TextInput, which seemed to have been deleted.
Descriptions are taken from https://github.com/facebook/react-native/pull/16755/files

## Changelog

[Internal] [Added] - Add description for rejectResponderTermination prop for TextInput
Pull Request resolved: https://github.com/facebook/react-native/pull/28001

Test Plan: This PR only changes comment, which has no effect on actual function.

Differential Revision: D19820886

Pulled By: TheSavior

fbshipit-source-id: 5cbaafcbae0bdbf6932ef9c7c0c1a75cd6d8794e
2020-02-10 14:48:50 -08:00
Jesse Katsumata 3f5c42f357 fix: prop name for passwordRules (#27999)
Summary:
There was a typo in passwordRules prop for TextInput.

ref:
https://github.com/facebook/react-native/blob/master/ReactCommon/fabric/components/textinput/iostextinput/propsConversions.h#L106-L110
https://github.com/facebook/react-native/blob/master/Libraries/Components/TextInput/RCTSinglelineTextInputViewConfig.js#L126

## Changelog

[iOS] [Fixed] - Fix prop name of passwordRules in TextInput
Pull Request resolved: https://github.com/facebook/react-native/pull/27999

Test Plan: run `flow` type check with TextInput that has `passwordRules` in the prop.

Differential Revision: D19805819

Pulled By: TheSavior

fbshipit-source-id: a59729c466eb3f47675c7f1472bec269d6c3ed5d
2020-02-10 11:11:52 -08:00
Samuel Susla fb8f5ea07f Implement setTextAndSelection as view command in TextInput
Summary: Changelog: Add view command `TextInput.setTextAndSelection`

Reviewed By: JoshuaGross

Differential Revision: D19789675

fbshipit-source-id: 8eb19bd21b1e153c9639507016a9f452c5f835b0
2020-02-07 14:10:28 -08:00
Samuel Susla 111f04ff11 Implement setMostRecentEventCount as view command
Summary: Changelog: Add view command `TextInput.setMostRecentEventCount`

Reviewed By: JoshuaGross

Differential Revision: D19789587

fbshipit-source-id: a52456cf5d39e25c730bbb2840009220b2242f87
2020-02-07 14:10:28 -08:00
Paige Sun edfdafc7a1 Resolve and reject promise for PushNotificationIOS.requestPermissions
Summary:
**Resolve/Reject Promise**
* Add onFulfill and onReject to the `PushNotificationIOS.requestPermissions()` Promise

**Replace Apple-deprecated notification method**
* Old: In iOS 10, `UIApplication.registerUserNotificationSettings` was deprecated. Calling this would then call the AppDelegate's lifecycle function `didRegisterUserNotificationSettings`, and then in the AppDelegate, we'd call `RCTPushNotificationManager.didRegisterUserNotificationSettings` to return the user settings.
[registerusernotificationsettings Doc](https://developer.apple.com/documentation/uikit/uiapplication/1622932-registerusernotificationsettings?language=objc)

* New: Replace deprecated function with Apple's recommended `UNUserNotificationCenter.currentNotificationCenter getNotificationSettingsWithCompletionHandler`, which no longer needs the AppDelegate lifecycle method because it directly returns the user's settings in a completion hander.
[requestauthorizationwithoptions Doc](https://developer.apple.com/documentation/usernotifications/unusernotificationcenter/1649527-requestauthorizationwithoptions?language=objc)

**Add Tests**
* Add tests on `PushNotificationIOSExample.js` to test that the onFulfill and onReject are called
* On `PushNotificationIOSExample.js`, instead of asking permission upon page load, ask for permission when the user taps the button "Request Notifications (Should Display Alert)".
* Before, asking for permission multiple times before would result in the RN error "cannot call requestPermissions twice before the first has returned", now you can ask for permission as many times as you want because I've removed the now unused `RCTPromiseResolveBlock`.

**Future**
If this works on device (we have to land this to test push on device), we can delete `RTCPushNotificationManager.didRegisterUserNotificationSettings` which is being called from several apps.

Changelog:
[iOS] [Added]  Resolve and reject promise for PushNotificationIOS.requestPermissions

Reviewed By: PeteTheHeat

Differential Revision: D19700061

fbshipit-source-id: 02ba815787efc9047f33ffcdfafe962b134afe6d
2020-02-07 08:50:26 -08:00
Valentin Shergin ed11a12a7c Revert D19235758: Implement onRequestClose for iOS 13+ modals
Differential Revision:
D19235758

Original commit changeset: c0f1d946c77c

fbshipit-source-id: c4a9d7876aa8d07ff5b8419f097b02e9c28e2880
2020-02-06 14:45:42 -08:00
Eli White 1e9db7bd6d Remove animated prop
Summary:
This prop was deprecated in April 2016 in [this commit](2bb1c263db (diff-931cea019b5e9faceffef4e46f1fff08)), first in 0.26.0

It's been a while, we can remove it now.

Changelog:
[Breaking][General] Modal: Remove support for `aniamted` prop (deprecated in 0.26)

Reviewed By: cpojer

Differential Revision: D19762163

fbshipit-source-id: b6173bba066fc9ad0e786f56a946e2f3fa3d79cc
2020-02-06 12:45:09 -08:00
Pieter De Baets 13d8f4848e Stub out callFunctionReturnResultAndFlushedQueue
Summary: Changelog: [Internal] Remove unused BatchedBridge.callFunctionReturnResultAndFlushedQueue

Reviewed By: cpojer

Differential Revision: D19765606

fbshipit-source-id: d639e76c48113060013f9e858a669d8b1e4d20e7
2020-02-06 03:35:32 -08:00
Eli White a26d622d04 Remove deprecated support for Alert.prompt with type as Callback
Summary:
This functionality was deprecated in [this commit](e2bd7db732) on Feb 12th, 2019, originall in 0.59.0

Changelog:
[Breaking][General] Alert: Remove deprecated support for Alert.prompt with type as Callback (deprecated in 0.59)

Reviewed By: cpojer

Differential Revision: D19762618

fbshipit-source-id: a8edb6045bbc57d56e75fd281e602f5370ba1810
2020-02-06 02:02:31 -08:00
Eli White 26912bd979 Delete thumbTintColor, tintColor, onTintColor props
Summary:
Deprecations for these props were added in 0.57, June 2018, in this commit: 965adee109 (diff-6ee4e62c750fcd87064f152f53214a05), with warnings added in 9a4fd6b78d (diff-6ee4e62c750fcd87064f152f53214a05)

It has been a couple releases now, so let's clean up the component code and finally remove support.

For instructions on how to migrate off these props, see the commit summary of 965adee109 (diff-6ee4e62c750fcd87064f152f53214a05)

Changelog:
[Breaking][General] Switch: Remove support for thumbTintColor, tintColor, onTintColor props (deprecated in 0.57)

Reviewed By: cpojer

Differential Revision: D19760913

fbshipit-source-id: 8fdcf7af99fecadecf3157c00e6d1cbab8e63268
2020-02-06 01:58:00 -08:00
Jorge Bernal 8e5fac89bb Implement onRequestClose for iOS 13+ modals (#27618)
Summary:
Starting on iOS 13, a View Controller presented modally will have a "bottom sheet" style unless it's explicitly presented full screen.

Before this, modals on iOS were only being dismissed programatically by setting `visible={false}`. However, now that the dismissal can happen on the OS side, we need a callback to be able to update the state.

This PR reuses the `onRequestClose` prop already available for tvOS and Android, and makes it work on iOS for this use case.

Should fix https://github.com/facebook/react-native/issues/26892

## Changelog

[iOS] [Added] - Add support for onRequestClose prop to Modal on iOS 13+
Pull Request resolved: https://github.com/facebook/react-native/pull/27618

Test Plan:
I tested this using the RNTester app with the Modal example:

1. Select any presentation style other than the full screen ones
2. Tap Present and the modal is presented
3. Swipe down on the presented modal until dismissed
4. Tap Present again and a second modal should be presented

![Screen Recording 2019-12-26 at 14 05 33](https://user-images.githubusercontent.com/8739/71477208-0ac88c80-27e9-11ea-9342-8631426a9b80.gif)

Differential Revision: D19235758

Pulled By: shergin

fbshipit-source-id: c0f1d946c77ce8d1baab209eaef7eb64697851df
2020-02-05 21:42:17 -08:00
Eli White f555202531 Make JS Animated Driver use forceUpdate in Fabric for list components
Summary:
List components aren't host components so checking if the direct component itself's internals isn't sufficient to know if we are in Fabric. For lists, we have to call through some helper functions to get to the host component.

Hopefully we will fix this in the future by making the lists use forwardRef, or by getting rid of the JS Driver altogether, but for now, this is fine (TM).

Changelog: Internal

Reviewed By: mdvacca

Differential Revision: D19731067

fbshipit-source-id: 0e73583c6bf7c10de30e668a390d29718d31b295
2020-02-05 18:38:28 -08:00
Pieter De Baets 46dcce0031 Remove unused callFunctionReturnResultAndFlushedQueue
Summary: Changelog: [Internal] Remove unused BatchedBridge.callFunctionReturnResultAndFlushedQueue

Reviewed By: sammy-SC

Differential Revision: D19740946

fbshipit-source-id: 9919d52074180d0fcfb7c0929005f0d925578912
2020-02-05 13:02:06 -08:00
Peter Argany 5ad964ba3e Disable animations in bridgeless mode
Summary:
Bridgeless mode requires all native modules to be turbomodules. The iOS animated module was converted to TM, but reverted due to perf issues. RSNara is looking into it, but it may be an involved fix. As a short term workaround, to unblock release mode testing of bridgeless mode, use `AnimatedMock`.

Changelog: [Internal] Disable animations in bridgeless mode

Reviewed By: RSNara

Differential Revision: D19729827

fbshipit-source-id: e6c4d89258ec23da252c047b4c67c171f7f21c25
2020-02-04 15:30:54 -08:00
Spencer Ahrens b7bc31a305 Cleanup StaticContainer a bit
Summary:
React is way better than it used to be...

Changelog: [Internal]

Reviewed By: zackargyle, lunaleaps

Differential Revision: D19421772

fbshipit-source-id: db82b68a0c2f31e9ef7e1875fd9e4bf27ef6295a
2020-02-04 13:54:27 -08:00
Yuanzhe Bian 484f62a71f Add hybrid scene tracker
Summary:
## This diff

- Add a hybird scene tracker that support both native navigation and js navigation
- It also has a filter that bypass loading routes and unrelated routes like log box
- The tracker can provide exactly what surface user is looking at

Changelog: [Internal]

Differential Revision: D19667699

fbshipit-source-id: 600efd05e68bf2702c6c2b1d794e720059f75f81
2020-02-03 18:46:38 -08:00
Emily Janzer bc210c03be Enable JS view configs for ViewNativeComponent in bridgeless mode
Summary:
All of our other JS view configs are gated by the `RN$Bridgeless` flag. This one has been behind a DEV flag instead. We've been using it in DEV for a long time now, so it's probably ok to be in prod, but I figured it's better to just be consistent with the rest of the native components, since we only need this for bridgeless.

Changelog: [Internal]

Reviewed By: TheSavior

Differential Revision: D19669902

fbshipit-source-id: bd28cf84947bfe298efd95ae07e38c2bf4e45091
2020-02-03 11:38:31 -08:00
Moti Zilberman ee01be3462 Fix indentation of inline snapshots in tests
Summary:
This diff regenerates all Jest inline snapshots (`expect().toMatchInlineSnapshot()`) now that we use Jest 24.9.0 which fixes a longstanding [formatting instability bug](https://github.com/facebook/jest/issues/8424).

This is strictly a formatting change.

Changelog: [Internal]

Reviewed By: cpojer

Differential Revision: D19684238

fbshipit-source-id: 77c1e5fe9d2dfef85dffdcc00056fb439d7d7f84
2020-02-03 03:19:10 -08:00
Janic Duplessis 7deeec7396 Fix resolving assets outside of the project root (#27932)
Summary:
When an asset is outside of the metro project root, it can lead to relative paths like `/assets/../../node_modules/coolpackage/image.png` as the `httpServerLocation`. This can happen for example when using yarn workspaces with hoisted node_modules.

This causes issues when bundling on iOS since we use this path in the filesystem. To avoid this we replace `../` with `_` to preserve the uniqueness of the path while avoiding these kind of problematic relative paths. The same logic is used when bundling assets in the rn-cli.

CLI part of this PR: https://github.com/react-native-community/cli/pull/939

## Changelog

[General] [Fixed] - Fix resolving assets outside of the project root
Pull Request resolved: https://github.com/facebook/react-native/pull/27932

Test Plan: Tested that an asset in a hoisted node_modules package doesn't show up before this patch and does after in a release build.

Differential Revision: D19690587

Pulled By: cpojer

fbshipit-source-id: 8a9c68af04594ce1503a810ecf2e97ef5bfb8004
2020-02-03 03:15:56 -08:00
Janic Duplessis 6adba409e6 Implement TextInput autoFocus natively on iOS (#27803)
Summary:
This implement the autoFocus functionality natively instead of calling the focus method from JS on mount. This is needed to properly fix the issue described in https://github.com/facebook/react-native/issues/27217, where when using native navigation (UINavigationController) text input focus needs to happen in the same frame transition starts or it leads to an animation bug in UIKit.

My previous attempt fixed the problem only partially and the bug could still happen since there is no guaranty code executed in useEffect will end up in the same frame as the native view being created and attached.

To fix this I added an autoFocus prop to the native component on iOS and in didAttachToWindow we focus the input if it is set. This makes sure the focus is set in the same frame as the view hierarchy containing the input is created.

## Changelog

[iOS] [Fixed] - Add native support for TextInput autoFocus on iOS
Pull Request resolved: https://github.com/facebook/react-native/pull/27803

Test Plan:
- Tested that the UI glitch when transitionning to a screen with an input with autofocus no longer happens in my app.
- Tested that autofocus still works in RNTester
- Made sure that onFocus does get called and TextInputState is updated properly

Differential Revision: D19673369

Pulled By: TheSavior

fbshipit-source-id: 14d8486ac635901622ca667c0e61c75fb446e493
2020-01-31 21:56:18 -08:00
Mackenzie Mance 6a4e06faa8 Allow zIndex to useNativeDriver (#27418)
Summary:
STYLES_WHITELIST
+zIndex
Pull Request resolved: https://github.com/facebook/react-native/pull/27418

Test Plan: Working on sim and device.

Differential Revision: D19644753

Pulled By: shergin

fbshipit-source-id: 9a3516f65de7011f7e91587e62153e083504d283
2020-01-30 22:15:41 -08:00
Peter Argany e1b8c954ef Add a hand-written JS view config for RCTSinglelineTextInputView
Summary: `requireNativeComponent` redboxes in bridgeless mode because there is no UIManager. This adds a handwritten view config to avoid using UIManager.

Reviewed By: ejanzer

Differential Revision: D19624044

fbshipit-source-id: 5ae68f63068a131a305754003154ee0cf0f1be46
2020-01-30 15:30:11 -08:00
Arthur Kushka 6a00a5deab Fixed crash during ScrollView initialisation if Platform.OS is not iOS or Android
Summary:
In case when Platform is different from Android or iOS, ScrollView initialised RCTScrollView two times, which caused a crash. It looks for me that default option is obsolete and can be united with iOS one to fix this issue.

## Changelog:
[Internal] [Fixed] - Fixed crash during ScrollView initialisation if Platform.OS is not iOS or Android

Reviewed By: ejanzer

Differential Revision: D19623046

fbshipit-source-id: 84f8a46ea24b463aa6aae761f4386ab7e4e95f9b
2020-01-29 12:52:34 -08:00
Peter Argany 0d968fd7dc Ignore deprecatedPropType in bridgeless mode
Summary:
This validate function uses the `UIManager.getViewManagerConfig` API to verify if props are supported. Bridgeless mode doesn't support UIManager APIs.

It seems like these `deprecatedPropType` will be removed eventually, so let's ignore it in bridgeless.

Changelog: [Internal] Ignore deprecatedPropType in bridgeless mode

Reviewed By: ejanzer

Differential Revision: D19603819

fbshipit-source-id: 2c744705be8821cc6a9d8daaac3e652987447e4d
2020-01-29 12:02:48 -08:00
Rick Hanlon 044991a93f LogBox - Add build version and open in browser
Summary:
Adds build version and an onPress for the build info.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D19334440

fbshipit-source-id: b201b630086179faca31a08c62019a2019cedf4f
2020-01-29 06:23:26 -08:00
Jesse Katsumata 5b8f4ef195 Clear some lint warnings (#27893)
Summary:
Applied linting for warnings that seemed trivial.

## Changelog

[Internal] [Fixed] - clear lint warnings
Pull Request resolved: https://github.com/facebook/react-native/pull/27893

Test Plan: yarn lint

Differential Revision: D19619569

Pulled By: cpojer

fbshipit-source-id: f9f02838c56e94abc1590686c8443c6c6e6f44ca
2020-01-29 04:36:28 -08:00
Spencer Ahrens f0dafd34fe Export LayoutAnimationConfig type
Summary:
Can be handy for general animation components, like `FancySuspense`.

ChangeLog:
[General][Added] Export LayoutAnimationConfig flow type

Reviewed By: zackargyle, TheSavior

Differential Revision: D19345668

fbshipit-source-id: 26178d1eb0b6f710f652bf82c8095dec5bf5afbd
2020-01-28 17:10:30 -08:00
Eli White 9cc920be2f Pressability: Support Rect or Numeric Size
Summary:
Introduces `Rect`, an (eventual) replacement for `EdgeInsetsProp`.

This new type is then used in `Pressability` to expand support such that `hitSlop` and `pressRectOffset` can be either a `Rect` or a numeric size.

Changelog:
[Internal]

Reviewed By: yungsters

Differential Revision: D18742616

fbshipit-source-id: 13dd360f68ab804839938fc950fa2f4b25d3ed8c
2020-01-28 15:14:23 -08:00
Eli White 4bbbe6a5ba Pressability: Create `usePressability` Hook
Summary:
Creates `usePressability`, a hook to simplify using `Pressability` from functional components.

Changelog:
[Internal]

Reviewed By: yungsters

Differential Revision: D18742613

fbshipit-source-id: 55cf48ad60a16a6a5c2c3fa2785f61f784a46b45
2020-01-28 15:14:23 -08:00
Eli White 4e31fbd39c Pressable: Update ReactTestTools to be able to tab on Pressable
Summary:
This was all yungsters idea. I blame him. :)

Switching Pressable to be a functional component presents a new challenge. ReactNativeTestTools can no longer find its instance because there is no instance Pressable uses forwardRef.

We need a way to both find a pressable, and then call the onPress callback if the pressable isn't also disabled.

So in DEV (and thus test) we add the pressable config to a secret key on a function passed onto View. The TestTools look for this key on this function, and then can call onPress.

Super hacky, but so is all of ReactNativeTestTools. We aren't proud of this.

Changelog:
[General][Changed]: Added support for Pressable to ReactNativeTestTools.tap

Reviewed By: yungsters

Differential Revision: D18849358

fbshipit-source-id: ea8880ceedfc04cda217ee17ba140475d003172c
2020-01-28 15:14:23 -08:00
Mike Vitousek 7bc2b91790 Deploy Flow v0.117.0 to xplat
Summary: Changelog: [Internal]

Reviewed By: jbrown215

Differential Revision: D19596867

fbshipit-source-id: 3fc2ec51672bb453cec0eb6bf3c522f23cf9cd38
2020-01-28 14:36:44 -08:00
Eloy Durán 25571ec452 Make C++ requirement opt-in (#27730)
Summary:
When building as a framework these headers get automatically added to the framework umbrella header for React-Core. Instead of converting all the React sources to ObjC++ files and still forcing external users that build native source (and link against a framework build) to also compile as ObjC++, this makes the attribution related methods that were added in https://github.com/facebook/react-native/commit/fdcdca4 opt-in to ObjC++ builds.

This is also the reason for the current failure of the CI `test_ios_frameworks` run.

## Changelog

I’m unsure if this change really warrants an entry in the CHANGELOG, as it’s more of an amendment of the (afaik) unreleased [change](https://github.com/facebook/react-native/commit/fdcdca4).

[iOS] [Fixed] - Make framework builds work again by making `RCTImageLoader` C++ requirement opt-in
Pull Request resolved: https://github.com/facebook/react-native/pull/27730

Test Plan:
I tested static and dynamic (framework) builds and ran the test suite.

This change should make the `test_ios_frameworks` CI run _build_ again, ~~but it may still fail overall as in my local testing one of the tests leads to a segfault (which I will try to address separately)~~.

Reviewed By: PeteTheHeat

Differential Revision: D19348846

Pulled By: fkgozali

fbshipit-source-id: 8a74e6f7ad3ddce2cf10b080b9a5d7b399bd5fc0
2020-01-28 13:14:35 -08:00
Moti Zilberman f7c6066425 Log VirtualizedList nesting hierarchy in listKey collision error
Summary:
## Context

When a `VirtualizedList` contains a cell which itself contains more than one `VirtualizedList` of the same orientation as the parent list, we log an error if sibling lists in a cell don't have unique `listKey`s (e.g. when the `listKey` prop isn't explicitly set). In release builds, this error does not have a component stack - nor a useful call stack - so it can be hard to track down the true source of the error in complex applications.

## This diff

Here, in addition to the generic error message, we also print the `listKey`, `cellKey` and orientation of each `VirtualizedList` in the hierarchy, from the child list upwards. This is done without significant overhead, by reusing the already-in-place context that `VirtualizedList`s use to manage nesting.

The assumption is that common strategies for deriving `listKey`s and `cellKey`s will make it possible to identify at least some lists in the hierarchy in common cases, and therefore help narrow down the search space even when component stacks are not available.

## Example

(See code in unit test)

```
A VirtualizedList contains a cell which itself contains more than one VirtualizedList of the same orientation as the parent list. You must pass a unique listKey prop to each sibling list.

VirtualizedList trace:
  Child (horizontal):
    listKey: level2
    cellKey: cell0
  Parent (horizontal):
    listKey: level1
    cellKey: cell0
  Parent (vertical):
    listKey: level0
    cellKey: rootList
```

Changelog: [Internal]

Reviewed By: TheSavior

Differential Revision: D19600366

fbshipit-source-id: 73f29507ec58a6a3f9b3f6b174a32b21dcd237a1
2020-01-28 11:34:14 -08:00
Ramanpreet Nara 9a8c06b502 Transform empty responses into empty Blobs
Summary:
In `XMLHttpRequest`, if the responseType is `Blob`, but the response is an empty string, we return `null` from `XMLHttpRequest.prototype.response()`. Instead, we should return an empty Blob. This is the behaviour on the web. To demonstrate, run the following HTTP server with Node:

## server.js
```
const http = require('http');
const server = http.createServer();

server.on('request', (request, response) => {
  if (request.url.includes('img.png')) {
    console.log('sending image');
    response.end('');
    return;
  }

  response.end('Hello World!');
});

server.listen('9000');
```

Then, open up a web browser to `http://localhost:9000`, and type the following in the console:

```
var oReq = new XMLHttpRequest();
oReq.open('GET', 'http://localhost:9000/img.png', true);
oReq.responseType = 'blob';

oReq.onload = function(oEvent) {
  var blob = oReq.response;
  console.warn(blob);
};

oReq.onerror = function(error) {
  console.warn('Error!');
};

oReq.send();
```

This warns:
```
Blob {size: 0, type: "text/xml"}
```

Changelog:
[Both][Fixed] - [RN][XMLHttpRequest] Transform empty responses into empty Blobs

Reviewed By: sahrens

Differential Revision: D19500607

fbshipit-source-id: ec35e534b32a507c8a94a29e955b7bc4c62902a0
2020-01-27 10:27:14 -08:00
Jesse Katsumata 674ac69cee fix: resolve Require Cycle warning (#27851)
Summary:
When I was testing React Native 0.62-rc.1, I noticed that console was showing a warning for Require Cycle as shown in image below

![Screen Shot 2020-01-24 at 12 22 38](https://user-images.githubusercontent.com/6936373/73042467-998dff00-3ea4-11ea-911c-955d55fd0743.png)

This is because ScrollResponder was importing `ScrollView` to get the `typeof ScrollView`.
I've made an export for ScrollView type in `ScrollView` so that Require cycle warning will not show up.

## Changelog

[General] [Fixed] - Remove Require cycle warning.
Pull Request resolved: https://github.com/facebook/react-native/pull/27851

Differential Revision: D19577644

Pulled By: cpojer

fbshipit-source-id: 257b9421a91244d69394375102cfbe683326bba2
2020-01-27 02:04:46 -08:00
Ahmed Ibrahim 5d08aab526 Disable `usesFontLeading` for NSLayoutManager on iOS to fix baseline alignment issue on some fonts (#27195)
Summary:
Fixes https://github.com/facebook/react-native/issues/27137

This PR fixes an issue on iOS where RCTTextView height is not calculated as it should for some fonts where font `leading` attributed is not equal to zero, which results in wrong baseline alignment behaviour.

The fix for this is by setting `usesFontLeading` property of `NSLayoutManager` to `NO`, which results is a layout behavior that is similar to `UILabel`

Probably the documentation for `usesFontLeading` describes why UILabel has a different (correct) layout behavior in that case
> // By default, a layout manager will use leading as specified by the font.  However, this is not appropriate for most UI text, for which a fixed leading is usually specified by UI layout guidelines.  These methods allow the use of the font's leading to be turned off.

## Changelog

[iOS] [Fixed] - Fix RCTTextView layout issue that happens on some font with `leading` attribute not equal to zero, which causes wrong base-alignment layout
Pull Request resolved: https://github.com/facebook/react-native/pull/27195

Test Plan:
Below are the test results before and after the change, and comparing that to native UILabel behavior.

The test is done with using system font and custom font (`GothamNarrow-Medium`) and font size 50

[GothamNarrow-Medium.otf.zip](https://github.com/facebook/react-native/files/3832143/GothamNarrow-Medium.otf.zip)

```js
const App: () => React$Node = () => {
  return (
    <View style={{flex: 1, margin: 40, flexDirection: 'row', justifyContent: 'center', alignItems: 'baseline'}}>
      <View style={{width: 30, height: 30, backgroundColor: 'lightgray'}} />
      <Text style={{fontSize: 50, backgroundColor: 'green', fontFamily: 'GothamNarrow-Medium'}}>{'Settings'}</Text>
    </View>
  );
};
```

-------
### Before the fix

<img width="962" alt="Screenshot 2019-11-11 at 16 53 26" src="https://user-images.githubusercontent.com/5355138/68601049-dd778780-04a3-11ea-879e-cc7b4eb2af95.png">

-----
### After the fix
<img width="944" alt="Screenshot 2019-11-11 at 16 55 11" src="https://user-images.githubusercontent.com/5355138/68601180-1d3e6f00-04a4-11ea-87bc-61c6fa2cdb18.png">

-----
### Using `UILabel`
<img width="805" alt="Screenshot 2019-11-11 at 16 59 28" src="https://user-images.githubusercontent.com/5355138/68601487-b2d9fe80-04a4-11ea-9a0f-c025c7753c24.png">

Differential Revision: D19576556

Pulled By: shergin

fbshipit-source-id: 4eaafdab963c3f53c461884c581e205e6426718a
2020-01-26 19:46:38 -08:00
Nikita Shanin 6237cfb325 disable momentum scrolling for vertical ScrollView (#27666)
Summary:
Following up changes added in https://github.com/facebook/react-native/issues/24045 I had the same use case for vertical ScrollView. This PR just enables existing `disableIntervalMomentum` property to work with vertical ScrollViews: restricts vertical pagination when page height is less than height of ScrollView.

## Changelog

[General] [Changed] - changed property `disableIntervalMomentum` to work with both horizontal and vertical ScrollViews
Pull Request resolved: https://github.com/facebook/react-native/pull/27666

Test Plan:
No new tests at the moment

`iOS`
```
All tests
Test Suite RNTesterUnitTests.xctest started
RCTAllocationTests
    ✓ testBridgeIsDeallocated (0.045 seconds)
    ✓ testContentViewIsInvalidated (0.006 seconds)
    ✓ testModuleMethodsAreDeallocated (0.002 seconds)
    ✓ testModulesAreDeallocated (0.022 seconds)
    ✓ testModulesAreInvalidated (0.017 seconds)
RCTAnimationUtilsTests
    ✓ testClampExtrapolate (0.002 seconds)
    ✓ testExtendExtrapolate (0.002 seconds)
    ✓ testIdentityExtrapolate (0.001 seconds)
    ✓ testManySegments (0.003 seconds)
    ✓ testSimpleOneToOneMapping (0.002 seconds)
    ✓ testWiderInputRange (0.003 seconds)
    ✓ testWiderOutputRange (0.002 seconds)
RCTBlobManagerTests
    ✓ testCreateFromParts (0.002 seconds)
    ✓ testRemove (0.001 seconds)
    ✓ testResolve (0.001 seconds)
    ✓ testResolveMap (0.001 seconds)
    ✓ testResolveURL (0.001 seconds)
RCTBundleURLProviderTests
    ✓ testBundleURL (0.041 seconds)
    ✓ testIPURL (0.005 seconds)
    ✓ testLocalhostURL (0.005 seconds)
RCTComponentPropsTests
    ✓ testNeedsOffscreenAlphaCompositing (0.019 seconds)
    ✓ testResetBackgroundColor (0.008 seconds)
    ✓ testResetProps (0.012 seconds)
    ✓ testSetProps (0.009 seconds)
RCTConvert_NSURLTests
    ✓ test_basic (0.002 seconds)
    ✓ test_documentsFolder (0.001 seconds)
    ✓ test_filePath (0.001 seconds)
    ✓ test_filePathWithEncodedSpaces (0.001 seconds)
    ✓ test_filePathWithSpaces (0.001 seconds)
    ✓ test_fileURL (0.001 seconds)
    ✓ test_fullURL (0.001 seconds)
    ✓ test_imageAt2XPath (0.001 seconds)
    ✓ test_imageFile (0.001 seconds)
    ✓ test_imageURL (0.001 seconds)
    ✓ test_imageURLWithSpaces (0.001 seconds)
    ✓ test_null (0.001 seconds)
    ✓ test_unicodeURL (0.001 seconds)
    ✓ test_urlWithEncodedSpaces (0.001 seconds)
    ✓ test_urlWithSpaces (0.001 seconds)
    ✓ testDataURL (0.003 seconds)
RCTConvert_YGValueTests
    ✓ testNumberPoints (0.002 seconds)
    ✓ testStringPercent (0.002 seconds)
    ✓ testUndefined (0.001 seconds)
RCTDevMenuTests
    ✓ testClosingActionSheetAfterAction (0.009 seconds)
    ✓ testShowCreatingActionSheet (0.017 seconds)
RCTEventDispatcherTests
    ✓ testBasicCoalescingReturnsLastEvent (0.006 seconds)
    ✓ testCoalescingEventIsImmediatelyDispatched (0.001 seconds)
    ✓ testDifferentEventTypesDontCoalesce (0.001 seconds)
    ✓ testDifferentViewTagsDontCoalesce (0.001 seconds)
    ✓ testLegacyEventsAreImmediatelyDispatched (0.001 seconds)
    ✓ testMultipleEventsResultInOnlyOneDispatchAfterTheFirstOne (0.001 seconds)
    ✓ testNonCoalescingEventIsImmediatelyDispatched (0.001 seconds)
    ✓ testRunningTheDispatchedBlockResultInANewOneBeingEnqueued (0.001 seconds)
    ✓ testSameEventTypesWithDifferentCoalesceKeysDontCoalesce (0.001 seconds)
RCTFontTests
    ✓ testFamily (0.029 seconds)
    ✓ testFamilyAndStyle (0.001 seconds)
    ✓ testFamilyAndWeight (0.002 seconds)
    ✓ testFamilyStyleAndWeight (0.002 seconds)
    ✓ testInvalidFont (0.002 seconds)
    ✓ testSize (0.001 seconds)
    ✓ testStyle (0.003 seconds)
    ✓ testStyleAndWeight (0.002 seconds)
    ✓ testVariant (0.002 seconds)
    ✓ testWeight (0.002 seconds)
RCTFormatErrorTests
    ✓ testSymbolication (0.002 seconds)
RCTGzipTests
    ✓ testDontRezipZippedData (0.004 seconds)
    ✓ testGzip (0.002 seconds)
    ✓ testRequestBodyEncoding (0.003 seconds)
RCTImageLoaderTests
    ✓ testImageDecoding (0.010 seconds)
    ✓ testImageLoaderUsesImageDecoderWithHighestPriority (0.003 seconds)
    ✓ testImageLoaderUsesImageURLLoaderWithHighestPriority (0.004 seconds)
    ✓ testImageLoading (0.004 seconds)
RCTImageUtilTests
    ✓ testLandscapeSourceLandscapeTarget (0.001 seconds)
    ✓ testPortraitSourceLandscapeTarget (0.001 seconds)
    ✓ testPortraitSourcePortraitTarget (0.001 seconds)
    ✓ testRounding (0.001 seconds)
    ✓ testScaling (0.001 seconds)
RCTJSONTests
    ✓ testDecodingArray (0.001 seconds)
    ✓ testDecodingMutableArray (0.001 seconds)
    ✓ testDecodingObject (0.001 seconds)
    ✓ testDecodingString (0.001 seconds)
    ✓ testEncodingArray (0.001 seconds)
    ✓ testEncodingNSError (0.023 seconds)
    ✓ testEncodingObject (0.001 seconds)
    ✓ testEncodingString (0.001 seconds)
    ✓ testErrorPointer (0.002 seconds)
    ✓ testLeadingWhitespace (0.001 seconds)
    ✓ testNaN (0.001 seconds)
    ✓ testNotJSONSerializable (0.001 seconds)
    ✓ testNotUTF8Convertible (0.004 seconds)
RCTMethodArgumentTests
    ✓ testAttributes (0.001 seconds)
    ✓ testGenericArray (0.001 seconds)
    ✓ testGenericDictionary (0.001 seconds)
    ✓ testGenericSet (0.001 seconds)
    ✓ testNamespacedCxxStruct (0.001 seconds)
    ✓ testNestedGenericArray (0.001 seconds)
    ✓ testNewlines (0.001 seconds)
    ✓ testNullability (0.001 seconds)
    ✓ testOneArgument (0.001 seconds)
    ✓ testSemicolonStripping (0.001 seconds)
    ✓ testSpaces (0.001 seconds)
    ✓ testTwoArguments (0.001 seconds)
    ✓ testUnnamedArgs (0.001 seconds)
    ✓ testUntypedUnnamedArgs (0.001 seconds)
    ✓ testUnused (0.001 seconds)
RCTModuleInitNotificationRaceTests
    ✓ testViewManagerNotInitializedBeforeSetBridgeModule (0.009 seconds)
RCTModuleInitTests
    ✓ testCustomInitModuleInitializedAtBridgeStartup (0.005 seconds)
    ✓ testCustomSetBridgeModuleInitializedAtBridgeStartup (0.006 seconds)
    ✓ testExportConstantsModuleInitializedAtBridgeStartup (0.005 seconds)
    ✓ testInjectedModulesInitializedDuringBridgeInit (0.003 seconds)
    ✓ testLazyInitModuleNotInitializedDuringBridgeInit (0.005 seconds)
RCTModuleMethodTests
    ✓ testFunctionType (0.001 seconds)
    ✓ testNonnull (0.001 seconds)
    ✓ testNumbersNonnull (0.001 seconds)
    ✓ testReturnsNilForDefaultFunction (0.001 seconds)
    ✓ testReturnsValueForSyncFunction (0.001 seconds)
    ✓ testReturnTypeForSyncFunction (0.001 seconds)
    ✓ testStructArgument (0.001 seconds)
    ✓ testWhitespaceTolerance (0.001 seconds)
RCTMultipartStreamReaderTests
    ✓ testMultipleParts (0.001 seconds)
    ✓ testNoCloseDelimiter (0.001 seconds)
    ✓ testNoDelimiter (0.001 seconds)
    ✓ testSimpleCase (0.001 seconds)
RCTNativeAnimatedNodesManagerTests
    ✓ testAdditionNode (0.002 seconds)
    ✓ testAnimationCallbackFinish (0.001 seconds)
    ✓ testCritcallyDampedSpringAnimation (0.003 seconds)
    ✓ testDecayAnimation (0.004 seconds)
    ✓ testDecayAnimationLoop (0.012 seconds)
    ✓ testFramesAnimation (0.001 seconds)
    ✓ testFramesAnimationLoop (0.002 seconds)
    ✓ testHandleStoppingAnimation (0.002 seconds)
    ✓ testInterpolationNode (0.002 seconds)
    ✓ testMultiplicationNode (0.001 seconds)
    ✓ testNativeAnimatedEventDoNotUpdate (0.001 seconds)
    ✓ testNativeAnimatedEventDoUpdate (0.002 seconds)
    ✓ testNodeValueListenerIfListening (0.001 seconds)
    ✓ testNodeValueListenerIfNotListening (0.001 seconds)
    ✓ testSpringAnimationLoop (0.007 seconds)
    ✓ testSpringTrackingRetainsSpeed (0.007 seconds)
    ✓ testTracking (0.002 seconds)
    ✓ testTrackingPausesWhenEndValueIsReached (0.001 seconds)
    ✓ testUnderdampedSpringAnimation (0.003 seconds)
    ✓ testViewReceiveUpdatesIfOneOfAnimationHasntStarted (0.001 seconds)
    ✓ testViewReceiveUpdatesWhenOneOfAnimationHasFinished (0.001 seconds)
RCTPerformanceLoggerTests
    ✓ testLabelCountInSyncWithRCTPLTag (0.001 seconds)
RCTShadowViewTests
    ✓ testAncestorCheck (0.001 seconds)
    ✓ testApplyingLayoutRecursivelyToShadowView (0.002 seconds)
    ✓ testAssignsSuggestedHeightDimension (0.001 seconds)
    ✓ testAssignsSuggestedWidthDimension (0.001 seconds)
    ✓ testDoesNotAssignSuggestedDimensionsWhenStyledWithFlexAttribute (0.001 seconds)
    ✓ testDoesNotOverrideDimensionStyleWithSuggestedDimensions (0.001 seconds)
RCTUIManagerTests
    ✓ testManagingChildrenToAddRemoveAndMove (0.001 seconds)
    ✓ testManagingChildrenToAddViews (0.001 seconds)
    ✓ testManagingChildrenToRemoveViews (0.001 seconds)
RCTURLUtilsTests
    ✓ testAppendParam (0.001 seconds)
    ✓ testDuplicateParamTakesLatter (0.001 seconds)
    ✓ testGetEncodedParam (0.001 seconds)
    ✓ testGetQueryParam (0.001 seconds)
    ✓ testIsLocalAssetsURLParam (0.001 seconds)
    ✓ testNilURLAppendQueryParam (0.001 seconds)
    ✓ testNilURLGetQueryParam (0.001 seconds)
    ✓ testQueryParamNotFound (0.001 seconds)
    ✓ testRemoveParam (0.001 seconds)
    ✓ testReplaceEncodedParam (0.001 seconds)
    ✓ testReplaceParam (0.001 seconds)
RCTUnicodeDecodeTests
    ✓ testEmojis (0.001 seconds)
    ✓ testNiqqud (0.001 seconds)

         Executed 167 tests, with 0 failures (0 unexpected) in 0.530 (0.667) seconds
```
`Android`
```
PASS      8.4s  7 Passed   0 Skipped   0 Failed   com.facebook.react.animated.NativeAnimatedInterpolationTest
PASS     16.7s 23 Passed   0 Skipped   0 Failed   com.facebook.react.animated.NativeAnimatedNodeTraversalTest
PASS     13.5s  4 Passed   0 Skipped   0 Failed   com.facebook.react.bridge.BaseJavaModuleTest
PASS     341ms  4 Passed   0 Skipped   0 Failed   com.facebook.react.bridge.FallbackJSBundleLoaderTest
PASS    <100ms  1 Passed   0 Skipped   0 Failed   com.facebook.react.bridge.JavaOnlyArrayTest
PASS     13.0s 10 Passed   0 Skipped   0 Failed   com.facebook.react.devsupport.JSDebuggerWebSocketClientTest
PASS      6.3s  4 Passed   0 Skipped   0 Failed   com.facebook.react.devsupport.MultipartStreamReaderTest
PASS      6.1s  5 Passed   0 Skipped   0 Failed   com.facebook.react.devsupport.StackTraceHelperTest
PASS     13.9s  6 Passed   0 Skipped   0 Failed   com.facebook.react.modules.blob.BlobModuleTest
PASS      6.7s  5 Passed   0 Skipped   0 Failed   com.facebook.react.modules.camera.ImageStoreManagerTest
PASS      5.2s  1 Passed   0 Skipped   0 Failed   com.facebook.react.modules.clipboard.ClipboardModuleTest
PASS      3.8s  5 Passed   0 Skipped   0 Failed   com.facebook.react.modules.dialog.DialogModuleTest
PASS    <100ms 10 Passed   0 Skipped   0 Failed   com.facebook.react.modules.network.HeaderUtilTest
PASS      3.3s 14 Passed   0 Skipped   0 Failed   com.facebook.react.modules.network.NetworkingModuleTest
PASS      1.4s  9 Passed   0 Skipped   0 Failed   com.facebook.react.modules.network.ProgressiveStringDecoderTest
PASS      1.6s  4 Passed   0 Skipped   0 Failed   com.facebook.react.modules.network.ReactCookieJarContainerTest
PASS      2.2s  2 Passed   0 Skipped   0 Failed   com.facebook.react.modules.share.ShareModuleTest
PASS      5.1s  6 Passed   0 Skipped   0 Failed   com.facebook.react.modules.storage.AsyncStorageModuleTest
PASS      2.7s  9 Passed   0 Skipped   0 Failed   com.facebook.react.modules.timing.TimingModuleTest
PASS      9.2s  9 Passed   0 Skipped   0 Failed   com.facebook.react.packagerconnection.JSPackagerClientTest
PASS      7.3s  4 Passed   0 Skipped   0 Failed   com.facebook.react.uimanager.layoutanimation.InterpolatorTypeTest
PASS      8.9s  2 Passed   0 Skipped   0 Failed   com.facebook.react.uimanager.BaseViewManagerTest
PASS      6.7s  4 Passed   0 Skipped   0 Failed   com.facebook.react.uimanager.MatrixMathHelperTest
PASS      8.8s  3 Passed   0 Skipped   0 Failed   com.facebook.react.uimanager.SimpleViewPropertyTest
PASS    <100ms  1 Passed   0 Skipped   0 Failed   com.facebook.react.util.JSStackTraceTest
PASS      9.5s  1 Passed   0 Skipped   0 Failed   com.facebook.react.views.image.ImageResizeModeTest
PASS     15.7s  4 Passed   0 Skipped   0 Failed   com.facebook.react.views.image.ReactImagePropertyTest
PASS      9.2s  4 Passed   0 Skipped   0 Failed   com.facebook.react.CompositeReactPackageTest
PASS      9.2s  2 Passed   0 Skipped   0 Failed   com.facebook.react.RootViewTest
```

Differential Revision: D19576473

Pulled By: shergin

fbshipit-source-id: 35a6bce9f7dd3efec0cfcdbb00796852e1a79d6c
2020-01-26 19:10:01 -08:00
Josh Leibsly efc2344868 Rename isolation root to "default" in fbobjc
Summary:
The reason for this change is that it is the primary root that we want people to be using and the naming should reflect that.

#nocancel

build-break
overriding_review_checks_triggers_an_audit_and_retroactive_review

Changelog: [Internal]

Oncall Short Name: fbobjc_sheriff

Differential Revision: D19431128

fbshipit-source-id: c7208e20ed0f5f5eb6c2849428c09a6d4af9b6f3
2020-01-24 08:26:36 -08:00
Janic Duplessis d72e078df4 Add missing NativeEventListener methods to NativeDevSettings (#27838)
Summary:
Since migrating to Turbomodules (8fe04cf) the addMenuItem method crashes because the NativeEventListener methods are missing from the codegen flow type. Added the same methods based on what we do in AppState which is another native module that extends NativeEventListener.

## Changelog

[Internal] [Fixed] - Add missing NativeEventListener methods to NativeDevSettings
Pull Request resolved: https://github.com/facebook/react-native/pull/27838

Test Plan:
|Before|After|
|{F226978596}|{F226978628}

Differential Revision: D19518474

Pulled By: PeteTheHeat

fbshipit-source-id: acddba9f18dd558df1d6df78b539689fdfd0062f
2020-01-23 13:20:53 -08:00
Pieter De Baets 19362f6116 Fix validation of AnimatedEvent mapping
Summary:
Noticed the _validateMapping call right now is a no-op, as the traverse method is never invoked. We can only really do validation once we've received a sample of an event, and can then verify the values being extracted indeed correspond with a valid key.

Changelog: [General] [Fixed] - Fix validation of event mappings for AnimatedEvent

Reviewed By: cpojer

Differential Revision: D19498971

fbshipit-source-id: e978dda895498a7e567d5e18b3181b319d88d95c
2020-01-23 07:59:29 -08:00
Emily Janzer 4dd93582b6 Add a hand-written JS view config for AndroidTextInput
Summary:
Hand-writing a JS view config for AndroidTextInputNativeComponent.

This diff was generated by adding logging to `getNativeComponentAttributes`. Diff preview: https://our.intern.facebook.com/intern/diff/view-version/96875488/

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D19456328

fbshipit-source-id: b2d5abd2fde380be182b95881c335d24481343f1
2020-01-22 14:12:22 -08:00
Samuel Susla 6449cc4363 Implement setMostRecentEventCount and setTextAndSelection commands in TextInput
Summary:
Implements JS interface and commands in native, however it isn't connected anywhere.
Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D19471025

fbshipit-source-id: 7ec53c04b38cb27b84ef06dea7a0fdb9e1deee60
2020-01-22 05:12:11 -08:00
Kudo Chien a27e31c059 Upgrade Folly to v2020.01.13.00 (#27810)
Summary:
Upgrade Folly to v2020.01.13.00. Fixes https://github.com/facebook/react-native/issues/27640

## Changelog

[iOS] [Changed] - Upgrade Folly to v2020.01.13.00
Pull Request resolved: https://github.com/facebook/react-native/pull/27810

Test Plan: Test by building and running RNTester

Reviewed By: mdvacca

Differential Revision: D19483115

Pulled By: fkgozali

fbshipit-source-id: 4a85325a95b5f7857da75995d587218740d8b077
2020-01-21 12:44:00 -08:00
Samuel Susla 7a8e10dac8 Use commands to send focus and blur to TextInput
Summary:
Migrate to Native commands with Blur and Focus on TextInput.

Changelog: [Internal]

Reviewed By: TheSavior, shergin

Differential Revision: D19412085

fbshipit-source-id: 33b29b2699bc74d31ef1b4b0e585daffd88c4140
2020-01-20 03:08:23 -08:00
Samuel Susla f43c9316e1 Add blur and focus native commands to TextInput
Summary:
Add Native Commands handlers to TextInput.
It is intentionally done in a way so that it can be easily swapped for codegened implementation once we properly type TextInput.

We also add native commands to view managers for backwards compatibility.

Changelog: [Internal]

Reviewed By: TheSavior, shergin

Differential Revision: D19412026

fbshipit-source-id: 8dc64275cf1da599b1bd5992a41035d51dd4148f
2020-01-20 03:08:23 -08:00
Rajat Gupta 9457efa84c Always update background color and bar style on Android status bar
Summary: Changelog: [Fix] Fix status bar color not updating when navigating between two screens with the same status bar color.

Reviewed By: RSNara

Differential Revision: D19439424

fbshipit-source-id: 44388f1f94c87c12102471d72183bb6c152a46b6
2020-01-17 16:14:57 -08:00
Samuel Susla dd476d0506 Run rn-native-modules/specs/update_oss to stop tests from failing
Summary:
Changelog: [Internal]

Fix following test failure

```
Date: 2020-01-17 07:18:10.533721
Step JSON: {"name": "Test: Verify OSS NativeModules Specs for iOS are up-to-date.", "continue_after_user_failure": true, "timeout": 3600, "shell": "cd \"$(hg root)/xplat/js\" && NODE_ENV=test scripts/rn-native-modules/specs/update_oss ios", "env": {}}
Command: cd "$(hg root)/xplat/js" && NODE_ENV=test scripts/rn-native-modules/specs/update_oss ios
Exit code: 1
Stdout:
Building OSS NativeModule Specs - platform: ios...
Stderr:
Starting new Buck daemon...
Using additional configuration options from .buckconfig.local, /etc/buckconfig.d/sandcastle
PARSING BUCK FILES: FINISHED IN 5.9s
CREATING ACTION GRAPH: FINISHED IN 0.1s
DOWNLOADED 0 ARTIFACTS, 0.00 BYTES, 0.0% CACHE MISS
BUILDING: FINISHED IN 8.5s (100%) 1/1 JOBS, 1 UPDATED
Top slow rules
    //xplat/js:FBReactNativeSpec-flow-types-ios: 0.1s
BUILD SUCCEEDED
More details at https://our.intern.facebook.com/intern/buck/build/d68bbc08-49cf-4ef5-8eba-51d79bea09ba
Error: Spec files are not up-to-date, please re-run 'js1 build oss-native-modules-specs -p ios'!
    at main.then.updated (/data/sandcastle/boxes/trunk-hg-fbobjc-fbsource/xplat/js/scripts/rn-native-modules/specs/update-specs.js:96:15)
```

I ran `js1 build oss-native-modules-specs -p ios` to fix it.

Reviewed By: PeteTheHeat

Differential Revision: D19450371

fbshipit-source-id: 0957298ad70ad3e8feca96622cd29ed223438961
2020-01-17 11:21:56 -08:00
Nat Mote c40988cc22 Deploy Flow v0.116 to xplat
Summary: Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D19416307

fbshipit-source-id: 32767f24e5bfeb1912f7dd5527eb8c4db7a08a1a
2020-01-16 14:05:49 -08:00
Kevin Gozali 58a6a40eac Re-land [RN] iOS - deprecate iOS 9 support by removing runtime checks for 10.0+
Summary:
Re-landing the reverted change:

This removes all callsites that rely on runtime checks to detect the target deployment version. We no longer need to check for iOS 10+ in a few places. Note: for this to compile, the hosting app needs to target iOS 10.0+.

Changelog: [iOS] [Deprecated] - Deprecate iOS 9

Reviewed By: sammy-SC

Differential Revision: D19411136

fbshipit-source-id: ec0a957dc57819f0ee7d138c858209cabe3e5102
2020-01-15 09:23:30 -08:00
Jiawei Lv f11937ef65 Revert D19271321: iOS - deprecate iOS 9 support by removing runtime checks for 10.0+
Differential Revision:
D19271321

Original commit changeset: 424ad7e21612

fbshipit-source-id: 2bd9599e8fb31914dbcbc03f732379d6c8103028
2020-01-14 21:43:08 -08:00
Kevin Gozali d3e81d5832 iOS - deprecate iOS 9 support by removing runtime checks for 10.0+
Summary:
This removes all callsites that rely on runtime checks to detect the target deployment version. We no longer need to check for iOS 10+ in a few places. Note: for this to compile, the hosting app needs to target iOS 10.0+.

Changelog: [iOS] [Deprecated] - Deprecate iOS 9

Reviewed By: hramos

Differential Revision: D19271321

fbshipit-source-id: 424ad7e2161261d148cb436cc20b4c531a4ba5b7
2020-01-14 18:23:49 -08:00
Nate Stedman 644eb0a961 Revert D19400656: Revert D19377037: [fb_apple_library][codemod][12/12] Add extension API parameters to libraries
Differential Revision:
D19400656

Original commit changeset: 57deddfd6006

fbshipit-source-id: 5271e9faa002ff64508d8e52d0c60bf7a362ff02
2020-01-14 15:27:31 -08:00
Shubho Sadhu 89823c944b Revert D19377037: Add extension API parameters to libraries
Differential Revision:
D19377037

Original commit changeset: 3026a3400570

fbshipit-source-id: 57deddfd6006c6d171a005f4dd35e1d1df30de64
2020-01-14 14:45:39 -08:00
Ramanpreet Nara 7e3a43c23d Fix NativeJSCHeapCapture
Summary:
In D15393464, we introduced `NativeHeapCapture`, but it had a few problems:
1. It required `JSCHeapCapture` by doing `TurboModuleRegistry.get<Spec>('HeapCapture')`, when it should have done `TurboModuleRegistry.get<Spec>('JSCHeapCapture')`.
2. It had an additional method `captureHeap`, which didn't exist on the Android NativeModule.

This diff corrects those mistakes.

Changelog:
[Both][Fixed] - Fix JSCHeapCapture

Reviewed By: PeteTheHeat

Differential Revision: D19383511

fbshipit-source-id: 30e69afbcdba673f3f32c16bde4f0342568ab97d
2020-01-14 08:03:49 -08:00
Oleksandr Melnykov e848b0036d Use commands instead of setNativeProps for PickerAndroid
Summary:
Fabric doesn't support setNativeProps, so we are using view commands instead.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D18044169

fbshipit-source-id: d5f199b930244d02f174ea8a7ef732e9a8ef2476
2020-01-14 03:57:28 -08:00
Oleksandr Melnykov 1e6e37a3a8 Use commands instead of setNativeProps for AndroidSwipeRefreshLayout
Summary:
As a part of the migration from setNativeProps in Fabric and Paper, we are replacing it by view commands in the RefreshControl component on Android.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D18475450

fbshipit-source-id: ad89547fada3444f725fd9b00e8482cfc8f4d7fc
2020-01-14 03:53:57 -08:00
Oleksandr Melnykov 461d68e656 Use commands instead of setNativeProps for CheckBox
Summary:
As a part of the migration from setNativeProps in Fabric and Paper, we are replacing it by view commands in the Checkbox component on Android.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D18451749

fbshipit-source-id: 49d786ef3383df95b10260ba2b7f68489ad31789
2020-01-14 03:44:25 -08:00
Nate Stedman 8d57691a60 Add extension API parameters to libraries
Summary: Changelog: [Internal]

Differential Revision: D19377037

fbshipit-source-id: 3026a34005707fb371df60eaacd142988b012751
2020-01-13 23:26:15 -08:00
Christoph Nakazawa 35c6bb9ac0 Only set dimensions if the window attributes change
Differential Revision: D19386339

fbshipit-source-id: b7f14c540ceec40cae0c4eb9fc93f2020a6ee16f
2020-01-13 23:26:14 -08:00
Valentin Shergin 41557966b5 Fabric: <TextInput> component on iOS: RCTTextInputUtils
Summary:
RCTTextInputUtils contains a bunch of conventions and convenience functions that we use in TextInput.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: JoshuaGross

Differential Revision: D19226658

fbshipit-source-id: df72dcdc052b96b6daef2cc0839235761005d914
2020-01-13 23:22:10 -08:00
Peter Argany 442dd26873 Fix error in RCTImageLoader in bridgeless mode
Summary:
Bridgeless mode hasn't been able to load random images. I was able to repro this 100% with base64 images. Loading these images hits a particular flow in `RCTImageLoader` which relies on the bridge to access `RCTNetworking`. This diff uses the TM Lookup Delegate as a fallback.

Changelog: [iOS][Internal] Fix error in RCTImageLoader in bridgeless mode

Reviewed By: sammy-SC

Differential Revision: D19331467

fbshipit-source-id: 8239ee258425da4ed8cb9f6dcdcd7f37c162eb19
2020-01-13 22:54:16 -08:00
Peter Argany 12f78f145a Fix crash in RCTBlobManager in bridgeless mode
Summary:
When bridge is nil, RCTBlobManager crashes with `EXC_BAD_ACCESS`.

The fix: instead of using the bridge to find RCTNetworking, use TM lookup delegate.

Changelog: [iOS][Internal] Fix crash in RCTBlobManager in bridgeless mode

Reviewed By: mdvacca

Differential Revision: D19320136

fbshipit-source-id: 49aabb3ce53b2ec620fcc02be1c6c1b44066f440
2020-01-13 22:54:16 -08:00
Dan Abramov 159624d901 React Native sync for revisions 6cff70a...19f6fe1
Summary:
This sync includes the following changes:
- **[19f6fe170](https://github.com/facebook/react/commit/19f6fe170 )**: Revert "Revert "Dispatch commands to both UIManagers from both renderers (#17211)" (#17232)" (#17799) //<Eli White>//
- **[6250462be](https://github.com/facebook/react/commit/6250462be )**: Renamed "ReactDOM-fb" imports to "ReactDOM" in www shims (#17797) //<Brian Vaughn>//
- **[59f21f1b2](https://github.com/facebook/react/commit/59f21f1b2 )**: HostText needs to copy over from current if it is unchanged in persistent  mode (#17538) //<Sebastian Markbåge>//
- **[ccc6100d7](https://github.com/facebook/react/commit/ccc6100d7 )**: Fix comments typos (#17550) //<Nick S. Plekhanov>//
- **[1b9328cd9](https://github.com/facebook/react/commit/1b9328cd9 )**: Null stateNode after unmount (#17666) //<Brian Vaughn>//
- **[897976600](https://github.com/facebook/react/commit/897976600 )**: [ESLint] Allow partial matches for custom Effect Hooks (#17663) //<Dan Abramov>//
- **[72592310a](https://github.com/facebook/react/commit/72592310a )**: Create packages/dom-event-testing-library (#17660) //<Nicolas Gallagher>//
- **[a5e951d4c](https://github.com/facebook/react/commit/a5e951d4c )**: [react-interactions] Event testing library improvements (#17614) //<Nicolas Gallagher>//
- **[7dc974542](https://github.com/facebook/react/commit/7dc974542 )**: [Flight] Chunks API (#17398) //<Sebastian Markbåge>//
- **[9354dd275](https://github.com/facebook/react/commit/9354dd275 )**: Make HostComponent inexact (#17412) //<Eli White>//
- **[4c270375e](https://github.com/facebook/react/commit/4c270375e )**: Favor fallthrough switch instead of case statements for work tags (#17648) //<Sebastian Markbåge>//
- **[6fef7c47a](https://github.com/facebook/react/commit/6fef7c47a )**: Add a regression test for switching from Fragment to a component (#17647) //<Dan Abramov>//
- **[9fe103124](https://github.com/facebook/react/commit/9fe103124 )**: [react-interactions] Rename Flare APIs to deprecated and remove from RN (#17644) //<Dominic Gannaway>//
- **[4b0cdf29a](https://github.com/facebook/react/commit/4b0cdf29a )**: Build FB RN targets only in experimental mode (#17641) //<Dan Abramov>//
- **[7309c5f93](https://github.com/facebook/react/commit/7309c5f93 )**: Use zero-fill right shift instead of Math.floor (#17616) //<伊撒尔>//
- **[3c54df091](https://github.com/facebook/react/commit/3c54df091 )**: Fix missing stacks in WWW warnings (#17638) //<Dan Abramov>//
- **[b66e86d95](https://github.com/facebook/react/commit/b66e86d95 )**: react-refresh@0.7.1 //<Dan Abramov>//
- **[c2d1561c6](https://github.com/facebook/react/commit/c2d1561c6 )**: [Fast Refresh] Support injecting runtime after renderer executes (#17633) //<Dan Abramov>//
- **[f42431abe](https://github.com/facebook/react/commit/f42431abe )**: Revert "Remove renderPhaseUpdates Map (#17484)" (#17623) //<Dan Abramov>//
- **[0b5a26a48](https://github.com/facebook/react/commit/0b5a26a48 )**: Rename toWarnDev -> toErrorDev, toLowPriorityWarnDev -> toWarnDev (#17605) //<Dan Abramov>//
- **[0cf22a56a](https://github.com/facebook/react/commit/0cf22a56a )**: Use console directly instead of warning() modules (#17599) //<Dan Abramov>//
- **[b6c423daa](https://github.com/facebook/react/commit/b6c423daa )**: Use matching test command for equivalence tests (#17604) //<Dan Abramov>//
- **[8a347ed02](https://github.com/facebook/react/commit/8a347ed02 )**: Remove renderPhaseUpdates Map (#17484) //<Sebastian Markbåge>//
- **[be603f5a5](https://github.com/facebook/react/commit/be603f5a5 )**: [react-events] Remove lastNativeEvent in favor of SystemFlags (#17585) //<Dominic Gannaway>//
- **[b15bf3675](https://github.com/facebook/react/commit/b15bf3675 )**: Add component stacks to (almost) all warnings (#17586) //<Dan Abramov>//
- **[2afeebdcc](https://github.com/facebook/react/commit/2afeebdcc )**: [react-interactions] Remove responder root event types + revert commit phase change (#17577) //<Dominic Gannaway>//
- **[9ac42dd07](https://github.com/facebook/react/commit/9ac42dd07 )**: Remove the condition argument from warning() (#17568) //<Laura buns>//
- **[7bf40e1cf](https://github.com/facebook/react/commit/7bf40e1cf )**: Initialize update queue object on mount (#17560) //<Andrew Clark>//
- **[e039e690b](https://github.com/facebook/react/commit/e039e690b )**: Revert Update Queue Refactor //<Andrew Clark>//
- **[b617db3d9](https://github.com/facebook/react/commit/b617db3d9 )**: Refactor Update Queues to Fix Rebasing Bug //<Andrew Clark>//
- **[b43eec7ea](https://github.com/facebook/react/commit/b43eec7ea )**: Replace `wrap-warning-with-env-check` with an eslint plugin (#17540) //<Laura buns>//
- **[acfe4b21b](https://github.com/facebook/react/commit/acfe4b21b )**: [react-interactions] Upgrade passive event listeners to active listeners (#17513) //<Dominic Gannaway>//
- **[5064c7f6a](https://github.com/facebook/react/commit/5064c7f6a )**: Revert Rerender Error Check (#17519) //<Sebastian Markbåge>//
- **[6d105ad3f](https://github.com/facebook/react/commit/6d105ad3f )**: [react-interactions] Move Flare event registration to commit phase (#17518) //<Dominic Gannaway>//
- **[dc18b8b8d](https://github.com/facebook/react/commit/dc18b8b8d )**: Don't group Idle/Offscreen work with other work (#17456) //<Sebastian Markbåge>//
- **[f523b2e0d](https://github.com/facebook/react/commit/f523b2e0d )**: Use fewer global variables in Hooks (#17480) //<Sebastian Markbåge>//
- **[d75323f65](https://github.com/facebook/react/commit/d75323f65 )**: Remove case that only exists for createBatch (#17506) //<Sebastian Markbåge>//
- **[79572e34d](https://github.com/facebook/react/commit/79572e34d )**: Adjust SuspenseList CPU bound heuristic (#17455) //<Sebastian Markbåge>//
- **[969f4b5bb](https://github.com/facebook/react/commit/969f4b5bb )**: Change DevTools hook warning message (#17478) //<Dan Abramov>//
- **[6470e0f16](https://github.com/facebook/react/commit/6470e0f16 )**: [Fresh] Make all errors recoverable (#17438) //<Dan Abramov>//

Changelog:
[General][Changed] - React sync for revisions 6cff70a...19f6fe1

Reviewed By: TheSavior

Differential Revision: D19318286

fbshipit-source-id: acaa5224f7162a274c395a62e54da82199001005
2020-01-09 11:18:06 -08:00
Eli White 66601e755f Attempted fix for view parenting issue
Summary:
View should reset whether we are inside of a text or not. For example, inline images should only be rendered inside text, but if we have a view inside text, then it should render a regular image, not an inline image.

This logic *should* exist in native instead of in JS, but this is an easier change for now.

I'm sad to have to turn this back into a JS component instead of just being the string 'RCTView' as this will have performance implications on all surfaces, but this is how it always used to be so maybe it's fine.

This example previously crashed, and no longer does:
```
function PlaygroundContent(props: {}) {
  return (
    <View style={styles.container}>
      <Text>
        <View style={{width: 10, height: 10}}>
          <Image source={fbicon.filled('chevron-down', 10)} />
        </View>
      </Text>
    </View>
  );
}
```

Changelog:
[General][Fixed] Fixes bug where <Text><View><Image> would crash.

Reviewed By: JoshuaGross

Differential Revision: D17564510

fbshipit-source-id: 0ecf49b3d466e7adf57a46a7a097dd3798c721a4
2020-01-08 13:30:49 -08:00
Christoph Nakazawa 02633fe522 Remove old JSC workarounds in HMRClient
Reviewed By: fkgozali

Differential Revision: D19297717

fbshipit-source-id: e85abe1c0d1b96cf21ae3a223ee65d92e6f88824
2020-01-07 16:53:15 -08:00
Kevin Gozali 11ea095ee0 iOS: removed the image instrumentation gating
Summary:
We're keeping the perf logging flag, but the general instrumentation flag is no longer needed (the use case isn't significant to need separate flag).

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D19304789

fbshipit-source-id: 094f7079283e4f4bf3d546dfd0ae50eb641d562e
2020-01-07 16:41:10 -08:00
Peter Argany 80cfa9c8ee Handwritten view configs for Image
Summary:
Hand writing view configs for NativeImageViewComponent so that it'll work in bridgeless mode and won't fall back to the UIManager.

Changelog: [Internal]

Reviewed By: ejanzer

Differential Revision: D19217961

fbshipit-source-id: d5a123b35a75ba3e22c57b1dde18a47893681614
2020-01-07 14:46:11 -08:00
Jesse Katsumata e8f577e541 feat: add custom color for iOS13 segmented control (#27643)
Summary:
Addresses Issue from https://github.com/react-native-community/react-native-segmented-control/issues/16

SegmentedControlIOS changed how it looks in iOS13.

This PR allows allows more customization of SegmentedControl for iOS13.

## Changelog

[iOS] [Added] - add textColor and backgroundColor props for iOS >=13
Pull Request resolved: https://github.com/facebook/react-native/pull/27643

Test Plan:
| Before | After |
| --- | --- |
| <img src="https://user-images.githubusercontent.com/6936373/71608475-e68ff580-2bc4-11ea-9fe4-b85b99130356.png" width="320" /> | <img src="https://user-images.githubusercontent.com/6936373/71608757-dc6ef680-2bc6-11ea-85be-aa31f25ecf36.png" width="320" /> |

Differential Revision: D19296783

Pulled By: cpojer

fbshipit-source-id: 81a31b2d5ae3085a6fd1874e7d72e75be4c51318
2020-01-06 22:19:37 -08:00
Poyan Nabati 26e8870fbf Add AnimatedInterpolation as possible type for toValue (#27558)
Summary:
AnimatedInterpolation should be a valid type to pass to `toValue` according to the documentation.

https://facebook.github.io/react-native/docs/animations#tracking-dynamic-values

## Changelog

[General] [Fixed] - Add AnimationInterpolation as possible type for toValue
Pull Request resolved: https://github.com/facebook/react-native/pull/27558

Test Plan: `yarn flow` works without errors.

Differential Revision: D19296804

Pulled By: cpojer

fbshipit-source-id: 7f09c762308c40f1eede5834fadf1837114aa397
2020-01-06 21:29:47 -08:00
Panagiotis Vekris 15ce226f5f v0.115 in xplat/js
Summary:
https://our.intern.facebook.com/intern/wiki/Flow/Flow_Release_Process/Updating_Internal_Repositories/#update-xplat-js

reverted manually:
```
RKJSModules/Apps/Jobs/top_level_components/JobsCandidateDetailView.js
RKJSModules/Apps/MobileHome/ui/sevs/v2/MobileHomeSevsDetailsEscalationLogRow.js
RKJSModules/Apps/MobileHome/ui/sevs/v2/MobileHomeSevsDetailsHeaderMetadata.js
RKJSModules/Apps/MobileHome/ui/user/MobileHomeUserDetails.js
RKJSModules/Apps/Profile/ProfileEdit/apps/ProfileEditCollegeApp.js
RKJSModules/Apps/Profile/ProfileEdit/apps/ProfileEditWorkApp.js
metro/packages/metro/src/cli.js
RKJSModules/Apps/AdsLWI/Surfaces/AdsLWICallToActionEditorSurface.js
react-native-github/jest/preprocessor.js
```

Changelog: [Internal]

allow-large-files

Reviewed By: jbrown215

Differential Revision: D19292958

fbshipit-source-id: 4aa969bf2d0f2f5857e68a7e31ff4dcaf29e67cd
2020-01-06 18:06:26 -08:00
Spencer Ahrens 4aac019176 add DEBUG_NETWORK_SEND_DELAY for simulating slow network
Summary:
It can be a pain to debug slow network issues, especially with the iOS simulator which doesn't have a network link conditioner. This makes it really easy and predictable by simply adding a `setTimeout` around calling `sendRequest`.

Changelog:
[General] [Added] - DEBUG_NETWORK_SEND_DELAY can be used to simulate slow network.

Reviewed By: PeteTheHeat

Differential Revision: D19236911

fbshipit-source-id: 14762c7e0c6408a8364aa569c482729a7a1fe740
2020-01-02 15:34:07 -08:00
Kevin Gozali 674b591809 iOS: Deprecate iOS 9 / tvOS 9 SDK support
Summary:
It is time to target SDK version 10.0+.

Changelog: [iOS] [Deprecated] - Deprecating support for iOS/tvOS SDK 9.x, 10.0+ is now required

Reviewed By: mdvacca

Differential Revision: D19265731

fbshipit-source-id: 93b6f9e8f61c5b36ff69e80d3f18256aa96cc2c0
2020-01-02 12:52:12 -08:00
Jordan Brown 4e71a30969 Fix return type of StyleSheet.create to be the identity function
Summary:
Changes the return type of StyleSheet.create to `$ReadOnly<S>`. At runtime, it just freezes the fields in dev mode and is the identity function otherwise. This cause 423 errors due to the wrong props being passed to different styles: P124372727

I went over errors at random with Eli to get confidence in the change.

Changelog:
[General][Fixed] Fix return type of StyleSheet.create

Reviewed By: zackargyle, TheSavior

Differential Revision: D19218817

fbshipit-source-id: b7aa10700f8333372c9f0bd61bfbef371caadf97
2020-01-02 10:01:15 -08:00
Christoph Nakazawa 022f9cc573 Force reload at split points when Metro restarts
Summary:
In https://fb.workplace.com/groups/rn.support/permalink/3132785890103338/?comment_id=3132873900094537 we identified that when Metro restarts but the app keeps the main bundle alive, the next request for a split bundle will always produce an invalid bundle. This is because we rely on module ids being stable while Metro is running and when Metro is restarted, those module ids will likely be assigned to different modules.

The fix applied here simply forces a full reload when downloading (registering) a new split bundle if the connection to Metro disappeared.

Another way to mitigate this is to use stable module ids. That's a more involved change in Metro that I'm not planning on making right now.

Changelog: [Internal]

Reviewed By: rickhanlonii

Differential Revision: D19235555

fbshipit-source-id: b8ff10590655952a2af1379bbf4e930f9eb95c1b
2019-12-26 22:31:40 -08:00
David Vacca cf10cf56ea Remove method findShadowNodeByTag_DEPRECATED from UIManagerBinding class
Summary:
This diff removes the findShadowNodeByTag_DEPRECATED method from class UIManagerBinding. This method was created on D17175953 to implement findNodeHandle in Fabric. Recently we decided that we don't need to expose findNodeHandle anymore. This diff cleans up thi code.

Changelog: [internal]

Reviewed By: JoshuaGross

Differential Revision: D19216996

fbshipit-source-id: 07c16aeed28851afc09b0f5d6be338bb4440f813
2019-12-23 17:09:44 -08:00
Samuel Susla 9c27ccd7d0 Use commands from JS in RefreshControl instead of setNativeProps
Summary: Changelog: [Internal] RefreshControl uses commands instead of setNativeProps

Reviewed By: TheSavior

Differential Revision: D18475794

fbshipit-source-id: fbfe3fcfa465c821d673bf9a9666c989ba4f9545
2019-12-23 12:02:20 -08:00
Emily Janzer 282b8b04e1 Return an empty object for RCTVirtualText from DummyUIManager
Summary:
We currently use `UIManager.getViewManagerConfig()` in a few places to check if a view manager exists at runtime; right now these checks fail for Venice because our DummyUIManager returns null. We don't yet have a replacement for this API for Fabric (see T59411524) so for now let's just hard code the view managers that we know exist to return something truthy here. This is hacky, but it works ok for now.

Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D19185957

fbshipit-source-id: e3135b45db4c9ff27fd95362deaa3c1b4340bf48
2019-12-20 16:37:52 -08:00
Jakub e2ec34deea Fix typo (#27579)
Summary:
Fixed typo (paramenter -> parameter) in `Libraries/Utilities/HMRClient.js`

## Changelog

[Internal] [Fixed] - Fixed typos in error messages
Pull Request resolved: https://github.com/facebook/react-native/pull/27579

Test Plan: N/A

Differential Revision: D19200542

Pulled By: hramos

fbshipit-source-id: 3e4e93f46a682f4606bf2f088d78b0d5edb55661
2019-12-20 13:25:16 -08:00
Kevin Gozali 5e9f4e67d3 iOS: guard image picker logic to check for the right source type
Summary:
The logic in the method is only relevant if the sourceType is `UIImagePickerControllerSourceTypeCamera`. So we guard it here, to prevent NSInvalidArgumentException.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D19184818

fbshipit-source-id: 5c99dabfaed23629e22fdc888263bd09e8768c88
2019-12-20 01:41:02 -08:00
Héctor Ramos be355a24b7 Re-sync with internal repository 2019-12-19 13:42:21 -08:00
Spencer Ahrens 3ed67ab26f test tweaks
Summary:
Addressed some post-commit comments from D18966721

Changelog: [Internal]

Reviewed By: TheSavior

Differential Revision: D19158712

fbshipit-source-id: 55e005a34fc6a3667077d58cee48822ebcf76b75
2019-12-19 03:00:25 -08:00
Rick Hanlon a62062f3c0 LogBox fixes for OSS
Summary:
This diff fixes two issues with LogBox in OSS.

Changelog: [Internal]

Reviewed By: mmmulani

Differential Revision: D19165696

fbshipit-source-id: 4dd9c480ea3d2b205f8e65cb32203949b1e32e8a
2019-12-18 19:28:56 -08:00
Ramanpreet Nara 048f88a33a Fix NativePlatformConstants
Summary:
When in debug mode, PlatformConstants doesn't have a `ServerHost` constant. This wasn't captured by `NativePlatformConstants`.

Changelog:
[Android][Fixed] - Make sure ServerHost is optional in NativePlatformConstants.js

Reviewed By: rickhanlonii

Differential Revision: D19091270

fbshipit-source-id: 4b3ac73a4ab6111b3e433ecca01cc769e8cdec6b
2019-12-18 08:22:09 -08:00
Eli White fa78a96739 Convert Inspector to call ref.measure
Summary:
`node` is passed to us from react devtools. We can call .measure on that directly instead of using findNodeHandle and UIManager. This makes this call compatible with Fabric.

Changelog:
[Internal]

Reviewed By: mdvacca

Differential Revision: D19152052

fbshipit-source-id: 05ab6d55f3a79221d99289f0341eb25352b96899
2019-12-17 20:09:25 -08:00
Emily Janzer 37ff892e24 Backwards-compatible implementation for registerCallableModule
Summary:
We currently use `BatchedBridge.registerCallableModule` to call JS from platform code in a bunch of places (e.g. `RCTDeviceEventEmitter.emit()`), including some pretty essential ones - for example, Networking relies on `RCTDeviceEventEmitter` to emit events to JS for network requests and errors. In order to make the migration to bridgeless mode as easy as possible, it'd be best if we didn't have to update all the callsites in JS and platform code, at least for core JS modules like `RCTDeviceEventEmitter`. So we'd like to implement this callable module pattern for bridgeless mode as well.

In this diff, I'm installing a global variable, `RN$registerCallableModule`, which will store the JS module name and factory function in C++. This can then be called from platform code (Java/Obj-C) to invoke a JS function on a module using the existing APIs (`context.getJSModule()` on Android, `enqueueJSCall()` or similar on iOS).

Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D18798852

fbshipit-source-id: fbe9eaecaf6f5cab5173beec999d3a933b13375d
2019-12-17 18:38:57 -08:00
Eli White 85529fe356 Refactor Inspector to take a react instance
Summary:
We will need to operate on instances instead of react tags. This diff passes through the instance instead of the tag.

This does not make the inspector work in Fabric, but it is a necessary refactor in that direction.

Changelog:
[Internal]

Reviewed By: mdvacca

Differential Revision: D19149647

fbshipit-source-id: 53fa35a2886bf36a146d473a496409dffc114a80
2019-12-17 18:35:00 -08:00
Freeman Latif f464dad5d4 Fix stylesheet validation of functions with additional prototype methods (#27264)
Summary:
Some babel plugins add additional methods to `Function.prototype` (see https://github.com/MatAtBread/fast-async):

```js
Function.prototype.$asyncbind = function $asyncbind(self, catcher) {
...
```

Although undocumented, React Native allows functions to be passed to `StyleSheet.create()` for dynamic styling:

```js
const styles = StyleSheet.create({
  animalItem: height => ({ height })
});
```

If there are additional custom methods on `Function.prototype`, React Native's `StyleSheetValidation.validateStyle` will loop through these properties and raise an error because those properties are not valid style keys, because it loops through _all_ properties, including inherited ones.

![Simulator Screen Shot - iPhone 11 Pro Max - 2019-11-19 at 12 04 49](https://user-images.githubusercontent.com/4031216/69145112-ce589100-0ac4-11ea-80d7-e93d59b935a8.png)

This PR modifies `StyleSheetValidation.validateStyle` to only loop through the style's own properties, instead of including inherited ones.

## Changelog

[General] [Fixed] - Fix stylesheet validation for functions with custom prototype methods.
Pull Request resolved: https://github.com/facebook/react-native/pull/27264

Test Plan: - Tested that non-function style properties are still validated

Differential Revision: D18694895

Pulled By: hramos

fbshipit-source-id: b36f4a62a435e7b6a689398de3bcc06d6bb14293
2019-12-17 18:25:32 -08:00
Andy Matuschak f21fa4ecb7 Enabling RCTWebSocket on UIKitForMac (macOS Catalyst) (#27469)
Summary:
In https://github.com/facebook/react-native/issues/25427, radex added initial support for running React Native projects on macOS via Catalyst. However, `RCTWebSocket` was disabled for that target because of some compilation issues. This meant that running projects via a connection to the packager wasn't possible: no live reload, and projects must be run in "Release" mode. It also meant making manual changes to Xcode projects deploying to macOS and scattering a number of conditional checks throughout the codebase.

In this change, I've implemented support for `RCTWebSocket` on the macOS target and re-enabled the affected features. Live reload and the inspector now work for macOS targets. Manual modifications of Xcode build settings are no longer necessary for react-native projects running on macOS.

![Screen Shot 2019-12-10 at 8 36 38 AM](https://user-images.githubusercontent.com/2771/70549905-ce7b0800-1b29-11ea-85c6-07bf09811ae2.png)

### Limitations

There's no binding which displays the developer menu (since there's no shake event on macOS). We'll probably want to add one, perhaps to the menu bar.

I've chosen not to commit the modifications to RNTester which enable macOS support, since that would imply more "official" support for this target than I suspect you all would like to convey. I'm happy to add those chunks if it would be helpful.

## Changelog

[iOS] [Added] - Added web socket support for macOS (Catalyst), enabling debug builds and live reload
Pull Request resolved: https://github.com/facebook/react-native/pull/27469

Test Plan:
* Open RNTester/RNTester.xcodeproj with Xcode 11.2.1, run it like a normal iOS app -- make sure it compiles and runs correctly (no regression)
* Select "My Mac" as device target, and run. You may need to configure a valid development team to make signing work.
* RNTester should run fine with no additional configuration. Modify a file in RNTester, note that live reload is now working.
* Test the developer inspector. To display the developer menu, you'll need to manually show it; here's an example diff which does that:
```
 diff --git a/RNTester/js/RNTesterApp.ios.js b/RNTester/js/RNTesterApp.ios.js
index 8245a68d12..a447ad3b1b 100644
 --- a/RNTester/js/RNTesterApp.ios.js
+++ b/RNTester/js/RNTesterApp.ios.js
@@ -19,6 +19,8 @@ const React = require('react');
 const SnapshotViewIOS = require('./examples/Snapshot/SnapshotViewIOS.ios');
 const URIActionMap = require('./utils/URIActionMap');

+import NativeDevMenu from '../../Libraries/NativeModules/specs/NativeDevMenu';
+
 const {
   AppRegistry,
   AsyncStorage,
@@ -143,6 +145,7 @@ class RNTesterApp extends React.Component<Props, RNTesterNavigationState> {

   UNSAFE_componentWillMount() {
     BackHandler.addEventListener('hardwareBackPress', this._handleBack);
+    NativeDevMenu.show();
   }

   componentDidMount() {
```

Reviewed By: sammy-SC

Differential Revision: D18945861

Pulled By: hramos

fbshipit-source-id: edcf02c5803742c89a845a3e5d72bc7dacae839f
2019-12-17 16:52:29 -08:00
Kevin Gonzales 0a525b6d9d Support for accessibility Label prop to the Picker component (#27342)
Summary:
With a Picker we would like to allow accessibility labels to be passed as a prop for situations where we want go give more detail. For example if we have a number picker that will be used for a timer instead of just saying 3, we might want to say 3 hours.

## Changelog
[General] [Added] - Picker test with an accessibility label prop
[General] [Added] - Support for accessibility Label prop to the Picker component
Pull Request resolved: https://github.com/facebook/react-native/pull/27342

Test Plan: Test plan is testing in RNTester making sure the examples work

Differential Revision: D18770184

Pulled By: hramos

fbshipit-source-id: e6f8ab4a9c50f3fb46342198441ecc71394913d3
2019-12-17 16:48:17 -08:00
Kevin Gozali eb95b2f855 iOS Fabric: added support for image instrumentation [2]
Summary:
Passing thru image instrumentation activities to the image loader class, which now supports Fabric instrumentation.

Changelog: [Internal]

Reviewed By: mdvacca, voznesenskym

Differential Revision: D19047898

fbshipit-source-id: d12cb5a06a83e85347629a25e593d30cb9020fe6
2019-12-16 22:50:45 -08:00
Kevin Gozali 55142efd3a iOS Fabric: added support for image instrumentation [1]
Summary:
Added basic hook to enable image instrumentation. The hook passes information to the existing image loader, where instrumentation is done, specific for each app, if any.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D19047899

fbshipit-source-id: 6c013806cce98bcf1ea240d696a7ede9697e5cd9
2019-12-16 22:50:44 -08:00
Kevin Gozali 743074d09c iOS image: introduced RCTImageURLLoaderRequest for instrumentation/tracking purpose
Summary:
The `RCTImageURLLoaderWithAttribution` protocol historically only returns a cancellation block to cancel the url request. But for more complex instrumentation, we may need to associate a requestId for the specific URL request. To do this, the protocol now returns an object that has both the unique ID and the cancellation block, so that instrumentation logic can refer to the ID in the future.

Note that the `RCTImageURLLoader` protocol is unchanged, because the request ID is only relevant for instrumentation purpose.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D19047900

fbshipit-source-id: cd029f2470c32fc7bffd674b09a5353fe1dbc80b
2019-12-16 22:50:44 -08:00
Peter Argany c7f7b4c87a Move RCTImageLoader asserts to protect bridge usage
Summary:
`RCTImageLoader ` needs loaders & decoders. These can be passed in through init, or looked up at runtime using the bridge. In bridgeless mode, we need to pass them in through init.

This diff just moves the assert to actually protect `_bridge` usage, since there exist other codepaths which don't use the bridge.

Changelog: [iOS][Internal] Move RCTImageLoader asserts to protect bridge usage

Reviewed By: RSNara

Differential Revision: D18990760

fbshipit-source-id: 285008e7b3f473c45381ab472c3d86e5d8e218ae
2019-12-16 16:41:20 -08:00
Tim Yung 9b81232ed2 Pressability: Explicitly Commit Configurations
Summary:
Refactors `Pressability` so that updates to the configuration are now explicitly committed using `configure()`.

Previously, the configuration was updated implicitly because `Pressability` accepted a series of functions whose closures capture values (e.g. `this.props`). Although these changes typically happen when component instances are "atomically" updated by React, it is not a guarantee. For example, arbitrary instance variables could be used to configure `Pressability`, and they could be muted at any time.

This change makes updates to the configuration of `Pressability` more predictable.

Changelog:
[Internal]

Reviewed By: TheSavior

Differential Revision: D18742620

fbshipit-source-id: d2e96dd1e3643289daab2177199a29f80d17b0bc
2019-12-15 22:07:47 -08:00
Valentin Shergin e020576b34 TextInput on iOS: Fixing `selectAll` feature for multiline text input
Summary:
`selectAll:` does not work for UITextView when it's being called inside UITextView's delegate methods.

This is a bug in UIKit and this quite ugly workaround is only a known solution for it.

Changelog: [Bug][iOS] Fixed bug in implementation of <TextInput>'s selectOnFocus prop

Reviewed By: sammy-SC

Differential Revision: D18966755

fbshipit-source-id: 2ba15fa94570d463a2ea3490331fb879611dc6b8
2019-12-15 18:51:22 -08:00
Spencer Ahrens 8ddf231306 Fix sporadic issue with onEndReached called on load when not needed
Summary:
Fixes https://github.com/facebook/react-native/issues/16067

The issue is due to a race between `onLayout` and `onContentSizeChange`, which in general should be fine because there is no expectation of ordering between the two, and only causes issues with certain configurations.

The bug can be triggered if `initialNumToRender` is smaller than needed to fill past the `onEndReachedThreshold` (say the default, 10, is only 580px tall, but it takes 15 to reach the threshold). This will cause an incrementally render of more items to try and fill the viewport. The problem is that if the `onLayout` comes back before the first `onContentSizeChange`, it will first do the state increment to render 20 items and then the stale `onContentSizeChange` callback from 10 items will fire and we'll think that the content size for 20 items is 580px when in fact it's 1160px (which is past the threshold). If those 20 items are also all of our available data, then we'll call `onEndReached` because we think we've rendered everything and are still within the `onEndReachedThreshold`.

The fundamental problem here is the system getting confused when a stale async `onContentSizeChange` comes in after increasing `state.last`. I wish there was a concrete timeframe, but Fabric will give us more flexibility to do things synchronously so hopefully we can avoid class of issues once that roles out.

The fix here simply adds a check to make sure `contentLength` has been set before adjusting the render window so it's not possible to increase the window size before the initial `onContentSizeChange` callback fires.

For completeness, there are a few user-code workarounds to avoid this issue entirely:

1) Provide the `getItemLayout` prop so the list doesn't have to rely on async layout data (you should do this whenever possible anyway for better perf). e.g. for the original snack example, you can just add `getItemLayout={(d, index) => ({length: 58, offset: 58 * index, index})}` since all the rows are height 58 and the issue will no longer repro. Note this is fragile and must be kept in sync with UI changes, a11y font scaling, etc - a more robust approach could be to render a single representative row offscreen and measure it with `onLayout` then use that value.
2) If `getItemLayout` is not feasible to compute for your UI, increase `initialNumToRender` to cover the `onEndReachedThreshold`.
3) And/or add your own logic to protect against extra calls to `onEndReached` as others have suggested.

Changelog:
[General][Fixed] - Fix sporadic issue with onEndReached called on load when not needed

# Test Plan
Adds a new jest test that fails without this fix and succeeds with it.

Reviewed By: TheSavior

Differential Revision: D18966721

fbshipit-source-id: de05d9f072e24a2faf351e7f5d60578a31def996
2019-12-13 16:09:00 -08:00
Jimmy Zhang aff6bad27c TextInput: Refactoring of RCTBackedTextInputViewProtocol (merging some props into defaultTextAttributes)
Summary:
Remove textColor font and textAlignment in RCTBackedTextInputViewProtocol since they're all wired up in defaultTextAttributes already

Changelog: [iOS] [Removed] Remove three properties:  "textColor" "font" "textAlignment" from RCTBackedTextInputViewProtocol, unifying the usage into "defaultTextAttributes".

Reviewed By: PeteTheHeat

Differential Revision: D18954292

fbshipit-source-id: 17fd38a824d035843ae59b1b875dd9c48b3fcc9b
2019-12-13 09:03:04 -08:00
Rick Hanlon 586d55d54f LogBox - lazily initialize on iOS, use sync APIs
Summary:
Update LogBox on iOS to lazily initialize, using a synchronous RCTSurface, behind RCTSharedApplication checks.

This results in faster of LogBox, without keeping around a long lived window in the background, and only used when LogBox is used.

On Android, we still start the react app in the background but we create a dialog when it's shown and then destroy it when it's hidden. Once we have the sync APIs on android we can update it to use the same strategy.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D18925538

fbshipit-source-id: 1a72c39aa0fc26c8ba657d36c7fa7bc0ae777eb9
2019-12-13 03:09:00 -08:00
Eli White 49e1071e4c Text: HostComponent instead of NativeComponent
Summary:
We can use the HostComponent type now instead of NativeComponent

Changelog:
[Internal]

Reviewed By: zackargyle, rickhanlonii

Differential Revision: D18871289

fbshipit-source-id: 3c70369c5848dedfc22ca6f6ccbb69d6d60a1330
2019-12-12 14:23:57 -08:00
Valentin Shergin ae113aa697 Refinements in RCTBackedTextInputViewProtocol protocol
Summary:
RCTBackedTextInputViewProtocol is a protocol that describes which capabilities must be exposed for some TextInput-like UIView to be compatible with the rest of TextInput infra. We use that in both implementations. In Classic React Native we use Objective-C runtime mechanisms to call many of those methods (via ViewManager's directives); that masked the problem that the protocol was incomplete.

In Fabric, we call all methods normally, so we need to declare all of them here.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D18950432

fbshipit-source-id: 3cd5cb57a033f7c43fd5f2c10f9706408e8e6d0c
2019-12-12 12:53:11 -08:00
Valentin Shergin 827b1fe7a4 TextInput: Correct implementation of RCTUITextField::scrollEnabled (which is still noop)
Summary:
Both RCTUITextField and RCTUITextView must maintain the same public interface that describes all possible features that TextInput needs. That features are declared via `RCTBackedTextInputViewProtocol`.
`scrollEnabled` is a part of this protocol. The idea behind this prop was borrowed from `UIScrollView` class (which `UITextView` extends) and implemented for `RCTUITextField` (yeah, implemented as no-op).
In this diff we change the implementation of this prop to be more consistent with original implementation in UIScrollView:
* Now the name of the getter is now `isScrollEnabled`;
* The object now retains the actual value of the prop (even if it ignores that).

We need all those features for Fabric-compatible implementation.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D18950426

fbshipit-source-id: 50c399d0fbba1be31750dbe4f235a075f86e8c01
2019-12-12 12:53:11 -08:00
Valentin Shergin 6a4d77aeb8 Fabric: Exposing `multiline` as a prop in ViewManager's generated ViewConfig
Summary:
We need to expose the `multiline` prop in View Manager class to enable Fabric component to use it.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D18950429

fbshipit-source-id: 69b225b24b4512a1ea21381daacbf868a23ccf6d
2019-12-12 12:53:10 -08:00