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

22504 Коммитов

Автор SHA1 Сообщение Дата
Samuel Susla 34d189ae09 Introducing Leak Checker
Summary:
Changelog: [internal]

Introducing LeakChecker. A tool that checks if all native components have been cleaned up when surface is stopped.

**Known shortcomings**:
- LeakChecker is only enabled in debug builds and the existence of leaks is logged to console.
- For now, Leak Checker looks at N-1 screen. This is intentional as there is a known limitation of React that doesn't free up all shadow nodes when surface is stopped. Because of this, the use of LeakChecker is not intuitive and I'll work with React team to try to work around this.
- It doesn't help locating the leak, it only informs that leak is present. I'll be looking into ways to help locate the leak.

Reviewed By: JoshuaGross, mdvacca

Differential Revision: D26727461

fbshipit-source-id: 8350190b99f24642f8e15a3c2e1d79cfaa810d3d
2021-03-17 02:57:37 -07:00
Luna Wei 529fbc84d5 ESM-ify VirtualizeUtils and flatten parameters on computeWindowedRenderLimits
Summary:
Changelog:
[General][Changed] - Change VirtualizeUtils to use ESM and change function signature on `computeWindowedRenderLimits` as part of larger effort to remove defaultProps from VirtualizedList

Reviewed By: nadiia

Differential Revision: D26969586

fbshipit-source-id: cd1961a2088d37543dbc9bca8c4a062cdb426a35
2021-03-16 21:30:25 -07:00
Luna Wei e928f54d76 Remove initialNumToRender defaultProps
Summary:
Changelog:
[Internal][Changed] - Remove initialNumToRender from defaultProps as part of larger effort to remove defaultProps from VirtualizedList

Reviewed By: nadiia

Differential Revision: D26969585

fbshipit-source-id: 8674544c06b7b99eee693cc7508c9e4199232e98
2021-03-16 21:30:24 -07:00
Scott Kyle 00bc09c8f7 Allow RCTRootView to be initialized with a frame
Summary:
If a root view is initialized with a bridge that is already loaded, then it immediately will initialize its content view with a zero size, which results in that content view's size being calculated according to its content instead of the size set on the root view after initialization. This would lead to a race condition where sometimes the content view has a smaller size than the root view.

Changelog:
[iOS][Added] - Allow RCTRootView to be initialized with a frame

Reviewed By: PeteTheHeat

Differential Revision: D27052637

fbshipit-source-id: 384ab3be27c92c0d84d34d49afb697882335d890
2021-03-16 15:08:09 -07:00
Luna Wei cbc3d90fd4 Remove horizontal from defaultProps
Summary:
Changelog:
[Internal][Changed] - Remove horizontal from defaultProps as part of larger effort to remove defaultProps from VirtualizedList

Reviewed By: nadiia

Differential Revision: D26969583

fbshipit-source-id: c21ac15a220a68a58e32b78dcc37c053756b72cf
2021-03-16 15:00:49 -07:00
Luna Wei 3ff7e86b0f Remove disableVirtualization from defaultProps
Summary:
Changelog:
[Internal][Changed] - Remove disableVirtualization from defaultProps as part of larger effort to remove defaultProps from VirtualizedList

Reviewed By: nadiia

Differential Revision: D26969587

fbshipit-source-id: 662fa620bc5b6b9a64c1906f62dae1f4b373a23b
2021-03-16 01:49:42 -07:00
Joshua Gross c4c0065b00 Add PressabilityPerformanceEventEmitter
Summary:
Add PressabilityPerformanceEventEmitter which allows product code / infrastructure to subscribe to touch-related performance events.

Changelog: [Added][JS] Product/infra can subscribe to Pressability touch events for telemetry purposes

Reviewed By: fkgozali

Differential Revision: D27034835

fbshipit-source-id: e62811f641994b9eadb5cdd7391e806b6cce479a
2021-03-15 23:45:45 -07:00
Joshua Gross 9c1926051e Pass `blockNativeResponder` param to setIsJSResponder
Summary:
The non-Fabric API has a `blockNativeResponder` param in setJSResponder. Make sure to pass that along in Fabric.

