Summary: I was reading through the ScrollView code and realized that the documentation was incomplete, and some of the flow types were wrong.
Reviewed By: yungsters
Differential Revision: D13583133
fbshipit-source-id: 11c495681e9671e078e4d2c9df76c25b04558696
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
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
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
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
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
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
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
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
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
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
Summary: Was getting a lint error for this being in the glob
Reviewed By: rickhanlonii
Differential Revision: D13618406
fbshipit-source-id: cebaff99cf71c6ff949342e8cb9f36853616cf0c
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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