Commit Graph

18316 Commits

Author SHA1 Message Date
Valentin Shergin e7ef9921d3 Fabric: Fixing crash in RCTScrollViewComponentView (2nd attempt)
Summary:
Seems a ScrollView sometimes calls the delegate in own destructor; and seems that in some configurations the delegate is also already destroyed at this point. I am not sure if this a bug in UIKit or not, but seems the fix is easy, we just have to clear the ScrollView's delegate on the delegate's deallocation.
This issue is also looks similar:
https://stackoverflow.com/questions/18778691/crash-on-exc-breakpoint-scroll-view/19011871

Changelog: [iOS] [Fixed] - Fixed crash in RCTScrollViewComponentView

Reviewed By: sammy-SC

Differential Revision: D17924429

fbshipit-source-id: 5727bca9f028e28f76f60304c187ee39eb6e1856
2019-10-15 07:43:20 -07:00
Valentin Shergin beae6d6fa0 Revert D17456225: [RN] RCTRefreshControl was renamed to PullToRefreshView (for Paper)
Differential Revision:
D17456225

Original commit changeset: a8db99ddd507

fbshipit-source-id: 3186d76de13cccc21619702a1ad07842a4788b15
2019-10-15 07:11:53 -07:00
Samuel Susla ddbfe24c3b Add SegmentedControl to LegacyViewManagerInterop white list
Summary:
For components to be used with LegacyViewManagerInterop they need to be added to a white list.
This makes it possible to test it out and assure proper functionality.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D17905453

fbshipit-source-id: 4e8e53a1898b38b2c9f01e7fc9e3527bd7004ffb
2019-10-15 03:16:21 -07:00
Samuel Susla 53f003f233 Add ProgressView to LegacyViewManagerInterop white list
Summary:
For components to be used with LegacyViewManagerInterop they need to be added to a white list.
This makes it possible to test it out and assure proper functionality.

Reviewed By: shergin

Differential Revision: D17905413