On Android this allows us to respect the flag and do the same thing non-Fabric was doing if `blockNativeResponder` is false. It's not clear yet what the impact is on iOS.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D27058806

fbshipit-source-id: aa5074fa46191d78f5292a93d9040ab4bb58ca66
2021-03-15 18:37:36 -07:00
Pieter De Baets 07f9d21131 Simplify YGNodeEmptyContainer / YGNodeWithMeasureFunc / YGNodeFixedSize
Summary:
These methods are only ever called just after setting the various YGStyle props. Therefore we can read any padding / margin / border state from there rather than recalculating it.

Changelog: [Internal]

Reviewed By: SidharthGuglani

Differential Revision: D27010098

fbshipit-source-id: a33f879b25c54cfdb0ffc724b6aa325858e97df5
2021-03-15 16:56:33 -07:00
Pieter De Baets 3708181ca2 Simplify YGNodeCalculateAvailableInnerDim
Summary:
Avoid recalculating margin and padding by pre-subtracting the margin from `availableWidth` and inlining the calculation of `paddingAndBorderAxisCross`.

Changelog: [Internal]

Reviewed By: SidharthGuglani

Differential Revision: D27010094

fbshipit-source-id: afc3cf251a0306b9e5d7f0dc6856feee8d1dca6e
2021-03-15 16:56:32 -07:00
Pieter De Baets eeed7e2e3a Optimize edge value resolution
Summary:
Noticed in simpleperf this was a very hot method, showing 8ms spent in these methods in our sample application. By splitting the method out in a horizontal and vertical variant we can simplify cases enormously and check for begin/end in one go.

Changelog: [Internal]

Reviewed By: SidharthGuglani

Differential Revision: D27010008

fbshipit-source-id: 22fed58c7476e1d716b0191b55997c7a06e63223
2021-03-15 16:56:32 -07:00
David Vacca e3e7701c14 Fix react-native-oss-android tests
Summary:
build-break
overriding_review_checks_triggers_an_audit_and_retroactive_review
Oncall Short Name: petetheheat

This diff removes the Nullable annotation added by  D27045861 (903351f22e)
The goal is to fix react-native-oss-android tests

Changelog:
[Android][Changed] - Remove Nullable annotation from ActivityEventListener.onActivityResult method

Reviewed By: fkgozali

Differential Revision: D27063989

fbshipit-source-id: fda81c36380e4ffdf9d3bf3ca5ff47f8ebb415cc
2021-03-15 16:21:10 -07:00
Nadiia D 6333c15fa2 Back out "Remove deprecated lifecycles usage"
Summary:
Changelog:
[General][Changed] REVERT: createAnimatedComponent: removed deprecated lifecycles usage

Original commit changeset: 04d016b30ae0

Reviewed By: JoshuaGross

Differential Revision: D27053061

fbshipit-source-id: 6bb50da0a773070a979e7c52957a375b20c7c609
2021-03-15 15:11:48 -07:00
Lulu Wu 903351f22e Fix media picking not working
Summary:
Media picking wasn't working for Venice because we didn't implement onActivityResult in BridgelessReactFragment so the listener in FBProfileGemstoneReactModule didn't called.

Changelog:
[Android][Changed] - Added Nullable annotation

Reviewed By: mdvacca

Differential Revision: D27045861

fbshipit-source-id: 0ab2961ef0570d92259856b4132507ebb264eb9d
2021-03-15 14:32:10 -07:00
Joshua Gross 7ac5d48341 Generalize "isVirtualView" logic to make debug asserts consistent with platform
Summary:
On Android we have the notion of "virtual views", which are defined consistently but the logic is scattered and duplicated throughout the codebase.

The logic exists to mark nodes that exist in the ShadowTree, but not the View tree. We want to CREATE, UPDATE, and DELETE them on the platform, but not INSERT or REMOVE
them. They basically exist as EventEmitter objects.

The only issue with this is (1) duplicated code, which opened the possibility for inconsistent definition (2) StubViewTree did not account for virtualized views, which caused
assert crashes in debug mode for certain LayoutAnimations on Android.

By moving the definition to ShadowViewMutation and accounting for it in StubViewTree, asserts are correct and consistent on all platforms.

