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

16348 Коммитов

Автор SHA1 Сообщение Дата
Kevin Gozali a43e666a34 TM iOS: force flush message queue when calling into JS from native
Summary: When calling into JS (e.g. promise resolve/reject, callback) in TurboModule, we bypass the bridge's message queue. At times this causes race condition, where there are a bunch of pending UI operations (in RCTUImanager) waiting to be flushed, but nothing adds calls to the message queue. Usually tapping the screen will trigger the flush because we're sending down touch events to JS.

Reviewed By: JoshuaGross

Differential Revision: D14656466

fbshipit-source-id: cb3a174e97542bf80f0a37b4170b6a8e6780fa35
2019-03-29 01:39:39 -07:00
Joshua Gross 1592acd4a9 Small changes to State objects to support Android
Summary: Small changes to State objects to support Android. See following diffs.

Reviewed By: mdvacca

Differential Revision: D14663470

fbshipit-source-id: 878f4dc39265991a7b8ff54ca80bdb862f1dd3de
2019-03-29 01:17:19 -07:00
David Vacca 5d0d50cc44 Fix scrolling of Android Horizontal Scroll View
Summary:
This diff fixes the scrolling of Android Horizontal Scroll View, the root cause was that Binding was mounting a ScrollView instead of an AndroidHorizontalScrollView component.
This will be automatically fixed when all the View components are autogenerated.

Reviewed By: shergin

Differential Revision: D14594622

fbshipit-source-id: 7c477ca167188ea9c473f61145461d3cf1696e17
2019-03-29 00:43:32 -07:00
David Vacca ed0085ca1b Refactor mapping of FabricComponentNames
Summary: Simple diff that refactors the usage of the sComponentNames to not require components to be part of the mapping when the name in JS is the same as the name in Native side.

Reviewed By: shergin

Differential Revision: D14594659

fbshipit-source-id: d1948b27e04686fefbf9b6e2b06d4f9317b97062
2019-03-29 00:43:31 -07:00
David Vacca 0c17992485 Add logs in mounting layer
Summary: Adds debug logging in FabricUIManager and the mounting layer of Fabric.

Reviewed By: shergin

Differential Revision: D14594521

fbshipit-source-id: a5c0ee39e1bac8a340849ca3e044694cbee5427e
2019-03-29 00:43:31 -07:00
David Vacca 58c16e63a4 Expose collapsable as React Prop in LayoutShadowNode
Summary: This diff exposes the collapsable prop as part of LayoutShadowNode, fixing the bug of the collapsable prop being filtered by JS in Fabric

Reviewed By: shergin

Differential Revision: D14594522

fbshipit-source-id: a892ba8228e76f11232acc6fe5c8d75e991d8fc6
2019-03-29 00:43:31 -07:00
Christoph Nakazawa 6345fcf12b Remove WebView from public RN interface
Summary:
This diff removes the `WebView` export from React Native. Internally, we are requiring `WebView` directly now and externally people will have to use the community maintained module. This diff does not yet move the WebView files from the repo, this will happen in a follow-up.

Note that I had to remove a test for Cookies that displayed data in a WebView. I don't think there is an easy way to retain this (debugging) information that likely very few people ever take a look at so I think it is fine.

Reviewed By: TheSavior

Differential Revision: D14613077

fbshipit-source-id: b1d412f970d09d7d70ecac2c23e62cfdd09d7c8e
2019-03-28 17:37:05 -07:00
Danny Yan c8b1e13630 Show full price instead of monthly price within the lead form
Summary: title

Differential Revision: D14634458

