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

15637 Коммитов

Автор SHA1 Сообщение Дата
David Vacca adc1a95a3b Reuse ViewManagerRegistry between UIManagerModule and FabricUIManager
Summary: This diff reuses the ViewManager registry between UIManagerModule and Fabric, previously View Managers were being initialized twice (one for each UIManager), increasing Fabric TTI by ~77ms

Reviewed By: shergin

Differential Revision: D13640912

fbshipit-source-id: d7a9591084c66e4a2fc2384b2dae1b7fc5a228d0
2019-01-11 18:45:45 -08:00
Valentin Shergin cb14b06309 Fabric: More systraces for Diffing and Commit phase
Summary: Trivial.

Reviewed By: mdvacca

Differential Revision: D13644482

fbshipit-source-id: 90cfa04797682e57fc4de009fe4a412167b9e8cd
2019-01-11 18:13:55 -08:00
Valentin Shergin 7bf6f2c238 Fabric: Layout/Yoga related systrace sections
Summary: Trivial.

Reviewed By: mdvacca

Differential Revision: D13643275

fbshipit-source-id: 67a562b899f077d7ca53b64456807a8d7c8fe6b7
2019-01-11 18:13:55 -08:00
Kacper Wiszczuk 7d79411008 imp: Add templates to rn package (#22952)
Summary:
Changelog:
----------

[General] [added] - Add `templates` to `react-native` package.

We need a `template` to initialize new RN project from `react-native-cli`. We are planning to remove `templates` from `cli` to be always synced with chosen rn version. Issue for that in `react-native-cli` is here: https://github.com/react-native-community/react-native-cli/issues/39 .
cc grabbou cpojer
Pull Request resolved: https://github.com/facebook/react-native/pull/22952

Differential Revision: D13644364

Pulled By: hramos

fbshipit-source-id: d5d7a820ffacb342e1e97d83739987678ff511e9
2019-01-11 17:54:08 -08:00
Eli White 7ef6716582 Change buck to take path to schema instead of fixture name
Summary: When we actually use the codegen we will be passing in a path to a schema. Refactoring the existing buck rules to take a path to a schema instead of a fixture name so it can be reused.

Reviewed By: mdvacca

Differential Revision: D13619358

fbshipit-source-id: 1180d2e80c11b93f3cbdb0f9e848ae37bff199f4
2019-01-11 15:34:58 -08:00
Dulmandakh 62264b7ce2 bump buck to 2019.01.10.01 (#22960)
Summary:
bump Buck to 2019.01.10.01

Changelog:
----------
[General] [Changed] - bump Buck to 2019.01.10.01
Pull Request resolved: https://github.com/facebook/react-native/pull/22960

Differential Revision: D13640470

Pulled By: hramos

fbshipit-source-id: 125e127eb5e71daaebcadbde6c067651c9c17986
2019-01-11 15:19:01 -08:00
Héctor Ramos 700c713671 Bump to Android Build Tools 28.0.3, Gradle 4.10.2, Gradle Plugin 3.2.1
Summary: Bump Android Build Tools to Version 28.0.3, Gradle to 4.10.2, and the Android Gradle Plugin to 3.2.1.

Reviewed By: mdvacca

Differential Revision: D13631120

fbshipit-source-id: 709aa25a7a8e1ff0bfc0a969ba6e7cd92850bc0f
2019-01-11 12:24:59 -08:00
David Aurelio 7406276a5b Remove enum count macros
Summary:
@public
Removes all `YG...Count` macros for enums and replaces them with `facebook::yoga::enums::count<YG...>()`.
This removes the need to manually maintain enum counts.

Same as D13597449, working around a defect in clang < 3.9

Reviewed By: amir-shalem

Differential Revision: D13634622

fbshipit-source-id: 344dc70e167b0caf746fe396cedd200f54e52219
2019-01-11 03:11:58 -08:00
Amir Shalem 1feda5e5c8 Revert D13597449: [Yoga][cleanup] Remove enum count macros
Differential Revision:
D13597449

Original commit changeset: edcee225ada4

fbshipit-source-id: 1afc24833c8657a8a198bc4529d98c8f605b7fbd
2019-01-10 23:51:29 -08:00
Taras Tsugrii c458242d87 Reformat xplat build files according to new formatting rules.
Summary: drop-conflicts

Reviewed By: zertosh

Differential Revision: D13610808

fbshipit-source-id: 52c2a90bba3d9b0ac383f6e4a76b4fb3e60bf382
2019-01-10 20:00:42 -08:00
gengjiawen 768c1ba641 remove envinfo from dependency. (#22870)
Summary:
remove it since `react-native-cli` already moved out.

pass current ci.
Pull Request resolved: https://github.com/facebook/react-native/pull/22870

Differential Revision: D13627371

Pulled By: hramos

fbshipit-source-id: 16a7b6516fa4778222aca52cf9c3c54645e1ccf7
2019-01-10 17:02:09 -08:00
Rick Hanlon 5d1b27b017 Fix RNTester Camera Example
Summary: Fixes a bug introduced with the example filtering in D13561744 causing the Camera Roll example to not show any pictures

Reviewed By: JoshuaGross

Differential Revision: D13622124

fbshipit-source-id: a5863dcdd9f89ae1373910f25b38e4a322796dbe
2019-01-10 15:47:02 -08:00
Arthur Lee 6c501eb666 Fix status bar default on Android
Summary: On Android, the status bar color is not always black by default. The existing code causes the status bar to revert to black once the last `<StatusBar>` component is unmounted from the "stack". This diff reverts the bar background color to what it was before, instead of assuming black.

Reviewed By: yungsters

Differential Revision: D13368136

fbshipit-source-id: ef0154f776607b57bb9400b72d521f5f485b0075
2019-01-10 14:53:22 -08:00
Joshua Gross 630e9faf74 Fix permissions regression in RCTCameraRollManager
Summary:
In the past (pre D13593314), ALAssetsLibrary camera operations would pop up a permissions dialogue when appropriate and block until the user responded to the dialogue. The calls that we're now using with PHPhotoLibrary immediately return if we don't have permission to access the photo library or haven't asked before, and then asynchronously pop up a permissions dialogue, causing every first photo interaction to fail. Instead we now explicitly check for permissions or request
permissions before any operations.

Reviewed By: PeteTheHeat

Differential Revision: D13620079

fbshipit-source-id: e1befc0ddaec2c1b3334e361f5ae3a3efc5da71d
2019-01-10 13:10:28 -08:00
Brian Shin 5c0b9071e7 Remove PlatformOS from RN
Summary: The existence of this file was confusing many in open source (5ee27ff755) and is no longer needed internally. Delete this file to remove the fork.

Reviewed By: fkgozali

Differential Revision: D13625760

fbshipit-source-id: 1be1943471b67e914377c24d445568532e378385
2019-01-10 12:52:02 -08:00
Eli White a1dc92e6f0 Fix Flow type for onAccessibilityEscape
Summary: This was added in [this PR](https://github.com/facebook/react-native/pull/22047) with a non strict type

Reviewed By: yungsters

Differential Revision: D13617894

fbshipit-source-id: 849f83203556e2830ac725570c9053503377f4be
2019-01-10 11:25:51 -08:00
Eli White 09795b6334 Don't glob over single files
Summary: Was getting a lint error for this being in the glob

Reviewed By: rickhanlonii

Differential Revision: D13618406

fbshipit-source-id: cebaff99cf71c6ff949342e8cb9f36853616cf0c
2019-01-10 11:21:31 -08:00
David Aurelio 35a136801c Remove enum count macros
Summary:
@public
Removes all `YG...Count` macros for enums and replaces them with `facebook::yoga::enums::count<YG...>()`.
This removes the need to manually maintain enum counts.

Reviewed By: shergin

Differential Revision: D13597449

fbshipit-source-id: edcee225ada4058e94f3a727246763e3cc45873d
2019-01-10 07:56:15 -08:00
Ramanpreet Nara 0265ee199b Fix autoFocus
Summary: In D13408886, I landed a PR that broke the `autoFocus` prop. This diff fixes this prop by partially reveting some of the changes in that diff.

Reviewed By: TheSavior

Differential Revision: D13611258

fbshipit-source-id: 225b9b59b2500cfac092f13c273685aaeb599ab0
2019-01-09 15:31:43 -08:00
Eli White f40a04ae3a Remove $FlowFixMe on View
Summary: https://fb.workplace.com/groups/flow/permalink/2274899262558676/

Reviewed By: yungsters

Differential Revision: D13610629

fbshipit-source-id: 5d066ff50b056d5dde0fa5b99796e6846723f5cf
2019-01-09 12:25:31 -08:00
Ram N 93fa4efe06 Implement callback method
Summary: Implement callbacks in Turbo Module

Reviewed By: mdvacca

Differential Revision: D6744474

fbshipit-source-id: c896dbc936c3051d9f0e4582da042cd34da996bc
2019-01-09 10:48:02 -08:00
Peter Argany e6eff1f54f Fix RNTester Snapshot and Integration tests missing polyfills
Summary: Emily removed some magic that required InitializeCore for everything back in Sept/Oct. These tests have been broken for a long time, so it wasn't obvious that they broke.

Reviewed By: ejanzer

Differential Revision: D13601264

fbshipit-source-id: ea6ab7c8891207dad06cd062968d019a236cf8fc
2019-01-09 10:23:50 -08:00
Eli White 2f32fea79a Remove LayoutStyle, ShadowStyle, TransformStyle in favor of just ViewStyleProp
Summary: We are working to remove additional types and eventually define everything at the top level as a public exported type of react-native. I was able to update callsites by just using ViewStyleProp in places that were expecting a prop of just one of these. It is a little bit weaker, but much simpler. If a callsite wants to only take margin, it should just take a margin prop instead of a LayoutStyle prop.

Reviewed By: rickhanlonii

Differential Revision: D13599460

fbshipit-source-id: 12c01bc58baa7f6acf33e0b8aab05dabb79c646b
2019-01-08 18:49:37 -08:00
Marko Novakovic 65194534f6 Using ENUM_BITFIELDS_NOT_SUPPORTED for enum bitfields
Reviewed By: davidaurelio

Differential Revision: D13556160

fbshipit-source-id: e6d373a4e1dd702509b5d63606c08fae9cdb5498
2019-01-08 16:22:29 -08:00
Adam Comella f6f8b092f9 Android TextInput: Improve application of styles for `value` prop (#22461)
Summary:
Prior to this change, when you passed text to `TextInput` via the `value` or `defaultValue` props, React Native didn't apply any of the styles in `buildSpannedFromShadowNode` to the text. This is because `spannedFromShadowNode` appends `value` after calling `buildSpannedFromShadowNode`. Many styles worked because their logic is included in both `buildSpannedFromShadowNode` and `ReactTextInputManager`. However, some only appear in `buildSpannedFromShadowNode` such as `textDecorationLine` (it would be good to understand why we need to duplicate styling logic in `buildSpannedFromShadowNode` & `ReactTextInputManager` and to know whether `ReactTextInputManager` should be handling `textDecorationLine`).

Also, this commit improves consistency between iOS and Android if you specify both `value` and children on a `TextInput`. Prior to this, iOS concatenated the strings such that the `value` prop came before the children whereas Android put the children before the `value` prop. Now Android matches iOS's behavior and puts the `value` prop before the children.

These appear to be regressions. The `value` prop used to be appended before calling `buildSpannedFromShadowNode` (this behavior appears to have been changed by accident in 80027ce6db (diff-4f5947f2fe0381c4a6373a30e596b8c3)).

The fix is to append the `value` prop before calling `buildSpannedFromShadowNode`. Additionally, we have to expose a new `start` parameter on `buildSpannedFromShadowNode` so that we can tell it to include the text from the `value` prop in the range that it styles. Without this, the start of the styled text would be immediately after `value` because `value` is appended before calling `buildSpannedFromShadowNode`
Pull Request resolved: https://github.com/facebook/react-native/pull/22461

Reviewed By: mdvacca

Differential Revision: D13282065

Pulled By: shergin

fbshipit-source-id: 4c99094741441cf54cdec0075bfd08ff7d889e66
2019-01-08 15:58:43 -08:00
David Aurelio 2a1faec1ca Remove repetition in `YGEnums.h`
Summary:
@public

Wraps enum definition in a single macro.

Down the line, this will allow us to add more functionality:
- Replace manual counts with `yoga::enums::count<YG...>()`
- `yoga::enums::max<YG...>()`
- A bitfield implementation with known memory layout using `max<>()`

Reviewed By: SidharthGuglani

Differential Revision: D13597259

fbshipit-source-id: 543a11a53090bedf1474d00328565ed57d059e23
2019-01-08 12:51:43 -08:00
David Aurelio 3e24710155 Apply clang-format rules
Summary:
@public

Formats Yoga's source according to our clang-format configuration

Reviewed By: SidharthGuglani

Differential Revision: D13596650

fbshipit-source-id: c3722d4eafd63b7596a8b1e85c0197e9d2d6cb7d
2019-01-08 12:51:43 -08:00
Kevin Gozali db87c2544c Re-land D13583442: [RN] Moved TurboModule iOS core to github
Summary:
The original commit was backed out due to a build failure, which seems to be due to compiler flag misconfiguration. That has been fixed.

Original commit: f2fccbb327

Reviewed By: mdvacca

Differential Revision: D13593075

fbshipit-source-id: f3a65e8bd9830f6ac2ea829020500b4632ee2149
2019-01-08 09:12:50 -08:00
Joshua Gross 8e9ce92f57 Un-revert D13513777: Replace ALAssets* with PHPhoto* in RCTCameraRoll
Summary: Replaced all deprecated ALAssets* references to roughly equivalent PHPhoto* references in RCTCameraRoll library. There are still some minor inconsistencies between iOS/Android and documentation that existed prior to this diff that need to be resolved after this.

Reviewed By: fkgozali

Differential Revision: D13593314

fbshipit-source-id: 6d3dc43383e3ad6e3dbe73d4ceceac1ba9261d9d
2019-01-07 16:15:44 -08:00
Luna Wei b5e6ae0fc4 Unify native props
Summary: Unify native props for Switch

Reviewed By: TheSavior, mdvacca

Differential Revision: D13563403

fbshipit-source-id: d219febf197bd024d1ef2acda9f42e40bdf39532
2019-01-07 15:39:21 -08:00
Josh Justice 00905ab8f7 Fix rerender count on RNTester blue tab (#22876)
Summary:
In the RNTester TabBarIOS screen, the content of the blue tab suggested it should be displaying a count for the number of rerenders, but it was not:

![before](https://user-images.githubusercontent.com/15832198/50725270-d122e100-10c0-11e9-88a2-1030f6dc3b9a.jpg)

This PR adds the count onto the blue tab:

![after](https://user-images.githubusercontent.com/15832198/50725275-dbdd7600-10c0-11e9-9f8f-0835fe1ea054.jpg)

The other two tabs already had the counter working correctly.

Changelog:
----------

[General] [Fixed] - Fix rerender count on RNTester blue tab
Pull Request resolved: https://github.com/facebook/react-native/pull/22876

Differential Revision: D13593262

Pulled By: PeteTheHeat

fbshipit-source-id: b45a9fcaed0f217054baa0d28fd3a2ff9a846b08
2019-01-07 15:32:01 -08:00
Kevin Gozali 8c23b1804b Revert D13583442: [RN] Moved TurboModule iOS core to github
Differential Revision:
D13583442

Original commit changeset: bb1cabd973e8

fbshipit-source-id: 0279e68c7001ec91cf7bbd835bf83232943bb708
2019-01-07 00:47:38 -08:00
David Vacca 3d12ad5b1a workaround to prevent NPE in ReactViewGroup.dispatchProvideStructure
Summary:
This diff adds a workaround to prevent a NPE to be thrown when the user tap on Android assistant.
The Android stacktrace doesn't help to determine what is the root cause
This is affecting few users in the route: react_MarketplaceProductDetailsFromPostIDRoute

see https://our.intern.facebook.com/intern/logview/details/facebook_android_crashes/b4858cd35bd3496922e5dad4cca70fff/?trace_key=d46b402c3f0cc48c33613b279439a8bf for more details

Reviewed By: fkgozali

Differential Revision: D13586092

fbshipit-source-id: 70f44ab3e32b0c0334e61e8e358c1441944d2727
2019-01-04 18:59:20 -08:00
David Vacca 9380ec0d23 Fix 'global reference table overflow' error in Fabric
Summary: This diff ensures that the 'measure' method in TextLayoutManager is memoized using a static variable.

Reviewed By: fkgozali

Differential Revision: D13585508

fbshipit-source-id: 9275a4d193b8abb0c3aaffd5a5535234717475e1
2019-01-04 16:36:32 -08:00
Kevin Gozali a3df286247 Move TurboModuleRegistry (JS) to github
Summary:
Moved the JS wrapper function to github. To access a TurboModule from JS:

```
export interface Spec extends TurboModule {
  +func1: () => number,
}

const module = TurboModuleRegistry.get<Spec>('SampleTurboModule');
```

This assumes:
* the binding on the native side has been installed properly, i.e. `global.__turboModuleProxy` needs to be installed properly.
* the module `SampleTurboModule` is registered properly in native.

More instructions will be provided later.

Reviewed By: yungsters

Differential Revision: D13584561

fbshipit-source-id: 50d29d88787f8d9caa7a3ee0d54d378db866515c
2019-01-04 16:19:43 -08:00
Kevin Gozali f2fccbb327 Moved TurboModule iOS core to github
Summary:
This is the iOS binding for TurboModule.

To install the TurboModule binding:
* Provide `RCTCxxBridgeDelegate`
* Provide `RCTTurboModuleManagerDelegate`

Somewhere in `RCTCxxBridgeDelegate` impl:

```
RCTTurboModuleManager *manager = [[RCTTurboModuleManager alloc] initWithRuntime:&runtime bridge:bridge delegate:self];
[manager installJSBinding];
```

Doing so will install `global.__turboModuleProxy()` in JS space.

Note:
* The full instructions will be provided once all pieces are moved to OSS.
* Sample modules and binding setup will be provided later.

Reviewed By: RSNara

Differential Revision: D13583442

fbshipit-source-id: bb1cabd973e8a9ec59da6b145826e9ea234a96b3
2019-01-04 15:24:07 -08:00
Ullrich Schäfer ac39795948 Fixing ActionSheetIOS position after rotation on tablet (#22738)
Summary:
There's been a bug on iOS and iPad that the position of an action sheet using UIActionController isn't updated if the position of its anchor view changes due to rotating the device. A common scenario would be, presenting an action sheet from a right bar button item. Rotating the device will most likely change the bar button's X coordinate. The action sheets arrow would still point to the old position due to how it has been implemented so far.

I used also reduced some code duplication between `-showActionSheetWithOptions` and `-showShareActionSheetWithOptions:` while at it.

Changelog:
----------

[iOS] [Fixed] - Action Sheet position after rotation on tablet
Pull Request resolved: https://github.com/facebook/react-native/pull/22738

Differential Revision: D13582810

Pulled By: PeteTheHeat

fbshipit-source-id: a93065284b02efc41ae7378465521330a828a126
2019-01-04 13:09:00 -08:00
Shen Junru 7de2f77d20 Fix expose originalConsole issue (#22844)
Summary:
The "originalConsole" expose is incorrect in the "polyfills/console.js"

Changelog:
----------

[GENERAL] [Fixed] - Fixed originalConsole expose issue
Pull Request resolved: https://github.com/facebook/react-native/pull/22844

Differential Revision: D13579480

Pulled By: cpojer

fbshipit-source-id: 1d3ad84d3560b757df23170924af9c7655738871
2019-01-04 00:04:05 -08:00
Rick Hanlon 2b883abc06 Codemod ImageStyleProp
Summary:
Created by running:

```
$ js1 codeshift rn-stylesheet-exports --component="Image" --prop="ImageStyleProp" ./
$ hg status -n --change . | xargs js1 prettier
```

drop-conflicts

Reviewed By: TheSavior

Differential Revision: D13565530

fbshipit-source-id: cc1ae4274db315bce607c2b62db786f87a2cfc21
2019-01-03 06:53:53 -08:00
Rick Hanlon 44a289cf26 Switch Text style to TextStyleProp
Summary: This diff switches `Text.style` from `DangerouslyImpreciseStyle` to `TextStyleProps` and fixes/ignores the related flow issues

Reviewed By: TheSavior

Differential Revision: D13568053

fbshipit-source-id: b4b6f8c22323faf9592ef13697043bb181c77423
2019-01-03 03:43:26 -08:00
David Vacca dc114260d9 Integrate Fabric rendering system with ReactChoreographer
Summary:
This diff moves the dispatching of views to the React Choreographer, this help to sort the mount of views following the order specified in the ReactChoreographer class.
This also enables synchronous and correct order for mounting of views that are dispatched in the UI Thread.

Reviewed By: sahrens

Differential Revision: D13444487

fbshipit-source-id: d8a43f473b07c9ccf7ea3bc9ab90545ec3c9ecee
2019-01-02 17:24:32 -08:00
Christoph Nakazawa 117dcd9c58 Fix error message in NativeViewHierarchy
Summary: It was pointed out to me in https://github.com/facebook/react-native/pull/22508 by raphael-liu that the error message refers to the wrong tag. I didn't merge the PR because I don't have good insight into the effects it could cause, but we should at least fix the error message.

Reviewed By: TheSavior

Differential Revision: D13564266

fbshipit-source-id: fa76f0888364df329d052dbcc2050f906d39dcef
2019-01-01 19:45:33 -08:00
zhongwuzw dd209bb789 Fix crash for web socket in some race conditions (#22439)
Summary:
Fixes #21086.
Fixes #6117.

This PR fixes a crash caused by a race condition when `webSocket` deallocated and `NSStream` delegate callback, because `NSStream`'s delegate callback be called on `RCTSR_networkRunLoop`.

This PR mainly changes:

* Remove unnecessary `nil` operation in `dealloc` method.
* Add a new method `_scheduleCleanUp` to schedule `webSocket` cleanup also on `RCTSR_networkRunLoop`.
* In `stream:(NSStream *)aStream handleEvent:(NSStreamEvent)eventCode` delegate method, add a `wself` to make safe further.
Pull Request resolved: https://github.com/facebook/react-native/pull/22439

Differential Revision: D13564247

Pulled By: cpojer

fbshipit-source-id: 675c1b2805aa45c54d7708d796f5843ef7ea34e2
2019-01-01 17:55:29 -08:00
Ignacio Olaciregui 2c3f807ace Fix no shadow warnings (#22190)
Summary:
Fixes `no-shadow` eslint errors.
Pull Request resolved: https://github.com/facebook/react-native/pull/22190

Differential Revision: D13564238

Pulled By: cpojer

fbshipit-source-id: 96ba36b397088fa406e8f5781b1538a0b6804a8d
2019-01-01 17:13:15 -08:00
Rick Hanlon bd32234e6e Add flow types RNTester examples (#22829)
Summary:
This PR adds flow types for the RNTester examples, and updates all of the RNTester examples to match the flow type consistently.

Previously, there was a mix of static class definitions and whether or not pages exported examples or a component. Now we will always export the same way, enforced by flow types

Note: I also fixed most of the $FlowFixMe in changed components
Pull Request resolved: https://github.com/facebook/react-native/pull/22829

Reviewed By: cpojer

Differential Revision: D13563191

Pulled By: rickhanlonii

fbshipit-source-id: b697e3346a863d1b130881592b0522a96c202b63
2018-12-31 08:30:54 -08:00
Rick Hanlon 34ee8250b5 Add filtering to e2e tests (#22828)
Summary:
This PR adds filtering for e2e test examples using the new examples filter introduced in https://github.com/facebook/react-native/pull/22777

To do that we:
- Add a `testID` to `RNTesterExampleFilter` to select an example
- Refactor a few examples to export multiple examples for filtering
- Update all tests to filter by example title
Pull Request resolved: https://github.com/facebook/react-native/pull/22828

Reviewed By: TheSavior

Differential Revision: D13562664

Pulled By: rickhanlonii

fbshipit-source-id: efb0ca8050c1ca5c10d96bd77d35dd1143c3a3b3
2018-12-31 04:33:49 -08:00
Ramanpreet Nara 9db0050635 Fix Jest mocks
Summary: Since we started relying on NativeModules' getConstants() method to access constants, we need to update our jest mocks of these NativeModules, so that the tests still pass. I do that in this diff.

Reviewed By: fkgozali

Differential Revision: D13561376

fbshipit-source-id: eaef3de82d842fd97d04be741d55bdded73c6a11
2018-12-30 13:31:16 -08:00
Kudo Chien 3fae388424 Fix CircleCI build error (#22822)
Summary:
----------

side effect of gradle task name changed from f3e5cce474

Changelog:
----------

[Android] [Fixed] - Fix CircleCI build error
Pull Request resolved: https://github.com/facebook/react-native/pull/22822

Differential Revision: D13562455

Pulled By: RSNara

fbshipit-source-id: a39a19350dcd91b2f06e064c3aec62b94d009fab
2018-12-30 10:47:10 -08:00
Josh Justice 386c2ec6f0 Added filtering to RNTester example screens (#22777)
Summary:
This PR adds filtering functionality to individual example screens of RNTester. This is useful for Detox testing of RNTester, since Detox requires elements to be visible on the screen before they can be interacted with. Instead of needing to scroll an arbitrary amount, the test can enter the name of the example to be tested, just as is done on the main screen. This will lead to simpler and more reliable E2E tests for long example screens. This PR doesn't add any automated tests using the filter; those will be added in a separate PR.

This is implemented by extracting the existing filtering functionality out of `RNTesterExampleList` into a shared `RNTesterExampleFilter` component that can be used both within `RNTesterExampleList` (the main screen) and `RNTesterExampleContainer` (the example screen).

![simulator screen shot - iphone 8 - 2018-12-24 at 08 22 46](https://user-images.githubusercontent.com/15832198/50401564-4273a300-0755-11e9-9120-9bf8fbb70261.png)

![simulator screen shot - iphone 8 - 2018-12-24 at 08 22 51](https://user-images.githubusercontent.com/15832198/50401566-44d5fd00-0755-11e9-9637-6e5ddce1c476.png)

Changelog:
----------

[General] [Added] - Added filtering to RNTester example screens
Pull Request resolved: https://github.com/facebook/react-native/pull/22777

Reviewed By: TheSavior

Differential Revision: D13561744

Pulled By: rickhanlonii

fbshipit-source-id: cb120626a8e2b8440f88b871557c0b92fbef5edc
2018-12-29 16:05:40 -08:00
Luna Wei 3407a74957 ReactViewGroup.dispatchDraw NullPointerException handling
Summary: Add a catch statement for NPE around ViewGroup's dispatchDraw and log it

Reviewed By: mdvacca

Differential Revision: D13554441

fbshipit-source-id: a94d3db71678e17ef6bcda46689a069b85e460c5
2018-12-28 10:34:38 -08:00