This was not caught until recently, because, until recently, no asserts actually ran on Android.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D27001199

fbshipit-source-id: eb29085317037ba8a286d7813bdd57095ad4746f
2021-03-15 13:50:56 -07:00
Samuel Susla 23cf99544c Introduce RCTInstallNativeComponentRegistryBinding
Summary:
Changelog: [internal]

Creates new function `RCTInstallNativeComponentRegistryBinding` which can be called during JS setup to register JS function `__nativeComponentRegistry__hasComponent`.

Note: This diff doesn't call `RCTInstallNativeComponentRegistryBinding`.

Reviewed By: shergin

Differential Revision: D26946176

fbshipit-source-id: 0625b8dd6090bc9e08baa38ba60b9cbe48268184
2021-03-15 03:39:13 -07:00
Lulu Wu ea1f9531f0 Add additional checks to prevent throwing native java errors in UIManagerBinding.cpp
Summary:
Right now there are places in UIManagerBinding.cpp where native java exceptions will be thrown if calling JSI functions results in errors, such as:

```Trying to report error getPropertyAsObject: property '__fbBatchedBridge' is undefined, expected an Object
Error: getPropertyAsObject: property '__fbBatchedBridge' is undefined, expected an Object
```

https://www.internalfb.com/intern/logview/details/facebook_android_javascripterrors/358181062b47b9561e60427bbb3816a9

In this diff I added LOG(ERROR) and checks because:
1, Throwing errors neither prevents the JSI errors nor handles them properly, checks prevent JSI errors from happening.
2, Errors are aggregated in Logview with other JSI errors as "Error: android_crash:com.facebook.react.devsupport.JSException:facebook::jni::throwNewJavaException" which keeps the SLA task open forever, checks can prevent JSI errors so they won't lead to exceptions, and  LOG(ERROR) will make sure we have enough info for debugging.

Changelog:
[General][Changed] -  Add checks and logs to for better error handling

Reviewed By: JoshuaGross

Differential Revision: D26885562

fbshipit-source-id: c0c1c057342e9efc0ff708188703f4332036e7a9
2021-03-15 03:09:30 -07:00
David Vacca 1bc06f18c6 Fix impression logging in VirtualizedList
Summary:
This diff forces a remeasure of the children of VirtualizedLists everytime the VirtualizedList is measured.
The goal is to ensure that nested VirtualizedList has the correct "scroll information" all the time, scroll information information is used by ViewabilityHelper.computeViewableItems method to determine if Items of the list are visible to the user.

This new code is controlled by the MC: rn_core:enable_virtualizedlist_remeasure_children_if_needed.

changelog: [internal] internal

// I used an internal changelog because this is under a MC

Reviewed By: lunaleaps

Differential Revision: D27003249

fbshipit-source-id: f9452ceb27683b0f595dd4bffdcced0ecf6bb0b5
2021-03-12 15:33:51 -08:00
Joshua Gross b88ec8b144 Format StubViewTree logs to be closer to other logs
Summary:
Debug logs should wrap React Tags in square brackets.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D27001202

fbshipit-source-id: 32fca9d0e1467a515ca3d9d1a3e24a35c23120db
2021-03-12 09:33:24 -08:00
Valentin Shergin fa64427236 Fabric: Fixed deadlock in Surface Handler
Summary:
As part of stoping a Surface, we have to commit an empty shadow node tree. And to avoid a deadlock we have to do it not under a `linkMutex_`. To do so, we need to move the part that commits an empty tree from UIManager to SurfaceHandler. And this diff does exactly this.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D27010535

fbshipit-source-id: 60cc79b1c81d7340b550e78653737d2cc5bec24d
2021-03-12 08:57:57 -08:00
generatedunixname89002005325676 1c564c3a1f Daily `arc lint --take CLANGFORMAT`
Reviewed By: zertosh

Differential Revision: D27005870

fbshipit-source-id: 5d51d0e64ae3fb15d38f8a9f8479af1c86b18fa9
2021-03-12 04:00:19 -08:00
Joshua Gross 3b0800a49a EventTarget (native)/InstanceHandle (JS) is not optional, assert that it's non-null
Summary:
When EventTarget is created in createNode, it's currently treated as optional in native, but it's not optional in JS. We should assert that it's non-null to make the contract more clear.

