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

5530 Коммитов

Автор SHA1 Сообщение Дата
Samuel Susla 4eb8a951ff Use Switch command from JavaScript
Summary: Changelog: Switch on iOS now uses command instead of `setNativeProps`.

Reviewed By: lunaleaps

Differential Revision: D17714895

fbshipit-source-id: 0e8784fc1d0a57c563b0a4c038febdc0320af11e
2019-11-04 07:44:10 -08:00
Samuel Susla b6a23d8793 Add excludedPlatform option to CodeSchema
Summary:
Currently we generate Java ViewManager interfaces and C++ classes for iOS regardless whether the component is supported on platform or it isn't. This adds an option to exclude either iOS to Android in order to avoid this.

Changelog: In codegen it is now possible to exclude one or the other platform

Reviewed By: rickhanlonii

Differential Revision: D18217185

fbshipit-source-id: 1c569b92c92a5b991c96b0abdff6b8ed395e449f
2019-11-04 04:36:55 -08:00
Tim Yung e22946c25a Animated: Update Abstract Component Flow Type
Summary:
Updates the return type of `createAnimatedComponent` to reflect the new behavior (where we forward the ref to the internal component).

I also improved the type annotation for `Props` so that we can still enforce that only valid prop names are supplied. (We still do not check the prop values because we do not currently have a good strategy for typing the "animated versions" of those.)

Changelog:
[General] [Changed] - Flow types for Animated components now validates prop names and yields the new component instance.

Reviewed By: TheSavior

Differential Revision: D18290473

fbshipit-source-id: 8c629ab6aff009ebe6dabca1683c99a357869977
2019-11-03 18:02:00 -08:00
Tim Yung 66e72bb4e0 Animated: Forward Ref to Component
Summary:
Changes `createAnimatedComponent` so that a `ref` assigned to an Animated component will now be forwarded to the internal component. Previously, a ref to the internal component was accessed using the `getNode` method. The `getNode` method is now deprecated and will return the same `ref` but show a deprecation error.

Changelog:
[General] [Changed] - Refs on an Animated component are now the internal component. The `getNode` call has been deprecated.

Reviewed By: TheSavior

Differential Revision: D18290474

fbshipit-source-id: 5849809583a17624a89071db8be1282a12caedf3
2019-11-03 18:02:00 -08:00
Tim Yung 86d90c03eb Animated: Minor `createAnimatedComponent` Cleanup
Summary:
Some minor cleanup to `createAnimatedComponent`:

- Remove deprecated `propTypes`.
- Reorder lifecycle methods in rough order of execution.

Changelog:
[General] [Removed] - Removed `propTypes` from Animated components.

Reviewed By: TheSavior

Differential Revision: D18289773

fbshipit-source-id: f97d9ee4a2a42d210726267506de3b6b78860e8c
2019-11-03 11:59:53 -08:00
Tim Yung dcd63078bd Animated: Delete `__skipSetNativeProps_FOR_TESTS_ONLY`
Summary:
Deletes `__skipSetNativeProps_FOR_TESTS_ONLY` in favor of a `process.env_NODE_ENV` check (which will be eliminated from production builds).

Changelog:
[General] [Removed] Removed `__skipSetNativeProps_FOR_TESTS_ONLY` from Animated components.

Reviewed By: TheSavior

Differential Revision: D18289739

fbshipit-source-id: 7c1f7a29f2b88821d358227a07eec778773e418a
2019-11-03 11:59:53 -08:00
Tim Yung 25041142e5 RN: Cleanup Testing Output
Summary:
Cleans up all the Jest tests to minimize spurious console output.

Changelog:
[Internal]

Reviewed By: TheSavior

Differential Revision: D18289690

fbshipit-source-id: cdcecca879b3b85d3dccf9e0ab617ea7dc1e0777
2019-11-03 11:59:52 -08:00
Tim Yung a70987cee2 Animated: Remove `defaultProps` Parameter
Summary:
Simplifies `Animated` by removing `defaultProps` in favor of composition and a more isolated fix for scroll components.

