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

5975 Коммитов

Автор SHA1 Сообщение Дата
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
Valentin Shergin 0fa2ce91fb Fabric: Fixed #include statements in RCTUITextView.h and RCTUITextField.h
Summary:
The general rule that we follow in RN is that the *exported* .h files must have only `<>` includes. That allows to use them outside of the library where they are defined. Those files are already exported technically, but without this change cannot be used as exported.
New Fabric text input implementation uses them, so we need to change those includes to have `<>` style.

Changelog: [Internal] Specific internal change.

Reviewed By: sammy-SC

Differential Revision: D18950427

fbshipit-source-id: 96cbe4cac9e28761c123bde8ac70464a0078ee6c
2019-12-12 12:53:10 -08:00
Rick Hanlon e295f4a394 Add WarningFilter handling for YellowBox
Summary:
This diff backports warning filter handling to yellow box. I also backported the skipped warning handling so that ignored patterns do not log to the console, same as LogBox.

Changelog: [Internal]

Reviewed By: gaearon

Differential Revision: D18573288

fbshipit-source-id: 5bf8e86f754adc808313d7ed02f98daaf65de98c
2019-12-11 16:14:17 -08:00
Ramanpreet Nara a8fbc5b893 Fix BlobModule getConstants()
Summary:
It's possible for us to return no constants from the BlobModule. Therefore, I'm correcting the flow-type.

Changelog:
[Internal]

Reviewed By: fkgozali

Differential Revision: D18932328

fbshipit-source-id: 2b415d12effd16eda313d5591825c711a20f9ae3
2019-12-11 11:31:51 -08:00
Rick Hanlon 3bf2917592 Hotfix - register null logbox outside of dev
Summary:
Outside of __DEV__ the app may still try to use LogBox. We're going to fix that but until we do, if it tries to use LogBox outside of dev render null.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D18932666

fbshipit-source-id: ef0f2542a295dc9332cae8b77faed78f8be350fe
2019-12-11 08:38:29 -08:00
Rick Hanlon c0eddad17b Disable LogBox if native module is not available
Summary: Changelog: [Internal]

Reviewed By: mmmulani

Differential Revision: D18920345

fbshipit-source-id: e5213dc9c3a1aa775138e71a8040a3472e9bbd67
2019-12-10 16:23:33 -08:00
Ramanpreet Nara b42371da5a Fix NativeJSDevSupport.onSuccess
Summary:
`JSDevSupport.onSuccess` is called in `JSDevSupportModule.getJSHierarchy`:

```
const JSDevSupportModule = {
  getJSHierarchy: function(tag: number) {
    try {
      const {
        computeComponentStackForErrorReporting,
      } = ReactNative.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
      const componentStack = computeComponentStackForErrorReporting(tag);
      if (!componentStack) {
        JSDevSupport.onFailure(
          JSDevSupport.ERROR_CODE_VIEW_NOT_FOUND,
          "Component stack doesn't exist for tag " + tag,
        );
      } else {
        JSDevSupport.onSuccess(componentStack);
      }
    } catch (e) {
      JSDevSupport.onFailure(JSDevSupport.ERROR_CODE_EXCEPTION, e.message);
    }
  },
};
```

If you look at the implementation of `computeComponentStackForErrorReporting`, it returns a `string`. The Java NativeModule also accepts a `String` for the argument to `JSDevSupport.onSuccess`. So, I've changed the `NativeJSDevSupport.onSuccess` method signature to match the native implementation (i.e: accept a string).

Changelog:
[General] [Fixed] - Correct argument types of NativeJSDevSupport.onSuccess

Reviewed By: fkgozali

Differential Revision: D18908306

fbshipit-source-id: 1c9a5c6fe5b3a81b25baed520e586ebf7e2514f8
2019-12-10 12:35:17 -08:00
Rick Hanlon 3714bfed2c Fix logs stuck in pending symbolocated state
Summary:
This diff fixes an issue where symbolicated logs were getting stuck in a "pending" state if the timeout occurred before symbolication finished.

Changelog: [Internal]

Reviewed By: sahrens

Differential Revision: D18894154

fbshipit-source-id: ed225962468f67aef40e430aa798f8d426d31027
2019-12-10 10:09:41 -08:00
Rick Hanlon bbfd64e3e9 RN DevX] LogBox - Handle tapping component stacks if possible
Summary:
This diff adds handling for tapping to open components in component stacks, whenever they're available.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D18882338

fbshipit-source-id: 574bff1c41c952c33e647cb142d278ace60b4631
2019-12-10 10:09:41 -08:00
Rick Hanlon dd8e5f468a Add unstable_enableLogBox
Summary:
This diff adds a new `unstable_enableLogBox` function to opt-into the new LogBox experience. If LogBox is not enabled early enough, we show an error with instructions.

With this, LogBox can be enabled with:

```
require('react-native').unstable_enableLogBox();
```

Changelog: [General] [Adds] unstable_enableLogBox

Reviewed By: zackargyle, rubennorte

Differential Revision: D18808940

fbshipit-source-id: 4b0234ddc4d1646515bf63110d5b02133780512e
2019-12-10 02:31:38 -08:00
Rick Hanlon 587979552d LogBox - Update to use it's own root for the inspector
Summary:
Apologies for the large diff, it was difficult to break down.

This diff is a major refactor of LogBox that:
- Separates LogBoxNotification and LogBoxInspector
- Moves them each to their own container
- Updates AppContainer to only render the notification
- Updates the native logbox root to render the inspector
- Adds withSubscription HOC to manage subscribing to LogBoxData
- Simplifies LogBox to export an object instead of a component

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D18750011

fbshipit-source-id: 639885d29e55e125892d1c2b6bbf2826f27d78db
2019-12-10 02:31:38 -08:00
Rick Hanlon 6b22a4e802 Add NativeLogBox module on iOS
Summary:
This diff adds a NativeLogBox module implementation on iOS to manage rendering LogBox the way we render RedBox, except rendering a React Native component instead of a native view.

The strategy here is:
- initialize: will create a hidden window (the way redbox does) and render the LogBox to it
- show: will show the window
- hide: will hide the window

Most of this is copied from the way RedBox works, the difference here is that we eagerly initialize the window with the `initialize` function so that it's warm by the time LogBox needs to render.

Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D18750008