For now, we keep it as an assert so we catch issues in debug/dev, but it won't impact prod.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D27002506

fbshipit-source-id: c541dc02d3de22df19292deaef1a3b68fe57ba1f
2021-03-11 20:49:53 -08:00
Lulu Wu 423453e105 Record latest error type in dev support
Summary:
In DevSupportManagerBase.java->updateLastErrorInfo(), errorType was not recorded like errorMessage and errorStack, we could either remove errorType as a parameter or recorded it for future use. This diff recorded it since it would make the error info complete.

Changelog:
[Android][Changed] - Record latest error type in dev support

Reviewed By: PeteTheHeat

Differential Revision: D26884647

fbshipit-source-id: 712d82667bdc4b3410f4c83a3df9a456af6d9061
2021-03-11 17:18:32 -08:00
Nadiia D ba61267015 Remove deprecated lifecycles usage
Summary:
Changelog:
[General][Changed] createAnimatedComponent: removed deprecated lifecycles usage

Reviewed By: lunaleaps

Differential Revision: D26734209

fbshipit-source-id: 04d016b30ae0d989890a4b3d8602d47a399dcd11
2021-03-11 16:43:10 -08:00
Peter Argany b512beb0c4 Delete concept of live reloading
Summary:
Live reloading has been deprecated in favor of fast refresh for years, this diff removes remaining references to it.

Changelog: [iOS] Delete deprecated "live reloading" setting

Reviewed By: fkgozali

Differential Revision: D26983596

