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

17417 Коммитов

Автор SHA1 Сообщение Дата
Orta Therox 9ed6dc750c Improve the android onboarding messages (#25353)
Summary:
When I installed React Native and loaded it up in the emulator, I wasn't really sure what the menu button was. I clicked around through the default emulator for advice but couldn't find it. So, instead this version now tells you directly what the key commands are.

Because it needs to show  both<key>ctrl</key> and <key>cmd</key> (depending on dev's OS) I opted to include both and felt like it needed spaces around the `+`. So, I made that consistent everywhere.

## Test Plan

n/a

## Changelog

[Android] [Fixed] - Improves the initial copy for creating a new RN project on android
Pull Request resolved: https://github.com/facebook/react-native/pull/25353

Differential Revision: D15956358

Pulled By: mdvacca

fbshipit-source-id: aa320e30da53e6ba35f879f57740777bdee26618
2019-06-21 21:55:56 -07:00
Emily Janzer 8af7e9289f Remove @UiThread annotation from MountingManager.addRootView()
Summary: Removing the UiThread annotation from MountingManager.addRootView() because it doesn't seem like it's needed.

Reviewed By: mdvacca

Differential Revision: D15945819

fbshipit-source-id: 0cb9bfb2fe2889001f1c061a07518cf9734f0c16
2019-06-21 16:52:04 -07:00
Eli White 38d974e6a2 Android TextInput now supports strings for autoCapitalize
Summary:
Similar to D15909582, this change makes the Android TextInput take strings for the value of autoCapitalize and not just numbers. As we are going to stop sending view configs from native and instead hardcode them in JS we can't do that anymore.

In this commit we are supporting the old style as well as the new style.

Changelog:
[Android] [Internal] - Supporting autoCapitalize as string to clean up internal TextInput.js file

Reviewed By: mdvacca

Differential Revision: D15911323

fbshipit-source-id: b236fdb314489cc1ef33f9214ff2d6b0e28b7310
2019-06-21 16:10:43 -07:00
Valentin Shergin 173a5cc222 Fabric: Removing unnecessary assert in RCTParagraphComponentView
Summary: This is strange why it's happening but it's not a reason to crash here. We will migrate the text component to State anyway, so we will fix the problem then.

Reviewed By: JoshuaGross

Differential Revision: D15951391

fbshipit-source-id: c1d1217fab1180f1eef84dfc2b2fd1ed0864b035
2019-06-21 16:04:50 -07:00
Eli White 1d0b397485 DrawerLayoutAndroid now takes strings for drawerPosition
Summary:
Previously DrawerLayoutAndroid required taking an int as the drawerPosition. This required a complex dance of pulling these constant values off of the native view config. As we are going to stop sending view configs from native and instead hardcode them in JS we can't do that anymore.

In this commit we are supporting the old style as well as the new style. The old way of specifying the sizes will go away in a future release.

Changelog:
[Android][Added] - DrawerLayoutAndroid now supports strings and not just numbers for drawerPosition.

Reviewed By: mdvacca

Differential Revision: D15912607

fbshipit-source-id: b444454a1e74f8f659995b9ebe5e164ac9660138
2019-06-21 15:59:31 -07:00
Kevin Gozali 01a42bc368 TM iOS: Prevent module cache invalidation race
Summary: There are still race condition during bridge invalidation. Some modules may be accessing other modules during invalidation, but it's racing with the TM manager clearing the cache.

Reviewed By: JoshuaGross

Differential Revision: D15947488

fbshipit-source-id: 3bd51382264f538a03ca565b0f099da40c3daadf
2019-06-21 15:54:01 -07:00
zhongwuzw af59323d81 TM: Backward compatibility of calling invalidate on module's method queue (#25264)
Summary:
Backward compatibility for `invalidate` method, because for the old module system, we ensure call all methods of modules on `methodQueue`, we also need to keep this rule to avoid some race condition in module.

## Changelog

[iOS] [Fixed] - Backward compatibility of calling invalidate on module's method queue
Pull Request resolved: https://github.com/facebook/react-native/pull/25264

Test Plan: Ensure `invalidate` method of `module` be called on `methodQueue`.

Reviewed By: PeteTheHeat, JoshuaGross

Differential Revision: D15944532

Pulled By: fkgozali

fbshipit-source-id: e260792bc6b86a48cdf376282063cbabccbf26f0
2019-06-21 15:54:01 -07:00
Dan Abramov a225d1aa5e Fix progress indication on iOS
Summary: We didn't update the header name. The ref was weak so it just didn't pull in the module.

Reviewed By: fkgozali

Differential Revision: D15944635

fbshipit-source-id: 8599c091a2265f807662c3deea4bd3c59e1a8aa8
2019-06-21 12:15:48 -07:00
David Vacca 42e35b3b56 Add extra logs in FabricUIManager
Summary: This diff adds extra logging in FabricUIManager, this will be useful to debug production issues

Reviewed By: JoshuaGross

Differential Revision: D15907520

fbshipit-source-id: 94e16444af3c023b6c4837c4797404d3debe8e95
2019-06-21 11:52:56 -07:00
David Vacca 4f4d3857ea Back out "[Fabric][C++] Backout Force Diffing algorithm to insert views Bottom Up"
Summary: Original commit changeset: 455034ce7b70

Reviewed By: JoshuaGross

Differential Revision: D15900818

fbshipit-source-id: c197aaedde1ab32e2e1a5764eb400600ab46b840
2019-06-21 11:52:56 -07:00
Kevin Gozali 7143d89d81 Move TypeSafety conversion utils to github
Summary: This is utility for TurboModule codegen for the purpose of typesafety. It is not used anywhere else at the moment.

Reviewed By: cpojer

Differential Revision: D15929957

fbshipit-source-id: ecf68cc98b78bc5b9c2078492b853a677b625eea
2019-06-21 11:42:18 -07:00
Kevin Gozali 04180bf8ff Move FBLazyVector to github
Summary: FBLazyVector is a simple utility to help typesafety/codegen of TurboModule specs. This is not used widely elsewhere at the moment.

Reviewed By: hramos, cpojer

Differential Revision: D15929956

fbshipit-source-id: 17226351738335a74e7b931812a1ca901f47963f
2019-06-21 11:42:17 -07:00
Kevin Gozali 1e0c30cfdf BUCK: added rn_apple_library alias
Summary: Internally, this maps to internal wrapper, externally, this defaults to built-in apple_library.

Reviewed By: cpojer

Differential Revision: D15929954

fbshipit-source-id: c582e8b07f454e56fe02a6628c24df9c9c1dc186
2019-06-21 11:42:17 -07:00
Chris Blappert 6f310b5553 Remove old comments
Reviewed By: threepointone

Differential Revision: D15582763

fbshipit-source-id: 3185a578945a725083b08050880758c623b13875
2019-06-21 10:59:09 -07:00
Dan Abramov e81c1e3c7a Change top bar colors for Hot Reloading label
Summary: The current grey one is very bland, hard to read (no contrast) and often looks like a bug. I've changed it to match the iOS Personal Hotspot colors which look more idiomatic.

Reviewed By: cpojer

Differential Revision: D15941200

fbshipit-source-id: d60a3744c73675b40f42c329c2a44e6b8b0a93dc
2019-06-21 09:02:47 -07:00
Spencer Ahrens d7cbe3347b protect against hanging when logging nasty objects
Summary:
Logging nasty objects can cause RN to lockup as we try to format it nicely. The formatting code has some safegaurds against excessive recursion and some cycles, but it's not failsafe.

This adds a limit on the total number of times format can be called before we start to bail out. In my testing, this limit keeps the format time under ~100ms for huge objects, and logcat and other log readers start truncating it anyway so there is rarely any lost information.

I also considered using wall time, but this seemed a little cleaner. Open to suggestions.

Reviewed By: yungsters

Differential Revision: D15710157

fbshipit-source-id: b50261093270d6fb67b3473432d384ec51b98fd5
2019-06-21 07:43:52 -07:00
Dan Abramov acd349e35a Don't show "Hot Reloading" banner on first load
Summary:
D10527979 made the "update" message sequence part of initial connection signals. But the HMR client uses this sequence as a signal to show "Hot Reloading..." bar. As a result, we were showing it on every initial load when Hot Reloading is on. This is very confusing.

As a simple fix, I now send an explicit message to mark the end of the first load. I could infer that by first update message but figured this is more explicit and less likely to break. Until we receive `connection-done`, we now don't attempt to show the "Hot Reloading..." bar.

Reviewed By: rubennorte

Differential Revision: D15936085

fbshipit-source-id: b18b6aceea6c47d919b4265e58b21fc44f77b0b3
2019-06-21 06:04:19 -07:00
Dan Abramov d7c8ace001 Replace React Transform HMR with React Refresh
Summary:
This removes React Transform HMR in favor of the new React Refresh implementation. It should only affect the "Enable Hot Reloading" mode. In further diffs I will remove "React Transform HMR" completely.

This is technically a breaking change for Metro so it'll need a version bump.

Reviewed By: rickhanlonii, rubennorte

Differential Revision: D15903585

fbshipit-source-id: 074380b00868cb31857f599a03799d3584c35d87
2019-06-21 06:04:18 -07:00
Oleksandr Melnykov a15eecf6bd Back out "[RN][Android] Release underlying resources when JS instance is GC'ed on Android"
Summary:
Since Ads Manager for Android is crashing when a user tries to log in, I'm reverting D15826082 for now. Will investigate the reason of the crash later.

Crashlog: P67222724

Reviewed By: cpojer

Differential Revision: D15939152

fbshipit-source-id: bc1276e6057418821e1ebd90203bea586943b633
2019-06-21 05:28:43 -07:00
Christoph Nakazawa 17edd131eb Downgrade TextInput warning
Summary: See https://fb.workplace.com/groups/rn.core/permalink/2389524107945980/ for motivation

Reviewed By: rubennorte

Differential Revision: D15938804

fbshipit-source-id: 78f72ec24ddeca0d3a71497dd1931eff2df3c330
2019-06-21 04:15:06 -07:00
David Aurelio 52e4c8df6c Replace relative include
Summary: Replaces the relative include to `YGEnums.h` in `yoga/event/event.h` with `#include <yoga/YGEnums.h>

Reviewed By: SidharthGuglani

Differential Revision: D15778634

fbshipit-source-id: 2bceeb58f26c0d9d0df6c0e7ea20b8ddf68a1ee5
2019-06-21 04:09:52 -07:00
Guilherme Iscaro 4b9c99dff0 Protocol property of WebSocket object is undefined (#25273)
Summary:
Prior to this patch the websocket protocol was not being set when a connection
was opened, which could cause client libraries and apps to not work properly.
According to the [whatwg] spec the protocol must be set once the connection is
estabilished.

[whatwg]: https://html.spec.whatwg.org/multipage/web-sockets.html#feedback-from-the-protocol

## Changelog

[Javascript] [Fixed] - Properly set the this.protocol on WebSocket open
[Android] [Fixed] - Send the server chosen protocol to the WebSocket object
[iOS] [Fixed] - Send the server chosen protocol to the WebSocket object
Pull Request resolved: https://github.com/facebook/react-native/pull/25273

Test Plan:
In order to reproduce the issue you **need to install wampy@6.2.1**. Since **wampy@6.2.2** and newer contains a workaround for this react-native bug.

https://www.npmjs.com/package/wampy

```javascript
/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 *
 * format
 * flow
 */

import React, { Component } from 'react';
import { Platform, StyleSheet, Text, View } from 'react-native';
import Wampy from "wampy";

const instructions = Platform.select({
  ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
  android:
    'Double tap R on your keyboard to reload,\n' +
    'Shake or press menu button for dev menu',
});

type Props = {};

export default class App extends Component<Props> {
  state = {conState: 'Initializing...'};
  componentDidMount() {
    const url = "wss://demo.crossbar.io/ws";

    const ws = new Wampy(url, {
      realm: "crossbardemo",
      ws: WebSocket,
      debug: true,
      onConnect: () => {
        console.log("WAMP onConnect");
        this.setState({conState: 'Connected'});
      },
      onClose: () => {
        console.log("WAMP onClose");
        this.setState({conState: 'Connection closed'});
      },
      onError: () => {
        console.log("WAMP onError");
        this.setState({conState: 'Connection Error'});
      }
    });
  }

  render() {
    return (
      <View style={styles.container}>
        <Text style={styles.message}>{this.state.conState}</Text>
      </View>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor: '#F5FCFF',
  },
  message: {
    fontSize: 20,
    color: 'black'
  },
});
```

Using the code above one must see the message **WAMP onConnect** on Console and **Connected** in the middle of the screen

Closes https://github.com/facebook/react-native/issues/24796

Differential Revision: D15938870

Pulled By: cpojer

fbshipit-source-id: 10a0a9b40c2a69e484ead37149abc2b1158a4ffc
2019-06-21 03:46:54 -07:00
Rick Hanlon b063c41782 Generate PullToRefreshView
Summary: Adds the codgen types and generated view config for PullToRefresh

Reviewed By: TheSavior

Differential Revision: D15900138

fbshipit-source-id: ee2c179317749182aaf6d3b90c8379ce06a82b9c
2019-06-21 03:35:40 -07:00
Kacper Wiszczuk c52027baf7 Deprecate React Native ART (#25321)
Summary:
Since React Native ART has been extracted to community module, we can deprecate it in Core. You can find the community module [here](https://github.com/react-native-community/art).

## Changelog

[General] [Deprecate] - Deprecate React Native ART
Pull Request resolved: https://github.com/facebook/react-native/pull/25321

Test Plan:
Deprecation warning prints when user imports ART from react-native core module.

cc. cpojer

Differential Revision: D15938910

Pulled By: cpojer

fbshipit-source-id: d360fab6582c0d6c9064005246a012d2d5391c5c
2019-06-21 03:35:39 -07:00
Michał Pierzchała 86a97e7830 – Bring back autolinking to the iOS template (#25314)
Summary:
Bringing back iOS autolinking to the template after reverting: 261197d857 (commitcomment-33479829)

## Changelog

[iOS] [Added] – Bring back autolinking to the iOS template
Pull Request resolved: https://github.com/facebook/react-native/pull/25314

Test Plan: `test_ios_e2e` should still pass

Differential Revision: D15938862

Pulled By: cpojer

fbshipit-source-id: 4cd948b280a90229fd128b0f6901f7f89c647204
2019-06-21 03:13:38 -07:00
Sam Mathias Weggersen 73c5a8ec1b Keyboard accessibility follow up (#25274)
Summary:
This is a follow up PR to https://github.com/facebook/react-native/issues/24359. There's a good thread in the mentioned PR for more background for why I'm doing this change. Essentially `focusable` makes more sense since it is about whether a view can receive user-initiated focus from a pointer or keyboard.
Pull Request resolved: https://github.com/facebook/react-native/pull/25274

Differential Revision: D15873739

Pulled By: cpojer

fbshipit-source-id: 0f526bb99ecdc68131dfc10200a5d44c2ef75b33
2019-06-21 03:13:38 -07:00
Janic Duplessis 1fb4b6caa0 Native Animated - Support events using RCT{Direct|Bubbling}EventBlock on iOS (#25317)
Summary:
Reland https://github.com/facebook/react-native/issues/15611 and added the gcc warning that was different from fb internal config. The original PR missed the static keyword for the `RCTNormalizeAnimatedEventName` function which triggered the gcc warning internally but not with the OSS xcode config.

When calling a prop of type `RCTDirectEventBlock` or `RCTBubblingEventBlock` it uses a completely different code path than events using `[RCTEventDispatcher sendEvent:]` and those were not dispatched to the `RCTEventDispatcherListener`s. We also do some event name normalization which caused issues between the JS and native event names. To fix that I simply remove the parts we normalize from the event key.

## Changelog:

[iOS] [Fixed] - Support events using RCT{Direct|Bubbling}EventBlock
Pull Request resolved: https://github.com/facebook/react-native/pull/25317

Test Plan: Added a Slider (it uses RCTBubblingEventBlock for its onValueChange event) that can control a native animated value in RNTester to reproduce the bug and made sure this diff fixes it.

Differential Revision: D15938856

Pulled By: cpojer

fbshipit-source-id: 7e7a3459e2a2e8b1254a2f1ec8153a159ea73eed
2019-06-21 03:05:59 -07:00
aamalric d010fc3bf4 Add key action info to Android EventHandler events. (#25300)
Summary:
Add event key action for Android EventHandler events, helps to know if the key event is a up (key release, value is 1) or down (key pressed, value is 0) action.

## Changelog

[ANDROID] [ADDED] - Add event key action to EventHandler events.
Pull Request resolved: https://github.com/facebook/react-native/pull/25300

Test Plan: No test added

Differential Revision: D15897484

Pulled By: cpojer

fbshipit-source-id: fdb3d5413d9da3dd5f46d41e31ac60f0b341f3eb
2019-06-21 03:00:32 -07:00
Sidharth Guglani fc82c59be7 Send measure pass duration
Summary: Send measure callback duration time to yoga plugin

Reviewed By: davidaurelio

Differential Revision: D15917548

fbshipit-source-id: 2c947f14ddbc5932cedd0aab8622260478ec29a6
2019-06-21 02:33:02 -07:00
Dan Abramov 5d29590cd4 Update renderer and packages
Summary:
This pulls in the latest package updates for Fresh. It doesn't have any user-observable behavior.

The renderer is rebuilt on top of the last cherry-picked sync. I cherry-picked https://github.com/facebook/react/pull/15928 on top of it.

Reviewed By: rickhanlonii

Differential Revision: D15901887

fbshipit-source-id: ccd974f79e4c0a2a8a8cab0d472deeaedf1e3ddd
2019-06-20 21:18:46 -07:00
Eli White a62490808d Make ViewNativeComponent use ES6 exports
Summary: We will need to use ES6 exports when we switch this to use the codegen'd view configs. I also need to have a named export from this file.

Reviewed By: rickhanlonii

Differential Revision: D15923789

fbshipit-source-id: 513e27834583b6d021ff06d5d7f116ccdcd27722
2019-06-20 18:29:41 -07:00
Eli White 28f1aac88c Remove extra component wrapper from View
Summary:
View needed this wrapper to add a dev time warning about text children. Text children became supported and this warning was removed in https://github.com/facebook/react-native/pull/23195

This check is no longer necessary and we can reduce the overhead and improve the performance of View by removing this.

Reviewed By: rickhanlonii

Differential Revision: D15914658

fbshipit-source-id: 6456a9cb356245fa8104036b2948aa5c5bf39e0f
2019-06-20 18:29:41 -07:00
Luna Wei 122acca759 StickerViewNativeComponent
Summary:
view config RCTStickerViewNativeComponent

had to get one view config in before I left London lol

Reviewed By: rickhanlonii

Differential Revision: D15825774

fbshipit-source-id: 846d9ee1d15f6ec64d88a1af7b72fd863ae10afc
2019-06-20 15:09:00 -07:00
Joshua Gross 40043a175e Animations: attempt to mitigate crashes in T43628589
Summary: Trying to mitigate animation-related crashes in T43628589. Clues: all the crashes are off the main thread, and most operations in this class happen explicitly in blocks executed on the main thread. I think there's a category of race conditions caused by animations not being allocated yet when this code runs / being deallocated as it's running. We shouldn't need to add locks if everything just runs on the main thread.

Reviewed By: PeteTheHeat

Differential Revision: D15924310

fbshipit-source-id: d82f5434e53fd394c4a7548d52f59a0f63961779
2019-06-20 15:00:21 -07:00
Eli White 2a4882e7e9 Using generated ViewConfigs for AndroidSwipeRefreshLayoutNativeComponent
Summary: $title

Reviewed By: rickhanlonii

Differential Revision: D15914074

fbshipit-source-id: 40fa6dcdf27b4fb88d936c439ba66a11e55966a9
2019-06-20 14:02:20 -07:00
Rick Hanlon f4fa539b8c Add android view props
Summary: Adds the view config props from android

Reviewed By: sahrens, shergin

Differential Revision: D15925354

fbshipit-source-id: 600dfbd9f77bde3323673c047c4461714d88d9d8
2019-06-20 12:45:44 -07:00
Eli White 09fe15910e Android SwipeRefreshLayout now supports strings for size
Summary:
Previously SwipeRefreshLayout (RefreshControl on Android) required taking an int as the size. This required a complex dance of pulling these constant values off of the native view config. As we are going to stop sending view configs from native and instead hardcode them in JS we can't do that anymore.

We will change the type of size from:
```
size?: ?(
  | typeof RefreshLayoutConsts.SIZE.DEFAULT
  | typeof RefreshLayoutConsts.SIZE.LARGE
),
```

to:
```
size?: ?('default' | 'large')
```

In this commit we are supporting the old style as well as the new style. The old way of specifying the sizes will go away in a future release.

Changelog:
[Android] [Added] - RefreshControl now supports strings and not just numbers for size.

Reviewed By: mdvacca

Differential Revision: D15909582

fbshipit-source-id: 1849edc980e1698de147e88d710e0f28d0fdc8d8
2019-06-20 10:58:27 -07:00
Kudo Chien cbf1b39c66 Fix Android Picker ArrayOutOfBoundsException during Picker.Item update from a long list (#25276)
Summary:
axe-fb reported this side effect from my previous commit in https://github.com/facebook/react-native/pull/24793#issuecomment-502202082
After revisited the implementation of Android Spinner, it seems the formal way to update existing adapter is mutating it, i.e. `arrayAdapter.clear()` & `arrayAdapter.addAll()` to update a Spinner Adapter.
`setAdapter()` will reset everything including `mDataChanged`.
A race condition may happens between rendering a long picker list and reseting adapter.
Here is a code snippet: https://snack.expo.io/kudochien/80f810
To reproduce the issue, please select large item (e.g. 500) first and click the button right hand side.
Please not to verify this on Expo directly in the meantime, because Expo with RN 0.59 does not include my previous commit.

## Changelog

[Android] [Fixed] - Fix Picker ArrayOutOfBoundsException during Picker.Item update from a long list
Pull Request resolved: https://github.com/facebook/react-native/pull/25276

Test Plan:
1. Check the test case https://snack.expo.io/kudochien/80f810 will have exception or not.
2. Regression of https://snack.expo.io/Sy1JClEag from https://github.com/facebook/react-native/issues/13351
3. Regression of https://snack.expo.io/kudochien/android-picker-issue from https://github.com/facebook/react-native/issues/22821
4. RNTester Picker example

Reviewed By: mdvacca

Differential Revision: D15857426

Pulled By: axe-fb

fbshipit-source-id: 8ef902447fdd1b8aeab50ad061545cd14c735e51
2019-06-20 07:48:20 -07:00
Oleksandr Melnykov 3a8b988cb2 Release underlying resources when JS instance is GC'ed on Android
Summary:
[Android] [Added] - Release underlying resources when JS instance is GC'ed on Android

D15279651 introduced a crash for Oculus Twilight on Android (T45199437), so it was reverted by D15611385.

This diff fixes the crash and re-applies D15279651. The problem was that ProGuard renamed BlobModule.remove() to BlobModule.release(), but the C++ code in `BlobCollector.cpp` still expected the old name. I confirmed this by looking at the Extracted Symbols file for the build which introduces the crash (https://fburl.com/mobile/ud40od3i):

```
com.facebook.react.modules.blob.BlobModule -> com.facebook.react.modules.blob.BlobModule:
...
8190:8193:void remove(java.lang.String):190:193 -> release
...
```

See the full log file here: https://fburl.com/pn02bwkb.

The solution is to annotate the method with `DoNotStrip` so that ProGuard doesn't rename it.

Reviewed By: mdvacca, cpojer

Differential Revision: D15826082

fbshipit-source-id: f7470d394666cd34c1acae5c6ffaecc84d5ca5a3
2019-06-20 02:49:19 -07:00
Rick Hanlon 8253f90967 Bump babel plugin version to break metro cache
Reviewed By: ejanzer

Differential Revision: D15904504

fbshipit-source-id: 8ea7437156d1bfebaeec3a5dcfccadaad728400b
2019-06-20 02:43:15 -07:00
Peter Argany 7bb2ba5494 Flow typed & codegen RCTInputAccessoryViewNativeComponent
Summary: title

Reviewed By: rickhanlonii

Differential Revision: D15804045

fbshipit-source-id: 6969984441e9c87750abbc0a046fb7b447a78c91
2019-06-19 18:41:58 -07:00
Peter Argany b441ced5c5 Flow type and codegen for RCTProgressViewNativeComponent
Summary: title

Reviewed By: rickhanlonii

Differential Revision: D15821776

fbshipit-source-id: 332abc58d270875a1ee45f954b287ecaac1912ef
2019-06-19 18:41:57 -07:00
Peter Argany b83a573c7d Flow type and codegen AndroidProgressBarNativeComponent
Summary: title

Reviewed By: rickhanlonii

Differential Revision: D15822629

fbshipit-source-id: 2d4181a860ae351c217ca3fb67b1d3bfeb4476e1
2019-06-19 18:36:14 -07:00
Valentin Shergin 044176925b Fabric: Disabling RN_SHADOW_TREE_INTROSPECTION
Summary:
It's unclear why, but the introspection infra is enabled somehow in prod.
It must be some kind of misconfiguration somewhere. Until we figure it now, we have to disable it completly.

Reviewed By: mdvacca

Differential Revision: D15908765

fbshipit-source-id: 2b17c61938731d43eaef51b070a4ec1ae9e5e1df
2019-06-19 18:07:11 -07:00
Rick Hanlon 503df2c69a Move scheduler to dependencies
Summary: Fixes https://github.com/react-native-community/releases/issues/116#issuecomment-503449687

Reviewed By: gaearon

Differential Revision: D15901557

fbshipit-source-id: 653119c181585cf9a4a561b350c66bd10cb674bd
2019-06-19 12:01:04 -07:00
Rick Hanlon ff5592cff4 Add paperComponentName and paperComponentNameDeprecated
Summary:
This diff removes an option from the codegen and replaces it with two new options

Removes:
- `isDeprecatedPaperComponentNameRCT`

Adds:
- `paperComponentName`: a better version of the removed option that allows more than just adding RCT
- `paperComponentNameDeprecated`: a new option that allows migrating native code to a new name

```
  // Use for components with no current paper rename in progress
  // Does not check for new name
  paperComponentName?: string,

  // Use for components currently being renamed in paper
  // Will use new name if it is available and fallback to this name
  paperComponentNameDeprecated?: string,
```

For example, Slider uses `paperComponentName: 'RCTSlider'` because it has a different name in fabric but is not currently being migrated to a new name. Because of other work in progress, we don't want to use UIManager check if we don't need to

Reviewed By: shergin

Differential Revision: D15857629

fbshipit-source-id: ca0d3b7dc4a75e00d136ae1f5c84f7423960399d
2019-06-19 09:56:04 -07:00
Moti Zilberman 56f08fcf84 Pop bridge frames from errors thrown by sync host function calls
Summary:
When a synchronous call from JS to native code throws an error, it doesn't include a useful stack trace from the native side. To improve error attribution, this diff pops the frames in `MessageQueue.js` and `NativeModules.js` from the stack traces of such errors. This uses the `error.framesToPop` convention understood by RN's global error handler.

For now we limit this to errors converted from C++ exceptions in host functions, since those are not likely to ever contain further JavaScript frames at the point where we catch them; if they did, it would violate our assumption that the top two frames of the stack are in the JS bridge code.

Reviewed By: cwdick

Differential Revision: D15805054

fbshipit-source-id: 8c1dd7c81b00b6a88e31473271889af1f88f7263
2019-06-19 09:15:14 -07:00
Moti Zilberman 37bbfa663d Add test for sync methods (type=sync)
Summary: Adds a test for synchronous methods (`type === 'sync'`) in NativeModules. This doesn't modify any behaviour.

Reviewed By: amnn

Differential Revision: D15804757

fbshipit-source-id: 4db76dbd0b0b111ed9311d4b7ec35a077c377f01
2019-06-19 09:15:14 -07:00
Moti Zilberman 88e9098a64 Preserve the caller's JS stack trace when a type=promise method rejects
Summary: TSIA

Reviewed By: cwdick

Differential Revision: D15802451

fbshipit-source-id: db31ddf697afe54c22bc2c16254a6231497d5c3f
2019-06-19 09:15:14 -07:00
Moti Zilberman d216b55ef5 Add test for promise-returning methods (type=promise)
Summary: Adds a test for promise-returning methods (`type === 'promise'`) in `NativeModules`. This doesn't modify any behaviour.

Reviewed By: cwdick

Differential Revision: D15802452

fbshipit-source-id: 8dc1f862d33742ef4ba355ca36338e0dbabf8edb
2019-06-19 09:15:14 -07:00