fbshipit-source-id: 013e55ded55c8572bb08e0219ff4cd0060ebe0da
2019-12-10 02:31:37 -08:00
Rick Hanlon 9b1845c3a0 Register LogBox by default in dev
Summary:
This diff stubs out registering LogBox as a renderable component. In later diffs, we'll render this component on the native side.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D18750005

fbshipit-source-id: 4db082ca2104731641d2d10de1ba83a318ab44fb
2019-12-10 02:31:37 -08:00
Eli White 5215703543 Migrate ActivityIndicator to HostComponent
Summary:
NativeComponent as a type isn't needed now that we have HostComponent

Changelog:
[Internal]

Reviewed By: zackargyle, rickhanlonii

Differential Revision: D18873494

fbshipit-source-id: 5ba3fa25537f8249c80c2303dcdb380e3b6b0ac5
2019-12-09 11:55:40 -08:00
Kevin Gozali 65a7ec4473 iOS: added helper functions to gate image instrumentations
Summary:
Introduced 2 helper functions to toggle image instrumentation/logging (not in this diff) so that gating check is more efficient and easy to access across RN iOS core.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D18597208

fbshipit-source-id: 0b22031802ab020b16d6fb63e52461cf80a37ab5
2019-12-09 10:59:18 -08:00
Eli White 0ef0d3167e Remove IncrementalPresenter
Summary:
This component no longer has any internal callsites and was never exposed in the public API!

Changelog:
[General][Removed] Removing experimental IncrementalPresenter component

Reviewed By: rickhanlonii

Differential Revision: D18828704

fbshipit-source-id: 931254c4328b93b946a7995e7d9d44cb5aeb6a7b
2019-12-07 10:41:54 -08:00
Riley Dulin 16e8a35d42 Remove groupCollapsed from list of unsupported polyfills
Summary:
Changelog: [Internal] Remove groupCollapsed from list of unsupported polyfills

`console.groupCollapsed` was always replaced with `originalConsole`'s implementation, but
the right behavior is to have it be a proxy (call both `console` and `originalConsole`).
So remove this key from a list of unsupported functions.

Reviewed By: yungsters

Differential Revision: D18820158

fbshipit-source-id: d83cffbc7e7939c2654fad2e0d681da7c3b5196a
2019-12-06 13:35:47 -08:00
Eli White e362470305 Convert easy files to flow strict-local
Summary:
This diff was generated by this script used by WWW
https://our.intern.facebook.com/intern/diffusion/WWW/browse/master/scripts/flow/upgrade_to_flow_strict_local.sh?lines=0

Changelog:
[Internal] Upgrade flow to flow strict-local

Reviewed By: zackargyle, rickhanlonii

Differential Revision: D18833630

fbshipit-source-id: e64d4e9a49a0db5e6bf70a0c489567862b578d7f
2019-12-05 16:06:46 -08:00
Eli White c24c8a039c Core files should depend on internals directly
Summary:
By depending on react-native, these files can't be flow strict until index.js is flow strict. By depending on the internals directly they can be flow strict as soon as their dependents are flow strict.

Changelog:
[Internal] Refactoring some core file imports to depend on internals directly

Reviewed By: zackargyle

Differential Revision: D18828324

fbshipit-source-id: 2a347c4e234a64edbb3e6f0ef6387ef1ce78badc
2019-12-05 13:33:58 -08:00
Jordan Brown 90ab8b89e8 Last pass over non-generated files for explicit inexact object rollout
Summary:
The flow team is rolling out exact-by-default object types to xplat/js. In order to do that, we need to take all inexact objects `{}` and turn them into explicitly inexact objects `{...}`.

This codemod does not change any type checking behavior. Prettier was run on all of the modified files with `format`.

drop-conflicts

Changelog: [Internal]

Reviewed By: zackargyle

Differential Revision: D18785076