Changelog:
[Breaking] Removed second defaultProps argument from createAnimatedComponent.

Reviewed By: TheSavior

Differential Revision: D18289648

fbshipit-source-id: 4e91c34297c3231f2bf691da74a7a624ca0b4f29
2019-11-03 11:59:52 -08:00
Tim Yung e802bd0ea9 RN: Prepare More Touchable Experiments
Summary:
Expands `TouchableWithoutFeedbackInjection` as `TouchableInjection` for use in testing out new implementations of all five `Touchable.Mixin` components.

Changelog:
[Internal]

Reviewed By: TheSavior

Differential Revision: D18278876

fbshipit-source-id: d511bdecefe38579f03a9d5ad52011f7cd71f4c0
2019-11-02 16:56:09 -07:00
Tim Yung 654d9d07c3 RN: View Type Refinement for Events
Summary:
Adds some missing props to the type definition for `View`.

Also, changed some of the callbacks to return `mixed`. (Sometime in the near future, we should align on this for event callbacks.)

Changelog:
[Changed] Revised View Event Callback Types

Reviewed By: TheSavior

Differential Revision: D18278877

fbshipit-source-id: a36d5c1c9b9aed6718bd2abb024700a08a9deaeb
2019-11-02 16:56:09 -07:00
Rick Hanlon 5a943ec235 LogBox - Fix for buttons forcing refresh on fatals
Summary:
Fixes an issue in LogBox that allowed users to try to dismiss warnings/errors when there was a fatal or syntax error up.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D18285678

fbshipit-source-id: 9d137fab63405c28b2bfa94a35c11c2f63b6d085
2019-11-01 21:42:42 -07:00
Ramanpreet Nara 38678f75b4 Fix podspecs
Summary:
I kept on running `USE_FRAMEWORKS=1 update-pods && open RNTesterPods.xcworkspace` and adding missing dependencies until `RNTesterPods` started compiling without failure.

**Note:** I made sure to only commit the podfile changes from `update-pods`, **without** `USE_FRAMEWORKS=1`.

Changelog:
[iOS][Fixed] - Fix all RN Podspecs

Reviewed By: fkgozali

Differential Revision: D18284535

fbshipit-source-id: 44d288ae0e52dd2cbbe26bebe7df73ce05644b5d
2019-11-01 19:34:46 -07:00
Rick Hanlon 62c79206ef Fast Refresh - Dismiss LogBox syntax errors
Summary:
This diff adds Fast Refresh support for dismissing LogBox syntax errors. We don't dismiss all errors because once a syntax error is fixed you'll still want to see the covered fatals, errors, and warnings.

If you actually full reload, then it falls back to the native redbox.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D18278889

fbshipit-source-id: f109ca1d6c34aa3eda6e434deca66f8ce5e02ce0
2019-11-01 16:08:49 -07:00
Rick Hanlon 0825c2b2e7 LogBox - Add syntax error handling
Summary:
This diff adds handling for syntax errors.

## Strategy
To do this we introduce a new log level type syntax, giving us these levels with semantics:
- `warn` - console warns, show collapsed, dismissible
- `error` - console errors, show collapsed, dismissible
- `fatal` - thrown exceptions, show expanded, not dismissible
- `syntax` - thrown exceptions for invalid syntax, show expanded, not dismissible

Syntax errors shows expanded, covers all other errors, and are only dismissible when the syntax error is fixed and updated with Fast Refresh. Once the syntax error is fixed, it reveals any previously covered fatals, errors, or warnings behind it

In many ways, this makes syntax errors the highest level error.

## Visuals
Syntax errors also have their own display formatting. Stack traces for syntax errors don't make sense, so we don't show them. Instead, we show the syntax error message and a code frame for the error.

The code frame is also updated so that is doesn't wrap and is horizontally scrollable, making it easier to read.

## Detecting syntax errors

To detect syntax errors we've updated `LogBoxData.addException` to call the parse function `parseLogBoxException`. This method will perform a regex on the error message to detect:

- file name
- location
- error message
- codeframe

If this regex fails for any reason to find all four parts, we'll fall back to a fatal. Over time we'll update this regex to be more robust and handle more cases we've missed.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D18278862

fbshipit-source-id: 59069aba38a27c44787e5248b2973c3a345c4a0a
2019-11-01 16:08:49 -07:00
Rick Hanlon eefece4be6 Hide stack frames when they're empty
Summary:
In the next diff we'll introduce syntax errors, which we don't show stackframes for since they don't make sense. This diff removes the Stack Frame section when there are no stack frames available.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D18278831

fbshipit-source-id: 0a6ad5c3b7fed76123b6ad3ccfc8f3f0b044bda2
2019-11-01 16:08:49 -07:00
Rick Hanlon f6b1fa3197 Add fatal handling
Summary:
This diff adds handling to fatal errors such as thrown exceptions by popping them full screen and not allowing the user to dismiss them. They say that they're "Fatal Errors" and explain that "Fatal errors require a reload".

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D18257185

fbshipit-source-id: ca051027b19c3cd2410ae59764d7b98a78f08dca
2019-11-01 16:08:48 -07:00
Samuel Susla a1c5e884ef Fix order of calls on Picker
Summary:
In previous implementation, `setNativeProps` was called before `render`. These two methods can change value of `selectedIndex` and it matters in which order they arrive in native.

This was fine in Paper because 1st selectedIndex is set from `setNativeProps` with wrong value and then correct value comes from props.

However in Fabric, 1st selectedIndex comes from props (this is the correct one), and 2nd comes from command which has the incorrect value.

changelog: [internal]

Reviewed By: TheSavior

Differential Revision: D18240118

fbshipit-source-id: dca897306d3e858b9175b2f81356c76f5a0f79e2
2019-11-01 12:11:54 -07:00
Ramanpreet Nara 7233ae4f11 Make RCTAppState TurboModule-compatible
Summary:
See title.

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

Reviewed By: PeteTheHeat

Differential Revision: D18142253

fbshipit-source-id: 5bd8afa6e3ee98f92aac3b2ebdfe63b9f7afc775
2019-11-01 12:06:21 -07:00
Ramanpreet Nara dc12676e3a Make RCTStatusBarManager TurboModule-compatible
Summary:
See title.

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

Reviewed By: shergin

Differential Revision: D18130374

fbshipit-source-id: 3ec226bcff17e47ffd9eba05e32c1eb68d6135b2
2019-11-01 12:06:20 -07:00
Ramanpreet Nara a257083d2b Split NativeStatusBarManager into NativeStatusBarManager{Android,IOS}
Summary:
The `StatusBarManager` NativeModule does not have a uniform API on iOS and Android. In particular, the `setStyle` and the `setHidden` methods have an additional parameter on iOS:

```
/**
 *  - statusBarStyles can be:
 *    - 'default'
 *    - 'dark-content'
 *    - 'light-content'
 */
+setStyle: (statusBarStyle?: ?string, animated: boolean) => void;
/**
 *  - withAnimation can be: 'none' | 'fade' | 'slide'
 */
+setHidden: (hidden: boolean, withAnimation: string) => void;
```

If we keep the NativeModule spec the same between the two platforms, we'd have to keep the second parameter optional for both methods. This works for `setHidden`, because the second parameter is a string, and optional strings are allowed. However, for `setStyle`, the second parameter is a number, and we don't support optional numbers/booleans on Android in the NativeModule system. If we keep the optional number, then the following check triggers in our RedBox tests on iOS, which makes them fail: https://fburl.com/diffusion/b7adezd9.

So, since the two specs are sufficiently different, I figured that the easiest path forward is to split them apart.

Changelog:
[iOS][Changed] - Separated NativeStatusBarManager into NativeStatusBarManager{IOS,Android}

Reviewed By: PeteTheHeat

Differential Revision: D18214161