fbshipit-source-id: c7f86e7ec511f80e53659bccd8f40ac4f0cac27c
2021-03-11 16:12:17 -08:00
Stefan Wrobel 0afba0e90d Restore refresh spinner fix (#30978)
Summary:
Fixes https://github.com/facebook/react-native/issues/30912
Reverts https://github.com/facebook/react-native/issues/31024 which did not fix the issue

This fix was removed in https://github.com/facebook/react-native/issues/28236, however it caused bug https://github.com/facebook/react-native/issues/7976 to resurface, as reported in https://github.com/facebook/react-native/issues/30912

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

Test Plan:
This code had been present for quite some time before being removed in https://github.com/facebook/react-native/issues/28236

## Changelog

[Internal] [fixed] - regression with refresh control

Reviewed By: p-sun

Differential Revision: D26981600

Pulled By: PeteTheHeat

fbshipit-source-id: 2560e7dba1cfd6ed41d98f2c9ff4cd07a0e5fa24
2021-03-11 15:48:10 -08:00
Valentin Shergin e19401843e Fabric: Incorporating text measure time into SurfaceTelemetry
Summary:
Now cumulative time spent on text measuring is available as as part of SurfaceTelemetry.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: mdvacca

Differential Revision: D26827445

fbshipit-source-id: 8ad3178557ea71170557fcf19b6f62f7072d6da2
2021-03-11 14:34:22 -08:00
Valentin Shergin 60f15d6b5d Tracking time spent on measuring text in TransactionTelemetry
Summary:
Now we not only measure how many times we measured text but also measure how much time it takes. This way we can see which portion of the layout process is spent by layout itself (and measuring embedded components).

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: mdvacca

Differential Revision: D26827447

fbshipit-source-id: e0b09fcacc86aed50dd94b48458215adbb0a60ef
2021-03-11 14:34:22 -08:00
Andrei Shikov 3ed133656f Use density from provided context for SurfaceHandler
Summary:
Changelog: [Internal]

We were using RN util to get pixel density, but it depends on the surface being created after venice instance is initialized. Given that we have context every time we update constraints, it makes sense to use it directly.

Reviewed By: mdvacca

Differential Revision: D26959430

fbshipit-source-id: 78701786efd82857812df689a725ba094fbd226e
2021-03-11 13:13:18 -08:00
Huzaifa Khan 5889cbebe3 Added talkback support for button accessibility: disabled prop (#31001)
Summary:
Issue # https://github.com/facebook/react-native/issues/30934 .When using a screen reader disabled buttons do not announce that they are disabled.

## Changelog

[Android] [Changed] - Passing accessibility state in button so it can announce disabled in talkback

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

Test Plan:
I have added Button in Button Example with accessibiltyState prop that will announce button is disabled when testing with talkback.

## Ios test
I am unable to run ios project on my machine. RNTesterPods.xcworkspace gives workspace integrity error :/

Reviewed By: kacieb

Differential Revision: D26492483

Pulled By: lunaleaps

fbshipit-source-id: c4bbe8ca896b0d303976591c300ccac67a96ac73
2021-03-11 12:02:40 -08:00
Samuel Susla fdb2bb76ec Refactor componentNameByReactViewName into separate file
Summary:
Changelog: [internal]

Extract componentNameByReactViewName to separate file so it can be used elsewhere.

Reviewed By: shergin, mdvacca

Differential Revision: D26946159

fbshipit-source-id: cf69df1f80f1c1938fc667f4666a5d3fec5a9658
2021-03-11 11:53:14 -08:00
Joshua Gross 6d1a4d3864 Add more debug logs to ReactHorizontalScrollView
Summary:
Just adding more logs I found useful while playing around with the last diff (to verify that these methods were not actually implicated at all).

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D26972725

fbshipit-source-id: 0e048e1edbfbe5ed32c5277f17a7197e0afdc04f
2021-03-11 10:57:47 -08:00
Joshua Gross b9b23e1ab1 Fix incorrect platform auto-scroll to right when height changes
Summary:
When the height of a HorizontalScrollView changes and there is a `layout` event, it can cause the underlying platform View code to scroll slightly to the right.

I'm... not really sure why, even after looking at the View code for a while. But it is clearly detectable and mirrors issues with RTL that were fixed recently.

This might warrant more investigation, but I believe the fix is relatively safe - we detect if there's an autoscroll only if the height changes and only if the scroll happens in "layout". That scopes the hack pretty well to just this bug.

There aren't really times when we actually want layout to scroll to the right, so... I think this is reasonable.

Changelog: [Changed][Android] Fixed issue that causes HorizontalScrollView to shift to the right when a TextInput is selected and keyboard pops up

Reviewed By: mdvacca

Differential Revision: D26972710

fbshipit-source-id: 441b1a3f07b9b68195a9e5e9a0c8d75c9d24a109
2021-03-11 10:57:47 -08:00
David Biedenbach 310a6bcf4b Fix Issue 10718: Add iOS support for progressViewOffset (#30737)
Summary:
Fixes https://github.com/facebook/react-native/issues/10718, bringing `progressViewOffset` support to iOS.

Thanks to Taylor123 for the initial PR upon which this fix is based.

## Changelog

[iOS] [Fix] - `progressViewOffset` prop of `RefreshControl` and `VirtualizedList` now works on iOS

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

Test Plan:
Tested with quick-and-dirty sample app.

![progressViewOffset-iOS](https://user-images.githubusercontent.com/1563532/104526540-82fe1d80-55b7-11eb-9f99-e025bedf4874.gif)

## Documentation

The corresponding documentation update PR can be found [here](https://github.com/facebook/react-native-website/pull/2441).

Reviewed By: kacieb

Differential Revision: D26813977

Pulled By: sammy-SC

fbshipit-source-id: 45cc5a647d70e44a29c6391b7586cb41ca011bef
2021-03-11 10:27:25 -08:00
Joshua Gross 896baf79d5 Fix crash in ReactHorizontalScrollView debug logging
Summary:
Does not impact prod or even debug builds unless you switch on the debug flag. The issue is that we were trying to coerce booleans to integers.

Changelog: [internal]

Reviewed By: mdvacca

Differential Revision: D26970274

fbshipit-source-id: 3327029ae3afc307dd19b089c23c190cb9e3150c
2021-03-10 20:21:50 -08:00
Nick Gerleman 4fb9e2f6a3 Add tests describing current sticky header realization behavior (#31075)
Summary:
See https://github.com/react-native-community/discussions-and-proposals/pull/335 for extra context.

A VirtualizedList may have sticky headers, forwarded on to ScrollView. These sticky headers are exempt from virtualization once realized for the first time. This change documents the behavior of keeping sticky header cells realized after scrolling away.

This scenario performs the same behavior as creating an internal "realization window" for sticky headers with a single cell window size. Generalizing the concept of realization windows should be shaped to support the existing sticky header scenario.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[Internal] [Added] - Add tests describing current sticky header realization behavior

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

Reviewed By: lunaleaps

Differential Revision: D26767582

Pulled By: appden

fbshipit-source-id: 0d151bd6046fcb5384c646205aafa1ca7edf6c77
2021-03-10 17:10:22 -08:00
Tim Yung 035718ba97 RN: Restore Deprecated Event Methods
Summary:
Restore deprecated event listener removal methods in order to minimize breaking changes for the next release. The methods will work, but they will not report a warning via `console.error`.

Changelog:
[General][Added] - `EventEmitter.removeListener` now emits a deprecation notice.
[General][Added] - Restored `AppState.removeEventListener` with a deprecation notice.
[General][Added] - Restored `Keyboard.removeEventListener` with a deprecation notice.
[General][Added] - Restored `Linking.removeEventListener` with a deprecation notice.

Reviewed By: nadiia, kacieb

Differential Revision: D26589441

fbshipit-source-id: 7d89982a182cf2163136e157d4c1beee91c30393
2021-03-10 16:06:26 -08:00
Tim Yung c47a03563d RN: Change Dimensions to Return EventSubscription
Summary:
Changes `Dimensions.addEventListener` to return an `EventSubscription` object that has a `remove()` method on it.

In an upcoming commit, calling `Dimensions.removeEventListener` will lead to a deprecation warning.

Changelog:
[General][Change] - `Dimensions.addEventListener` now returns an `EventSubscription`.

Reviewed By: kacieb

Differential Revision: D26808827

fbshipit-source-id: 0cfdc65b83c177f60937c1aa3a4cf633592f73d7
2021-03-10 16:06:26 -08:00
Daniel Andersson 42fa4a6a4e Fix incorrect comment about strictEquals
Summary:
The documentation of jsi::Value::strictEquals was confusing it with SameValue (which differs in treatment of signed zeroes and NaN). Fix it by referring to the correct part of the spec.

Changelog:
[Internal][Fixed] - Fix incorrect comment

Reviewed By: avp

Differential Revision: D26430216

fbshipit-source-id: 0ea4208fbdda40c87f8028231ddefb2323b6eb96
2021-03-10 15:33:31 -08:00
Ramanpreet Nara 2b2c69aab1 Prevent TurboModuleManagerDelegate.mHybridData from being dead-code eliminated
Summary:
mHybridData should have a SuppressWarnings("unsed") annotation on it. Furthermore, we should add a DoNotStrip annotation, to make sure that the HybridData object doesn't get removed. We do the same in TurboModuleManager:

https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/TurboModuleManager.java?commit=5e1cd0c2ed84ff8e718473ff26145733868ebaba&lines=46-48

Changelog: [Internal]

Created from Diffusion's 'Open in Editor' feature.

Reviewed By: fkgozali

Differential Revision: D26958686

fbshipit-source-id: 83c0626c0681966dfcda7f6e4fb4cbeac8340b3f
2021-03-10 15:10:51 -08:00
Ramanpreet Nara 23d9bf1a24 Make I18nManagerModule TurboModule-compatible
Summary:
This NativeModule will now be type-safe, and TurboModule-compatible.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D26956332

fbshipit-source-id: 6651a003c70819934869dd6a8c664ef984d0efcb
2021-03-10 14:55:29 -08:00
Eric Rozell b15f8a30e7 Fixes layout of nodes with YGDisplayNone and YGPositionTypeAbsolute (#1068)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1068

There is an issue in react-native when the Yoga node position type is set to absolute and display: none is set where the node layout calculation gives the absolute dimensions, rather than the expected 0 x 0.

Here are some OSS issues tracking this:
https://github.com/facebook/react-native/issues/18415
https://github.com/microsoft/react-native-windows/issues/7289

## Changelog

[General] [Fix] - Fixes layout of nodes with YGDisplayNone and YGPositionTypeAbsolute

Reviewed By: Andrey-Mishanin

Differential Revision: D26849307

fbshipit-source-id: 197618aa3c4e1b3b7efeba7ea4efd30b2d1c982d
2021-03-10 13:12:04 -08:00
Andrew Coates 81c895fb3f Fix various C++ warnings (#31002)
Summary:
Fix warnings about implicit type truncation.

## Changelog

[Internal] [Fixed] - Fix various C++ warnings

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

Test Plan:
Almost all the changes here are simply making explicit conversions which are already occurring.  With the exception of a couple of constants being changed from doubles to floats.

With these changes I am able to remove a bunch of warning suppressions in react-native-windows.

Reviewed By: shergin

Differential Revision: D26900502

Pulled By: rozele

fbshipit-source-id: d5e415282815c2212a840a863713287bbf118c10
2021-03-10 12:39:12 -08:00
Andrei Shikov 4170726dfa Move to Maven Central for flipper deps
Summary:
Changelog: [Internal]

Flipper moved to maven central recently, so we can remove exceptions for it.

Reviewed By: fkgozali

Differential Revision: D26915353

fbshipit-source-id: c245e25ecb0eef1e279f197c2717673ec9ce3ca1
2021-03-10 08:38:13 -08:00
Samuel Susla 56e0309b78 Send onDismiss event when Modal is dismissed
Summary:
Changelog: [internal]

"onDismiss" event wasn't called in Fabric. This diff adds it.
Paper implementation of Modal uses `RCTEventEmitter` instead of callback to deliver the event. To align better with Paper, Fabric will follow this pattern.

Reviewed By: shergin

Differential Revision: D26911312

fbshipit-source-id: b0de619c5a02c3378d1f7ac3ce1b705bb5fb634d
2021-03-10 05:47:47 -08:00
Pranjal Shankhdhar cdf3182793 Remove worker_requirement files
Summary:
Changelog:

These are no longer being used by Buck, we can just remove them.

Reviewed By: zigwei

Differential Revision: D26913017

fbshipit-source-id: c75a07b2dc8c337ceef6da275b0046c0ac048ba7
2021-03-10 04:25:43 -08:00
Yan Zhang ffba25c648 add a hide-on-scroll feature to ScrollView
Summary:
Add a stickyHeaderHiddenOnScroll option to keep the sticky header hidden during scrolling down, and only slide in when scrolling up
Changelog:
[General][Added] - Add a stickyHeaderHiddenOnScroll option to keep the sticky header hidden during scrolling down, and only slide in when scrolling up

Reviewed By: JoshuaGross

Differential Revision: D26900810

fbshipit-source-id: 6bfb1a4da07fff0763223d60836df187f9d95dd6
2021-03-09 12:36:20 -08:00
Samuel Susla 311d2fb0c5 Disable swipe down gesture in Modal component
Summary:
Changelog: [internal]

Paper implementation prevents swipe to dismiss gesture in Modal.

https://www.internalfb.com/intern/diffusion/FBS/browse/master/xplat/js/react-native-github/React/Views/RCTModalHostViewController.m?commit=9d1f344633fb&lines=25-30

This diff implements the same in Fabric.

Reviewed By: ShikaSD

Differential Revision: D26910753

fbshipit-source-id: cb036ce0a9cd57c7d549a1a58eb941d8e64f2468
2021-03-09 11:55:30 -08:00
Valentin Shergin 2f67c8d5b7 Fabric: `surfaceId`-based that controls Surface status methods were removed from `Scheduler`
Summary:
We don't use them anymore.

Changelog: [Internal] Fabric-specific internal change.

Differential Revision: D26376683

fbshipit-source-id: 801e9225502005ed01317ed396346176b2f2f5bc
2021-03-09 11:50:43 -08:00
David Vacca aba11daff8 Integrate global.__nativeComponentRegistry__hasComponent into NativeComponentRegistry.js
Summary:
This diff creates a new unstable method (unstable_hasComponent) to expose `global.__nativeComponentRegistry__hasComponent` into NativeComponentRegistry.js

changelog: [internal] internal

Reviewed By: yungsters

Differential Revision: D26716903

fbshipit-source-id: 52ff63b2779f41770b292cfc0b9022b1669d59fe
2021-03-09 10:39:20 -08:00