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

16817 Коммитов

Автор SHA1 Сообщение Дата
Christoph Nakazawa 5a30c2a205 Move NetInfo JS module to FB internal
Summary: This removes the NetInfo import from RN and moves it to FB internal. Follow-up diffs will move the Android and iOS files as well.

Reviewed By: rubennorte

Differential Revision: D15392486

fbshipit-source-id: b868b671b8d91661bc7634b4662074ae953835be
2019-05-20 02:15:10 -07:00
Uilque Messias 2ad3bb2e2d fix(android): Normalize start and end args (#24938)
Summary:
Fixes #18579

Normalize `start` and `end` arguments when `onSelectionChange` is
dispatched on Android.

It just applies a [fix](https://github.com/facebook/react-native/issues/18579#issuecomment-474466525) sent by TheSavior (Thanks, by the way 😄)

## Changelog

[Android] [Fixed] - fix(android): Normalize start and end args
Pull Request resolved: https://github.com/facebook/react-native/pull/24938

Differential Revision: D15412005

Pulled By: cpojer

fbshipit-source-id: bb132313cfb8877a682f3865a5f9e48d45ac20ac
2019-05-20 01:45:51 -07:00
Samuel Susla d4ff5ed258 Don't return empty string for `accessibilityLabel` for RCTView
Summary:
In case `RCTView` had no subviews, `RCTRecursiveAccessibilityLabel` was returning an empty string rather than nil.

I've noticed that https://fburl.com/i95iynxi returns empty string as well. Shall we change it there as well?

Reviewed By: shergin

Differential Revision: D15337865

fbshipit-source-id: 8e38a88321f3dcfdf35a38d43fdbe4f5118796f1
2019-05-20 01:40:52 -07:00
thib92 4a5d0bdbd7 Resolve Promise to YES for Linking.openURL (#24955)
Summary:
The `Linking.openURL()` method is supposed to resolve to a `true` `Promise` when the URL was properly open. However, in iOS, the `Promise` was resolving to `nil`. So I fixed this issue by making it resolve to `YES` (`true`), just like on Android.

## Changelog

[iOS] [Fixed] - Fix return value of `Linking.openURL()`
Pull Request resolved: https://github.com/facebook/react-native/pull/24955

Differential Revision: D15411994

Pulled By: cpojer

fbshipit-source-id: 90bdd6cfae8d69d7a239a0b4c84d75859e293b32
2019-05-20 01:32:53 -07:00
Sharon Gong 14b4668947 Extended Accessibility Actions Support (#24695)
Summary:
This is a reconstitution of #24190. It extends accessibility actions to include both a name and user facing label. These extensions support both standard and custom actions.

We've also added actions support on Android, and added examples to RNTester showing how both standard and custom accessibility actions are used.

## Changelog

[general] [changed] - Enhanced accessibility actions support
Pull Request resolved: https://github.com/facebook/react-native/pull/24695

Differential Revision: D15391408

Pulled By: cpojer

fbshipit-source-id: 5ed48004d46d9887da53baea7fdcd0e7e15c5739
2019-05-20 01:32:53 -07:00
Janic Duplessis 933e65e245 Add default scrollEventThrottle to Animated{FlatList, SectionList} (#24954)
Summary:
`scrollEventThrottle` is often a source of confusion, especially when using native animated since users expect that it doesn't affect `Animated.event` but it does. We added a default prop to Animated.ScrollView but not to `Animated.FlatList` and `Animated.SectionList` so this adds it for those.

## Changelog

[JavaScript] [Added] - Add default scrollEventThrottle to Animated{FlatList, SectionList}
Pull Request resolved: https://github.com/facebook/react-native/pull/24954

Differential Revision: D15411998

Pulled By: cpojer

fbshipit-source-id: 41589a96c0a8b75ae7cf3169ccef363ac5140ad3
2019-05-20 01:19:21 -07:00
Jean Regisser 0ac2171c54 Fixed code and reason arguments ignored when closing a WebSocket on iOS (#24950)
Summary:
While working on https://github.com/facebook/react-native/pull/24893 I noticed the `WebSocket` module implementation on iOS was ignoring the code and reason arguments for the `close` method.
The Android implementation already handled those arguments properly.
So this PR brings iOS implementation on par with Android for the `WebSocket` module.

## Changelog

[iOS] [Fixed] - Fixed `code` and `reason` arguments ignored on iOS when calling `WebSocket.close`
Pull Request resolved: https://github.com/facebook/react-native/pull/24950

Differential Revision: D15411922

Pulled By: cpojer

fbshipit-source-id: f8a25598bd9c727313e24fea3801d5884d0723e4
2019-05-20 01:09:39 -07:00
Lucas Bento 4ea6204111 Do not run packager in Release mode (#24929)
Summary:
This PR fixes a regression introduced on [3273d23](3273d23a26 (diff-883359f85083d00b7266ec2acebcca9f)) that removed #23938.

It also adds the check for `React` and `React-tvOS` targets.

## Changelog

[IOS] [FIXED] - Do not run packager in Release mode
Pull Request resolved: https://github.com/facebook/react-native/pull/24929

Differential Revision: D15391692

Pulled By: cpojer

fbshipit-source-id: c2e524108be3bf1e45b0d0ff7cddd9785b51a60f
2019-05-20 00:58:23 -07:00
Sidharth Guglani fb8a7c3cc5 mutex lock while accessing event subscribers vector for thread safety
Summary: Using Mutex lock_guard mechanism when writing to subscribers and when accessing them in publish to make a copy

Reviewed By: davidaurelio

Differential Revision: D15391679

fbshipit-source-id: 16713ff28ce1762a5ca4c48c152897a92417e80b
2019-05-19 23:32:38 -07:00
Valentin Shergin f02feb8d38 Fabric: Codegen for PullToRefresh component
Summary:
Straightforward.
Rick, I rename some stuff, I hope you are cool with that.

Reviewed By: mdvacca

Differential Revision: D15403306

fbshipit-source-id: 1dbd34060052a9bd39ed4211010f14b76fffcde6
2019-05-19 17:44:40 -07:00
Valentin Shergin e8b2145263 Fabric: Standard PullToRefresh component
Summary: This is implementation of standard PullToRefresh component that uses standard iOS component and modern integration approach.

Reviewed By: mdvacca

Differential Revision: D15403308

fbshipit-source-id: 5c877f7c18af9f5ac40e15a4ba44118614ba80bc
2019-05-19 17:44:40 -07:00
Valentin Shergin de47b47b7c Fabric: findScrollViewComponentViewForView was moved to RCTScrollViewComponentView
Summary: This way we can reuse this code in other RCTScrollViewComponentView-satellite components, especially in standard pull-to-refresh component.

Reviewed By: mdvacca

Differential Revision: D15403307

fbshipit-source-id: 5999f851f22db0f358887e1a86d610e163adcb1d
2019-05-19 17:44:40 -07:00
Kyle Fang 5d3d3987d8 - fix crash on performance logger (#24821)
Summary:
Fix Issue https://github.com/facebook/react-native/issues/24820

It's caused by `_labelsForTags` and `RCTPLTag` being out of sync, the crash might only be one of the issues that this bug was causing.

## Changelog

[iOS] [Fixed] - fix crash on performance logger
Pull Request resolved: https://github.com/facebook/react-native/pull/24821

Differential Revision: D15407291

Pulled By: PeteTheHeat

fbshipit-source-id: c8d2a047fceb9cec981c48fe5181d1b4cbf0976c
2019-05-18 08:36:15 -07:00
Valentin Shergin 64db98febf Fabric: Improvements in RCTScrollViewComponentView
Summary:
This diff contains two changes:
* The actual UIScrollView is now mounted inside the component as `contentView` which mostly means that border-props will properly affect the layout of the scroll view (the scroll view will be laid out inside borders, not on top of those). And that also simplifies the code.
* Now the component view exposes the actual scroll view, its delegate splitter, and the container view defining a single interface for all possible integration that can be done with the Scroll View Component.

Reviewed By: mdvacca

Differential Revision: D15397283

fbshipit-source-id: 35e860b8bf55fbd4d0a5f4116f79e4507df79098
2019-05-17 20:04:15 -07:00
Valentin Shergin a982decb84 Fabric: Stopping messing with `clipToBounds` in RCTViewComponentView
Summary:
There was a reason why it exists: on iOS if you want to implement a view with rounded corners with a non-transparent background you need to set `clipToBounds = YES` to enabling clipping because besides drawing borders we need to clip the background otherwise it will "stick out".
There were a bunch of problems with this implementation and approach:
* It's overshooting. It applies `clipToBounds` no matter which border-radius is and no matter is there a background or not. So, it's kinda heuristic implementation and it's totally unexpected behavior sometimes.
* The previous problems can lead to performance problems as well (clipping requires additional work to do for CoreGraphics/GPU).
* The border-radius that we assigned to contentView is incorrect because it does not take border-width into account.
* This functionality only applies to non-null `contentView` which is a rear and custom case in which that can always be done manually for components that require that for some reason.

Reviewed By: mdvacca

Differential Revision: D15397282

fbshipit-source-id: 1599882ca8e591a9c4edb4d2b845bbf3d147bfce
2019-05-17 20:04:14 -07:00
Joshua Gross b0d1f9ac10 ReadableNativeMap: `importKeys` shouldn't choke on null `map_`
Summary: Make sure that `importKeys` doesn't choke on null `map_`, since ReadableNativeMap can have a null backing `map_`.

Reviewed By: mdvacca

Differential Revision: D15360094

fbshipit-source-id: b507bdd93c247153aa34e4f62ac6f93349c1faf5
2019-05-17 18:04:16 -07:00
Rubén Norte edb07c1f64 Fallback to empty object when native module constants are not defined
Summary: Force `getConstants` in native modules to return an empty object when they're not defined in their native implementations.

Reviewed By: fkgozali

Differential Revision: D15393585

fbshipit-source-id: cdda9df0d0f0a98ba226340d3cee67fec63e106c
2019-05-17 10:04:49 -07:00
Orta Therox ad4a5d9a3e Improves the copy for the new app screen (#24918)
Summary:
1. Consistency with full stops  (you can see screenshots in https://github.com/facebook/react-native/pull/24783 )
2. Improvements to the wording, describing what you're going to see

## Changelog

[Internal] [Fixed] - Improves the copy for the new app screen
Pull Request resolved: https://github.com/facebook/react-native/pull/24918

Differential Revision: D15391421

Pulled By: cpojer

fbshipit-source-id: 2ec6d2d5bd4845c5f4c699838ae865ab4217e49e
2019-05-17 03:49:21 -07:00
luancurti bb060d6cf8 Fix DatePickerAndroid with mode spinner on Android Nougat(7.0) (#24739)
Summary:
When mode is spinner in Android Nougat the DatePicker shows calendar

I got it from https://gist.github.com/jeffdgr8/6bc5f990bf0c13a7334ce385d482af9f and
did some adjustments in order to work with `DatePicker`. Workaround for this bug: https://code.google.com/p/android/issues/detail?id=222208. In Android 7.0 Nougat, spinner mode for the DatePicker in DatePickerDialog is incorrectly displayed as calendar.

## Changelog

[Android][Fixed] Fix date picker with mode spinner on Android Nougat (7.0)
Pull Request resolved: https://github.com/facebook/react-native/pull/24739

Differential Revision: D15391354

Pulled By: cpojer

fbshipit-source-id: 09f45367250aa14857a9c68846c7f2ce7c49ee3b
2019-05-17 02:54:12 -07:00
Eric Lewis cf9babf082 Remove hacks from RNTester (#24924)
Summary:
Removes the hacks we had in place to help Fabric run in RNTester. Runs fine without them now, so let's remove em!

## Changelog

[Internal] [Removed] - RNTester Fabric hax
Pull Request resolved: https://github.com/facebook/react-native/pull/24924

Differential Revision: D15391418

Pulled By: cpojer

fbshipit-source-id: d800f4c2f68f5e68a20a03c65fdf0317072d2c5e
2019-05-17 02:32:41 -07:00
Oleg Lokhvitsky 7abfd23b90 Fix error in Animated Interpolation when inputMin === inputMax
Summary:
This is already handled cleanly on the JS side of things in AnimatedInterpolation.js: 0ee5f68929/Libraries/Animated/src/nodes/AnimatedInterpolation.js (L133-L142)

However, the native driver interpolation will try to divide by 0, produce NaN and then crash. This change just copies the logic from the JS version of the interpolation logic and adds it to the Java version.

Note that this bug only reproduces on Android Q. It seems that RenderNode::setCameraDistance now crashes when receiving NaN on Android Q.

Reviewed By: sahrens

Differential Revision: D15380844

fbshipit-source-id: cfa82d8f58574e1040a851aaa5b5af1e23c9daa8
2019-05-16 18:15:11 -07:00
Eric Lewis d9930897a8 Add spec for AppState (#24880)
Summary:
part of #24875.

## Changelog

[General] [Added] - Add TM spec for AppState
Pull Request resolved: https://github.com/facebook/react-native/pull/24880

Differential Revision: D15379482

Pulled By: fkgozali

fbshipit-source-id: a76a145a77388cd2ba5cb97d17570162b38f1089
2019-05-16 16:53:39 -07:00
Eric Lewis 06bb76abd9 Update PR template changelog link (#24919)
Summary:
fix #24917.

## Changelog

[Internal] [Changed] - Update PR template changelog link
Pull Request resolved: https://github.com/facebook/react-native/pull/24919

Differential Revision: D15385773

Pulled By: hramos

fbshipit-source-id: 81a220efc3999942bd41ddf7cbd3107a755cfebd
2019-05-16 16:45:21 -07:00
George Zahariev f050f99e56 Codemod $Enum<...> to $Keys<...> in xplat/fbcode
Summary:
In D15367312, I deprecate `$Enum<...>` in favour of `$Keys<...>` (the functionality is identical). Codemod existing usages in xplat and fbcode.

bypass-lint

Reviewed By: samwgoldman

Differential Revision: D15378084

fbshipit-source-id: 251c6b9ac07cb50139a8f03e3a45a5fac0d91812
2019-05-16 14:20:29 -07:00
David Vacca 016afe26bc Adding @Nullable into Fabric UI Manager
Summary: cleanup diff to add Nullable annotations into Fabric UI Manager classes

Reviewed By: shergin

Differential Revision: D15365295

fbshipit-source-id: b9d39addd5b71377389a7687ea3176cd4359c5ba
2019-05-16 13:00:25 -07:00
Eric Lewis 99899d008f Add spec for Linking (#24877)
Summary:
Part of #24875, adds a spec for linking.

## Changelog

[General] [Added] - TM Spec for Linking
Pull Request resolved: https://github.com/facebook/react-native/pull/24877

Differential Revision: D15374328

Pulled By: fkgozali

fbshipit-source-id: 4b86a75d58d275c0ddc864b4f3f1ec489b0b408b
2019-05-16 12:31:35 -07:00
David Aurelio c3c3c3c655 `YGNode`: one byte of private storage
Summary:
Adds one byte of private storage to `YGNode`, intended to be used by Yoga itself.

This is in previously unused alignment space, and won’t cause more memory to be allocated.

Reviewed By: SidharthGuglani

Differential Revision: D15296732

fbshipit-source-id: 3caf0a3cd506e4e324e51c31869c69be5781d476
2019-05-16 11:47:58 -07:00
David Aurelio ec82e05e9a Fix style property bits
Summary: Style bits had overlap, because `dimensionBit` was set with an incorrect increment.

Reviewed By: SidharthGuglani

Differential Revision: D15335134

fbshipit-source-id: 370e1a73547d76b0e26bc6ab67acb96d33ddf180
2019-05-16 11:47:58 -07:00
Alexey Lang 1ece46b42c Use array map from android support library
Summary: `android.util.ArrayMap` ins't available on API < 19. Let's use the one that Android Support Library (aka AndroidX) provides.

Reviewed By: mdvacca

Differential Revision: D15372704

fbshipit-source-id: 5c2ea3c7ea7368bb75ff22c54af0b258558556b5
2019-05-16 11:02:58 -07:00
Rick Hanlon 5a905a5e16 Add android specific view config props
Summary: This diff adds the android specific View view config props that I missed in an earlier diff in this stack

Reviewed By: cpojer

Differential Revision: D15336076

fbshipit-source-id: 6d20462b2682e3ea80b0ffc95ef35aa7618d4cf2
2019-05-16 10:51:07 -07:00
Rick Hanlon 7927437a6d Switch Slider onSlidingComplete event to a non-bubbling event on iOS to match Android
Summary:
## Overview

This diff switches the RCTSlider onSlidingComplete event on iOS from a bubbling event to a direct (non-bubbling) event to match the non-bubbling type on android.

Note that in this case these seems like a bug. I will still explain the motivation and reasoning as this will come up in future diffs.

## Changelog
[Slider][BREAKING] Switch Slider onSlidingComplete event to a non-bubbling event on iOS to match Android

## Motivation:

The motivation here is that when we codgen the view configs, we'll need to unify all of the events and props across platforms for components that have the same name on iOS and Android.

In this case, the view configs (below) conflict for onSlidingComplete. On iOS this is under bubblingEventTypes, on Android this is under directEventTypes. We have code [here](https://fburl.com/3s1dahm2) in the react native renderer which ensures an event is not listed as both.

```
// iOS
const SliderViewConfig = {
  bubblingEventTypes: {
    onSlidingComplete: {
      phasedRegistrationNames: {
        captured: 'onChangeCapture',
        bubbled: 'onChange'
      }
    }
  },

  directEventTypes: {
    // None
  },

  validAttributes: {
    // ...
  }
};
```
```
// Android
const SliderViewConfig = {
  bubblingEventTypes: {
    // None
  },

  directEventTypes: {
    onSlidingComplete: {
      registrationName: 'onEventDirect'
    }
  },

  validAttributes: {
    // ...
  }
};
```

## Solutions
There are three solutions to this issue:
1. Don't generate view configs
2. Rename the component on one platform
3. Make a breaking change in the event behavior on one platform to make it consistent across both platforms

Here we've chosen option #3

Reviewed By: TheSavior

Differential Revision: D15322304

fbshipit-source-id: ff1ab86efe9e2bc50fd3f7619e6760ab5c1c5090
2019-05-16 10:51:07 -07:00
Rick Hanlon fb41a836be Only generate supported schemas
Summary: We're going to be incrementally adding these view configs and enforcing that they're up to date in react-native-sanity-test so we need to limit them to what's supported (which is just Slider for now)

Reviewed By: TheSavior

Differential Revision: D15321950

fbshipit-source-id: 22b014db1d9b58553237f571b438c82948f19634
2019-05-16 10:51:07 -07:00
Rick Hanlon ed61a3b5f9 Handle component name
Summary:
In order to generate the view configs, we need to know the name of the component used in:

```
ReactNativeViewConfigRegistry.register(
  'RCTNativeComponent',  // <------- this name
  () => BooleanPropNativeComponentViewConfig,
);
```

For this, we'll use `component.name` in the schema (see fixture updates). Doing this would break the native code we generate though, since that code has the RCT stripped.

So this diff adds support to mirror the native stripping of 'RCT' for generated native code

Reviewed By: TheSavior

Differential Revision: D15320422

fbshipit-source-id: be1ab9964078df2c7bc6e41462776f00b94b104f
2019-05-16 10:51:06 -07:00
Rick Hanlon 382846aefd Add viewconfig verification
Summary: This diff adds a line to the codegen'd view configs which will check that all of the properties in the native view config are also in the JS view config we generate (note that the JS view config may have more properties than one native platform because it includes a union of both platforms)

Reviewed By: TheSavior

Differential Revision: D15278478

fbshipit-source-id: 0fef20c12265b952c69aca4e4c070a7d036db05a
2019-05-16 10:51:06 -07:00
Rick Hanlon 1aca74586f Update view configs handle view props/events
Summary:
This diff adds support for spreading view props into the generated viewconfig (currently hardcoded the view viewconfig but soon that will also be generated)

Results in a generated view config such as:

```
const ReactNativeViewConfig = require('ReactNativeViewConfig');
const ReactNativeViewConfigRegistry = require('ReactNativeViewConfigRegistry');

const BooleanPropNativeComponentViewConfig = {
  uiViewClassName: 'BooleanPropNativeComponent',
  Commands: {},

  bubblingEventTypes: {
    ...ReactNativeViewConfig.bubblingEventTypes
  },

  directEventTypes: {
    ...ReactNativeViewConfig.directEventTypes
  },

  validAttributes: {
    ...ReactNativeViewConfig.validAttributes,
    disabled: true
  }
};

ReactNativeViewConfigRegistry.register(
  'BooleanPropNativeComponent',
  () => BooleanPropNativeComponentViewConfig,
);

module.exports = 'BooleanPropNativeComponent';
```

Reviewed By: TheSavior

Differential Revision: D15258778

fbshipit-source-id: 2c70d20dc366f32a8114d42e0e15b5f1e359d11f
2019-05-16 10:51:06 -07:00
Rick Hanlon 3e1e661d2a Update generated differs
Summary: This diff inserts the differs for color/image/point inline into the generated viewconfigs

Reviewed By: TheSavior

Differential Revision: D15258752

fbshipit-source-id: 0e93dc6abc186851b411dfd6864d5b4ca005885b
2019-05-16 10:51:06 -07:00
Rick Hanlon c9d9f8cc2a Add js1 build viewconfigs
Summary:
This diff adds a new `js1` script `js1 build viewconfigs` which will generate the view configs for generated components in xplat/js

Note that the view configs are not currently valid so I'm not checking them in or adding them to a test, that work will follow

Reviewed By: TheSavior

Differential Revision: D15239656

fbshipit-source-id: d15776f36a7d7684f50beafd783bccb02352afc0
2019-05-16 10:51:05 -07:00
Michał Pierzchała 0815f811df - update CLI to alpha.20 to fix Android tests (#24869)
Summary:
PR https://github.com/facebook/react-native/pull/24843 broke Android tests because of a regression we introduced in terms of passing `reporter` argument to Metro config. This was fixed in latest `alpha.20` release of CLI

## Changelog

[General] [Fix] - update CLI to alpha.20 to fix Android tests
Pull Request resolved: https://github.com/facebook/react-native/pull/24869

Reviewed By: rickhanlonii

Differential Revision: D15355144

Pulled By: cpojer

fbshipit-source-id: faafd8098c708845264b7164557076bce45ea332
2019-05-16 06:11:15 -07:00
zhongwuzw 5954880875 Fixes syntax of autolink script (#24882)
Summary:
Oops, fixes syntax of autolink script landed in https://github.com/facebook/react-native/pull/24867.

## Changelog

[iOS] [Fixed] - Fixes syntax of autolink script
Pull Request resolved: https://github.com/facebook/react-native/pull/24882

Differential Revision: D15371272

Pulled By: cpojer

fbshipit-source-id: 8538be040b8b116b9651dc26749ab8febad0fe7c
2019-05-16 02:48:44 -07:00
Eric Lewis 90040290ef Add Fabric/Turbo Modules flags to iOS autolinking script (#24867)
Summary:
This makes it easier to enable fabric / turbo modules with the new fancy autolinking script.

## Changelog

[iOS] [Added] - Add Fabric/Turbo Module flags to iOS autolinking script
Pull Request resolved: https://github.com/facebook/react-native/pull/24867

Differential Revision: D15368550

Pulled By: fkgozali

fbshipit-source-id: 366cd9fb8b630011f9287ae762b985e4778de423
2019-05-15 22:30:41 -07:00
zhongwuzw a352ecfabd TM iOS: Remove retainArguments && do retain by us explicitly (#24849)
Summary:
This is a TODO, we met crash if we don't call `retainArguments` when return type is like `NSDictionary`, the reason is `getReturnValue` don't retain the return value, so we need to using `__bridge` to transfer ownership to OC type.
Also add `resolveBlock` and `rejectBlock` to `retainedObjectsForInvocation`.

cc. cpojer

## Changelog

[iOS] [Fixed] - Remove retainArguments && do retain by us explicitly
Pull Request resolved: https://github.com/facebook/react-native/pull/24849

Differential Revision: D15369209

Pulled By: fkgozali

fbshipit-source-id: 8431d03705d8476f38c8b5d29630489a545d373a
2019-05-15 21:50:40 -07:00
Kevin Gozali 8662d9d3b0 TM iOS: Added backward-compatible ObjC invalidation logic
Summary:
Some ObjC NativeModules conform to `RCTInvalidating` protocol and implements `invalidate` method. This is typically used to clean things up during bridge teardown or reload. In TurboModule system the invalidate method can be replaced by pure destructors, but for backward compatibility, we call existing invalidate method on each module during teardown.

This also cleans up all existing LongLivedObject's.

Reviewed By: mdvacca, RSNara

Differential Revision: D15365655

fbshipit-source-id: 802844b39b5b7adb54970ea541f4d744bbf9e480
2019-05-15 17:36:05 -07:00
RCiesielczuk cd2f8c567b Introduce TurboModule Setup Metric (#24732)
Summary:
With the introduction of TurboModules, it would be beneficial to measure the setup time of these modules, as we currently have it in place for NativeModules.

The instantiation of the TMs occurs in the `RCTTurboModuleManager`. In order to successfully measure the time it took to setup the module, we need to ensure that we don't take into account cached modules. As such, we need to:

1. Check if module is in `_turboModuleCache`
  a. Start mark for `RCTPLTurboModuleSetup` tag if not found
2. Get the TM via `[self provideTurboModule:]`
3. Check if module is in `_turboModuleCache`
   a. Stop mark for `RCTPLTurboModuleSetup` if we did not find module in cache prior to **step 2** and if it's now present in the cache.
   b. Notify about setup time if the above is true.
4. Return TM

## Changelog

[iOS] [Added] - Gain insights on the the turbo module setup times by observing `RCTDidSetupModuleNotification`. The userInfo dictionary will contain the module name and setup time in milliseconds. These values can be extracted via `RCTDidSetupModuleNotificationModuleNameKey` and `RCTDidSetupModuleNotificationSetupTimeKey`.
Pull Request resolved: https://github.com/facebook/react-native/pull/24732

Differential Revision: D15362088

Pulled By: RSNara

fbshipit-source-id: e6a8044e4aba5a12ae63e9c7dbf707a17ec00180
2019-05-15 15:28:10 -07:00
zhongwuzw 36f9a4aca7 TM iOS: Consolidate RCTDidInitializeModuleNotification sender to batchedBridge (#24866)
Summary:
Consolidate sender of notification to `batchedBridge` for TM and old module system, old module implementation can see dc893756b8/React/Base/RCTModuleData.mm (L191-L193).

## Changelog

[iOS] [Fixed] - Conlidate RCTDidInitializeModuleNotification sender to batchedBridge
Pull Request resolved: https://github.com/facebook/react-native/pull/24866

Differential Revision: D15357566

Pulled By: RSNara

fbshipit-source-id: 479575c1e9781d8aea9fa3aea9e0283d24df7e81
2019-05-15 12:31:30 -07:00
Valentin Shergin bcc1d999a8 Fabric: Introducing RNGenericDelegateSplitter
Summary: Future improvements in RCTScrollViewComponentView require ability to have multiple listeners of UIScrollViewDelegate (e.g. PullToRefresh component needs it), therefore we need a splitter to support it.

Reviewed By: JoshuaGross

Differential Revision: D15345301

fbshipit-source-id: 62bb50c4fdd4fa64ece5d7cc6ddc76367c84c4b3
2019-05-15 10:30:29 -07:00
Valentin Shergin 197c644f7a Fabric: Make measuring ScrollView::contentOffset-aware
Summary:
This is the final piece of change that makes measuring (`LayoutableShadowNode::getRelativeLayoutMetrics()`) take ScrollView content offset into account (on iOS).

It works pretty simply: at the end of scrolling (or zooming) action ScrollView updates the state which later can be used for computing `transform` which measuring uses to adjust values in LaoutMetrics.

Reviewed By: mdvacca

Differential Revision: D15323688

fbshipit-source-id: fdf86c6cd9bdfd56caddd4b39bdd1185760b9f94
2019-05-15 10:30:29 -07:00
Valentin Shergin cd231da27a Fabric: Migrate ScrollView from LocalData to State
Summary: Seems we need this now to enable future improvements in ScrollView such as correct measure, pull-to-refresh and so on.

Reviewed By: mdvacca

Differential Revision: D15323687

fbshipit-source-id: fae37431ccbbf2faec9c84752396153689b873ef
2019-05-15 10:30:29 -07:00
Valentin Shergin 4001ffb7ce Fabric: Refinements in State management infra
Summary: A couple of new methods in ConcreteShadowNode allows us to deal with State in more LocalData-like manner.

Reviewed By: mdvacca

Differential Revision: D15323686

fbshipit-source-id: ede4aa1f1d0ad6f876bd963e57a00a0ad470c1c0
2019-05-15 10:30:28 -07:00
Moti Zilberman 7ff3874ec0 Upgrade Metro packages to 0.54.1
Summary: Upgrades React Native's direct Metro dependencies to 0.54.1.

Reviewed By: amnn

Differential Revision: D15335292

fbshipit-source-id: b6787937c74a1ab6ad0f1793ba7beb38dc7fe999
2019-05-15 10:05:22 -07:00
Sidharth Guglani 37c8771bc6 use shared_ptr for subscribers vector in event system
Summary:
using shared_ptr for vector of subscribers
Further changes in commit stack support the mutiple subscribers in event system

Reviewed By: davidaurelio

Differential Revision: D15352512

fbshipit-source-id: fac7f4268abf9ca4277734aca2f21cd711eb7d6e
2019-05-15 09:02:16 -07:00