fbshipit-source-id: c89c7fcc9eabe69859c8a488e03185fba5d06f80
2019-12-04 21:41:16 -08:00
jeswinsimon 70ec7e2add Share - title is not a valid attribute in iOS (#27351)
Summary:
Code document incorrectly indicates that the `title` property is supported in both iOS and Android.
https://github.com/facebook/react-native/issues/27306

## Changelog

[iOS] [Changed] - Changed doc.
Pull Request resolved: https://github.com/facebook/react-native/pull/27351

Test Plan: NA - Only code comments have been changed.

Differential Revision: D18770026

Pulled By: hramos

fbshipit-source-id: af51c0b08bdf534d5e2c861b10e22d969d6f80f9
2019-12-04 15:49:22 -08:00
talhaazhar 3c4b1d6c4f adding tests for the processColorArray mapping (#27344)
Summary:
The following pull-requests adds test for the `processColorArray` function. This ensures that the mapping is respected even in the `processColor` file changes. It also ensures that the mapping follows the basic expected functionality

## Changelog
[General] [Added] - Add test for the `processColorArray` to make sure it maps correctly
Pull Request resolved: https://github.com/facebook/react-native/pull/27344

Test Plan:
- Run `npm run test Libraries/StyleSheet/__tests__/processColorArray-test.js` to ensure tests pass
- Run `npm run lint` to make sure there are no styling conflicts.

<img width="454" alt="Screen Shot 2019-11-26 at 3 24 44 PM" src="https://user-images.githubusercontent.com/31664059/69680816-e8641780-1060-11ea-89ca-336c5534eb16.png">

Differential Revision: D18770069

Pulled By: hramos

fbshipit-source-id: 1a8647931818360b9912dc6fb50c339a91b9d4ea
2019-12-04 15:27:54 -08:00
Emily Janzer de6aa10bdd Use registerLazyCallableModule to register HMRClient
Summary:
Right now we use `BatchedBridge.registerLazyCallableModule` for all JS modules except for `HMRClient`, which uses `registerCallableModule` instead (takes the module itself instead of a function that returns it). I'm standardizing on `registerLazyCallableModule` so that it will be easier to swap out the implementation later for bridgeless mode.

The only reason I could think why we wouldn't want to do this is if we're relying on some side effect of `require('HMRClient')` when setting up JS, but there don't seem to be any side effects in that module that I can see.

Changelog: [Internal]

Reviewed By: rickhanlonii

Differential Revision: D18798870

fbshipit-source-id: a5c950bdbfd998bb12e4843ee28ece08a26c84bf
2019-12-04 10:52:06 -08:00
Tim Yung 37d8440a8e Touchable: Restore `underlayColor={null}` Behavior
Summary:
The former implementations of `TouchableHighlight` used `defaultProps` for `underlayColor`. However, the newly landed implementations use `??` which falls back to the default behavior if the prop is `null`.

This restores the former behavior so that, for example, supplying `underlayColor={null}` to `TouchableHighlight` will not fallback to black. (It probably should always have, but the intention of my rewrite was not to introduce a breaking change.)

Changelog:
[General] [Fixed] - Restore behavior for `underlayColor={null}` in `TouchableHighlight`.

Reviewed By: zackargyle

Differential Revision: D18806494

fbshipit-source-id: 4d33810e2f754f980385d76d81dc0f34006f4337
2019-12-04 09:35:46 -08:00
Isabel B d3980dceab moved normalizeColor and changed dependencies (#27372)
Summary:
Originally, normalizeColor.js was in Library/Color/ however, I noticed that its tests were in a completely different directly (Library/StyleSheet/__tests__) which was confusing. The other files such as processColor.js, setNormalizedAlphaColor.js had their tests in Library/StyleSheet/__tests__ as well.

## Changelog

[Internal] [Changed] - Moved normalizeColor.js to a more appropriate directory where its tests live.
Pull Request resolved: https://github.com/facebook/react-native/pull/27372

Test Plan: I simply moved a file and changed dependencies. The code should still function as is.

Reviewed By: rickhanlonii, mdvacca

Differential Revision: D18760210

Pulled By: yungsters

fbshipit-source-id: 4c2400acabab35ccbb2533faa5c1d6487c9bf48e
2019-12-03 16:05:22 -08:00
Ramanpreet Nara a6a34ba1d1 Add codegen specs as dependencies of NativeModules
Summary:
## Step 1
I'm going to make every Java NativeModule type-safe and TurboModule-compatible. The first step is to make sure that every type-unsafe NativeModule has a dependency on its spec's codegen target.

## Input
Module -> owner(Module): P123320255
Module -> name(Module): P123320256
Module -> owner(spec(name(Module))): P123320257

### Excluded NativeModules
NativeModules without Specs: P123320644
Java only NativeModules: P123320645

Changelog:
[Internal] - Add buck dependencies for NativeModule specs

Reviewed By: mdvacca

Differential Revision: D18781629

fbshipit-source-id: 89f39017b8224355d9d7b43bf6c162b0957760ee
2019-12-03 15:37:30 -08:00
Kacie Bawiec bde1d63c85 Add getNativeScrollRef to FlatList
Summary:
Add a method to get the underlying host component of `FlatList`. Fix flow types in `FlatList` and `VirtualizedList`. Add test cases to test the behavior of the new function in all cases.

Changelog: [General] [Added] - Add getNativeScrollRef method to FlatList component

Reviewed By: TheSavior

Differential Revision: D18302202

fbshipit-source-id: 7005a2bc1dab207434be3f1f4d8fde0b11b3bb4d
2019-12-03 10:17:15 -08:00
Andy Huang fa9ff07017 Pass disabled prop down to native implementation
Summary:
Changelog:
[iOS] [Fixed] - Slider is now disabled properly on iOS if the disabled prop is set.

Reviewed By: yungsters

Differential Revision: D18758835

fbshipit-source-id: 4850ebf05380f241d49d40107de61fd840049779
2019-12-02 14:21:16 -08:00
Moti Zilberman 60b4ba16c0 Always return 0-based columns from parseErrorStack
Summary:
Fixes a bug where we were skewing some stack traces by sending 1-based column numbers to the Metro symbolication endpoint, which expects them to be 0-based. This is achieved by subtracting 1 from the column numbers we find in textual stack traces, which are almost universally 1-based in current JS engines.

The bug is only noticeable in *some* cases, namely where the column immediately following the correct one is in a different function.

NOTE: The behaviour under Hermes was fixed separately, in a previous commit. This fix applies to other engines (e.g. JSC).

Changelog: [General] [Fixed] - Fix stack traces showing the wrong function name in some cases

Reviewed By: cpojer

Differential Revision: D18628230

fbshipit-source-id: 5677803500e45a41c1005496d19c150526af2d07
2019-12-02 06:02:25 -08:00
Moti Zilberman 75d03b56fa Implement a dedicated Hermes stack trace parser
Summary:
Makes stack trace parsing return a consistent representation of column numbers when using Hermes, whether we're executing bytecode (in prod) or source code (in dev). This is achieved by creating a new full-fidelity stack trace parser for Hermes.

NOTE:  We still use the `stacktrace-parser` package for other engines, so this fix applies only to Hermes and not to JSC - that will be fixed separately in an upcoming diff.

This fixes a bug where we were skewing some stack traces by sending 1-based column numbers to the Metro symbolication endpoint, which expects them to be 0-based. The bug is only noticeable in *some* cases, namely where the column immediately following the correct one is in a different function.

Changelog: [Internal]

Reviewed By: cpojer

Differential Revision: D18627930

fbshipit-source-id: abd80846f00f24428670b2c92153564fb4bb2aff
2019-12-02 06:02:25 -08:00
Valentin Shergin 58f69ca504 New delegate method in RCTBackedTextInputDelegate and its implementation
Summary:
This is a more feature-full replacement for `textInputShouldChangeTextInRange:replacementText:` that allows implementing things like limiting text input content length without hacks and compromising the order of events. The new version of the TextInput will rely on that. The existing TextInput will use that as exacly like the previous version (because the new API is a superset of the the old one).

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D18670792

fbshipit-source-id: 0c434b351dfc8ab42404eb9aea0ede70bedaa9dc
2019-12-01 19:09:49 -08:00
Joshua Gross 7ab5eb4caf AndroidTextInput: support using commands instead of setNativeProps (native change)
Summary:
In AndroidTextInput, support codegen'd ViewCommands in native and add three commands that will eventually replace usage of setNativeProps on Android.

TextInput will use these commands in a future diff.

Changelog: [Internal]

Reviewed By: TheSavior

Differential Revision: D18612150

fbshipit-source-id: 5d427040686e8c5ab504dd845bc8ef863f558c35
2019-11-27 12:55:48 -08:00
Rick Hanlon 178f126d83 Parse any babel codeframe error as syntax error
Summary:
## Overview

This diff adds handling for syntax errors created using `buildCodeFrameError` which have a slightly different format than syntax errors thrown during transforms.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D18658502

fbshipit-source-id: 0836f2c16cdd57c10ed1e03dc7345d8e1ccf53f3
2019-11-27 09:25:04 -08:00
Rick Hanlon a64e5bc251 LogBox - Use Modal for full screen inspector
Summary:
This diff switches LogBox over to use a Modal component so that the log inspector is always full screen.

In order to do that, it needed to add an `internal_excludeLogBox` flag to AppContainer so that it's not recursively rendered  as: AppContainer -> LogBox -> Modal -> AppContainer. Not thrilled about the prop but it's necessary for now until this is rendered as it's own root (which we're working on next).

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D18461394

fbshipit-source-id: e1a80dfffbbe6c5467ac6f8d3c445a3280829020
2019-11-27 08:27:31 -08:00
Tim Yung 7bcae81299 RN: Stop Exporting TouchableWithoutFeedback Props
Summary:
Changes `TouchableWithoutFeedback` so that `Props` is no longer exported as a Flow type.

Instead, other modules should use `React.ElementConfig<typeof TouchableWithoutFeedback>`.

Changelog:
[General] [Removed] - TouchableWithoutFeedback no longer exports Props. Use React.ElementConfig, instead.

Reviewed By: zackargyle, TheSavior

Differential Revision: D18718131

fbshipit-source-id: 0bd63123c49564fdab160d5fc8e7f1bf86da1fbe
2019-11-27 07:48:40 -08:00
Tim Yung a516167526 RN: Delete Touchable Injection
Summary:
The experimentation code for `Touchable` is no longer necessary. Clean up all the injection points.

Changelog:
[Internal]

Reviewed By: TheSavior

Differential Revision: D18715851

fbshipit-source-id: 15fe59e218d89f222ae2183a1452718e460048cb
2019-11-27 07:48:40 -08:00
Tim Yung 18d0cba3a9 RN: New `TouchableBounce`
Summary:
Launches a new implementation of `TouchableBounce`.

It is implemented using `Pressability` and extends `React.Component`. Notably, `propTypes` no longer exist.

Changelog:
[Internal]

Reviewed By: TheSavior

Differential Revision: D18715856

fbshipit-source-id: df2300600a8f0f07fc669c1e28183a0ef3a6f695
2019-11-27 07:48:39 -08:00
Tim Yung 7c01172bef RN: New `TouchableHighlight`
Summary:
Launches a new implementation of `TouchableHighlight`.

It is implemented using `Pressability` and extends `React.Component`. Notably, `propTypes` no longer exist.

Changelog:
[General] [Changed] - TouchableHighlight overhauled as a class without propTypes.

Reviewed By: TheSavior

Differential Revision: D18715854

fbshipit-source-id: d4ea6ebd2ca9aef2af93ffad2fe75a96424514e5
2019-11-27 07:48:39 -08:00
Tim Yung 2185dd298a RN: New `TouchableNativeFeedback`
Summary:
Launches a new implementation of `TouchableNativeFeedback`.

It is implemented using `Pressability` and extends `React.Component`. Notably, `propTypes` no longer exist.

Furthermore, `TouchableNativeFeedback` now behaves similar to `TouchableWithoutFeedback` on iOS (instead of rendering an error message).

Changelog:
[General] [Changed] - TouchableNativeFeedback overhauled as a class without propTypes. Also, replaced iOS error renderer.

Reviewed By: TheSavior

Differential Revision: D18715857

fbshipit-source-id: aa42c7547ac94340fde0ef30641cab7eb48ea81b
2019-11-27 07:48:39 -08:00
Tim Yung 88ae24f719 RN: New `TouchableOpacity`
Summary:
Launches a new implementation of `TouchableOpacity`.

It is implemented using `Pressability` and extends `React.Component`. Notably, `propTypes` no longer exist.

Changelog:
[General] [Changed] - TouchableOpacity overhauled as a class without propTypes.

Reviewed By: TheSavior

Differential Revision: D18715858

fbshipit-source-id: 06ba5fc7eaacdbb7dc12d1564cc5d04e1a991229
2019-11-27 07:48:38 -08:00
Tim Yung ebf7d75816 RN: New `TouchableWithoutFeedback`
Summary:
Launches a new implementation of `TouchableWithoutFeedback`.

It is implemented using `Pressability` and extends `React.Component`. Notably, `propTypes` no longer exist.

Changelog:
[General] [Changed] - TouchableWithoutFeedback overhauled as a class without propTypes.

Reviewed By: TheSavior

Differential Revision: D18715852

fbshipit-source-id: f2eb28e3b8500bfcd8db44fc6bdbc0476193723a
2019-11-27 07:48:38 -08:00
Tim Yung c5cc181c7e RN: Open Source `Pressability`
Summary:
Makes `Pressability` available the open source `react-native` repository.

This abstraction is intended to replace `Touchable.Mixin` and enable us to finally stop depending on `createReactClass` (et al).

Changelog:
[Internal]

Reviewed By: TheSavior

Differential Revision: D18715853

fbshipit-source-id: 21af8652cfb4557c60babd31b2776bcaeaed8447
2019-11-27 07:48:38 -08:00
Sharon Gong 8c0c860e38 Add missing accessibility props to Touchables (#27293)
Summary:
The following accessibility properties was added for view but not for Touchables - importantForAccessibility, accessibilityLiveRegion, accessibilityViewIsModal and accessibilityElementsHidden. This PR is to extend the support for all touchables.

## Changelog

[General] [Added] - Add missing accessibility props on Touchables
Pull Request resolved: https://github.com/facebook/react-native/pull/27293

Test Plan: Tested in RNTester app.

Differential Revision: D18650884

Pulled By: yungsters

fbshipit-source-id: 2172ac55a8c8803d7d923511f43b2598593ea1d2
2019-11-23 10:28:07 -08:00
Tim Yung b7ab922bb3 RN: Console Stub Parity
Summary:
Brings parity to the non-`__DEV__` stub polyfill for `console`.

Changelog:
[General][Added] - Added missing `console` polyfills in release builds.

Reviewed By: ejanzer, RSNara

Differential Revision: D18667335

fbshipit-source-id: 0307d04a136e5f7bb914f18b80441b7a7fae5e5b
2019-11-23 07:22:44 -08:00
Valentin Shergin ac3c167ead Moving some workarounds and fixes from RCTMultilineTextInputView to RCTUITextView
Summary:
The class `RCTUITextView` is designed to be a home for workarounds. In Fabric we will use it as well, so we need to have all workarounds there.
That's just a move of some code between clases, it does not really affect how the workarounds work.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D18607833

fbshipit-source-id: 1ba0e8c5cd928f3bf6fe1d2727325ecfc1dbf684
2019-11-22 22:25:07 -08:00
Janic Duplessis 5798cf2aa9 Remove requestAnimationFrame when focusing input on mount (#27217)
Summary:
When using `react-native-screen` which uses native view controller animations for navigation `TextInput` with `autoFocus` causes a weird animation glitch.

Removing the requestAnimationFrame will cause the focus command to be sent in the same batch as starting screen transitions which fixes the issue.

It is unclear why the rAF was added in the first place as it was part of the initial RN open source commit. If someone at facebook has more context that would be great to make sure it doesn't cause unintended side effects.

Credits to kmagiera for figuring out this

## Changelog

[General] [Fixed] - Remove requestAnimationFrame when focusing input on mount
Pull Request resolved: https://github.com/facebook/react-native/pull/27217

Test Plan:
- Tested in an app using react-native-screen to make sure the animation glitch is fixed
- Tested in RNTester to make sure it doesn't cause other issues when not using react-native-screens

Before:

![1](https://user-images.githubusercontent.com/2677334/68799447-2ce5c100-0626-11ea-8310-a9ac9e9419b6.gif)

After:

![2](https://user-images.githubusercontent.com/2677334/68799450-2fe0b180-0626-11ea-865f-ef88f7307831.gif)

Differential Revision: D18666991

Pulled By: TheSavior

fbshipit-source-id: 66664c89e06c9ae65074ddcc4688dc5109fc9c72
2019-11-22 16:13:57 -08:00
Christoph Nakazawa 03766d6a08 Remove unnecessary whitespace from code frames
Summary:
This removes common whitespace from a code frame to show more code. This is especially useful for heavily intended code that may not even be visible in the small window.

I am not 100% confident I wrote the right code because I'm under time pressure but it seems to work. I'm an intern and it's my last day.

Changelog: [Internal]

(Note: this ignores all push blocking failures!)

Reviewed By: rickhanlonii

Differential Revision: D18657572

fbshipit-source-id: 6b93999c4482891f2123d67005843ce5db0d2976
2019-11-22 09:09:10 -08:00
Christoph Nakazawa 89be2d00ea Remove the vertical bar next to the code frame
Summary:
This vertical bar doesn't really add any value. This diff removes it. At first I tried to use regex but ansi codes make that hard. We can just use the structured data and rely on the fact that the second item is always the one with the vertical bar.

(Note: this ignores all push blocking failures!)

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D18656911

fbshipit-source-id: b72d4c93d0008c7da54647d072a4c4eb7646b694
2019-11-22 09:09:09 -08:00
Christoph Nakazawa 16e72ad370 Syntax highlighting for LogBox Code Frames
Summary:
This diff adds syntax highlighting to LogBox CodeFrames. It works by turning Ansi codes into "JSON" (it's actually just a JS object but the third-party API uses JSON as terminology) and then turning that into `<Text>` elements.

The syntax theme is called Afterglow and I took it from https://iterm2colorschemes.com/. Happy for anyone who wants to further tweak it! I installed this into iTerm and extracted the colors from there as it has a color picker and the labels directly map to the color classes exposed by the `anser` package.

Changelog: [Internal]

(Note: this ignores all push blocking failures!)

Reviewed By: rickhanlonii

Differential Revision: D18618897

fbshipit-source-id: 64815619fc482e08b5671f492dabda8c8c0ceca5
2019-11-22 09:09:09 -08:00
Rick Hanlon 4ad5d1c473 LogBox - Clear selectedIndex when logs are cleared
Summary:
This diff fixes an exception thrown when using fast refresh when a log is opened.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D18656859

fbshipit-source-id: 707f71f627daa172a4f9e02e3ff5d05b6174eb63
2019-11-22 05:49:54 -08:00
Rick Hanlon 0d994df04d LogBox - Add ReferenceError to transform error regex
Summary:
Adds handling for reference errors so when we throw them in the next diff they're handled as syntax errors.

Changelog: [Internal]

Reviewed By: cpojer

Differential Revision: D18644642

fbshipit-source-id: 2b751578c616c27d5b1ec6255aca56063bfd9d16
2019-11-22 04:24:17 -08:00
Eli White 390d0895ba Back out "Revert D18626496: Partial React Sync from 6cff70a74...bb1853f73"
Summary:
Original commit changeset: d982163fe3f5

Landing the original but with the feature flag disabled. *doh*

Changelog:
[General][Changed] Partial React Sync from 6cff70a74...bb1853f73

Reviewed By: mdvacca

Differential Revision: D18649739

fbshipit-source-id: c9a15f511595fe0ae76dd49db7a7097d1bfa3853
2019-11-21 18:11:30 -08:00
Eli White 821166c111 Revert D18626496: Partial React Sync from 6cff70a74...bb1853f73
Differential Revision:
D18626496

Original commit changeset: c8fc6551bf2b

fbshipit-source-id: d982163fe3f5bed6d26cdbf1dc080c1ac7b6889d
2019-11-21 16:05:15 -08:00
Eli White dff490d140 Convert TextInput to Hooks
Summary:
Modernizing this code a bit more, converting it to hooks.

Changelog:
[General][Changed] Converted TextInput to use React hooks
[General][Fixed] TextInput now properly sends native the end selection location on change

(Note: this ignores all push blocking failures!)

Reviewed By: JoshuaGross

Differential Revision: D18581712

fbshipit-source-id: 62d6ea8489fa019ddf941c520930365f2c4887d8
2019-11-21 12:41:52 -08:00
George Zahariev 8553e1acc4 Exact-by-default codemod for react-native-github
Summary:
We are rolling out exact-by-default syntax to xplat/js.

I had to manually move around some comments to preserve proper placement.

Changelog: [Internal]

Reviewed By: jbrown215

Differential Revision: D18633611

fbshipit-source-id: 48f7468dcc55b1d00985419d035a61c6820b3abe
2019-11-21 09:42:57 -08:00
Ramanpreet Nara 1ad0862363 Revert D16969764: Make RCTDevLoadingView TurboModule-compatible
Differential Revision:
D16969764

Original commit changeset: 47e6682eea3f

fbshipit-source-id: d95b76eb8e57bbaff840b3d85f3745b13d622ce0
2019-11-21 08:43:12 -08:00
Rick Hanlon 93b892cac6 Don't allow pressing on un-symbolicated stackframes (reland)
Summary:
Re-land [RN DevX] Don't allow pressing on un-symbolicated stackframes

Changelog: [Internal]

Reviewed By: TheSavior

Differential Revision: D18628349

fbshipit-source-id: 22d6b931b0ad09976b80aa6b90f10bffa6a4a46c
2019-11-21 06:16:42 -08:00
Lucy Beatriz Gomez a7233e45a4 Fixing RN Picker
Summary:
Changelog: [Internal]

Fixing a red screen on the RN picker.
Looks like the picker gets confused when  for unknown reasons a native value is undefined. In that case we stick to the JS value as it is specified in the comment.
https://fb.workplace.com/groups/rn.support/permalink/2997783536936908/

NOTE : Native fix was landed, this add an extra layer on the JS side

Reviewed By: mmmulani

Differential Revision: D18443005

fbshipit-source-id: 9511ac90f2d9e6186c6c0de3b673cc535cdb9fa6
2019-11-20 20:16:13 -08:00
Eli White 222a0895d9 Partial React Sync from 6cff70a74...bb1853f73
Summary:
This sync includes these changes:

- **[bb1853f73](https://github.com/facebook/react/commit/bb1853f73 )**: [Native] If statement cleanup for null targets (#17346) //<Eli White>//
- **[a9d9fc7bb](https://github.com/facebook/react/commit/a9d9fc7bb )**: [Native] Add FeatureFlag to dispatch events with instance currentTarget (#17345) //<Eli White>//
- **[731456a12](https://github.com/facebook/react/commit/731456a12 )**: [Native] Add FeatureFlag to dispatch events with instance targets (#17323) //<Eli White>//
- **[9d5363820](https://github.com/facebook/react/commit/9d5363820 )**: Change legacy-events plugin nativeEventTarget to allow null (#17344) //<Eli White>//

Changelog:
[General][Changed] Partial React Sync from 6cff70a74...bb1853f73

Reviewed By: mdvacca

Differential Revision: D18626496

fbshipit-source-id: c8fc6551bf2b37ce27d4e9dbc7fe3455dfa08af9
2019-11-20 18:13:18 -08:00
Eli White 7813e24cdb Remove unused _focusSubscription
Summary:
This variable is never set and only ever removed

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D18537317

fbshipit-source-id: bbb084e2ea5408fc59ef3853b2ec74bf22afbe21
2019-11-20 18:09:30 -08:00
Eli White e483bd4d49 Add Jest snapshot tests to TextInput
Summary:
$title

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D18536359

fbshipit-source-id: 382c81c094c0ae28ec3e203cb0726bdbccf755dc
2019-11-20 18:09:30 -08:00
Eli White 20a3bb52ce Convert component snapshot tests to a reusable helper
Summary:
These tests need to be consistent with every test so a helper makes more sense.

Changelog: [Internal]

Reviewed By: rickhanlonii

Differential Revision: D18500439

fbshipit-source-id: de535156d370102bad88e556ad3d2a0d5443e4e2
2019-11-20 18:09:30 -08:00
Eli White 9b53f52236 Revert D18577288: Don't allow pressing on un-symbolicated stackframes
Differential Revision:
D18577288

Original commit changeset: 6de322b47558

fbshipit-source-id: 095766e07a43008abf5fc6adb0f46bb08fc420a0
2019-11-20 15:51:06 -08:00
Christoph Nakazawa 1e0e9582ab Improve rendering perf of LogBoxInspectorStackFrame
Summary:
LogBox tends to take a bit of time to open after tapping a log banner. This is very noticeable on Android where it takes multiple seconds.

When looking at React DevTools, the Stack Frame code can be responsible for two thirds of total LogBox rendering time. With this diff, the time is reduced from about 46ms to 25ms, and the total time spent rendering LogBox is reduced by one third.

This diff makes a few micro-optimizations but primarily it gets rid of an unnecessary View and collapses multiple text components into a single one as they are all rendered the same. Note that this also fixes an issue in the case where a line number may be missing but a column was provided. While I can't think of a case where that would actually happen, previously it would print the column (which could be mistaken for the lineNumber in that case) but now it prints the column only if the line Number is also present.

Changelog: [Internal]

Reviewed By: rickhanlonii

Differential Revision: D18613899

fbshipit-source-id: 5c6a3b65b749d5f95058b34ded6cc12531d91c38
2019-11-20 11:24:15 -08:00
Ramanpreet Nara 294e31b7c2 Make RCTDevLoadingView TurboModule-compatible
Summary:
RCTDevLoadingView wasn't hooked up to the codegen. This diff makes RCTDevLoadingView type-safe and also makes it TurboModule-compatible.

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

Reviewed By: PeteTheHeat

Differential Revision: D16969764

fbshipit-source-id: 47e6682eea3fc49d3f0448c636b5f616d5bce220
2019-11-20 11:20:12 -08:00
Rick Hanlon 55cb6ab07c Don't allow pressing on un-symbolicated stackframes
Summary:
This diff makes a few improvements to the call stack / symbolication process:

- Removes button from unsymbolicated stack frames
- Adds a warning message for missing features without symbolication
- Reduces symbolication requests (we were re-requesting stacks when they were pending)
- Speeds up opening unsymbolicated logs (because we were re-requesting them, the components were updating a lot)

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D18577288

fbshipit-source-id: 6de322b4755895e2d1599b06100a61e64f7ec023
2019-11-20 11:05:20 -08:00
Rick Hanlon bdd1a675ba Dismiss all logs on fast refresh
Summary:
Based on feedback we're going to clear all logs on fast refresh 👍

Changelog: [Internal]

Reviewed By: gaearon

Differential Revision: D18614230

fbshipit-source-id: 119a09e8ffea9d86137583d8da435338833f910c
2019-11-20 08:50:49 -08:00
Stepan Furdei 25a21b8e49 Don't crash when pretty-format is not available
Summary:
pretty-format library is not available on some JSC which causes the app to crash while trying to log a warning. This change defaults to just stringify the error if formatter is not available. The behavior on platforms where it already works fine isn't changed.

Changelog: Don't crash the app while formatting a warning for console if pretty-format is not available.

Reviewed By: PeteTheHeat

Differential Revision: D18403456

fbshipit-source-id: 73226f1a4e3f38c8d7c4e5ace909dd494e1da298
2019-11-19 16:22:29 -08:00
Jordan Brown 48cb80892d Manually fix places the codemod doesnt hit
Summary:
Generating this diff was difficult. We _will_ fix the issues with jscodeshift, but i don't want to block the syntax change on that.

To get this diff, I first codemodded all of xplat to use exact-by-default. Then i turned on implicit-inexact-object:error enforcement to get a list of errors showing places that violated the lint. With that, I used this to generate a list of `sed` commands to add `...`:

```
flow --json | jq '.errors | .[] | .message | .[] | .loc | {source, "line": .end."line", "column": .end."column"} | "\(.column),\(.line),\(.source)"' | sort -n -r | sed 's/"//g' | while read -r line; do echo $line; awk -F',' "{ print \"sed -i '\"\$2\"s/./...&/\"\$1\"' \" \$3 }"; done
```

Then I ran prettier, reverted generated files, and manually fixed up suppressions that got messed up.

Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D18516431

fbshipit-source-id: 6cf940dce411fb179e7ebaff764bd5113a07989f
2019-11-19 13:38:18 -08:00
Samuel Susla 2d80a248cd Migrate RefreshControl to Native Commands
Summary:
Changelog: [Internal]

Introduce native command `setNativeRefreshing`, it has the word Native in order to avoid name conflict with setRefreshing in Android implementation. Even this component is iOS only, it would make it easier to merge them in the future.

Introduce `RCTRefreshableProtocol` and make `RCTRefreshControl` and `RCTPullToRefreshViewComponentView` to conform to the protocol so view manager can forward command to both, Paper and Fabric component.

Reviewed By: mmmulani

Differential Revision: D18475804

fbshipit-source-id: 4c19225784efc931b7b8f2d2671cc839bce429bf
2019-11-19 10:06:56 -08:00
Rick Hanlon 6db52c5fe0 LogBox - Add app version and move meta info
Summary:
This diff adds a new API `setAppInfo` to add app version and engine to LogBox and changes the way they're displayed so that they're more subtle and visible for screenshots.

Changelog: [Internal]

Reviewed By: cpojer

Differential Revision: D18592992

fbshipit-source-id: 1c57b21fa9dca93029ffc92acf1287f3ee247f4d
2019-11-19 09:36:28 -08:00
Dan Abramov 1edce56a9d React Native sync for revisions 4eeee35...6cff70a
Summary:
Changelog: [General][Changed] - React sync for revisions 0b61e2698...6cff70a74 (Includes React 16.11.0)

This sync includes the following changes:
- **[6cff70a74](https://github.com/facebook/react/commit/6cff70a74 )**: [react-interactions]
Expost host instance to Scope Query function (#17341) //<Dominic Gannaway>//
- **[b8f825877](https://github.com/facebook/react/commit/b8f825877 )**: Split ReactDOM entry
point (#17331) //<Dan Abramov>//
- **[a7b4d51a2](https://github.com/facebook/react/commit/a7b4d51a2 )**: Warn when doing creat
eRoot twice on the same node (another approach) (#17329) //<Dan Abramov>//
- **[be3bfa6fa](https://github.com/facebook/react/commit/be3bfa6fa )**: [Flight] Basic Integr
ation Test (#17307) //<Dan Abramov>//
- **[6cb6b1d66](https://github.com/facebook/react/commit/6cb6b1d66 )**: Add yarn build --unsa
fe-partial (#17316) //<Dan Abramov>//
- **[38dd17ab9](https://github.com/facebook/react/commit/38dd17ab9 )**: [RN] Hoist static dee
pDiffer options object (#17303) //<Moti Zilberman>//
- **[61d3dd0e0](https://github.com/facebook/react/commit/61d3dd0e0 )**: Update deepDiffer usa
ge in React Native renderer (#17282) //<Moti Zilberman>//
- **[e701632ad](https://github.com/facebook/react/commit/e701632ad )**: [react-interactions] Change unmount blur logic to a dedicated event (#17291) //<Dominic Gannaway>//
- **[ce4b3e998](https://github.com/facebook/react/commit/ce4b3e998 )**: [react-interactions] Add optional searchNodes to Scope.queryAllNodes (#17293) //<Dominic Gannaway>//
- **[dee03049f](https://github.com/facebook/react/commit/dee03049f )**: [Flight] Basic Streaming Suspense Support (#17285) //<Sebastian Markbåge>//
- **[f50f39b55](https://github.com/facebook/react/commit/f50f39b55 )**: [Flight] Better compat with http.createServer (#17289) //<Dan Abramov>//
- **[345270630](https://github.com/facebook/react/commit/345270630 )**: DevTools cleanup (#17283) //<Brian Vaughn>//
- **[cd1bdcd06](https://github.com/facebook/react/commit/cd1bdcd06 )**: [react-interactions] Prevent duplicate onPress firing for keyboard Enter (#17266) //<Dominic Gannaway>//
- **[4f02c93c7](https://github.com/facebook/react/commit/4f02c93c7 )**: Fix devtools displaying Anonymous for memo of ref-forwarding components (#17274) //<Waseem Dahman>//
- **[053cf0fed](https://github.com/facebook/react/commit/053cf0fed )**: Fix react-is memo and lazy type checks (#17278) //<Brian Vaughn>//
- **[0f3838a01](https://github.com/facebook/react/commit/0f3838a01 )**: Remove `debugRenderPhaseSideEffects` flag (#17270) //<Andrew Clark>//
- **[cb09dbe0a](https://github.com/facebook/react/commit/cb09dbe0a )**: [react-interactions] Add handleSimulateChildBlur upon DOM node removal (#17225) //<Dominic Gannaway>//
- **[6095993d4](https://github.com/facebook/react/commit/6095993d4 )**: Types: findHostInstance_DEPRECATED returns React.ElementRef<HostComponent<mixed>> (#17265) //<Eli White>//
- **[62ef25077](https://github.com/facebook/react/commit/62ef25077 )**: Avoid bundling in ponyfill for Object.assign in use-subscription package (#17259) //<Mateusz Burzyński>//
- **[f4148b256](https://github.com/facebook/react/commit/f4148b256 )**: [Flight] Move around the Server side a bit (#17251) //<Sebastian Markbåge>//
- **[fadc97167](https://github.com/facebook/react/commit/fadc97167 )**: [Flight] Add Client Infrastructure (#17234) //<Sebastian Markbåge>//
- **[36fd29f09](https://github.com/facebook/react/commit/36fd29f09 )**: Don't show empty (no work) commits in Profiler (#17253) //<Brian Vaughn>//
- **[a2e05b6c1](https://github.com/facebook/react/commit/a2e05b6c1 )**: [Scheduler] Delete old rAF implementation (#17252) //<Andrew Clark>//
- **[6dc2734b4](https://github.com/facebook/react/commit/6dc2734b4 )**: Codemod tests to `it.experimental` (#17243) //<Andrew Clark>//
- **[273679a78](https://github.com/facebook/react/commit/273679a78 )**: DevTools standalone shell changes: (#17213) //<Brian Vaughn>//
- **[d0fc0ba0a](https://github.com/facebook/react/commit/d0fc0ba0a )**: Revert "Dispatch commands to both UIManagers from both renderers (#17211)" (#17232) //<Eli White>//
- **[bdcdb69a2](https://github.com/facebook/react/commit/bdcdb69a2 )**: Rename findHostInstance_deprecated to findHostInstance_DEPRECATED (#17228) //<Eli White>//
- **[515746c21](https://github.com/facebook/react/commit/515746c21 )**: Add findHostInstance_deprecated to the React Native Renderer (#17224) //<Eli White>//
- **[9a35adc96](https://github.com/facebook/react/commit/9a35adc96 )**: Only call Profiler onRender when a descendant had work (#17223) //<Brian Vaughn>//
- **[8eee0eb01](https://github.com/facebook/react/commit/8eee0eb01 )**: Dispatch commands to both UIManagers from both renderers (#17211) //<Eli White>//
- **[f4e974d26](https://github.com/facebook/react/commit/f4e974d26 )**: Add Experimental Flight Infrastructure (#16398) //<Sebastian Markbåge>//
- **[6cd365cac](https://github.com/facebook/react/commit/6cd365cac )**: Don't treat the last row in hidden as deleted if already mounted (#17206) //<Sebastian Markbåge>//
- **[048879eda](https://github.com/facebook/react/commit/048879eda )**: [react-interactions] Ensure props on scope query function is always object (#17212) //<Dominic Gannaway>//
- **[3497ccc14](https://github.com/facebook/react/commit/3497ccc14 )**: Add guard to handle modified React elements with non-string keys (#17164) //<Brian Vaughn>//
- **[3f9c03675](https://github.com/facebook/react/commit/3f9c03675 )**: Typo fix in comment (#17111) //<Deniz Susman>//
- **[f6b8d31a7](https://github.com/facebook/react/commit/f6b8d31a7 )**: Rename createSyncRoot to createBlockingRoot (#17165) //<Dan Abramov>//
- **[9c02d2654](https://github.com/facebook/react/commit/9c02d2654 )**: docs: Fixed a typo in readme.md (#17119) //<Wilco Fiers>//
- **[8075c8505](https://github.com/facebook/react/commit/8075c8505 )**: Update local package versions for 16.10 release //<Andrew Clark>//
- **[5faf377df](https://github.com/facebook/react/commit/5faf377df )**: Fixed a style bug in props editor (#17162) //<Brian Vaughn>//
- **[f7ec65eeb](https://github.com/facebook/react/commit/f7ec65eeb )**: [react-interactions] Make events non-passive to allow preventDefault (#17136) //<Dominic Gannaway>//
- **[1022ee0ec](https://github.com/facebook/react/commit/1022ee0ec )**: Read current time without marking event start time (#17160) //<Andrew Clark>//
- **[349cf5acc](https://github.com/facebook/react/commit/349cf5acc )**: Experimental test helper: `it.experimental` (#17149) //<Andrew Clark>//
- **[edc234c73](https://github.com/facebook/react/commit/edc234c73 )**: Build script should default to experimental (#17144) //<Andrew Clark>//
- **[3cc564547](https://github.com/facebook/react/commit/3cc564547 )**: SuspenseList support in DevTools (#17145) //<Sebastian Markbåge>//
- **[68fb58029](https://github.com/facebook/react/commit/68fb58029 )**: Remove unstable_ prefix in various internal uses (#17146) //<Sebastian Markbåge>//
- **[7082d5a2d](https://github.com/facebook/react/commit/7082d5a2d )**: Don't build non-experimental www bundles (#17139) //<Andrew Clark>//
- **[c47f59331](https://github.com/facebook/react/commit/c47f59331 )**: Move SuspenseList to experimental package (#17130) //<Andrew Clark>//
- **[685ed561f](https://github.com/facebook/react/commit/685ed561f )**: Migrate useDeferredValue and useTransition (#17058) //<Luna Ruan>//
- **[0b61e2698](https://github.com/facebook/react/commit/0b61e2698 )**: Update RN typings for a shim (#17138) //<Dan Abramov>//

Reviewed By: threepointone

Differential Revision: D18428149

fbshipit-source-id: 28273be4d7a4c7ec0fe0451cea134ee09a3b4d86
2019-11-19 08:52:37 -08:00
Valentin Shergin 3f7e0a2c96 Removing <TextInput>'s `onTextInput` event
Summary:
This is the first diff in the series. It removes Flow types for this feature to verify that we actually do not have any usages. After it lands, we will remove actual support on the native side.

There are several reasons why removing it is a good idea:
* There is no any evidence that this feature is actually useful. That was discussed several times (e.g. see T7936714) during RN lifetime and the overall consensus is: We need something else, something like sync `onChange` event instead of it.
* Supporting the previous point, it's not used (at least inside Facebook). I searched hard and I could find only one place where it's used: in the TextInput Example.
* To deliver more functionality we should lean towards W3C specs, this one is not W3C compliant.
* Supporting this Feature in Fabric is quite challenging, so I want to do it sooner than later.
* This feature was never documented.

Changelog: [Breaking] `<TextInput>::onTextInput` event was removed

Reviewed By: TheSavior

Differential Revision: D18456175

fbshipit-source-id: c7a8ed7a86b33ecc01d45497645fe249556fdf96
2019-11-18 20:53:35 -08:00