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

2867 Коммитов

Автор SHA1 Сообщение Дата
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
Valentin Shergin f92b161eb3 SafeAreaView: Custom `description` method extended with inset values
Summary:
That should help with debugging SafeAreaView-related issues (esp. to see the info inside view hierarchy recursive description).

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D19539216

fbshipit-source-id: 1bee481c2766ad2d130e435582876d9f5ed27b3c
2020-01-23 12:53:49 -08:00
Valentin Shergin a69abb419a Fabric: Using State::getRevision() instead of TextInputState::revision
Summary:
Previously, State revision number was implemented manually as part of the StateData. Now we have it as a built-in concept in State, so we can rely on that.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: JoshuaGross

Differential Revision: D19467161

fbshipit-source-id: cac907265090730cdb89207aad2b52141cda5dc6
2020-01-23 10:39:14 -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
Valentin Shergin b9ac1d52c9 Fabric: Image, checking for instrumentation not being null before calling on it
Summary:
There is no guarantee that the pointer is not null, so we have to check for it. And particularly, the `instrumentation` pointer is null when the `ImageSource`'s type is `invalid`.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D19482208

fbshipit-source-id: e1eab02841b1594136388e51d9d5b5c881ab9366
2020-01-21 07:54:26 -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
Peter Argany 8fe04cfd7e Migrate RCTDevSettings to TM
Summary: As titled. The work to write the spec and make this module compatible were done in D18148890.

Reviewed By: RSNara

Differential Revision: D19442016

fbshipit-source-id: 369bb4247d6590d41ec414f93c79d98d4a6bed88
2020-01-17 17:22:14 -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
Samuel Susla 6bdfd84a45 Move event structs into event emitter namespace
Summary:
In codegen we generate structs that represents events. These structs are later dispatched by generated `EventEmitter`.
They had unpleasant naming, for example `SliderOnValueChangeStruct`. This diff changes the code generated so it becomes `SliderEventEmitter::OnValueChange`, this better expresses the relationship of the two classes.

Changelog: [Internal]

Motivation: Better express relationship between EventEmitter and classes that represent events.

Reviewed By: rickhanlonii, shergin

Differential Revision: D19373850

fbshipit-source-id: a5eea085013dbc119169e2b06ba9f9fe44c7fcd9
2020-01-14 06:39:33 -08:00
Samuel Susla f15b80b675 Migrate Keyframes to Fabric using interop layer
Summary:
Adds Keyframes to interop whitelist of supported components.
In `RCTKeyframesManager.m` we look into subviews in order to find `RCTKeyframesView`, this is because the view returned from paper's `UIManager` is interop itself.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D19309355

fbshipit-source-id: f9b598ee6ad5340a4e4b3914330c70eea9f43926
2020-01-14 06:30:35 -08:00
Samuel Susla 139bf7cffe Add plugin assertion to ensure image component is loaded
Summary:
With plugins being used for components, there is danger that someone will remove buck target as dependency and component in the target won't be available for Fabric.

That's where `plugin_assertion` comes into play. For now I hardcoded a list of components. In the future, this list will be generated from JS components that are used in the app.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D19197548

fbshipit-source-id: 0d31f53b573c343561715a8fb6fc7f0abfdb5b76
2020-01-14 04:05:16 -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
Valentin Shergin 8219db9a4a Fabric: The basic implementation of <TextInput> for iOS
Summary:
This is the partial implementation of Fabric-compatible <TextInput> component on iOS. All features are supported besides those:
 * `focus()`, `blur()`, `clear()` imperative calls;
 * Controlled TextInput as the whole feature in general;
 * Controlling selection from JavaScript side;
 * `autoFocus` prop;
 * KeyboardAccessoryView.

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D17400907

fbshipit-source-id: 0ccd0e0923293e5f504d5fae7b7ba9f048f7d259
2020-01-13 23:22:10 -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
Samuel Susla cfbd93ccd5 Fix crash when accessing nullptr imageRequest
Summary:
ImageState if created with default constructor is created with `imageRequest_` being nullptr.
Calling `getObserverCoordinator()` on it was causing a crash.

We create initial state data with `imageRequest` populated.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D19332711

fbshipit-source-id: 0266222551dbfb10b3f86e72a43d5306650fd09b
2020-01-13 23:19:26 -08:00
Peter Argany a6c0f5a120 Fix typo in RCTSurface log
Summary:
title

Changelog: [iOS][Internal] Fix typo in RCTSurface log

Reviewed By: zackargyle, sammy-SC

Differential Revision: D19334748

