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

18122 Коммитов

Автор SHA1 Сообщение Дата
Valentin Shergin e6c6ebf08e Fabric: Removing `EventBeat::setFailCallback`
Summary: We don't use it anymore. (And that was debug only concept.)

Reviewed By: sammy-SC

Differential Revision: D17115538

fbshipit-source-id: 20aac5457e37666cbf9ca9f62cdfca411026c219
2019-08-30 18:24:27 -07:00
Valentin Shergin 4ffe5b6f6d Fabric: Farewell EventBeatBasedExecutor
Summary: We don't use it anymore.

Reviewed By: JoshuaGross

Differential Revision: D17115539

fbshipit-source-id: e1fa5cc023cd27e53307aa0ea8eae0bad5413be3
2019-08-30 18:24:26 -07:00
Valentin Shergin 6a10feacda Fabric: Passing EventDispatcher as a weak pointer everywhere
Summary: Storing a strong shared pointer to `ComponentDescriptor` can cause a memory leak. Therefore we enforce all call sides and params to be weak pointers. The only Scheduler preserves a retaining pointer to it (to prevent preliminary deallocation).

Reviewed By: sammy-SC

Differential Revision: D17115540

fbshipit-source-id: fdea7d19f742ff04d5ba5470dd9748a5b226aa7c
2019-08-30 18:24:26 -07:00
Dan Abramov 42a385bddf Partial RN sync
Summary:
This cherry-picks one commit: 01fb68b9bf

It fixes a bug in Fast Refresh.

Reviewed By: threepointone

Differential Revision: D17140543

fbshipit-source-id: a7654152d1cc7c27e7c4024380349b44ac496b22
2019-08-30 18:10:35 -07:00
Dan Abramov f107d3b78c Fix Redbox on iOS
Summary:
Looks like we broke iOS redbox in D16812212. It stopped showing up because the feature detection stopped working, and we started calling noops. The fix is an explicit platform check.

Fixes #26260

Reviewed By: motiz88

Differential Revision: D17139310

fbshipit-source-id: 829eec23cbb49151ac250889c34ab28d36b05e6a
2019-08-30 18:10:35 -07:00
Kevin Gozali 951785de8a Architecture indicator: hide the overlay when Fabric/TM are both disabled
Summary: Instead of showing a thin gray line, don't render anything if no new architecture project is active.

Reviewed By: ejanzer

Differential Revision: D17142557

fbshipit-source-id: 644a8e515c04f84336d80bea00d641c2bfa3be41
2019-08-30 17:14:44 -07:00
Héctor Ramos 63fa3f21c5 Add Appearance native module
Summary:
Implements the Appearance native module as discussed in https://github.com/react-native-community/discussions-and-proposals/issues/126.

The purpose of the Appearance native module is to expose the user's appearance preferences. It provides a basic get() API that returns the user's preferred color scheme on iOS 13 devices, also known as Dark Mode. It also provides the ability to subscribe to events whenever an appearance preference changes.

The name, "Appearance", was chosen purposefully to allow for future expansion to cover other appearance preferences such as reduced motion, reduced transparency, or high contrast modes.

Changelog:

[iOS] [Added] - The Appearance native module can be used to prepare your app for Dark Mode on iOS 13.

Reviewed By: yungsters

Differential Revision: D16699954