fbshipit-source-id: 6fd8b8c5f576244b5b90ee47faa7f50508c5e1d3
2019-11-01 12:06:20 -07:00
Tim Yung 548aad4ff1 RN: Delete Apple TV Props
Summary:
With tvOS (Apple TV) now residing in a separately maintained fork, this removes the residual props from React Native. This only includes the JavaScript changes. The Objective-C changes will come later.

Specifically, the following props have been removed:

- `isTVSelectable`
- `tvParallaxProperties`
- `tvParallaxShiftDistanceX`
- `tvParallaxShiftDistanceY`
- `tvParallaxTiltAngle`
- `tvParallaxMagnification`

Note that `hasTVPreferredFocus` is still being used by Android TV, so it remains.

Changelog:
[Removed] Apple TV View Props

Reviewed By: TheSavior

Differential Revision: D18266278

fbshipit-source-id: 9d1448bf2f434a74e6eb23c70d3a37971e406768
2019-11-01 08:49:26 -07:00
Tim Yung 95158ec692 RN: Export Focus / Blur / Mouse Events
Summary:
Exports these events in a canonical manner so that they can be used in future refactors.

Changelog:
[Internal]

Reviewed By: TheSavior

Differential Revision: D18257693

fbshipit-source-id: aac40277df8a88224c8df29caa04ffc9a6db0a22
2019-10-31 23:44:53 -07:00
Rick Hanlon 038353b89c LogBox - switch to array filter
Summary:
Fixes a bug for old versions of JSC that do not support `for of` syntax

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D18265611