fbshipit-source-id: 61cc984072d2f109d5ae8bce70688094d9fbe67c
2020-01-13 14:23:54 -08:00
Valentin Shergin 5e6c61e449 Fabric: Fixing incorrect retaining policy for RCTSurfacePreseter (crash in RCTNativeAnimatedModule)
Summary:
This fixing a crash in RCTNativeAnimatedModule caused by accessing an `RCTSurfacePreseter` instance as "Objective-C runtime associated object" which was retained with `OBJC_ASSOCIATION_ASSIGN` policy. The documentation for `OBJC_ASSOCIATION_ASSIGN` says "Specifies a weak reference to the associated object." but it's a lie ( https://stackoverflow.com/questions/16569840/using-objc-setassociatedobject-with-weak-references) ). The policy is actually `ASSIGN` (aka `unsafe-unretained`).
That's why it's crashing.

We change that to `OBJC_ASSOCIATION_RETAIN` to retain the object (which meets the expectation of the interface of the category).

We also should not have over-retaining issues because:
* SurfacePresenter does not retain a Bridge or any object that can retain a Bridge;
* SurfacePresenter is a long-living object, we don't recreate it during bridge reloading or stuff like that.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D19333869

fbshipit-source-id: 1ff03659a880f2742b909c5668c47144719eeee2
2020-01-13 13:36:36 -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
Peter Argany b4d5ffb804 Guard against nil bridge during teardown
Summary:
A UBN surfaced in v252 because [this assert](https://our.intern.facebook.com/intern/diffusion/FBS/browse/master/xplat/js/react-native-github/React/Modules/RCTEventEmitter.m?commit=e5d1e6375a640d0387bb7016d3becd262c22c327&lines=40) started firing, originating from `RCTAppState`.

This appears to be a race condition during RN teardown. RN receives a memory warning and attempts to forward to JS, but the bridge is already destroyed.

IMO, if the bridge is already destroyed, then there shouldn't be a need to send a memory warning to JS? This is just a hunch though, if anyone feels otherwise, please let me know :)

See the UBN task for further details.

Changelog: [iOS][Internal] Guard against nil bridge during teardown

Reviewed By: shergin

Differential Revision: D19293063

fbshipit-source-id: 566f21af30d3d9bcd25a673ce664f8caddc701ca
2020-01-06 17:03:06 -08:00
Valentin Shergin bd0c37e456 Back out "Fabric: Temporary workaround for a deadlock in RCTSurfacePresenter"
Summary:
This is a backout of the temporary workaround.
A proper fix was landed as D19249490.

Original commit changeset: 53d19e90e080

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D19252609

fbshipit-source-id: 4a6239944440f392ef8a0e85a5038ee5f4d774f0
2020-01-06 12:44:56 -08:00
Samuel Susla b920bf8736 Fabric: remove LocalData from mounting layer
Summary:
Changelog: [Internal]

We are moving away from LocalData in favour of State.
LocalData isn't used on iOS anymore, this diff removes it so it can't be reintroduced

Reviewed By: shergin

Differential Revision: D19250731

fbshipit-source-id: aaa5d79b4d885b6bf9b2df2d67d80ecd3d6982bc
2020-01-06 05:25:24 -08:00
Samuel Susla 0c64733c6b Fabric: migrate Slider from LocalData to State
Summary:
Changelog: [Internal]
We are moving away from LocalData in favour of State.

Reviewed By: shergin

Differential Revision: D19250592

fbshipit-source-id: 6d2eef9a0c0e53e0146da609ba0c24fa09766433
2020-01-06 05:25:23 -08:00
Samuel Susla 3d6f5f50a7 Fabric: Migrate Image to State from LocalData
Summary:
Changelog: [Internal]

We are moving away from LocalData in favour of State.

Reviewed By: shergin

Differential Revision: D19247031

fbshipit-source-id: 8884133b13dd111e8d9e2cd4936bf90bfc5b4932
2020-01-06 05:25:23 -08:00
Samuel Susla 8a4f9b31b3 Implement RCTComponentViewClassWithName in single place with conditional compilation
Summary:
Instead of defining `RCTComponentViewClassWithName` in every single app. It is easier to use conditional compilation to determine whether iOS plugins are available or not.

Based on that a plugin for given name will be either come from plugin system or generated map of components.

Changelog: [internal]

Reviewed By: shergin

Differential Revision: D19168527

fbshipit-source-id: cb130fc563a15882e2b163c84ea37aaa3849c16d
2020-01-06 03:45:38 -08:00
Rick Hanlon 88813761ec LogBox - Double sync rendering timeout
Summary:
On slower devices , 0.5s is not fast enough and we frequently render a black screen. Let's bump the sync rendering timeout to 1s.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D19282619

fbshipit-source-id: 0d9ae60f4869b0de7c4523c2cb33fbbf320c6438
2020-01-05 05:22:01 -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
Valentin Shergin 9c1412882e Fabric: Using shared mutex to protect scheduler object in RCTSurfacePresenter
Summary:
This fixes a deadlock caused by recursive calling of `-[RCTSurfacePresenter setMinimumSize:minimumSize:]` (because of an attempt to lock the mutex which was already locked upper the call stack).
Seems there is no reason why this operation should not be allowed. This diff replaces a regular mutex with a shared one which allows multiple shared locks and this prevents the deadlock. A Scheduler is already a thread-safe object and the mutex only protected the mutation of a pointer to it.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D19249490

fbshipit-source-id: 00e8934c6502328f34b78ea6ec004b7216665db1
2019-12-30 11:21:42 -08:00
Valentin Shergin b2d095d9b3 Fabric: Temporary workaround for a deadlock in RCTSurfacePresenter
Summary:
This fix should stop T59424871 from bleeding. This is just an ugly workaround, I need some time to figure out a proper solution for that.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D19244682

fbshipit-source-id: 53d19e90e080d6c3816c78869826ed2ec0c982eb
2019-12-28 08:58:03 -08:00
Valentin Shergin 23d2a6248c Fabric: Fixed crash in RCTSurfaceTouchHandler (`unordered_set::at()`)
Summary:
It's not fully clear why it happens but sometimes UIKit cancels (calling some UIGersureRecognizer interface) some UITouch events that seem never previously started. That might be a bug in UIKit or in our local registry.
That happens extremely rarely but happens.
After this change, RCTSurfaceTouchHandler will ignore those touches in production but crash in debug mode (I hope we can find a repro case and fix it).

Anyway, ignoring canceling of touches that RCTSurfaceTouchHandler is not aware of should not be a big deal.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: mdvacca

Differential Revision: D19221204

fbshipit-source-id: 77ce773f7bcc31725bf90a182a91789fd5deeedb
2019-12-23 16:55:53 -08:00
Valentin Shergin 2c09f65f63 Fabric: Codestyle for RCTSurfaceTouchHandler
Summary:
Trivial. I need this to make the next diff readable.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: mdvacca

Differential Revision: D19221205

fbshipit-source-id: 0f8b608866ea974272901b2b2e208e9cd88c8e0a
2019-12-23 16:55:53 -08:00
Peter Argany 2c40cc714c Make RCTEventEmitter a RCTJSInvokerModule [2/n]
Summary:
Diff 1/N explained how calls to `[_bridge enqueueJSCall:]` can be replaced with `_invokeJS` in a bridgeless world.

This diff replaces RCTEventEmitter's usage of `enqueueJSCall` if the bridge isn't available.

Changelog: [Internal][iOS] Make RCTEventEmitter a RCTJSInvokerModule

Reviewed By: RSNara

Differential Revision: D18941955

fbshipit-source-id: 1b81e46585432e005cff5aa0ab4d151f50ea051b
2019-12-23 13:52:03 -08:00
Peter Argany f0d0c1c688 Introducing RCTJSInvokerModule [1/N]
Summary:
Problem: Certain turbo modules use the bridge to access JS directly by calling something like `[_bridge enqueueJSCall:]`. In a bridgeless world, this API no longer works.

Solution: These turbo modules can implement the new protocol defined here. This protocol provides a block during module init which can be used to call JS directly (using `ReactContext`) instead of going through the bridge.

Changelog: [Internal][iOS] - Introducing RCTJSInvokerModule, a new protocol for turbo modules which call js

Reviewed By: RSNara

Differential Revision: D18941933

fbshipit-source-id: 8d581df06be59debf83575124e7d221145c5afb8
2019-12-23 13:52:03 -08:00
Valentin Shergin 2237ea6d2e Fabric: Fixed crash in RCTGenericDelegateSplitter (collection was mutated while being enumerated)
Summary:
The concept of the class cannot guarantee that the set of delegates cannot be removed as a side-effect of calling a delegate, so we must make a copy of the delegates before calling on them.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D19213549

fbshipit-source-id: 7040b2994433d83e3148ec73820e051729be9e29
2019-12-23 07:46:27 -08:00
Zack Argyle fa65b156d4 Add RCTOverrideAppearancePreference to iOS Appearance module
Summary:
In order to enable more fine-grained control of theming in brownfield apps, this adds RCTOverrideAppearancePreference to RCTAppearance.

## Changelog:
[iOS] [Added] - Adds RCTOverrideAppearancePreference to the iOS Appearance module

Reviewed By: sammy-SC

Differential Revision: D19187657

fbshipit-source-id: 52783c497d32d36af2523fce6f040d6cfb5aac3c
2019-12-20 11:20:48 -08:00
Emilio 7a4753d76a tapping on iOS status bar should scroll inverted ScrollViews to their top (#27574)
Summary:
React Native ScrollViews are flipped upside down when the prop inverted is set to true. This is the root of a bug: tapping on the status bar in iOS should scroll the Flatlist up to the top but currently it does to the bottom.

The solution proposed is to detect natively if the ScrollView is inverted, on such case, prevent it from scrolling it to the beginning of the ScrollView (as a non-inverted ScrollView would do) and force a scroll to the end of it.

I've been careful enough not to force the scroll if the user explicitly selected not to do it or if it's happening in a nested ScrollView, as it is the default behaviour in iOS.

Fixes https://github.com/facebook/react-native/issues/21126

## Changelog

[iOS] [Fixed] - Inverted ScrollViews scroll to their bottom when the status bar is pressed
Pull Request resolved: https://github.com/facebook/react-native/pull/27574

Test Plan:
- on iOS, add a ScrollView and put enough content to overflow the screen size so it can be scrolled
- add the prop `inverted={true}` to the ScrollView
- go to the screen the Scrollview is in and press the status bar
- it should scroll to top (previously it scrolled to the bottom)

![v](https://user-images.githubusercontent.com/807710/71188640-a0ac6680-2281-11ea-91a7-d1e46aba8b14.gif)

Differential Revision: D19185270

Pulled By: hramos

fbshipit-source-id: 5445093ff38f4ba4082f1d883d8ed087e9565eaf
2019-12-19 15:29:54 -08:00
Samuel Susla 5fc3b442ec Migrate Image to Plugins
Summary: Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D19088558

fbshipit-source-id: 10dfcef8d2a244318ded4d55b4e4805663d8139e
2019-12-19 07:35:38 -08:00
Samuel Susla e33b276084 Component views are now loaded through C function rather than delegate
Summary:
I moved towards C function to return component class instead of delegate.

We need this in order to register components that are optimistically registered, such as View, Image and Text.

In D19088558, we need this in order to register Image.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D19088559

fbshipit-source-id: 061f3ba15dfb44b9acce7be2dc6828b9afbecbfa
2019-12-19 07:35:37 -08:00
Valentin Shergin c89ead313c Fabric: Proper implementation of ScrollView::contentOffset-aware measure functions (iOS only for now)
Summary:
This diff re-enables propagation of ScrollView's content-offset value down to the ShadowTree layer and enables measure fucntions opt-in incorporating this info to result.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: zackargyle

Differential Revision: D18981891

fbshipit-source-id: a6c0f4e690703b0ee07d45efab161750cfcc4b60
2019-12-18 10:48:40 -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
zhongwuzw 948cbfdacc Add autorelease pool for each run loop for JS Thread (#27395)
Summary:
Fixes https://github.com/facebook/react-native/issues/27327 , we need to create autorelease pool for each run loop in secondary thread, otherwise application may have memory issues. More details can refer to [CreatingThreads](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/Multithreading/CreatingThreads/CreatingThreads.html)
![image](https://user-images.githubusercontent.com/5061845/70033738-05fa2980-15eb-11ea-9adb-f01bee937766.png)

## Changelog

[iOS] [Fixed] - Add autorelease pool for each run loop for JS Thread
Pull Request resolved: https://github.com/facebook/react-native/pull/27395

Test Plan: Example can be found in https://github.com/facebook/react-native/issues/27327. No memory spikes any more.

Reviewed By: PeteTheHeat

Differential Revision: D19132504

Pulled By: fkgozali

fbshipit-source-id: d1747f27d36e9a7934966b34aa46d344e06193b3
2019-12-16 23:31:38 -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 6ceef13a9c iOS Logbox: always return a turbomodule instance
Summary:
We have assertion to ensure that `getTurboModuleWithJsInvoker:` returns non-nullptr, so conditionally returning `nullptr` is not going to work.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D19103125

fbshipit-source-id: 663850c01e4db40cca96d254950ea5a7bf6b96b7
2019-12-16 15:04:27 -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
Valentin Shergin 294cf84469 Fabric: Debouncing `insets` value in SafeAreaView
Summary:
iOS/UIKit prop `safeAreaInsets` sometimes produces values (and calls `safeAreaInsetsDidChange`) that practically the same but differ just enough to make operator `==` return `false`. That causes an indefinite state update loop and dizzying of the interface.

We do the same in Paper component as well.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: JoshuaGross

Differential Revision: D18964089

fbshipit-source-id: 4c714d2554fdee0f6e999921f69b95676080b8fa
2019-12-12 12:53:13 -08:00