fbshipit-source-id: 03b4cc5d2a1a69f31f3a6d9bece23f6867b774ea
2019-08-30 17:07:57 -07:00
Oleksandr Melnykov 26a8d2e03a Remove RCT prefix from names of generated Java classes
Summary: This diff removes the 'RCT' prefix (if it's present) from the names of the generated Java classes. The motivation is that we don't want to have any Java files having this prefix in the RN Android codebase.

Reviewed By: JoshuaGross

Differential Revision: D17123804

fbshipit-source-id: 31905d3141e0f58ea47cdbdb0cf77d2d105de9a9
2019-08-30 10:03:27 -07:00
Oleksandr Melnykov 38089753ef Fix tests for JS codegen by renaming conflicting props
Summary:
** Summary of failures encountered during the build **
Rule //fbandroid/java/com/facebook/catalyst/launcher:app_prod_debug FAILED because Command failed with exit code 1.
stderr: /java/InterfaceOnlyNativeComponentViewManagerDelegate.java:18: error: reference to setAccessibilityHint is ambiguous
        mViewManager.setAccessibilityHint(view, value == null ? "" : (String) value);
                    ^
  both method setAccessibilityHint(T,java.lang.String) in com.facebook.react.uimanager.BaseViewManagerInterface and method setAccessibilityHint(T,java.lang.String) in com.facebook.react.viewmanagers.InterfaceOnlyNativeComponentViewManagerInterface match
/java/StringPropNativeComponentViewManagerDelegate.java:18: error: reference to setAccessibilityHint is ambiguous
        mViewManager.setAccessibilityHint(view, value == null ? "" : (String) value);
                    ^
  both method setAccessibilityHint(T,java.lang.String) in com.facebook.react.uimanager.BaseViewManagerInterface and method setAccessibilityHint(T,java.lang.String) in com.facebook.react.viewmanagers.StringPropNativeComponentViewManagerInterface match
/java/StringPropNativeComponentViewManagerDelegate.java:21: error: reference to setAccessibilityRole is ambiguous
        mViewManager.setAccessibilityRole(view, value == null ? null : (String) value);
                    ^
  both method setAccessibilityRole(T,java.lang.String) in com.facebook.react.uimanager.BaseViewManagerInterface and method setAccessibilityRole(T,java.lang.String) in com.facebook.react.viewmanagers.StringPropNativeComponentViewManagerInterface match
Errors: 3. Warnings: 0.

    When running <javac_jar>.
    When building rule //xplat/js/react-native-github/packages/react-native-codegen:generated_components_java-codegen_testsAndroid.
```

Reviewed By: mdvacca

Differential Revision: D17107929

fbshipit-source-id: 32bc553d450628c530e22cb13f305e3a3e0f45cd
2019-08-30 09:40:48 -07:00
glevi@fb.com b31056d802 Deploy v0.106.3 to xplat/js
Reviewed By: jbrown215

Differential Revision: D17120458

fbshipit-source-id: b1f097acffcf277b624910a3c4d7141ef5f352ad
2019-08-30 08:18:13 -07:00
Ram N a58dd9683d Update the version of yoga podspec to match the actual version of Yoga published
Summary: Yoga is currently published in cocoapods. While we don't use the Yoga from Cocoapods in React Native, we should atleast try to follow that version, so that other integrations with Yoga are possible

Reviewed By: shergin

Differential Revision: D17127625

fbshipit-source-id: bca2e1e33ad775e2a0d7a6f1e4177c3b480c023a
2019-08-30 07:12:34 -07:00
Ram N 82a8080f07 Change podspec name of yoga to Yoga
Summary:
Needed to capitalize the name, since this is the convention used elsewhere too

## Changelog:

[iOS] [Changed] - Renamed yoga podspec to Yoga

Reviewed By: shergin

Differential Revision: D17127104

fbshipit-source-id: 14047bf452edda000037701f4ba7f4a02a0e717b
2019-08-30 07:12:34 -07:00
Isaac Lem 36d4a969dd Prevent usage of Array index in keys (#26102)
Summary:
To ensure source code conform with no-array-index-key rules: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-array-index-key.md

## Changelog

[General] [Fixed] - To avoid using index as key
Pull Request resolved: https://github.com/facebook/react-native/pull/26102

Reviewed By: rubennorte

Differential Revision: D17093314

Pulled By: osdnk

fbshipit-source-id: 3c50f8fa0b220638e4cec1b71292f2c5c1bdc1c9
2019-08-30 04:57:40 -07:00
henrymoulton 1c27552502 fix: ios detox date picker test (#26111)
Summary:
iOS e2e tests using Detox are failing on CI:
https://circleci.com/gh/facebook/react-native/107417#tests/containers/0
https://circleci.com/gh/facebook/react-native/107390

## Changelog

[INTERNAL] [FIXED] - Date Picker iOS test
Pull Request resolved: https://github.com/facebook/react-native/pull/26111

Test Plan: ` yarn build-ios-e2e && yarn test-ios-e2e`

Reviewed By: rubennorte

Differential Revision: D17093319

Pulled By: osdnk

fbshipit-source-id: fedf45aa85c1ddfe2dfdf669b5248d1393771958
2019-08-30 04:19:02 -07:00
Paul O'Shannessy a939f8b317 Adopt Contributor Covenant
Summary:
In order to foster healthy open source communities, we're adopting the
[Contributor Covenant](https://www.contributor-covenant.org/). It has been
built by open source community members and represents a shared understanding of
what is expected from a healthy community.

Reviewed By: josephsavona, danobi, rdzhabarov

Differential Revision: D17104640

fbshipit-source-id: d210000de686c5f0d97d602b50472d5869bc6a49
2019-08-29 23:21:10 -07:00
Oleksandr Melnykov 3d3db71763 Generate OSS view manager interfaces and delegates
Summary: This diff checks in the OSS view manager interfaces and delegates generated by the JS codegen. This is a temporary workaround since we don't have the JS codegen running in open source.

Reviewed By: fkgozali

Differential Revision: D17104816

fbshipit-source-id: 848afc081785c9a78891d3dc0740ebe858eb8891
2019-08-29 16:08:48 -07:00
Oleksandr Melnykov 9d5d2549e3 Add copyright header and @generated annotation to Android view manager interfaces and delegates
Summary: This diff adds a missing copyright header and the `generated` annotation to the Java files generated by the JS codegen. Since we are going to check in the generated classes for the OSS components, we need to make sure the Lint formatter doesn't complain about formatting issues in those files.

Reviewed By: fkgozali

Differential Revision: D17101946

fbshipit-source-id: 1361a294b8c1538c0ea346b43ef623e843d7038d
2019-08-29 16:08:47 -07:00
Kevin Gozali 15b2353382 iOS Pods: added missing deps for React-CoreModules
Summary:
This is needed for use_frameworks! support with CocoaPods. Also, with recent changes to RCTImageLoader etc (moved to CoreModules), we need to add a dep to `React-RCTImage` pod.

If this approach works for 0.61 branch as well, it should be beneficial to pick. Note that https://github.com/facebook/react-native/pull/26151 attempts to fix similar things, but in 0.61 branch, not master.

Reviewed By: axe-fb

Differential Revision: D17120352

fbshipit-source-id: ca96a7a61a6422a6f9fc3a4bf3add51e6f33f4f1
2019-08-29 14:31:38 -07:00
Dulmandakh 4763000554 bump android gradle plugin to 3.5.0 (#26129)
Summary:
Android Gradle Plugin 3.5.0 released with a lot of improvements and bug fixes. It's important to have this change merged before 0.61 release. See https://developer.android.com/studio/releases/gradle-plugin

## Changelog

[Android] [Changed] - bump android gradle plugin to 3.5.0
Pull Request resolved: https://github.com/facebook/react-native/pull/26129

Test Plan: RNTester builds and runs as expected

Reviewed By: mdvacca

Differential Revision: D17091520

Pulled By: osdnk

fbshipit-source-id: 232b9209526e62a7344d74422fd8471a03dec7f4
2019-08-29 07:35:41 -07:00
Valentin Shergin 28d26c2e56 Fabric: Small optimization in RCTMountingManager
Summary: `pullTransaction` can return an empty transaction. That's fine to interate over the empty collection and do nothing, but it's inneficient because we also call delegate methods around the loop (that can be expensive).

Reviewed By: sammy-SC

Differential Revision: D17053430

fbshipit-source-id: c78959d47ea22cd9bb99419f6a80de3ac8e89fd3
2019-08-28 21:10:25 -07:00
Valentin Shergin 33112a1c20 Fabric: Making `State::getMostRecentState` public
Summary: That was always part of design, that's okay to get a newer state from any other state. We will need it in the future diffs.

Reviewed By: sammy-SC

Differential Revision: D17053429

fbshipit-source-id: 2174e7d6e3a1ed231f7f6e238d216d0b09ec8797
2019-08-28 21:10:24 -07:00
Valentin Shergin 876a2789db Fabric: Preventing an obsolete state to be committed
Summary:
It's okay in Fabric model to commit some subtrees which are kinda obsolete (that's strange but technically it's not against the model), but it's not okay to commit some states that were already committed before.
This diff prevents that.

Reviewed By: JoshuaGross

Differential Revision: D17053428

fbshipit-source-id: fb3536312163b7b57011647b4ba7b931c2179d89
2019-08-28 21:10:24 -07:00
Eli White f8e5093823 Improve Flow Type for ScrollResponder
Summary: FlatList and VirtualizedList were typing this value as any instead of using the actual type from ScrollView. I started with that change and then fixed the type to solve the other callsites in the codebase.

Reviewed By: zackargyle

Differential Revision: D17089934

fbshipit-source-id: bfc22cec9993904d779cad37b1de7cb3c0484d2c
2019-08-28 13:15:29 -07:00
Eli White c526b3ff14 Back out "Migrate TouchableNativeFeedback to use codegenNativeCommands"
Summary:
Reverting D16909622 and D16909622 due to T53098065. This change made TouchableNativeFeedback a bit less resilient to non native components being passed as the child. We probably need to handle this migration a little bit safer.

Original commit changeset: 902528623742

Differential Revision: D17096765

fbshipit-source-id: e3fc1a21504459b6d7ea5442c4bc926bbd77379d
2019-08-28 12:41:23 -07:00
Spencer Ahrens ed9ecb5d73 improve UIManager QPL markers
Summary:
The commit and batch points are just showing up as points in scuba relativity which isn't very useful - we want to know how long they take as well, so make them ranges.

Also adds view creation and update counts as annotations which can be handy for debugging regressions.

Reviewed By: JoshuaGross, axe-fb

Differential Revision: D17083058

fbshipit-source-id: dd29d12731734252930c9a4424bddbb98a8acccf
2019-08-28 08:48:48 -07:00
zhongwuzw 6f2e6f170e Fixes animated gifs incorrectly looping (#25612)
Summary:
[After migrate to new GIF implementation](https://github.com/facebook/react-native/pull/24822), we need to do some cleanup, before, we already unify the gif loop count between iOS and Android, more details please see https://github.com/facebook/react-native/pull/21999, so let's unify it again.

## Changelog

[iOS] [Fixed] - Fixes animated gifs incorrectly looping
Pull Request resolved: https://github.com/facebook/react-native/pull/25612

Test Plan:
example gif should repeat playback twice.
```
        <Image
          style={styles.gif}
          source={{uri: "https://user-images.githubusercontent.com/475235/47662061-77011f00-db57-11e8-904f-a1824912ace9.gif"}}
        />
```

Reviewed By: sammy-SC

Differential Revision: D16280067

Pulled By: osdnk

fbshipit-source-id: 2351499855f1e0e97c358fa0b3544dd2cc0cf703
2019-08-28 08:15:11 -07:00
Joshua Gross 44bfc4be44 Support for UpdatePaddingMountItem
Summary: Some views (TextInput!) need padding props.

Reviewed By: mdvacca

Differential Revision: D17081799

fbshipit-source-id: 4f5d6a139bb4dd878f90af0ed4a30fe3810e3429
2019-08-27 19:00:11 -07:00
André Krüger 51aacd5241 Implement fading edges for ScrollView and it's dependent FlatList (#26163)
Summary:
This should add props for enabling horizontal and vertical fading
edges for Scrollview and FlatList.
These fading edges are used to communicate to the user that there is more content to see.

## Changelog

[Android] [Added] - fading edges props to the FlatList and ScrollView components
Pull Request resolved: https://github.com/facebook/react-native/pull/26163

Test Plan:
Open the React Native test app and navigate to the FlatList section.
Enable the `useFadingEdges` switch and insert a number into `Fading edge length`.

![device-2019-08-23-123745](https://user-images.githubusercontent.com/222393/63587150-7385cb00-c5a3-11e9-98dc-bffe8276d30c.png)
![device-2019-08-23-123844](https://user-images.githubusercontent.com/222393/63587156-75e82500-c5a3-11e9-9e9f-66876ac8f506.png)

Differential Revision: D17080676

Pulled By: TheSavior

fbshipit-source-id: 91df629c17052d43c99145672e9084e1379a4113
2019-08-27 18:37:04 -07:00
Tianyu Yao c9ff99f18e Upgrade eslint-plugin-relay to 1.3.10
Summary: Bump eslint-plugin-relay version to 1.3.10 which contains fix for JS errors that blocks enabling the rules.

Reviewed By: kassens

Differential Revision: D17052055

fbshipit-source-id: 74867c16d128d2c0767e92861575ffcbe20370cc
2019-08-27 09:52:34 -07:00
Luna Wei 25f6be109b zoomToRect convert to command
Summary: Convert this to a UIManager command

Reviewed By: TheSavior

Differential Revision: D16973257

fbshipit-source-id: 0e129c17926229fc20d020e3c0e52a36b0b405d2
2019-08-27 09:28:03 -07:00
Peter Laraia db5994980d Android Q related NaN error fix - don't try to do math with NaN values
Summary:
We noticed a repro-able crash in Ride in T52804960 on Android Q due to NaN being passed into setCameraDistance
 on View

see Oleg's related post: https://fb.workplace.com/groups/rn.support/permalink/2682537011794897/

It looks like a generic fix or wrapper around View setCameraDistance might be planned in T48580247

But in the meantime, it kind of maybe seems reasonable-ish to say, ~~if the value of an input node is NaN, don't use it in the math for this node?~~ if a one of the inputs for this node evaluates to NaN, update that input node first? But I'm not super familiar with the Animations library so maybe that's not a good idea, idk.

From what I can tell in our specific error, it's coming from an InterpolatedNode A based off an AdditionNode B which tried to add a ValueNode C + a InterpolatedNode D, but D had only just been created and not had it's first update, so it's value was NaN, and so when B runs it's update value of C + NaN means B's new values is also NaN, and A's subsequent update based on that now comes out to NaN. Atleast that's what it seems like based on Log statements.

Reviewed By: olegbl

Differential Revision: D16960177

fbshipit-source-id: 99c8ca35be4b5e99f7c21db6733ebd622ae39d07
2019-08-27 00:24:45 -07:00
Brian Vaughn 92a3c9da0a React DevTools v4 integration
Summary:
This Diff is being posted for discussion purposes. It will not be ready to land until React DevTools v4 has been published to NPM.

Update React Native to be compatible with the [new version 4 React DevTools extension](https://github.com/bvaughn/react-devtools-experimental).

**Note that this is a breaking change**, as the version 3 and version 4 backends are **not compatible**. Once this update ships (in React Native) users will be required to update their version of the [`react-devtools` NPM package](https://www.npmjs.com/package/react-devtools). The same will be true for IDEs like Nuclide as well as other developer tools like Flipper and [React Native Debugger](https://github.com/jhen0409/react-native-debugger).

Related changes also included in this diff are:
* Pass an explicit whitelist of style props for the React Native style editor (to improve developer experience when adding new styles).
* Update `YellowBox` console patching to coordinate with DevTools own console patching.
  * Also improved formatting slightly by not calling `stringifySafe` for strings (since this adds visible quotation marks).

Regarding the console patching- component stacks will be appended by default when there's no DevTools frontend open. The frontend will provide an option to turn this behavior off though:

{F168852162}

React DevTools will detect if the new version is used with an older version of React Native, and offer inline upgrade instructions:

{F169306863}

**Note that the change to the `RCTEnableTurboModule` will not be included in this Diff**. I've just turned those off temporarily so I can use v8+Chrome for debugging.

Reviewed By: rickhanlonii

Differential Revision: D15973709

fbshipit-source-id: bb9d83fc829af4693e7a10a622acc95a411a48e4
2019-08-26 23:56:59 -07:00
Andres Suarez 5acb36483c Apply BUCKFORMAT to all BUCK files
Reviewed By: scottrice

Differential Revision: D17051732

fbshipit-source-id: 2e9d81cd8d547456eb2d8d97f08b8d2e951787a5
2019-08-26 21:41:43 -07:00
Valentin Shergin 59c3d05058 Fabric: Support for <ScrollView scrollEventThrottle={...}> on iOS
Summary: This diff adds support from `ScrollView::scrollEventThrottle` property on iOS.

Reviewed By: JoshuaGross

Differential Revision: D17000397

fbshipit-source-id: 93f23919a6a2588000c0eeca869171d1036348b6
2019-08-26 21:01:46 -07:00
Frieder Bluemle be2a2529af Update Gradle wrapper to 5.6 (#26079)
Summary:
```
Welcome to Gradle 5.6!

Here are the highlights of this release:
 - Incremental Groovy compilation
 - Groovy compile avoidance
 - Test fixtures for Java projects
 - Manage plugin versions via settings script

For more details see https://docs.gradle.org/5.6/release-notes.html
```

## Changelog

[Android] [Changed] - Gradle wrapper 5.6
Pull Request resolved: https://github.com/facebook/react-native/pull/26079

Test Plan: Ran build and tests locally.

Differential Revision: D17054310

Pulled By: mdvacca

fbshipit-source-id: de7ba3a6d04058e51b8bc6a21d5a3f828ef8bc25
2019-08-26 12:13:37 -07:00
Kevin Gozali e5b63410b4 Show both TM/Fabric overlay over the root view
Summary: This expands the existing FABRIC overlay to also indicate "TM" if turbomodule is active.

Reviewed By: yungsters

Differential Revision: D16999391

fbshipit-source-id: 42eedb697636c1172e595bc7c1ace2a9367a13b8
2019-08-26 11:02:25 -07:00
Spencer Ahrens 8e04a1485f Back out "[react-native][PR] [Android] Implement fading edges for ScrollView and it's dependent FlatList"
Summary:
After some thought, we decided we don't need the flexibility of
separate horizontal and vertical props - it would be much nicer
to just have a single prop for the edge length and then the native
code can enable the booleans as appropriate.

Original PR: https://github.com/facebook/react-native/pull/26163

Original commit changeset: f72a9a890d90

Reviewed By: TheSavior

Differential Revision: D16997468

fbshipit-source-id: 7973262287a7ec2cee5957f8dc1806a0f28c1432
2019-08-23 17:11:17 -07:00
Anda Bereczky f8dff0bcb3 Default accessibility hint is read for buttons
Summary: [Android] [Fixed] - Make sure the default accessibility hint is read for buttons on Android.

Reviewed By: PeteTheHeat

Differential Revision: D16974987

fbshipit-source-id: e7b932041f82d41271d9393e651967789c05f38a
2019-08-23 15:20:40 -07:00
Dulmandakh 3b3c95b017 Fix useWindowDimensions firing continuously after dims change (#26008)
Summary:
https://github.com/facebook/react-native/pull/25990 fixed the `forceUpdate` method to actually update the component, but caused the useEffect to fire on every render, causing continuous updates after dimensions changed (e.g. from rotation).

This reworks things a bit to be a bit simpler and more idiomatic so it's not quite as confusing, and fixes the bugs.

## Changelog

[General] [Fixed] - Fix useWindowDimensions hook firing continuously after dimensions change

Pull Request resolved: https://github.com/facebook/react-native/pull/26008

Test Plan:
Aparently the Mobile Home app supports rotation on iOS now, so replaced it's content with the first `DimensionsExample` and confirmed with logging that `useEffect` fires exactly once, on initial mount, but the view still updates as expected when rotated:

https://pxl.cl/Hfds

Reviewed By: yungsters

Differential Revision: D16765269

Pulled By: sahrens

fbshipit-source-id: ef55d8a470dcfe87aa125d4c426bf01cfe0091a7
2019-08-23 13:50:56 -07:00
André Krüger f8a64f9d61 Implement fading edges for ScrollView and it's dependent FlatList (#26163)
Summary:
This should add props for enabling horizontal and vertical fading
edges for Scrollview and FlatList.
These fading edges are used to communicate to the user that there is more content to see.

## Changelog

[Android] [Added] - fading edges props to the FlatList and ScrollView components
Pull Request resolved: https://github.com/facebook/react-native/pull/26163

Test Plan:
Open the React Native test app and navigate to the FlatList section.
Enable the `useFadingEdges` switch and insert a number into `Fading edge length`.

![device-2019-08-23-123745](https://user-images.githubusercontent.com/222393/63587150-7385cb00-c5a3-11e9-98dc-bffe8276d30c.png)
![device-2019-08-23-123844](https://user-images.githubusercontent.com/222393/63587156-75e82500-c5a3-11e9-9e9f-66876ac8f506.png)

Differential Revision: D16992488

Pulled By: sahrens

fbshipit-source-id: f72a9a890d9056bb017cc5747c6f66b7c35633dd
2019-08-23 13:02:52 -07:00
Peter Argany 41525c02a2 Allow for null bridge in RCTSurfacePresenter
Facebook:
This technically culminates M8 for iOS in Venice :D

We're now rendering `View` and `Text` completely without the bridge!

Reviewed By: shergin

Differential Revision: D16950332

fbshipit-source-id: f8c896323756411f5ac97586c0d85fdd6e39ed40
2019-08-23 12:01:52 -07:00
Peter Argany f229d67498 Make RCTAccessibilityManger a TurboModule
Summary:
Move RCTAccessibilityManager to CoreModules (since that's the only dir that supports TM).

Fixup some variable names to match spec.

Reviewed By: RSNara

Differential Revision: D16861739

fbshipit-source-id: a0a53b221dcc172979d1f2c83851ab92e23f2333
2019-08-23 12:01:52 -07:00
Moti Zilberman db9fab4473 Add unstable_setExceptionDecorator
Summary: Adds a way for the app to add information to an exception report before it is sent to native. This API is not final.

Reviewed By: rubennorte

Differential Revision: D16984151

fbshipit-source-id: 8450356d608e05deaed437e2a35094cd16962027
2019-08-23 11:52:30 -07:00
ifsnow bb05176a4b Better implementation for getItemCount on FlatList (#26164)
Summary:
Flatlist's `getItemCount` function is frequently called internally by VirtualizedList.
As with other functions, we can remove unnecessary operations with the `numColumns` value.
This makes it much more efficient.

## Changelog
[Internal] [Changed] - Better implementation for getItemCount on FlatList
Pull Request resolved: https://github.com/facebook/react-native/pull/26164

Test Plan: Not required

Differential Revision: D16989335

Pulled By: sahrens

fbshipit-source-id: b0075b2c2aeb9b9d7644c8bb18702a7cca8a4dce
2019-08-23 11:48:59 -07:00
Logan Daniels b6333f79e1 Final fixes and seal xplat/js/react-native-github
Reviewed By: panagosg7

Differential Revision: D16946423

fbshipit-source-id: 89ca82c955e99a23a14984d51f3c97346c363afd
2019-08-23 08:45:11 -07:00
glevi@fb.com 97b42bb142 Deploy v0.106.0 to xplat/js
Reviewed By: mroch

Differential Revision: D16979246

fbshipit-source-id: 995fbd391823eaf0c9e3a673cf8fbe061ce0545a
2019-08-23 08:06:44 -07:00
Logan Daniels 08daad4427 Add annotations to ReactNativePrivateInterface
Reviewed By: panagosg7

Differential Revision: D16946424

fbshipit-source-id: 90f13dd8bb25aac7ed8b2bebe6d7e49fa97958ff
2019-08-22 17:50:36 -07:00
Joshua Gross cafbf67d0d Fix generated props CPP default values
Summary:
This one is fun.

# What?

Previously, the codegen'd constructor for a prop value in CPP was defined like so: `value(convertRawProp(rawProps, "value", sourceProps.value, value))`.

The fourth argument there is the default value of the result of `convertRawProps`. What that is saying is: the default value of `value` is `value` - the default value is itself.

The assumption was that because value is defined as `T value{someDefaultValue}` in the struct, in other words, because it has a default value in the `.h` file, that it will /start out/ being equal to `someDefaultValue`, and then be overridden later optionally, or be set to itself, which should be `someDefaultValue`.

However, that is not how initialization of class members in C++ constructors work. If a class member is in the member initializer list, [then the default value is not set](https://en.cppreference.com/w/cpp/language/initializer_list). That means that if the `defaultValue` as passed is /ever/ used, we incur undefined behavior.

# When is the defaultValue used?

The defaultValue is only used when no prop or a null value is sent from JS to C++: https://our.intern.facebook.com/intern/diffusion/FBS/browse/master/xplat/js/react-native-github/ReactCommon/fabric/core/propsConversions.h?commit=becfded106d706e6028e705d7883483051061e9f&lines=60

In most cases, the `sourceProps.value` is actually used as a fallback (the previous props value). The first time props are ever constructed, `sourceProps` should have valid values since it goes through a different path where only the defaultValues from props.h are used.

# Why wasn't this crashing before?

Most codegen'd properties are ints, floats, doubles, and bools. They might get wacky values, but they won't crash. I wouldn't be surprised if this diff solves some subtle visual or layout bugs, but I have no evidence of this yet.

# How do non-codegen'd props.cpp initialize default values?

Same as this diff does: defaultValue should be explicit everywhere: https://our.intern.facebook.com/intern/diffusion/FBS/browse/master/xplat/js/react-native-github/ReactCommon/fabric/components/scrollview/ScrollViewProps.cpp?commit=2813789c292dfdf1220b88f203af6b33ba9e42de&lines=51

# So... what have we learned?

C++ is tricky!

Reviewed By: yungsters, shergin

Differential Revision: D16955421

fbshipit-source-id: 75bb3f22822299e17df1c36abecdb6ce49012406
2019-08-22 14:05:09 -07:00
Eli White 2f7732b145 Migrate TouchableNativeFeedback to use codegenNativeCommands
Summary:
Instead of dispatching the command with findNodeHandle and the UIManager, go through the new API. This is safe because codegenNativeCommands can work at runtime as well as with the babel transform.

Changelog:
[Internal]

Reviewed By: rickhanlonii

Differential Revision: D16909599

fbshipit-source-id: 90252862374290dbeb7202483fa585b6a7051c12
2019-08-22 14:02:16 -07:00
Eli White 3b7eb7ed85 Fix Flowtype for Command refs
Summary:
The types we were using before weren't very strict and it had been on my list to fix this. I *think* this is the right type. With Flow's type first project having these exported types will be necessary anyways so we can just use that for the ref.

Changelog:
[Internal]

Reviewed By: JoshuaGross

Differential Revision: D16930573

fbshipit-source-id: 05c1e097794633a2cefa7384c9d81ab15a63d8af
2019-08-22 12:07:50 -07:00