fbshipit-source-id: 4643b6e2571c57ddd982661d188c3449f17a151e
2019-10-31 21:10:26 -07:00
Jacob Thornton a7437710d2 Fix for: You cannot blur a text-input if you tab to it. (#27038)
Summary:
I've been working on a new iOS experience with lots of text inputs and this has been driving me a bit nuts…

If you're in a scrollview with `keyboardShouldPersistTaps="handled"` and you tab through your text-inputs, you aren't able to tap outside of a given text-input to blur it (and dismiss the keyboard).

I wrote up a quick explanation and some repo steps here: https://snack.expo.io/BJBcKgrqB

The patch i came up with, after poking around for a little bit seems terrifying - so almost certainly not it. But if it's helpful at all - decided to just got ahead and submit it.

## Changelog

[iOS] [Fixed] - TextInput blur when tabbing in iOS simulator.
Pull Request resolved: https://github.com/facebook/react-native/pull/27038

Test Plan:
I tried to think of a way to test this in jest… but i didn't get very far sorry 😢

I did create a snack here so you can demo the issue: https://snack.expo.io/BJBcKgrqB

I also created two videos…

**Here's the text input not working when i try to blur it after tabbing in simulator**
![ezgif-1-dc85b405c760](https://user-images.githubusercontent.com/169705/67726290-8e5d2d00-f9a2-11e9-98c9-29c0b0bb25b9.gif)

**Here's it working after I applied this patch**
![ezgif-1-ed9f6b19653d](https://user-images.githubusercontent.com/169705/67726309-97e69500-f9a2-11e9-9992-c2a79d0bd408.gif)

Thanks!

Differential Revision: D18262867

Pulled By: TheSavior

fbshipit-source-id: 4087f3a27a7e6a146f7f84d7c6e9e8e2b6adc75d
2019-10-31 18:17:59 -07:00
Rick Hanlon a09ab64874 Don't pass through ignored warnings to console
Summary:
This diff check if warnings are ignored before calling through to the wrapped console.warn implementation below, thus preventing ignored logs from being sent to adb/metro/flipper and cleaning them up a bit.

Changelog: [Internal]

Reviewed By: cpojer

Differential Revision: D18239936

fbshipit-source-id: 533beced3e66ad1a4d0810933862c63a0b88628c
2019-10-31 16:26:44 -07:00
Rick Hanlon 1807a6afee LogBox - Dismiss errors and warnings independently
Summary:
This diff makes the warning and error notifications independently dismissible

Changelog: [Internal]

Reviewed By: cpojer

Differential Revision: D18218937

fbshipit-source-id: 198b18d7f177fcb59506a4adfed5b1ce0a331aba
2019-10-31 16:26:43 -07:00
Rick Hanlon b2bafa06fa LogBox - Better error support
Summary:
This diff adds support for thrown exceptions to redboxes, and hides the native redbox when we show an error in LogBox.

Changelog: [Internal]

Reviewed By: cpojer

Differential Revision: D18212064

fbshipit-source-id: 92031d554968bcb079f81568673ae85697c8f5ad
2019-10-31 16:26:43 -07:00
Rick Hanlon 6b783b4fb0 LogBox - Don't show native redbox for JS errors
Summary:
This diff switches the exception manager over to the reportException native module function on iOS and adds a new field `extraData.showRedbox` as a temporary hack to control hiding/showing native redboxes for LogBox.

Once LogBox is rolled out we'll remove this field, so we're hacking it into the available unused and untyped extraData bag, which will simplify gutting it in the future.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D18212047

fbshipit-source-id: f14e31d90359b7d455a73c2368ce010c28364a5c
2019-10-31 16:26:42 -07:00
Rick Hanlon 4265daa790 LogBox - Schedule logs to unblock rendering
Summary:
Currently if you land of a surface with a lot of logs, we're basically blocked until they stop. This diff schedules the log parsing in LogBox to free up the app to do other things.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D18203391

fbshipit-source-id: 35c5f03316a1106a3a48e7770d5bb59c62a3694f
2019-10-31 16:26:42 -07:00
Rick Hanlon 8524b6182d LogBox - Optimistically symbolicate
Summary:
This diff adds optimistic loading for symbolicated stack traces by so that we (almost) never show a loading state for stack traces. Because of this, we also remove the "Stack Trace" status except when it is loading or failed. Also refactored the related components to hooks 🎣

Changelog: [Internal]

Reviewed By: mmmulani

Differential Revision: D18110403

fbshipit-source-id: a93b0a63e1c9490fea73ca6ec7c5707670bdea53
2019-10-31 16:26:42 -07:00
David Vacca 67a1743e20 Enable codegen ViewConfig in production
Summary:
This diff enables the codegen ViewConfig in production, which have been running in Dev mode for 4+ months withouth any issue

Changelog: [Internal]

Reviewed By: rickhanlonii, ejanzer

Differential Revision: D18218546

fbshipit-source-id: cc74a89db1b1f8d9770a0b7dacb2fbfa6fd3a2d7
2019-10-31 12:09:04 -07:00
Eli White bb29cd92cc Partial React Sync for revisions 4eeee358e12c...2b18a13d2bf
Summary:
This sync includes the following commits:

- **[2b18a13d2](https://github.com/facebook/react/commit/2b18a13d2 )**: Revert "Dispatch commands to both UIManagers from both renderers (#17211)" (#17232) //<Eli White>//
- **[ab69a4d7e](https://github.com/facebook/react/commit/ab69a4d7e )**: Rename findHostInstance_deprecated to findHostInstance_DEPRECATED (#17228) //<Eli White>//
- **[d26ed2e42](https://github.com/facebook/react/commit/d26ed2e42 )**: Add findHostInstance_deprecated to the React Native Renderer (#17224) //<Eli White>//
- **[5ec25817c](https://github.com/facebook/react/commit/5ec25817c )**: Dispatch commands to both UIManagers from both renderers (#17211) //<Eli White>//
- **[f68f5fcee](https://github.com/facebook/react/commit/f68f5fcee )**: Update RN typings for a shim (#17138) //<Dan Abramov>//

Changelog:
[General][Changed] Partial React Sync for revisions 4eeee358e12c...2b18a13d2bf

Reviewed By: gaearon

Differential Revision: D18233299

fbshipit-source-id: 0adbc51d8a69de8b95f5efa4be011be88bc450aa
2019-10-31 12:00:55 -07:00
Eli White c5980a4b0f Move ReactNativeTypes-flowtest.js out of the Renderer folder
Summary:
The renderer folder gets replaced by react syncs but we don't want to lose this flow test. It would make sense to move this file into the React repo as it is trying to test `ReactNativeTypes.js` which lives there. However, the React repo is on Flow 0.72 which apparently doesn't catch this issue.

Changelog: [Internal]

(Note: this ignores all push blocking failures!)

Reviewed By: gaearon

Differential Revision: D18231354

fbshipit-source-id: 69f4617899c06118c74a8991f061e3bb3fdc88fb
2019-10-30 14:35:02 -07:00
Maurus Cuelenaere c2c4b43dfe Add Android support for fontVariant prop (#27006)
Summary:
Android was missing support for the `fontVariant` prop in TextViews, this PR adds that.

## Changelog

[Android] [Added] - Add Android support for fontVariant prop
Pull Request resolved: https://github.com/facebook/react-native/pull/27006

Test Plan:
Since I can't get RNTester to work locally (it crashes when loading `libyoga.so` on `No implementation found for long com.facebook.yoga.YogaNative.jni_YGConfigNew()`), I'll post some screenshots below of our app showing the difference.

We are using a slightly different [version](10cafcaa07) of this commit, since we're still on 0.60, but the gist remains the same when rebased on master.

Before:
![Screenshot_20191025-130325__01](https://user-images.githubusercontent.com/1682432/67566586-7b3f2880-f728-11e9-85c0-57667d645153.jpg)

After:
![Screenshot_20191025-130444__01](https://user-images.githubusercontent.com/1682432/67566599-842ffa00-f728-11e9-988a-1b12ee393b83.jpg)

Differential Revision: D18179642

Pulled By: mdvacca

fbshipit-source-id: 03a050aa76e7bafa0343354dfa778cf74af5abd2
2019-10-29 00:29:20 -07:00
Oleksandr Melnykov bcec1281c7 Use commands instead of setNativeProps for AndroidSwitch
Summary:
Fabric doesn't support setNativeProps, so we are using view commands instead.

Changelog: [Internal]

Reviewed By: JoshuaGross, TheSavior

Differential Revision: D17736672

fbshipit-source-id: bb0eee9330c01751829172bbc03bfd12b1e24cad
2019-10-28 17:47:03 -07:00
david dfb4f4af68 issue #18943 - SectionSeparatorComponent and ItemSeparatorComponent s… (#26933)
Summary:
SectionSeparatorComponent and ItemSeparatorComponent should displays in the correct place with an inverted list

This PR fix issue https://github.com/facebook/react-native/issues/18943
Currently, when using SectionSeparatorComponent and ItemSeparatorComponent with an inverted SectionList, the separators will display at the wrong place.
Please see issue https://github.com/facebook/react-native/issues/18943 for more information.

## Changelog
[General] [Fixed] - Fix separators displays in wrong places with the inverted list
Pull Request resolved: https://github.com/facebook/react-native/pull/26933

Test Plan:
before this fix, the following code will result in following screenshots:
```
import React from 'react';
import { StyleSheet, Text, SectionList, SafeAreaView } from 'react-native';

export default function App() {
  return (
    <SafeAreaView style={styles.container}>
      <SectionList
        style={{ width: '100%' }}
        sections={[
          {
            data: ['item 1', 'item 2', 'item 3', 'item 4', 'item 5', 'item 6', 'item 7']
          }
        ]}
        renderItem={({ item }) => <Text style={{ fontSize: 18, backgroundColor: 'greenyellow', width: '100%' }}>{item}</Text>}
        inverted
        SectionSeparatorComponent={() => <Text style={{ fontSize: 28, backgroundColor: 'fuchsia', width: '100%' }}>section separator</Text>}
        ItemSeparatorComponent={() => <Text style={{ fontSize: 12, backgroundColor: 'gold', width: '100%' }}>item separator</Text>}
        renderSectionHeader={()=><Text style={{ fontSize: 38, backgroundColor: 'lightpink', width: '100%' }}>section header</Text>}
        renderSectionFooter={()=><Text style={{ fontSize: 38, backgroundColor: 'lightpink', width: '100%' }}>section footer</Text>}
      />
    </SafeAreaView>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#fff',
    alignItems: 'center',
    justifyContent: 'center',
  },
});
```
<img width="413" alt="螢幕快照 2019-10-21 下午12 23 36" src="https://user-images.githubusercontent.com/1477985/67176763-030df580-f3fe-11e9-938f-38939339bf5c.png">

after this fix, the separators will display in the right place
<img width="414" alt="螢幕快照 2019-10-21 下午12 23 51" src="https://user-images.githubusercontent.com/1477985/67176795-2042c400-f3fe-11e9-96f3-a8ea1cfb28a2.png">

Differential Revision: D18174225

Pulled By: cpojer

fbshipit-source-id: 30901e68f38326c69715514a09a7a5130a2332a0
2019-10-28 12:14:38 -07:00
Rick Hanlon 8cfa379503 LogBox - Update header to cycle around to begining
Summary:
This diff updates the header pagination logic so that it circles around to the beginning/end when reaching either end of the log list in the LogBox inspector.

It also changes the header message for a single log from "Logs" to "Log 1 of 1"

Changelog: [Internal]

Reviewed By: cpojer

Differential Revision: D18091621

fbshipit-source-id: 4d7e5e2cb0eb1a1ed09ca8ad318e6715d674648f
2019-10-28 10:10:55 -07:00
Rick Hanlon 3c525d5b17 LogBox - Display errors for notifications and inspector
Summary:
This diff adds and displays errors in LogBox. We will now toast both warnings and errors, open errors for inspection, and allow paginating through errors and warnings.

Changelog: [Internal]

Reviewed By: cpojer

Differential Revision: D18091519

fbshipit-source-id: c155969dc505de5cfb0e95bb5a8221b9f8cfe4f7
2019-10-28 10:10:55 -07:00
Rick Hanlon c5aa26da41 Add log level to support errors
Summary:
This diff adds a level to LogBox logs so that we can store and display errors in later diffs

Changelog: [Internal]

Reviewed By: cpojer

Differential Revision: D18091101

fbshipit-source-id: 21661d28a7945bdcb56702e2a03ab3612c11fe35
2019-10-28 10:10:54 -07:00
Adam Ernst bdaab3c2e5 Run depslint on fb_plugin_apple_library rules
Summary: Changelog: [Internal]

Differential Revision: D18152380

fbshipit-source-id: f33f6cb2f6baeba0719a91c5189357be33a38f59
2019-10-26 13:47:15 -07:00
Kevin Gozali f15309fa15 Appearance: stop caching colorScheme in JS
Summary:
At times, the OS updates the color scheme without any active listener on RN side, e.g. if all RCTRootView's in iOS have been deallocated, no one will tell JS that the color scheme changes. So let's just always ask native side for the latest value.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D18117334

fbshipit-source-id: e8564fb284c5720061592ba72e5b4907e5b48853
2019-10-24 11:09:10 -07:00
Kacie Bawiec 85ac9cf6c7 Flow type Animated.View
Summary:
Add flow typing to `Animated.View`.

Changelog: [Internal]

Reviewed By: TheSavior

Differential Revision: D18050607

fbshipit-source-id: 454ef20715527c3c809e2fa4cfb2e1a198d6a3e0
2019-10-23 11:43:28 -07:00
Emily Janzer e7f6210d5d Don't attempt to connect to React devtools every 2s
Summary:
When testing out the NetworkOverlay, I noticed that we were creating a lot of WebSocket connections for localhost:8097. Rick found that this is because we're trying to connect to React devtools every 2 seconds: https://github.com/facebook/react/blob/master/packages/react-devtools-core/src/backend.js#L67 and it appears we create a new WebSocket every time.

Dan suggested that we use opening the dev menu as a trigger for attempting to connect to React devtools. This diff uses RCTNativeAppEventEmitter to emit an event from native when the dev menu/dialog is shown, and listening to that event in JS to attempt to connect to devtools.

I'm also making the change of passing in a websocket instead of just passing in the host + port; this way it will only attempt to connect once on each call to `connectToDevTools` (otherwise, we would attempt to reconnect every 2 seconds as soon as the dev menu is opened, and then the next time the menu is opened we'd so start that *again*, and so on - I could have it keep track of whether it's already connecting and avoid doing it again, but this is easier and should be sufficient, I think).

We should probably also update the suggested troubleshooting tips on the devtools page to reflect this change, so that people don't get confused.

Changelog: [General] [Fixed] Fix issue where we attempt to connect to React devtools every 2 seconds

Reviewed By: mmmulani

Differential Revision: D17919808

fbshipit-source-id: 4658d995c274574d22f2f54ea06d7f29ef2f54dc
2019-10-23 10:30:43 -07:00
Moti Zilberman 99d229e186 Make deepDiffer behavior with function inputs configurable, add logging
Summary: Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D17951644

fbshipit-source-id: 34bff1937a6157b049193359cb0ad346c48287a6
2019-10-23 00:58:56 -07:00
Emily Janzer c10c147bcc Fix a parameter type in NativeNetworkingAndroidSpec
Summary:
`responseType` should be a string, not an Object (which gets converted to a NativeMap by TM).

Changelog: [General] [Fixed] Fix the flow type for NativeNetworkingModule

Reviewed By: fkgozali

Differential Revision: D18019418

fbshipit-source-id: 316470ca82241223eafb5b05a54fc2bbf3074821
2019-10-22 19:34:40 -07:00
Luna Wei 6ba2769f0f Separate ScrollViewCommands
Summary: Changelog: [Internal] Move out ScrollView commands to prevent circular dependency

Reviewed By: TheSavior

Differential Revision: D18065033

fbshipit-source-id: fa4f69ec6fd565bc7b7f4bd085ed44e1289c5246
2019-10-22 19:03:43 -07:00
Luna Wei b6343408f9 Back out "Back out "Convert scrollresponder dipatches to native commands""
Summary:
Changelog: [Internal] Convert scrollTo, scrollToEnd, flashScrollIndicators to use native commands

This was reverted because of a circular dependency that was found in AMA. See D18065033 for fixing the circular dependency

Reviewed By: TheSavior

Differential Revision: D18063703

fbshipit-source-id: 7bd0125833f4f9e9e2f227732af0d6e38f009c06
2019-10-22 19:03:43 -07:00
Ramanpreet Nara 002d3c179d Retain cropData object in ImageEditingManager.cropImage
Summary:
All struct args are passed into NativeModule methods via references. If blocks access those references, we don't move those references to the heap. This means that by the time that the block accesses the struct arg, it could be freed. This can crash the program.

The solution is simple: we copy the struct arg, and access the copy in the block. This ensures that the block will make a copy, which prevents the underlying data structures from being released by the time that the block accesses the struct arg.

Changelog:
[iOS][Fixed] - Retain cropData struct arg in ImageEditingManager.cropImage call

Differential Revision: D18076026

fbshipit-source-id: 1a7bb602606ff1afac38ad5451662c82fa86f205
2019-10-22 17:16:33 -07:00
Panagiotis Vekris 94845b5783 Suppress private property accesses
Summary: Changelog: [Internal]

Reviewed By: rijn

Differential Revision: D18055795

fbshipit-source-id: c48e1b7c14dc052b9cebc48037ac745dd2890969
2019-10-22 16:55:17 -07:00
Rick Hanlon cc056907cf Clean up API for LogBoxLogParser
Summary:
This diff cleans up two functions from:

```
LogBoxLogData.add({args: ['A']});
LogBoxLogParser({args: ['A']});
```

to:

```
LogBoxLogData.add(['A']);
LogBoxLogParser.parseLog(['A']);
```

Changelog: [Internal]

Reviewed By: cpojer

Differential Revision: D18056462

fbshipit-source-id: be6108069fc24b1f25d1382ad31c314183c793f8
2019-10-22 14:13:20 -07:00