fbshipit-source-id: 60adbc117ba3ac3bff00f2b8ad8781e881e9e4b3
2019-03-28 16:07:19 -07:00
Kacper Wiszczuk ab1edae669 Add bin to package.json (#24187)
Summary:
Add `bin` field to `package.json`. It will be required for initializing `react-native` with `npx`:
```sh
npx react-native init ProjectName
```

[General] [Added] - Added bin to package.json

cc thymikee cpojer
Pull Request resolved: https://github.com/facebook/react-native/pull/24187

Differential Revision: D14672211

Pulled By: hramos

fbshipit-source-id: 9e8633213bba4b3f02d20b54391a04d0a1a19376
2019-03-28 14:20:48 -07:00
Gábor Siffel 81fcaa151d Add the ability to customize the http client in networking native module
Summary:
Add the ability to build on top of the OkHttpClient.Builder by defining a lambda that gets called on network requests

[Android][Added] - Public method `setCustomClientBuilder` to the native `com.facebook.react.modules.network.NetworkingModule`, that allows customizing the OkHttpClient per-request for greater control over HTTP requests.

Reviewed By: hramos

Differential Revision: D14288613

fbshipit-source-id: 34df0ff3e18eeea1d565ccfcf97408379900120b
2019-03-27 21:50:56 -07:00
zhongwuzw b312543d3c Ensure runtime established before created contextContainer (#24176)
Summary:
Ensure bridge finished initialize before we access runtime.
cc. shergin.

[iOS] [Fixed] - Ensure runtime established before created contextContainer
Pull Request resolved: https://github.com/facebook/react-native/pull/24176

Differential Revision: D14660690

Pulled By: shergin

fbshipit-source-id: 1d4237a0a344abf32d52243e46f92e346a63e3da
2019-03-27 20:55:21 -07:00
Christoph Nakazawa d5ae59ab2a Use standard version of Promise.prototype.finally
Summary: See https://github.com/facebook/fbjs/pull/293 for an explanation.

Reviewed By: yungsters

Differential Revision: D14658680

fbshipit-source-id: aad8808b8514817314bf67b9a43b01d52e850e36
2019-03-27 20:48:45 -07:00
Christoph Nakazawa 9ca7989f60 Remove SwipeableFlatList from RN
Summary: According to TheSavior this was an experimental module that "accidentally" got added to RN open source. In fact, we only use it in two places internally. This diff moves these files to FB internal and removes them from RN completely. I skipped the deprecation message because it was always an experimental feature and I don't expect anyone out there using it.

Reviewed By: TheSavior

Differential Revision: D14631749

fbshipit-source-id: 87878fcbb901e1e7fa4a3ff3205e09886ff3ed43
2019-03-27 16:30:09 -07:00
Sam Goldman 58335abd97 Remove deprecated-call-syntax lint setting
Summary:
This lint setting makes deprecated $call syntax a warning instead of an error,
which is the default. This feature has been deprecated since Flow v0.75.0, and
I'm working to finally remove it, which will also remove this lint setting.

Reviewed By: dsainati1

Differential Revision: D14650366

fbshipit-source-id: 779df61be88996278ea63355517c17ec721cea7f
2019-03-27 14:58:17 -07:00
Ioannis Kokkinidis f149426c83 Enforced thread safety on UIImplementation methods that mutate the shadowNodeRegistry (#20025)
Summary:
Fixes: #17178

[ANDROID] [Fixes] - UIImplementation: Now enforcing atomic mutation of the shadowNodeRegistry
Pull Request resolved: https://github.com/facebook/react-native/pull/20025

Differential Revision: D14652876

Pulled By: shergin

fbshipit-source-id: 7b20bad4cb43d3e6f09e2037e3c60a217a91d273
2019-03-27 14:43:12 -07:00
Dulmandakh 92f019c666 use TraceCompat (#23780)
Summary:
I was working to use more Android Support Library in RN core, but wasn't able to finish it. So this PR is for only Systrace and TraceCompat only.

[Android] [Changed] - Use TraceCompat in Systrace
Pull Request resolved: https://github.com/facebook/react-native/pull/23780

Differential Revision: D14423742

Pulled By: hramos

fbshipit-source-id: e3c3e2dfd95eac3d2484313f9be69df1c85904cf
2019-03-27 12:07:37 -07:00
michalchudziak c13f5d48cf Fix behaviour of Header, Footer and Empty List components in VirtualizedList when it's inverted (#24167)
Summary:
Fixes https://github.com/facebook/react-native/issues/23453
Fixes https://github.com/facebook/react-native/issues/21196

Basically, changes made in https://github.com/facebook/react-native/pull/21496 currently breaks behavior of `<VirtualizedList />`  and any components that are based on it (`<SectionList />, <FlatList />`). This PR solves both issues listed above.

Visual confirmation of the resolved issue:

**Vertical, not inverted, not empty**
![image](https://user-images.githubusercontent.com/7837457/55076839-b005d700-5096-11e9-91de-090934cb0129.png)

**Vertical, not inverted, empty**
![image](https://user-images.githubusercontent.com/7837457/55076971-fb1fea00-5096-11e9-8d73-5a2d86275da8.png)

**Vertical, inverted, not empty**
![image](https://user-images.githubusercontent.com/7837457/55077042-23a7e400-5097-11e9-911f-9dad4d48a578.png)

**Vertical, inverted, empty**
![image](https://user-images.githubusercontent.com/7837457/55079957-87351000-509d-11e9-8f1c-b7134f1f43f9.png)

**Horizontal, not inverted, not empty**
![image](https://user-images.githubusercontent.com/7837457/55077118-44703980-5097-11e9-94e9-e33d4af436ee.png)

**Horizontal, not inverted, empty**
![image](https://user-images.githubusercontent.com/7837457/55077150-52be5580-5097-11e9-9d43-7cb4e983167e.png)

**Horizontal, inverted, not empty**
![image](https://user-images.githubusercontent.com/7837457/55077183-623d9e80-5097-11e9-9e8a-1b2468c7b3a9.png)

**Horizontal, inverted, empty**
![image](https://user-images.githubusercontent.com/7837457/55080033-af247380-509d-11e9-90ae-1ff656d46dd1.png)

[General] [Fixed] - Fixed VirtualizedList, SectionList and FlatList behavior on rendering list headers with inverted prop and zero items
Pull Request resolved: https://github.com/facebook/react-native/pull/24167

Differential Revision: D14642345

Pulled By: cpojer

fbshipit-source-id: b530bbbd57f60e53a976ac5db272ea4b2d2b3e99
2019-03-27 12:02:41 -07:00
Janic Duplessis 41343f6a73 BREAKING - RCTEvent improvements, remove deprecated [sendInputEventWithName:body:] (#15894)
Summary:
This makes the RCTEvent protocol more generic to make it easier to use the event coalescing feature for type of events other than components. This does a few other improvements that will be useful in follow up PRs.

- Add `RCTComponentEvent` which is used instead of deprecated `[sendInputEventWithName:body:]` and remove that method completely (was only used at 2 places).
- Make `coalescingKey` optional for events that return NO from `canCoalesce`.
- Make `viewTag` optional for events that are not related to views.
- Fast path for events that return NO from `canCoalesce`.
- Add a missing test for event coalescing with different view tags.

Ended up making only one PR for all this since the changes are related and hard to separate.

**Migration**
Use a custom RCTEvent subclass with `[sendEvent:]` (preferred way to allow type safe events) or `RCTComponentEvent`.

**Test plan**
- Ran RCTEventDispatcher unit tests
- Tested manually in RNTester

Changelog:

[iOS] [Changed] - Remove deprecated RCTEvent method, sendInputEventWithName:body:
Pull Request resolved: https://github.com/facebook/react-native/pull/15894

Reviewed By: shergin

Differential Revision: D13726194

Pulled By: hramos

fbshipit-source-id: 11f63a99e08f46ec6b4f16f8d9949cdbf5c3fe13
2019-03-27 11:20:22 -07:00
zhongwuzw 456c03a37e Remove obliterated snapshots (#24162)
Summary:
Part of #23889 . To remove obliterated snapshots.
cc. cpojer .

[iOS] [Changed] - Remove obliterated snapshots
Pull Request resolved: https://github.com/facebook/react-native/pull/24162

Differential Revision: D14642318

Pulled By: cpojer

fbshipit-source-id: 5638d2104b529522363de3885e282851a51c497e
2019-03-27 08:29:57 -07:00
Alexander Vasyuk f330056420 Revert D14368107: [yoga] moved all the properties used for layout outputs to YogaNodeJNI
Differential Revision:
D14368107

Original commit changeset: 75ca330c1e7f

fbshipit-source-id: 9a9f5140bf8b1563c9ba85b3fe5f93fc6d8fdf41
2019-03-26 20:21:32 -07:00
Alexander Vasyuk ac22913121 Revert D14368114: [yoga] removing unused const int
Differential Revision:
D14368114

Original commit changeset: f63b978813a0

fbshipit-source-id: 86a517b1483b0635f283702602712c42c3d51e20
2019-03-26 20:21:32 -07:00
Christoph Nakazawa 95c7db90b8 Back out "[react-native][PR] Support Interpolation of strings when using native driver in Animated, fix Expected node to be marked as "native", optimize AnimatedNode creation and connections"
Summary: Original commit changeset: 82a948a95419

Reviewed By: TheSavior

Differential Revision: D14631845

fbshipit-source-id: f20d8150bccf50ea85388761e2f31ca4f97ae158
2019-03-26 17:13:11 -07:00
Ramanpreet Nara 58cd20459f Force JS null to be translated to ObjC nil
Summary:
In D14571128, we made it so that when a JS object's property was `undefined`, we wouldn't insert that property into the corresponding NSDictionary. Here are two important observations about that diff:
1. ALL JS `null`s were now being converted to `NSNull`, and JS `undefined`s were now being converted to `nil`.
2. If a JS object's property was explicitly `null`, then we'd insert `NSNull` into the corresponding dictionary.

Considering that when a property doesn't exist in a `NSDictionary`, property access returns `nil`, I've made it so that if a JS object's property is either `null` or `undefined`, then we simply do not insert it in the corresponding `NSDictionary`. Also, I've reverted #1 and made it so that `undefined` and `null` always map to the ObjC `nil`.

This shouldn't unfix the problem that D14571128 was trying to fix.

Here's my understanding of the problem that D14571128 was trying to fix (to make sure I'm not breaking something by this diff).

This method was invoked from JS.
```
RCT_EXPORT_METHOD(logEvents:(NSDictionary *)events)
{
  RCTAssert(events, @"You should provide events for logger");
  [[NSNotificationCenter defaultCenter] postNotificationName:@"FBReactPerfLoggerDidReceiveEventsNotification"
                                                      object:nil
                                                    userInfo:@{@"FBReactPerfLoggerUserInfoPerfEventsKey" : [events copy]}];
}
```

The above dispatch calls into this method, which appends `events` into `_pendingJSPerfEvents`.

```
- (void)reactPerfLoggerDidReceiveEvents:(NSNotification *)notification
{
  NSDictionary *events = notification.userInfo[@"FBReactPerfLoggerUserInfoPerfEventsKey"];
  if (events) {
    dispatch_async(_eventQueue, ^{
      if (self->_sessionData.perfLoggerFlagId != nil) {
        if ([self processJSPerfEvents:events]) {
          [self reportMetricsIfFinished];
        }
      } else {
        [self->_pendingJSPerfEvents addObject:events];
      }
    });
  }
}
```

Then, in `_processJSPerfEvents`, we do the following (link: https://fburl.com/tr4wr2a7):
```
NSNumber *actionId = events[@"actionId"];
if (actionId) {
  self->_sessionData.actionId = actionId;
}
```

So, if `undefined` or `null` was passed in as the `actionId` property of the `events` JS object in `FBReactPerformanceLogger logEvents:`, then we'd default the `NSDictionary` to have `NSNull` in the corresponding property. This is bad because we had this line in FBReactWildePerfLogger (link: https://fburl.com/2nsywl2n):  `actionId ? [actionId shortValue] : PerfLoggerActions.SUCCESS`. Essentially, this is the same problem that my diff is trying to fix.

Reviewed By: fkgozali

Differential Revision: D14625287

fbshipit-source-id: c701d4b6172484cee62494256175e8b205b23c73
2019-03-26 14:28:23 -07:00
Kyle Pinkham b1251d067a Implement data detection for android Text elements (#19216)
Summary:
We want the ability to use Linkify on android text elements. This only adds this property to Text and not TextInput since there are some functional differences with how the types could be used between iOS and android - iOS allows one or many types while Linkify restricted us to providing only one option (using the masks).

Performance is affected ONLY FOR TEXT ELEMENTS USING THIS FEATURE since Linkify is searching for patterns.
Pull Request resolved: https://github.com/facebook/react-native/pull/19216

Differential Revision: D14621883

Pulled By: cpojer

fbshipit-source-id: cb692021d314140b9a92b29e23384afd7fd1b09e
2019-03-26 12:31:30 -07:00
cojo 97c414ec8d Fire timers in the background via NSTimer (#23674)
Summary:
This PR is a follow-up to #21211 by request of hramos to incorporate some additional crash fixes / synchronization edge cases found in our production testing.  What follows is largely a copy of the original PR description from #21211 - see that PR for original discussion thread as well as context on why this replacement PR was needed.

This PR is a minimalistic change to RCTTiming that causes it to switch exclusively to NSTimer (i.e., the 'sleep timer') in order to continue triggering timers when the app has moved to the background.

Many people have expressed a desire for background timer support on iOS. (See #1282, #167, and #16493). In our app — a podcast/audio player — we use background timers to ensure that we never lose track of the user's playback position, should the app crash or be terminated by the OS.

The RCTTimer module uses a RN-managed CADisplayLink if the next requested timer is less than a second away; otherwise, it switches to an NSTimer (which is refers to as a 'sleep timer' in source). The RN-managed CADisplayLink is always disabled when the app goes to the background (and thus cannot be used); however, the NSTimer will still issue its callbacks in the background.

This PR adds a flag to track whether the app is in the background, and if so, all timers are routed through NSTimer until the app returns to the foreground. vishnevskiy at Discord opened a similar PR (#16493) that implements a drop-in for CADisplayLink which falls back to NSTimer, but I decided to incorporate the background-NSTimer logic directly into RCTTimer, since NSTimer is already in use.

It's worth noting that the background NSTimer may not fire as often as requested — it may give the appearance of lagging depending upon your app's priority in the background. For our audio app, NSTimer fires exactly on schedule if there's an open AVAudioSession and audio is playing; if audio is not playing, it fires about half as often as requested, which is still adequate for networking polling and other tasks.

It's worth noting that background timers only function as long as an app is actually running in the background. Apple offers a variety of Background Modes (which can be toggled in the Capabilities section of the target inspector in Xcode), and the app will need to be legitimately using one of these modes in order for this change to provide any value — otherwise it will be terminated within a couple of seconds of moving to the background.

The good thing about this change is that for apps that do perform essential computation in support of their Background Mode, they can now use `setTimeout` and `setInterval` without problem — whereas in the past, neither would ever trigger their callback until the app returns to the foreground.
Pull Request resolved: https://github.com/facebook/react-native/pull/23674

Differential Revision: D14621326

Pulled By: shergin

fbshipit-source-id: c76e060ad2c662c140d7d2f4fb5aaa7094032515
2019-03-26 12:24:37 -07:00
Ilja Daderko 56679ed359 Fix universal links not working in iOS 12 / Xcode 10 (#22764)
Summary:
fix #22716

Changelog:
----------
[iOS][Fixed] - Fix universal links in iOS 12 / Xcode 10
Pull Request resolved: https://github.com/facebook/react-native/pull/22764

Differential Revision: D14576559

Pulled By: cpojer

fbshipit-source-id: 4ef727e1d9aa7646359b63468285fec1f8f1651b
2019-03-26 12:08:27 -07:00
David Vacca 2a336f2b11 Fix NoSuchElementException in ReactChoreographerDispatcher.doFrame
Summary: This diff fixes a NoSuchElementException that was being thrown at ReactChoreographerDispatcher.doFrame(). The root cause was a lack of syncronization in removeFrameCallback().

Reviewed By: shergin

Differential Revision: D14619386

fbshipit-source-id: 80bc9e44866218d2a8703b3186f6958c145f260b
2019-03-26 10:38:42 -07:00
Luna Wei 20b4879dfd - LayoutAnimations cause invalid view operations
Summary:
[Android] [Fixed] - LayoutAnimations cause invalid view operations

The dating team has found a consistent repro where following an order of steps will get you the following exception:

https://lookaside.facebook.com/intern/pixelcloudnew/asset/?id=2113362972287761

The exception is due to the fact that the following operation
 `delete child tag 17 from parent tag 481 which is located at index 2`
cannot be performed because parent tag 481 only has 2 children.. and they also happen to not have the tag 17 as a child. Somehow the operations and the tree they act upon are out of sync.

RN receives operations from React via the native module `UIManagerModule`. The operations use tags (an identifier for a view) and indices to determine what view is updated. These operations (grouped together as a batch) are then passed to the UI thread where we perform them on the platform views.

LayoutAnimations are implemented per batch in RN. When LayoutAnimations are on, qualified view updates are animated. Because the delete operation is animated, RN doesn't remove the view from the platform view hierarchy immediately but asynchronously -- after the animation is complete. This is problematic for other view operations that rely on an index on where to insert or delete a view because during the creation of those operations, it was assumed all prior operations were performed synchronously.

This is what was occurring in the repro and there were silent view errors occurring before the exception was thrown.

This diff proposes a solution to track all pending delete operations across operations.
We introduce a map that is keyed on view tags and has a value of a sparse array that represents child index -> count of views that are pending deletion.
`{11: [0=1], 481: [2=1]}` where this would be interpreted as for index 0 under view tag 11, there is one async view deletion that has not completed and under tag 481 there is one async view deletion at index 2.

We use the map to adjust indices on add / delete operations. We also update the count when the deletion animation is complete and remove the tag from the map when it is deleted.

Regarding worst case sizing of the map => O(# of platform views rendered)

Reviewed By: mdvacca

Differential Revision: D14529038

fbshipit-source-id: 86d8982845e25a2b23d6d89ce27852fd77dbb060
2019-03-26 10:33:08 -07:00
zhongwuzw 946f1a6c87 Add lock for surface presenter observers (#24052)
Summary:
Add lock for observers when do enumeration.
cc. shergin .

[iOS] [Fixed] - Add lock for surface presenter observers
Pull Request resolved: https://github.com/facebook/react-native/pull/24052

Differential Revision: D14619029

Pulled By: shergin

fbshipit-source-id: b843ac0e4b106a572de75663840f2e5e5f126f31
2019-03-26 09:56:40 -07:00
Mikael Sand 5e4a5892b9 Support Interpolation of strings when using native driver in Animated, fix Expected node to be marked as "native", optimize AnimatedNode creation and connections (#18187)
Summary:
Allow interpolation of strings with useNativeDriver. This allows animating much more of react-native-svg. This PR adds support for native animation of lengths with units, path data, colors etc. Plus, fixing the redundantly created nodes and (and thus, previously incorrect) connection of native animated nodes, improving performance.

Docs will need to change, specifying that string interpolation works with the native driver as well.

[GENERAL] [Added] Add support for native driven string interpolation in Animated
[GENERAL] Fix exception: Expected node to be marked as "native"
[GENERAL] Fix connection of AnimatedNodes and creation of redundant AnimatedNodes
Pull Request resolved: https://github.com/facebook/react-native/pull/18187

Differential Revision: D14597147

Pulled By: cpojer

fbshipit-source-id: 82a948a95419236be7931a8cc4ff72f41e477e9c
2019-03-26 09:33:25 -07:00
Sidharth Guglani 81a702b426 removing unused const int
Summary: Removed unused const int

Reviewed By: davidaurelio

Differential Revision: D14368114

fbshipit-source-id: f63b978813a01a37710fac299dc7ec9aff610844
2019-03-26 08:50:33 -07:00
Christoph Nakazawa 938c3bdfa0 Change WebView to be required from 'WebView' module directly
Summary: This is the first diff part of moving WebView internally to Facebook. It will be available under the same name `WebView` but won't be required from `react-native` any longer.

Reviewed By: TheSavior

Differential Revision: D14598043

fbshipit-source-id: f870d3f58e1d304071405344de09598dd22cdcc2
2019-03-26 08:20:37 -07:00
Sidharth Guglani d5a8f4d600 moved all the properties used for layout outputs to YogaNodeJNI
Summary:
Moved layout outputs transfer logic from YogaNodeJNIBase to YogaNodeJNI.
This change set is for adding experiment for layout outputs batching using a float array

Reviewed By: davidaurelio

Differential Revision: D14368107

fbshipit-source-id: 75ca330c1e7f07adc0ab8e7a5927d93977088918
2019-03-26 07:36:58 -07:00
David Aurelio 82b27832d6 `CompactValue` overrides of `YGResolveValue`/`YGValueEqual`
Summary:
@public

I would like to get rid of implicit conversions between `YGValue` and `CompactValue`, because they don’t come for free.

That’s why I am adding `CompactValue` specific overrides for `YGResolveValue` and  `YGValueEqual`, that do explicit casts. Up the commit stack, we will be able mark both `CompactValue(const YGValue&)` and `CompactValue::operator YGValue()` as `explicit`.

Reviewed By: SidharthGuglani

Differential Revision: D14598447

fbshipit-source-id: 75dc15cefb2dddcf8def891c5fb37893cacd9d46
2019-03-26 05:22:24 -07:00
David Aurelio d1c7760ef7 Remove duplicated function declaration
Summary:
@public

Just removes a duplicated function declaration.

Reviewed By: SidharthGuglani

Differential Revision: D14598446

fbshipit-source-id: b4d8fe192f9a07f512f6a346f27d9046bb3bae23
2019-03-26 05:22:23 -07:00
satyajit.happy b49fdd19e4 Add typescript support to the ESLint config (#24100)
Summary:
This adds TypeScript support to the community ESLint config. Our babel preset supports TypeScript by default, so it's nice to have TypeScript support pre-configured in the ESLint config too.

Note: Users need to install `typescript` in their project for linting to work for TypeScript files.

[General] [Added] - Add TypeScript support to the ESLint config
Pull Request resolved: https://github.com/facebook/react-native/pull/24100

Differential Revision: D14597127

Pulled By: cpojer

fbshipit-source-id: dfbf1b97061ed6e8c46aa49adb21630f5acdb5d1
2019-03-25 21:28:26 -07:00
Valentin Shergin cc66d36583 Fabric: Removing ShadowNode::constructAncestorPath()
Summary: We don't use it anymore.

Reviewed By: mdvacca

Differential Revision: D14523377

fbshipit-source-id: 20777d835960105e875c9e37bbe753bd925dfd78
2019-03-25 20:32:21 -07:00
Spencer Ahrens d9eae2a809 fix setNativeProps crash
Summary:
setNativeProps ends up calling UIManager.updateView which fails to find the view tag in the Paper UIManager and crashes.

This diff simply checks if the tag is managed by fabric, and calls `fabricUIManager.synchronouslyUpdateViewOnUIThread` if it is.

Not the ideal fix, but it generally works (js-driven animations work as well as in Paper) and it's better than crashing or not working at all.

Reviewed By: JoshuaGross

Differential Revision: D14414523

fbshipit-source-id: 0acd404f55094f8ce8eda39cb87ab58c727fb068
2019-03-25 12:24:46 -07:00
Spencer Ahrens 45b9b656cc factor out common native obj switch code
Summary: No reason to duplicate it.

Reviewed By: mdvacca

Differential Revision: D14488262

fbshipit-source-id: b5ce23ea591abc3e9bc07ee48cc756322cae220c
2019-03-25 12:12:11 -07:00
Spencer Ahrens a062b34493 same cleanup but for ReadableNativeArray
Summary: Removes useArrayNativeAccessor and everything needed to support it, similar to D14486283

Reviewed By: mdvacca

Differential Revision: D14487244

fbshipit-source-id: 7cfa91f7cf322c648c82be5951f3622cd6468961
2019-03-25 12:12:11 -07:00
Spencer Ahrens b257e06bc6 remove useMapNativeAccessor stuff
Summary:
This was quite a rabit hole of remove deps -> delete dead code -> repeat.

Waaay simpler now with less duplicate lookups, redundant type verification, and extra function calls.

Reviewed By: mdvacca

Differential Revision: D14486283

fbshipit-source-id: 035db30181755d046a1ae99760468b954b2449df
2019-03-25 12:12:10 -07:00
Spencer Ahrens a46fba5dd3 use DynamicFromObject to avoid maps
Summary:
Changes our property access pattern to iterate through props once and pass the Object value directly rather than looking the value up in the map with the key.

Note some ViewManagers methods (especially yoga related ones on shadow nodes) expect a `Dyanamic`, so this diff also creates Dynamic's only when needed by the hand-written code, and introduces a new `DynamicWithObject` to create them that simply wraps the underlying object (as opposed to `DynamicWithMap` which wraps the map and does a lookup any time the `Dynamic` is accessed.

Reviewed By: mdvacca

Differential Revision: D14453300

fbshipit-source-id: df98567b6eff1e6b7c611f179eb11e413fb94e5d
2019-03-25 12:12:10 -07:00
Valentin Shergin af38a0cf87 Fabric: `Transform` type was moved to `graphics` module.
Summary:
We will use it inside `core` module, so we have to decouple it from `view`.
As part of this, I added some comments, changed `const Float &` to just `Float` and put the implementation into `.cpp` file.

Reviewed By: mdvacca

Differential Revision: D14593952

fbshipit-source-id: 80f7746f4fc5b95febc8df9f5a9c0386a6425c88
2019-03-25 12:04:53 -07:00
David Vacca b943db418f Fix IllegalStateException when tapping next on Android Keyboard
Summary: This diff fixes an IllegalStateException that is thrown when the user click is on a edit text and tap 'Next' on the keyboard to focus on the next view, but the next view is hidden.

Reviewed By: lunaleaps, mmmulani

Differential Revision: D14598410

fbshipit-source-id: 2999cc468ed24bedff163eedcfaec50f6ee005d6
2019-03-25 10:17:39 -07:00
Dhaval Kapil 64f3a87c9d Refactor JSIExecutor to use runtimeInstaller for injecting the logger instance
Summary: This is based on the work done in D8686586. Removed the logger instance from JSIExecutor constructor and installed it into the runtimeInstaller at all call sites.

Reviewed By: mhorowitz

Differential Revision: D14444120

fbshipit-source-id: 0476fda4230c467573ea04102a12101bcdf36c53
2019-03-25 09:12:11 -07:00
Mr. Anonymous 9db347fabc Update projectRoot in launchPackager.bat (#24115)
Summary:
`launchPackager.bat` starts metro server but does not pass projectRoot to it. So metro server starts in the wrong directory, It is because `startServerInNewWindow` pass `react-native` directory instead of `projectRoot` in the third argument of `spawn()` in `runAndroid.js`

Its working for people
See https://github.com/facebook/react-native/issues/23908#issuecomment-475889443

[Android] [Fixed] - projectRoot in launchPackager.bat
Pull Request resolved: https://github.com/facebook/react-native/pull/24115

Differential Revision: D14597101

Pulled By: cpojer

fbshipit-source-id: fb4155b72e35062cfb41fe1b3ecca0e2b4e849ce
2019-03-25 07:27:11 -07:00
Sidharth Guglani 526b40bfe3 fixed @Nullable missing infer errors
Summary: Fixed Nullable lint errors

Reviewed By: davidaurelio

Differential Revision: D14383930

fbshipit-source-id: 0847e19c50a0b8d4039199045b74aa86c96ac096
2019-03-25 06:36:15 -07:00
David Aurelio 4ba34b0a26 Automatic lint fixes
Summary:
@public
A round of automatic lint fixes.

Reviewed By: SidharthGuglani

Differential Revision: D14590396

fbshipit-source-id: f0b4a0ce503a1d9d46ea7ae788f9f2eac09c2ac7
2019-03-25 05:55:21 -07:00
David Vacca d53200a4c3 ReactTTRCRenderFlag component in Fabric android
Summary: This diff migrates ReactTTRCRenderFlag component to Fabric android

Reviewed By: fkgozali

Differential Revision: D14591212

fbshipit-source-id: c10de2ab4a77af985853da6d3fe7a7c6a1bc7a1e
2019-03-23 22:53:23 -07:00
David Vacca ce3952faf5 Replace abort() with LOG(FATAL) when a prop-value is not found during parsing
Summary: This diff replaces usage of abort() with LOG(FATAL) when a prop-value is not found during parsing of prop values

Reviewed By: fkgozali

Differential Revision: D14591210

fbshipit-source-id: 4a8484ea6bdfec5534122ded43cc24ef80c13c1d
2019-03-23 22:53:23 -07:00