fbshipit-source-id: f5ab523cca6227e99a7607ca1927005392b1ae36
2019-10-15 03:16:21 -07:00
zhongwuzw 4203d24b83 Fixes Fabric related podspec (#26805)
Summary:
1. Add missing podspec like `safeareaview` and `legacyviewmanagerinterop`.
2. Expose `YGNode,YGStyle.h` to public, fabric uses it, ex. `YogaStylableProps.h`.
3. Make `React-Core`'s Cxx header public, because `RCTLegacyViewManagerInteropCoordinator.m` uses it.

## Changelog

[iOS] [Fixed] - Fixes Fabric related podspec
Pull Request resolved: https://github.com/facebook/react-native/pull/26805

Test Plan: Fabric RNTester can run.

Reviewed By: shergin

Differential Revision: D17872379

Pulled By: mdvacca

fbshipit-source-id: 4b18a931a2e403237a96d5cc3505b99c7253c710
2019-10-14 22:34:40 -07:00
Valentin Shergin 08d6cb19c4 RCTRefreshControl was renamed to PullToRefreshView (for Paper)
Summary:
The component RCTRefreshControl was renamed to PullToRefreshView (for Paper). Now only old Objective-C class names have the old name, which is okay.

Changelog: [Internal] [Changed] - The internal name of PullToRefresh component was changed from `RCTRefreshControl` to `PullToRefreshView` (No public API changes)

Reviewed By: rickhanlonii

Differential Revision: D17456225

fbshipit-source-id: a8db99ddd507377d8c98b26707a3b9fae483d20c
2019-10-14 20:49:48 -07:00
James Ide df653a9dc2 More robust hermes-engine lookup logic in makefiles (#26820)
Summary:
The Android makefiles had hard-coded paths to hermes-engine, sometimes looking in `node_modules` and other times looking in `..`. This commit implements the Node module resolution algorithm (see common.mk), which handles both of these cases and also looks further up the root if necessary, handling the case when the `hermes-engine` npm package is hoisted.

This commit does three things:

- Defines `find-node-module` and uses it in the makefiles to find `hermes-engine`
- Removes the unused `/path/to/hermes-engine/include` paths since this directory does not exist and should be `/path/to/hermes-engine/android/include` (`android`)
- Moves the definition of `REACT_NATIVE` in the makefiles to the top. It was defined after every `$(CLEAR_VARS)` invocation but was not actually cleared anyway. `$(CLEAR_VARS)` resets only `LOCAL_*` variables in this list: https://android.googlesource.com/platform/build/+/7dc45a8/core/clear_vars.mk

## Changelog

[Internal] [Changed] - Android Makefiles look for hermes-engine using Node's module resolution algorithm
Pull Request resolved: https://github.com/facebook/react-native/pull/26820

Test Plan: Run `./gradlew :ReactAndroid:installArchives`, which requires the hermes-engine paths to be correct in order to find the headers.

Differential Revision: D17923671

Pulled By: cpojer

fbshipit-source-id: 9238b8718a94080db1abbba6375a6a1d484c871d
2019-10-14 19:21:43 -07:00
Ramanpreet Nara 63e58a375e Improve method argument RCTConvert logic
Summary:
**Context**
For method calls from JS to Objective C, we have to convert JS values to ObjC objects/primitives. Before we can call our ObjC methods, we need to run both the ObjC primitives and objects through `RCTConvert`. This is necessary, because we sometimes convert `NSDictionary`s to special Objective C objects. Apparently, in `RCTTiming`, we also do the same with `double` (i.e: we convert a `double` arg to another `double` type with different meaning).

**Problem**
`RCTTiming` used `RCTConvert` to convert `double`s into `NSTimeInterval` (also a double). The conversion is defined like this:

```
// i.e: division by 1000
RCT_CUSTOM_CONVERTER(NSTimeInterval, NSTimeInterval, [self double:json] / 1000.0)
```

This diff implements the support necessary to make this work. For completeness, I also implemented the same functionality for `BOOL`s.

Changelog: [iOS][Fixed] Improve method argument RCTConvert logic

Reviewed By: mdvacca

Differential Revision: D17887915

fbshipit-source-id: 3246fdbf4db7e96911f16460d92448b1f1e99444
2019-10-14 15:39:34 -07:00
Eli White 878f0500e7 TextInput: Add tests for checking which input is focused
Summary:
We are going to need to change some of these APIs to use refs instead of findNodeHandle. I figured I'd start by adding some tests

Changelog:
[Internal] Adding tests for TextInput

Reviewed By: yungsters

Differential Revision: D17892806

fbshipit-source-id: f59ff99fa4d064239f171acb64a8441e07bb71c1
2019-10-14 14:40:07 -07:00
Ramanpreet Nara bec5b8711f Improve TM main queue initialization
Summary:
In the legacy system, when NativeModules are supposed to be initialized on the main queue, we do the following synchronously on the main thread:
1. Done: Attach bridge on main queue
2. Register the NativeModule for frame updates on main queue
3. Post Notification that NativeModule was created on main queue
4. Attach methodQueue on main queue
5. Call new on main queue

`[RCTModuleData instance]` is the entrypoint for all of this logic.

We probably shouldn't synchronously execute all this initialization on the main queue, because it can lead to deadlocks down the road. Therefore, this diff makes it so that we still call `new` on the same thread. However, we do all other initialization in the main thread, if that's required.

Changelog: [iOS][Fixed] TurboModule initialization on the main queue

Reviewed By: PeteTheHeat

Differential Revision: D17867583

fbshipit-source-id: a88412ee1e3d93a4f9b5ab0b4dd8fc5213fa91f8
2019-10-14 14:19:23 -07:00
Eli White e640637928 Core: Remove any from calls to requireNativeComponent
Summary:
These were being cast to a NativeComponent but that is no longer accurate. `requireNativeComponent` returns the type of `HostComponent` now which is more accurate. We don't need the cast through `any` anymore.

In order to know that I found all the callsites, I ran this command to find these:
```
grep -r "requireNativeComponent" react-native-github -C 5 | grep 'any'
```

Changelog:
[Internal]

Reviewed By: cpojer

Differential Revision: D17864165

fbshipit-source-id: 3774d6d47d7bb0d885cc1a1352f81fec7d3bca0d
2019-10-14 13:53:48 -07:00
Moti Zilberman 9f71551167 Remove use of framesToPop from JSTimers
Summary:
Replaces the use of `framesToPop` in `_allocateCallback` (in `__DEV__` only) with statically accessing the second frame of the stack.

Changelog: [Internal]

Reviewed By: cpojer

Differential Revision: D17877261

fbshipit-source-id: 8e4d0eb2ed7984b66a99752fb21f7909474fda8f
2019-10-14 09:03:51 -07:00
Sharon Gong baa66f63d8 Announce accessibility state changes happening in the background (#26624)
Summary:
Currently the react native framework doesn't handle the accessibility state changes of the focused item that happen not upon double tapping. Screen reader doesn't get notified when the state of the focused item changes in the background.
To fix this problem, post a layout change notification for every state changes on iOS.
On Android, send a click event whenever state "checked", "selected" or "disabled" changes. In the case that such states changes upon user's clicking, the duplicated click event will be skipped by Talkback.

## Changelog:
[General][Fixed] - Announce accessibility state changes happening in the background
Pull Request resolved: https://github.com/facebook/react-native/pull/26624

Test Plan: Add a nested checkbox example which state changes after a delay in the AccessibilityExample.

Differential Revision: D17903205

Pulled By: cpojer

fbshipit-source-id: 9245ee0b79936cf11b408b52d45c59ba3415b9f9
2019-10-14 00:28:34 -07:00
empyrical 80857f295c JSBigString: Fix building on Windows (#26826)
Summary:
This pull request replaces the last remaining Unix headers in `JSBigString` with their equivalent Folly Portability headers, and replaces the calls to `getpagesize()` with `sysconf(_SC_PAGESIZE)` since Folly Portability is missing that function.

The work to get this building on windows was mostly done by acoates-ms, this pull request just adds the finishing touches.

## Changelog:

[General] [Fixed] - Fixed `JSBigString` not compiling on Windows due to Unix-specific headers
Pull Request resolved: https://github.com/facebook/react-native/pull/26826

Test Plan: Compiled with Clang and with MSVC (2017)

Differential Revision: D17903214

Pulled By: cpojer

fbshipit-source-id: 230f8fb410fa81d8f13d8b6ccf1147cfc70358bf
2019-10-14 00:22:22 -07:00
Maksym Rusynyk a0d8740878 Android template: Allow overriding default "index.js" entry file (#26769)
Summary:
- Using "System.getenv" allows to specify any entry file using environment variables and without modifying gradle file. Example:

    export ENTRY_FILE="another_entry_file.js"
    ./gradlew assembleDebug

- This functionality is also more align with iOS implementation that uses 'if [[ "$ENTRY_FILE" ]]; then'. See https://github.com/facebook/react-native/pull/23667 for more details.

- Possibility to define entry file on CI without modifying sources (Example: project like [pixels-catcher](https://www.npmjs.com/package/pixels-catcher) requires different entry file)

## Changelog:

[Android] [Added]  - Custom entry file on android using `ENTRY_FILE` environment variable
Pull Request resolved: https://github.com/facebook/react-native/pull/26769

Test Plan:
- Create a project from template

- Define `ENTRY_FILE` environment variable

```
export ENTRY_FILE="anotherIndexFile.js"
```

- Build android

```
./gradlew assembleDebug
```

Expected result: App contains bundle file that starts from `anotherIndexFile.js` file.

Differential Revision: D17903165

Pulled By: cpojer

fbshipit-source-id: 6b7cdf229918d101c170aa5fbdca6f3ef293d41c
2019-10-13 23:41:15 -07:00
James Ide fc25f288fe Use Node's module resolution algo to find JSC & Hermes (#26773)
Summary:
The Gradle build file looks up jsc-android and hermes-engine using hard-coded paths. Rather than assuming the location of these packages, which are distributed and installed as npm packages, this commit makes the Gradle file use Node's standard module resolution algorithm. It looks up the file hierarchy until it finds a matching npm package or reaches the root directory.

## Changelog:

[Android] [Changed] - ReactAndroid's Gradle file uses Node's module resolution algorithm to find JSC & Hermes
Pull Request resolved: https://github.com/facebook/react-native/pull/26773

Test Plan: Ensure that CI tests pass, and that `./gradlew :ReactAndroid:installArchives` works. Printed out the paths that the Gradle script found for jsc-android and hermes-engine (both were `<my stuff>/react-native/node_modules/jsc-android|hermes-engine`).

Differential Revision: D17903179

Pulled By: cpojer

fbshipit-source-id: 9ac3ba509974f39f87b511d5bc3398451c12393f
2019-10-13 23:26:39 -07:00
Tim Yung 6c7d34e8ec RN: Delete merge[Into]
Summary:
Deletes `merge[Into]` in favor of object spread.

Changelog:
[Internal]

Reviewed By: TheSavior

Differential Revision: D17884312

fbshipit-source-id: e70b4d4e388d3c6a68908258019bf2bd145e6752
2019-10-12 15:52:27 -07:00
Tim Yung 3a3b535874 RN: Delete getObjectValues
Summary:
Deletes `getObjectValues` because there are no more references to it in `react-native`.

Changelog:
[Internal]

Reviewed By: TheSavior

Differential Revision: D17884311

fbshipit-source-id: c97caeed00fe94a6cc099fba7039d9defee719dd
2019-10-12 15:52:26 -07:00
Tim Yung 2d99b3bab3 RN: Delete isEmpty
Summary:
Deletes `isEmpty` because there are no more references to it in `react-native`.

Changelog:
[Internal]

Reviewed By: zackargyle, fred2028

Differential Revision: D17884310

fbshipit-source-id: 0554aee4044452b6c04f638f1ad762025eecd929
2019-10-12 15:52:26 -07:00
Tim Yung da3e23fa70 RN: Delete guid
Summary:
Deletes `guid` because there are no more references to it in `react-native`.

Changelog:
[Internal]

Reviewed By: zackargyle

Differential Revision: D17882369

fbshipit-source-id: c3ee6d23e5fa233a7f5d2e2c7baef005384ea5b1
2019-10-12 15:52:26 -07:00
Tim Yung 82f4a44086 RN: Delete toIterator
Summary:
Deletes `toIterator` because there are no more call sites.

Changelog:
[Internal]

Reviewed By: TheSavior

Differential Revision: D17879834

fbshipit-source-id: 95679d7504c044d0e842bfcbdc07a8c33268f5d6
2019-10-12 15:52:25 -07:00
Tim Yung fc9feb16e0 RN: Delete mixInEventEmitter
Summary:
Deletes `mixInEventEmitter` and its dependencies that are no longer being used by anything in `react-native`.

Changelog:
[Internal]

Reviewed By: TheSavior

Differential Revision: D17879835

fbshipit-source-id: 45f30d21cb01365fcfc723cf564ebb47794ea176
2019-10-12 15:52:25 -07:00
Tim Yung 2becdfd404 RN: Delete TextInput.selectionState Prop
Summary:
Deletes the `selectionState` prop from `TextInput`.

It does not provide meaningful value over `onBlur`, `onFocus`, and `selectionState`.

Changelog:
[Breaking][TextInput] Removing `selectionState` prop, use `onBlur`, `onFocus`, and `onUpdate` instead.

Reviewed By: zackargyle, TheSavior

Differential Revision: D17879667

fbshipit-source-id: 03a4e239406932adad898d6d2a092e3bc2e6b064
2019-10-12 15:52:25 -07:00
Albert Sun 63769518e0 Fix selecting videos from library in iOS 13
Summary:
In iOS 13, Apple made a change that results in video URLs returned by UIImagePickerController becoming invalidated as soon as the info object from the delegate callback is released. This commit works around this issue by retaining these info objects by default and giving the application a way to release them once it is done processing the video.

See also https://stackoverflow.com/questions/57798968/didfinishpickingmediawithinfo-returns-different-url-in-ios-13

Reviewed By: olegbl, mmmulani

Differential Revision: D17845889

fbshipit-source-id: 12d0e496508dafa2581ef12730f7537ef98c60e2
2019-10-11 16:33:19 -07:00
Eli White 082f293c85 Add Landcastle job that requires changelog for React Native diffs
Summary:
Each React Native release has almost 1000 commits and we need to help make it easier for our releases by making sure we put changelogs in our diffs.

This will make changelogs required at land time for diffs touching files in react-native-github.

Reviewed By: zackargyle

Differential Revision: D17585190

fbshipit-source-id: a8ba65e6cc90bed47eeca3d58f16a1dc818c64aa
2019-10-11 15:25:00 -07:00
Joshua Gross 26cf89f3f4 Usage of a C++ raw pointer necessitates 30 lines of comments
Summary:
In a previous diff I converted this line from a shared_ptr to a raw pointer. I'm documenting the reason why in code here to proactively document assumptions.

Changelog:
[[Internal]]

Reviewed By: shergin

Differential Revision: D17884942

fbshipit-source-id: 25e29a5e3ff0695d081c8d46c1ceaa6458248e26
2019-10-11 14:19:14 -07:00
Eli White db84ae8fb3 Improve return type for ScrollView getters
Summary: These types are more accurate

Reviewed By: lunaleaps

Differential Revision: D17862010

fbshipit-source-id: 84dfcade35c21b7be49db46ae021819dda020c98
2019-10-11 11:46:00 -07:00
Eli White db662af5b2 Fix ref type for Native Scroll View
Summary: These types were wrong, this is a HostComponent, not a ReactNative.NativeComponent

Reviewed By: lunaleaps

Differential Revision: D17862305

fbshipit-source-id: e1e7acc7a5892f124b07cdc39d73d6ce7d414063
2019-10-11 11:46:00 -07:00
Joshua Gross fa1c2be387 Slightly more aggressive FabricUIManager teardown
Summary: Tear down FabricUIManager more aggressively. The rest of the ivars here we can't set to null (yet) because they're marked as final.

Reviewed By: mdvacca

Differential Revision: D17878342

fbshipit-source-id: a1c8ace2603750ac39c3d97e1aca6c486ba5fb79
2019-10-11 11:41:37 -07:00
Eli White 06f32bff82 Improve ScrollView and friends flow types for Props
Summary:
These components had props that were poorly typed and let many things through. This diff tightens that all up.

The main difference in this diff is using `{...BaseProps, ...LocalProps }` instead of `BaseProps & LocalProps`.

The majority of the changes in this diff is reducing duplicated prop definitions. For example, FlatList defines a bunch of props that VirtualizedList also defines. Since FlatList extends those props, using spread now means that FlatList can't duplicate those props. So I've moved the definitions to the correct base file and deleted the duplicates.

Changelog:
[Internal]

Reviewed By: lunaleaps

Differential Revision: D17824459

fbshipit-source-id: 089ac4c58c3c9f70a9f28e517f2e9ecd8aab1a50
2019-10-11 09:49:31 -07:00
Eli White bd70cbf042 VirtualizedSectionList: Fix flow error about this.props.onViewableItemsChanged being null
Summary:
Flow complains that the function could be null or undefined even after checking that because this._convertviewable is called first and could potentially muck with the type.
Here is an example in try flow: https://flow.org/try/#0CYUwxgNghgTiAEA3W8AeAueBvAZpg-ABSEB2ArgLYBGIMAlPALwB8SA9gJbB0C+A3ACgcZEmAAuHNiXg5CdTOWq1s8OGLIxpAZh4CBHHPEKoAdIYCEjeOQgQGWAfDRnCsunUE8gA

Changelog:
[Internal]

Reviewed By: jbrown215

Differential Revision: D17863358

fbshipit-source-id: 7689819de4c15f22e427cf5af520566bcea17bbc
2019-10-11 09:49:30 -07:00
Eli White ce3628e9d8 Change FillRateHelper.computeBlankness to take any, as expected
Summary:
Data doesn't have to be an array. data and getItemCount can take any arbitrarty data, as long as they expect the same thing. This should probably be parameterized with a generic but that is an improvement for another day.

It is worth noting the comment explanation for the defintion of `data` and `getItem` in VirtualizedList: https://fburl.com/u7ldzaa8

```
/**
 * The default accessor functions assume this is an Array<{key: string} | {id: string}> but you can override
 * getItem, getItemCount, and keyExtractor to handle any type of index-based data.
 */
data?: any,
/**
 * A generic accessor for extracting an item from any sort of data blob.
 */
getItem: (data: any, index: number) => ?Item,
/**
 * Determines how many items are in the data blob.
 */
getItemCount: (data: any) => number,
```

Changelog:
[Internal]

Reviewed By: lunaleaps

Differential Revision: D17863130

fbshipit-source-id: 40a1d57e3b4dd1e38c84d5907fe88f6b665287ae
2019-10-11 09:49:30 -07:00
Eli White 43ff9da68d VirtualizedList update parentProps.getItemLayout flow type
Summary:
This is a tighter type that matches the actual prop as defined on line 100

Changelog:
[Internal]

Reviewed By: lunaleaps

Differential Revision: D17863133

fbshipit-source-id: 97f966ff13aa2ce36ef936a9a154fdd137191c6b
2019-10-11 09:49:30 -07:00
Eli White 7a2e83dba5 Nit change to VirtualizedSectionList callback flow type
Summary: This change surprisingly fixes a Flow error because these types weren't compatible with the prop types these were passed into that had `info: `. Flow passes now though!

Reviewed By: lunaleaps

Differential Revision: D17863131

fbshipit-source-id: 094f1d97e96686d16bb69732b8a4b319492b5780
2019-10-11 09:49:30 -07:00
Eli White 8eea187085 VirtualizedList clean up prop flow definitions and comments
Summary: These comments existed for other components that had these props. Putting them here as this is the proper base of those other components. Also adding `ItemSeparatorComponent` as it is used in this component.

Reviewed By: lunaleaps

Differential Revision: D17860495

fbshipit-source-id: b7b60058d37e90699b28419af27d488bd46d3ebd
2019-10-11 09:49:29 -07:00
Eli White 5d2de9e54e ScrollView: Fix flow type for StickyHeaderComponentType
Summary: The instance type wasn't being set properly. Using AbstractComponent

Reviewed By: lunaleaps

Differential Revision: D17859988

fbshipit-source-id: 95e2098a7218afeaf3f6ee39ba2b69170ee2f54c
2019-10-11 09:49:29 -07:00
Eli White dd3bf0545a Change ScrollView event flow types to support spreading
Summary: These need to be both optional and nullable to support spreading props like `<ScrollView {...props} />` where these types are optional in a parent component.

Reviewed By: lunaleaps

Differential Revision: D17859633

fbshipit-source-id: 093456d13ee041473a4605e62bf48b3510b49b8f
2019-10-11 09:49:29 -07:00
Eli White fb5276c189 Remove duplicate flow type for TouchableProps
Summary: These are already defined as part of ViewProps. They don't need to be duplicated

Reviewed By: lunaleaps

Differential Revision: D17859553

fbshipit-source-id: c3de534526efd94c0a9ff2c772a4d92c6164815b
2019-10-11 09:49:28 -07:00
Eli White 55b32130bb Lists: Change flow type to not allow rendering undefined
Summary:
`?React.Element<any>` allows passing in `undefined`, an invalid value to render into a React component. Changing these types to be `null | React.Element<any>`.

The issues that this caught were fixed in a previous diff.

Reviewed By: lunaleaps

Differential Revision: D17859220

fbshipit-source-id: 71438cb357b44bca0bf3437aea99ece99a616f7d
2019-10-11 09:49:28 -07:00
Eli White 51bf5f9962 Move VirtualizedSectionList's getItem into a class helper
Summary:
Moving this to the class lets the first argument be typed as `Props<SectionT>` instead of `Props<SectionBase<any>>`. This is consistent with the structure of FlatList

Changelog:
[Internal]

Reviewed By: zackargyle

Differential Revision: D17841258

fbshipit-source-id: 3e0e6c2f6b21cbce0e662647cb43a012e062c4bc
2019-10-11 09:49:28 -07:00
Eli White d1789dbf8c Destructure out unused props
Summary:
These props are unusupported by the component they were being passed to.

Changelog:
[Internal]

Reviewed By: zackargyle

Differential Revision: D17839765

fbshipit-source-id: 13c80a07da2026b61070ffc93f26194b979ee8fc
2019-10-11 09:49:27 -07:00
Eli White 515cc6f596 Fix some $FlowFixMe in VirtualizedList
Summary:
Fixing up some of the FlowFixMes in VirtualizedList

Changelog:
[Internal]

Reviewed By: zackargyle

Differential Revision: D17839611

fbshipit-source-id: c763a799efca63fd7110cfaed87afde80995b8aa
2019-10-11 09:49:27 -07:00
Eli White da057749f8 Lists: Fix invalid prop usage in RNTesterExampleList
Summary: backgroundColor must be passed in a style prop

Reviewed By: PeteTheHeat

Differential Revision: D17838513

fbshipit-source-id: 315ca144f63e67b0e9db5e705074974372db2f5e
2019-10-11 09:49:27 -07:00
Eli White 8770151a77 List: Remove invalid props
Summary:
These props were pretty much all typos and thus didn't do anything.

My two choices are to change the code to do what it seems it *intends*, or keep the behavior the same. To de-risk, I'm preferring to keep the behavior the same.

Changelog:
[Internal]

Differential Revision: D17834712

fbshipit-source-id: 2f6b6376ff5936d4ad20291022c043ff7808bac4
2019-10-11 09:49:27 -07:00
Sharon Gong 3042407f43 Add accessibilityValue prop on Touchables (#26752)
Summary:
AccessibilityValue support was added for view in PR[https://github.com/facebook/react-native/issues/26169](https://github.com/facebook/react-native/pull/26169). This patch is to extend the support for all touchables.

## Changelog

[General] [Added] - Add accessibilityValue prop on Touchables
Pull Request resolved: https://github.com/facebook/react-native/pull/26752

Test Plan: Modify one accessibility value example to use Touchable in AccessibilityExample.js.

Differential Revision: D17878614

Pulled By: mdvacca

fbshipit-source-id: ef201225f7dfbb2c6054102ab22fa151499656d5
2019-10-11 08:59:59 -07:00
Joshua Gross 0a6f4dd8aa UIManagerBinding JSI function lambdas should not retain UIManager
Summary:
Ensure that on Android, only Scheduler and UIManagerBinder directly retain UIManager. These existing JSI function-retained lambdas will not have owning share_ptr refs to UIManager, just raw pointers.

By the time the VM deallocates all JSI objects and UIManagerBinding goes away, it should be able to deallocate UIManager synchronously when UIManagerBinding is deallocated. The VM should not be executing any of these JSI functions at that time, so this should ensure that the raw pointer access is safe.

This should also provide some extremely small perf wins, and make our memory model easier to reason about, since we're using shared_ptr less often and now `UIManager` is only owned in two places: Scheduler and UIManagerBinding.

So, there are now only two places where UIManager can be deallocated:
1) Hermes is deallocated first, and UIManagerBinding is deallocated before Scheduler. Scheduler holds onto UIManager. Scheduler later is deallocated and frees UIManager; this would cause a crash if it's not completed before Hermes is torn down, but we currently ensure that Scheduler is torn down before Hermes. This is fine but we should document this contract, or make Scheduler not own UIManager.
2) Scheduler is deallocated first, decrementing the shared_ptr to UIManager. Later Hermes is torn down, which deallocates UIManagerBinding via the JSI pointer table, which synchronously deallocates UIManager before Hermes has shut down. This is the desired outcome.

Changelog:
[[Internal]]

Reviewed By: shergin

Differential Revision: D17872586

fbshipit-source-id: cbb25b5cd025f5f8597dc7a66073fe64edc57aa8
2019-10-11 07:15:24 -07:00
Samuel Susla ffc7ec992c Add support for ScrollView.onScroll animations
Summary: To enable onScroll animations with Fabric's scrollView on iOS, we dispatch onScroll event to Paper's eventDispatcher as well as to Fabric's one. One we have a proper NativeAnimationDriver in place, we will get rid of this.

Reviewed By: shergin

Differential Revision: D17814260

fbshipit-source-id: f04faf59cdfd4ea5cede513388e30500b4cb2ad5
2019-10-11 06:55:21 -07:00
Moti Zilberman 90977b0e00 Enable no-useless-escape lint rule
Summary: See https://eslint.org/docs/rules/no-useless-escape. Useless escapes can reflect a mismatch between the intended and actual effect of a backslash in a literal.

Reviewed By: rubennorte

Differential Revision: D17876784

fbshipit-source-id: 7641b1f2227b92e1e91469adc0d0d990a64109cf
2019-10-11 05:56:06 -07:00
Samuel Susla 4159e20146 Fix throttling in scroll view
Summary:
Setting minimal throttle to 1/60 causes dropped updates.

Let's take following example

Each frame is 16.666 MS.

Frame1: [________didScroll is called towards end of the frame_]

Frame2: [_didScroll is called towards beginning of the frame_________]

update from Frame 2 doesn't propagate because we set throttle to 16MS thinking that `onScroll` is called for each frame.

If Javascript specified value below 1/60 it is basically asking for every update.

Reviewed By: shergin, mdvacca

Differential Revision: D17829926

fbshipit-source-id: e7b07fd09581cd5053aa27a62cf6f6ddb2193783
2019-10-11 05:44:49 -07:00
Samuel Susla 1ba67fd9a6 Move RCTScrollEvent into separate file
Summary: Move RCTScrollEvent into separate file and export its header.

Reviewed By: shergin

Differential Revision: D17831709

fbshipit-source-id: f4ee4e09147ef5703b85a10238ddb6cdefdf05a5
2019-10-11 04:46:16 -07:00