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

22004 Коммитов

Автор SHA1 Сообщение Дата
Joshua Gross 3357341347 When surface is stopped, reset View ID of ReactRootView
Summary:
If there's a JS/native crash and the surface is stopped, the ReactRootView could be reused when the surface is restarted (or potentially to show the errors in a logbox; I'm don't think that's possible, but not 100% sure).

Regardless, now it will crash in those cases because of T83802049. There's no reason to do that, so just mark the ReactRootView as explicitly unused once the surface is stopped.

Changelog: [Internal]

Reviewed By: ShikaSD

Differential Revision: D26469742

fbshipit-source-id: ee79c094393a8ae8b5c53f04c14b90bc8e1a5a17
2021-02-16 14:48:28 -08:00
Aditya Sharat 6a9bb45e09 Adds InternalNode#freeze() API
Summary:
Litho needs a new API which is called immediately before yoga begins layout calculations so that the InternalNode gets the opportunity to finalise itself; i.e. perform the last mutations and in effect avoid any more mutations to the hierarchy.

See D26373731 where the mutations from `Layout#collectResults` is moved back into the InternalNode.

Changelog: [Internal]  Adds new API to YogaNodeJNIBase

Reviewed By: SidharthGuglani

Differential Revision: D26373730

fbshipit-source-id: 471346d3444986ada91e86c95f5f9fb98bcd2fa6
2021-02-16 10:20:35 -08:00
Lulu Wu eaedb10755 Switch to using ViewManagerResolver for view managers
Summary:
Right now the FbReactInstanceDelegate provides a list of view managers to the instance during initialization, this means that we're basically eagerly loading all of the view manager classes.

In this change we use ViewManagerResolver instead.

Changelog:
[Android][Changed] - Move ViewManagerResolver into a seperate file

Reviewed By: mdvacca

Differential Revision: D26424214

fbshipit-source-id: 550ade31c256a56d6e32c463f112ea16dd55a218
2021-02-16 10:12:24 -08:00
Kacie Bawiec 099f67cf8a Move ScrollResponder.Mixin methods into ScrollView and Remove ScrollResponder.js
Summary:
The purpose of this diff is to move all of the ScrollResponder methods into ScrollView to delete ScrollResponder.Mixin.

NOTE: ScrollResponder.Mixin uses a variable named "state" but it does not use React state correctly. Instead of calling `setState()`, state is set using `this.state.item = 123` ([example](https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/Libraries/Components/ScrollResponder.js?lines=315)).  This means these are not actually React state - these are functionally just variables. In this stack, these "state" items from ScrollResponder are turned into regular internal variables.

Changelog:
[General][Removed] Moved ScrollResponder.Mixin methods into ScrollView to Remove ScrollResponder.js

Reviewed By: lunaleaps, nadiia

Differential Revision: D20715880

fbshipit-source-id: 99441434a6dc1c8ff3f435e7d6ec2840821e4e05
2021-02-16 08:03:11 -08:00
Valentin Shergin 4324ca8122 Fabric: Using SurfaceHandler API in Binding.cpp on Android
Summary:
Now we use SurfaceHandler-based APIs to control surfaces in `Binding.cpp` on Android instead of using Scheduler-based APIs.

This is a transitional change; eventually, we will need to wrap C++ SurfaceHandler's into JNI wrappers. For now, it will allow to clean up the C++ part.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: JoshuaGross

Differential Revision: D26375641

fbshipit-source-id: 6f293e79cecf50de72294e90d5243ebb02d71236
2021-02-15 23:19:55 -08:00
David Vacca 5d500f4dbc Remove log in PaperUIManager
Summary:
Removing log in PaperUIManager since this is logging warn messages for "Text" components

changelog: [internal] internal

Differential Revision: D26315745

fbshipit-source-id: 8871148b0fc1791e1723962f1f2477cd5e0c562d
2021-02-15 21:07:25 -08:00
David Vacca d71a0be6fa Release fix for race condition on startSurface
Summary:
This bug doesn't reproduce anymore in v301+. MC has been enabled since december

https://www.internalfb.com/intern/logview/details/facebook_android_javascripterrors/419f8892e7b1a02f205810219ddfc299/trends?selected-logview-tab=All%20Traces&drillstate={%22start%22:%22Thu,%2028%20Jan%202021%2000:59:54%20-0800%22,%22end%22:%22Thu,%2011%20Feb%202021%2000:59:54%20-0800%22,%22constraints%22:[{%22col%22:%22mid%22,%22op%22:%22==%22,%22vals%22:[%22419f8892e7b1a02f205810219ddfc299%22]}],%22context%22:%22facebook_android_javascripterrors%22,%22metric%22:%22count%22}

changelog: [internal] internal

Reviewed By: ShikaSD

Differential Revision: D26398484

fbshipit-source-id: ca85ca211f1a38aa2691f150956a27c878d243bc
2021-02-15 21:02:05 -08:00
David Vacca 2ecdb69b74 Revert D26445966: Bump Android compileSdkVersion and targetSdkVersion to 30
Differential Revision:
D26445966 (c7efd5b369)

Original commit changeset: 54c7b2dfff88

fbshipit-source-id: 91bf5564ed01f77d0837a090c941d65ad8d376a5
2021-02-15 20:47:34 -08:00
David Vacca c7efd5b369 Bump Android compileSdkVersion and targetSdkVersion to 30
Summary:
Bump Android compileSdkVersion and targetSdkVersion to 30

changelog: [Android][Changed] Bump Android compileSdkVersion and targetSdkVersion from 29 to 30

Reviewed By: JoshuaGross

Differential Revision: D26445966

fbshipit-source-id: 54c7b2dfff88cf2405fd66b3440a03f11de2304f
2021-02-15 20:24:06 -08:00
Gijs Weterings eae7e97f82 Bump Metro to v0.65.1
Summary:
After releasing https://github.com/facebook/metro/releases/tag/v0.65.1, I'm bumping the version here too.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D26450287

fbshipit-source-id: 1a6732ebd52e32e0e45ccd2cefffe762b8dcd824
2021-02-15 05:57:27 -08:00
Valentin Shergin 1e9f63fe27 Fabric: Fixed a prop application bug in LegacyViewManagerInterop
Summary:
The standard merge_patch (aka RFC7386) mechanism that we used before removes the key-value pairs from the original object in case if the patch has a `null` value. And we don't need it there because we should pass this null value down to the mounting layer to clean up this prop there. Besides that, the patch should not be recursive because props are not divisible.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D26435620

fbshipit-source-id: 0d7612c6ca04dcbc122ff6add3777674e3868af8
2021-02-12 16:51:43 -08:00
Valentin Shergin 1da2369b9e RN] Fabric: New way to specify layout constraints for YGNodeCalculateLayout
Summary:
In D26292378 (81147b6f79) we changed the way the layout constraints are specified to Yoga for measuring and layout. This is a second iteration of the change that slightly more correct and fixes other problematic cases we discovered. See also the commend in the code.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: mdvacca

Differential Revision: D26412484

fbshipit-source-id: 06011982a63cd4d3b61ae295f9aba6f8dab6ca02
2021-02-12 15:44:39 -08:00
Luna Wei 0939b938b2 Remove FlowFixMe on ref
Summary:
Changelog:
[Internal][Fixed]:Remove FlowFixMe VirtualizedSectionList ref

Reviewed By: nadiia

Differential Revision: D26381836

fbshipit-source-id: ed9a687c50a05f1176d99e6e6bd362ac830fbfae
2021-02-12 14:49:19 -08:00
Luna Wei 4e6d33a112 Remove UNSAFE_componentWillReceiveProps
Summary:
Changelog:
[General][Fixed] Remove UNSAFE_componentWillReceiveProps from VirtualizedSectionList

Reviewed By: nadiia

Differential Revision: D26381837

fbshipit-source-id: b029c82e4090369c76f303e71a3c9158e34ad82e
2021-02-12 14:49:19 -08:00
Héctor Ramos 4384fb266b Refresh yarn gpg key in analyze_pr job (#30993)
Summary:
Workaround https://github.com/yarnpkg/yarn/issues/7866 by refreshing the yarn key before using apt.

## 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] - CI

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

Test Plan:
```
circleci config validate

Config file at .circleci/config.yml is valid.
```

Reviewed By: fkgozali

Differential Revision: D26428755

Pulled By: hramos

fbshipit-source-id: d64c37eb6678e12279075a060deecef5d2e04919
2021-02-12 11:34:21 -08:00
Peter Argany d9064703fe Fix CMD+R reloading in bridgeless mode
Summary: Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D26412253

fbshipit-source-id: 6be41120f598bbac841a6b42fafe3bb47e3f8a46
2021-02-12 10:06:39 -08:00
Ramanpreet Nara c76070412f Move TurboModuleManager init outside JSIModules guard
Summary:
TurboModuleManager used to be provided by a JSIModules package. In D26193053 (13f100f788), we moved TurboModuleManager creation off JSIModules. However, we didn't move the creation outside the JSIModules guard. So, when there were no JSIModules registered, we simply wouldn't create the TurboModuleManager. This diff fixes that mistake.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D26380674

fbshipit-source-id: 66939d11205b1d2eccd8c3b59ca4782e90645cd9
2021-02-11 13:02:53 -08:00
Igor Klemenski c37d49492b Work around max path length during source build of RN Android (#30776)
Summary:
Building ReactAndroid from source on Windows has recently hit the limitation of maximum path lengths.
At build time, during the `:ReactAndroid:buildReactNdkLib` task, the linker tries to access several of the intermediate binaries located deep in the tmp folder hierarchy, eg.
```
D:\r\ReactAndroid\build\tmp\buildReactNdkLib/local/armeabi-v7a/objs/react_render_components_progressbar/D_/r/ReactAndroid/__/ReactCommon/react/renderer/components/progressbar/android/react/renderer/components/progressbar/AndroidProgressBarMeasurementsManager.o
```
**Suggested fix:** for modules such as `react_render_components_progressbar` and `react_render_components_picker`, rename them to `rrc_progressbar` etc.

**NOTE**: this assumes that the fix from https://github.com/facebook/react-native/issues/30535 is in place. This regression happened while https://github.com/facebook/react-native/issues/30535 has been pending checkin.

**Other mitigations I've tried:**
- setting [`LOCAL_SHORT_COMMANDS`](https://developer.android.com/ndk/guides/android_mk#local_short_commands) for the problematic modules or `APP_SHORT_COMMANDS` for the root project. Turns out those commands don't work on the NDK version RN requires, but even after manually applying a [patch ](https://android-review.googlesource.com/c/platform/ndk/+/1126440) to my local copy of the NDK, these flags had no effect.
- moving the repo directory higher in the file system tree, and using short directory names `D:\r\...` was not enough
- creating virtual drive letters for specific long paths with the [`sust`](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/subst#examples) command is not workable, since they depend on the source folder structure, and get partly generated by the build system, which I can't plug into
- just enabling long path support on Windows is not enough, since the compiler toolchain doesn't support them.
## 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
-->

[Android] [Fixed] - Fix source build on Windows machines vol. 2

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

Test Plan:
Run `.\gradlew installArchives`

Before:
![image](https://user-images.githubusercontent.com/12816515/105435667-a1e15d00-5c12-11eb-9fcd-d0c278aaf477.png)
Now:
![image](https://user-images.githubusercontent.com/12816515/105435741-c2a9b280-5c12-11eb-88d5-a69ae56bbf50.png)

Differential Revision: D26194286

Pulled By: mdvacca

fbshipit-source-id: 778b5a0515148e2ace19e7902f74301831ebed94
2021-02-11 12:32:33 -08:00
Lulu Wu 9d1e8897e0 Load Logbox module for venice
Summary:
1, Add logbox module to BridgelessReactPackage for loading by TurboModleManager
2, Implement createRootView for creating venice's logbox
3, Move setting reactcontext and devsupportmanager for FbReactFragment into onReactContextInitialized()
4, Fix some nullability warnings

Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D26370269

fbshipit-source-id: 016f1dab8387d3766b2fd24d6e88f14538f443ea
2021-02-10 19:47:44 -08:00
Luna Wei 49f5d148a7 Add inverted test case
Summary:
Changelog:
[General][Added] - Add inverted example for SectionList in RNTester

Reviewed By: kacieb

Differential Revision: D26333023

fbshipit-source-id: 43ca139a725b7b5d269150d2d56b7b57124a69e0
2021-02-10 19:18:24 -08:00
Luna Wei 575e23eb2a Add stickyHeadersEnabled example
Summary:
Changelog:
[General][Added] - [RNTester] Add stickyHeadersEnabled example

Reviewed By: kacieb

Differential Revision: D26333022

fbshipit-source-id: 37c869bbd25e4d6a090b53b1cffdf236ac27a8f3
2021-02-10 19:18:24 -08:00
Luna Wei 2e8b5df7b7 Refactor SectionList examples
Summary:
Changelog:
[General][Changed] Refactor how we create test cases for SectionList and update some styling

Reviewed By: kacieb

Differential Revision: D26326600

fbshipit-source-id: d6f62f60fec9a5890db9d00c264b62123d3c723e
2021-02-10 19:18:23 -08:00
Joshua Gross 81810f4c62 Add invariant to SurfaceMountingManager: when removing a view, the parent View must be a ViewGroup
Summary:
In addViewAt, we have this check. Add this same check to removeViewAt.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D26381475

fbshipit-source-id: 1050377aa4e528668446fd561ff09c61f27c700f
2021-02-10 16:03:10 -08:00
Andrei Shikov 5ca832b4aa Fix Android tests for touch events
Summary:
Updates Android tests to pass the tests [failing on CircleCI](https://app.circleci.com/pipelines/github/facebook/react-native/8047/workflows/50c356d0-f9a4-4909-b4e7-cad3b4bb6c57/jobs/188224/steps).

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D26368501

fbshipit-source-id: 61d4fdbc22cec2e397e365e415a08dbbc01cef09
2021-02-10 09:22:48 -08:00
Pieter De Baets a8b5b63d4e Remove unused promiseRejectionIsError
Summary: Changelog: [Internal]

Reviewed By: MichaReiser

Differential Revision: D26338073

fbshipit-source-id: 7b4d8881ffc58ee93b1ccf58e6717a4a8597dece
2021-02-10 07:57:17 -08:00
Micha Reiser cb0764eeb0 Upgrade react-hooks rules
Summary:
Upgrades the `react-hooks` eslint-rules to `4.2.0`

Changelog:
[Internal]

Reviewed By: GijsWeterings

Differential Revision: D26366235

fbshipit-source-id: 04628e8f2a6c56eacba516d877df143c6c81adb8
2021-02-10 07:43:52 -08:00
David Vacca ff3c1307ff Remove out of date TODO
Summary:
Remove out of data TODO

changelog: [internal] internal

Reviewed By: PeteTheHeat

Differential Revision: D26144400

fbshipit-source-id: c5a97ce98cd7251e40adc15c16fceed4b9c76f81
2021-02-09 23:19:28 -08:00
David Vacca 68207541d9 Increase severity for yoga logs
Summary:
This diff increases the severity for yoga logs to match all other logs in Fabric

changelog: [internal] internal

Differential Revision: D26315760

fbshipit-source-id: 1de3c23513ad8ce1630e3d0e3576f60608aac7de
2021-02-09 23:19:28 -08:00
David Vacca 8b72941a0a Add debug logs to check for overflow
Summary:
In this diff I'm adding debug assertions to verify that there are no overflows when muptiplying layout metrics by the pointScaleFactor

Ideally these should crash the app, but I'm trying to be conservative.

changelog: [internal] internal

Reviewed By: JoshuaGross

Differential Revision: D26297396

fbshipit-source-id: 068c60f4d89ea9cfd04a2e2174da2043ae150928
2021-02-09 23:19:27 -08:00
Joshua Gross 97ecb5eb19 StubViewTree: ensure nodes don't have parents when they're inserted
Summary:
iOS and Android platform code already explicitly check this invariant: nodes cannot have parents when they're inserted into the View hierarchy.

Check this in the core so we get these checks in unit tests, and earlier in the core before platform code runs.

Changelog: [Internal]

Reviewed By: shergin, mdvacca

Differential Revision: D26331842

fbshipit-source-id: c12bc9066d280cb85ccc9e754c9fa475927e6080
2021-02-09 22:43:44 -08:00
Joshua Gross 248704e8de Rename unit tests to match filenames
Summary:
Rename tests to match filenames so results appear correctly in console.

Changelog: [internal]

Reviewed By: PeteTheHeat

Differential Revision: D26306214

fbshipit-source-id: 58ce5ee0f5df5d7da38da8a2653a042ab7c26bb2
2021-02-09 22:43:44 -08:00
Joshua Gross 077f1d233c Remove Android-specific ViewShadowNode concrete/flattened view hack
Summary:
This hack was introduced to fix T63560216. See before/after, it no longer repros.

Changelog: [Internal]

Differential Revision: D26306134

fbshipit-source-id: 7e6f886d76f3c54912fbb548069c31faaac08786
2021-02-09 22:43:43 -08:00
Joshua Gross 03390d7c87 Differ: fix confusion between flattening and concreteness of views
Summary:
During earlier testing I didn't fully realize that Android disables a core bit of View Flattening: Views can be concrete or non-concrete; and their children can be flattened or not. None of these properties are mutually exclusive with each other.

Except on Android - that functionality is currently disabled. A View can be either flattened and non-concrete, or non-flat and concrete. So there are some flattening edge-cases hit on iOS but not Android, due to the larger state-space on iOS.

To test, I forced Android to align with iOS and tested; and then tested on iOS; and ensured no mounting errors, assertions, or crashes were hit during some specific tests.

Changelog: [Internal]

Differential Revision: D26298872

fbshipit-source-id: 2f0f78127a7bf057c7cf109005f1dae74f0ff6ba
2021-02-09 22:43:43 -08:00
Joshua Gross 84d0a2ed4e Flush glog lines at the end of StubViewTree mutate function
Summary:
On iOS, log lines are not entirely flushed when an assert is hit right after (or during) this mutate function. Make sure to flush log lines regularly during this function so that debugging is easier.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D26291789

fbshipit-source-id: 47af109cdc3dcfc6bf08cbb41db06e9260bfaa08
2021-02-09 22:43:43 -08:00
Joshua Gross e0f1101e7e Add invariant to SurfaceMountingManager: Views must not have parents when they are inserted
Summary:
We have no evidence of this happening on Android, but we are hitting a similar invariant on iOS. Adding this to Android for debugging purposes.

For now it's a SoftException to catch in debug and capture information; if we don't hit this prod at all, we'll elevate to a hard crash.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D26281585

fbshipit-source-id: 8ea9cf3ac555b13bf311f24c81bbbbc2845521d5
2021-02-09 22:43:43 -08:00
Joshua Gross e723294630 LayoutAnimations: remove dead code
Summary:
remove dead code; this flag is always defaulted to false, and not used anywhere

Changelog: [Internal]

Reviewed By: sammy-SC, mdvacca

Differential Revision: D26271507

fbshipit-source-id: e2277cc24f164c53f2e8a0aa72456ac400834d70
2021-02-09 22:43:42 -08:00
Joshua Gross 49baf65844 LayoutAnimations: assert -> LA_ASSERT
Summary:
Add LA_ASSERT macro, this just makes debugging easier on Android since these asserts are compiled out for us even in debug.

Changelog: [internal]

Reviewed By: mdvacca

Differential Revision: D26271508

fbshipit-source-id: 9be8c71e273d762a4f31ff1fcc629ce48218b98d
2021-02-09 22:43:42 -08:00
Joshua Gross 76c384ff61 LayoutAnimations: in setup, guard against props being null in prod
Summary:
These asserts don't run in prod; only set starting/final view props if the result props object is non-null.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D26271512

fbshipit-source-id: b495c014a062cf255fd4b5cb8609582f23edcec8
2021-02-09 22:43:42 -08:00
Joshua Gross 2218952d8b LayoutAnimations: when detecting conflicting mutations: crash more in debug, fail elegantly in prod
Summary:
In this case where there's an ongoing UPDATE animation and an INSERT of the same node, make sure the ongoing animation type is what we expect, and that the `newChildShadowView` is valid.

We were already guarding against these, but we should (1) crash more in debug and (2) fail more elegantly in prod when the asserts don't run.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D26271514

fbshipit-source-id: 48e7d37a2493241f16099d9fe5ecb0d247707ca7
2021-02-09 22:43:41 -08:00
Tim Yung d39643b9de RN: Rewrite `NativeEventEmitter`
Summary:
Rewrites `NativeEventEmitter` to not extend `EventEmitter` and to compose `RCTDeviceEventEmitter` instead of (mis)using its exported `sharedSubscriber` property.

This makes it easier to reason about `NativeEventEmitter`. Also, the extraneous methods on `EventEmitter` are no longer inherited.

Changelog:
[General][Removed] - `NativeEventEmitter` no longer inherits from `EventEmitter`, so it no longer implements `removeListener` and `removeSubscription`. Instead, use the `remove()` method on the subscription object returned by `addListener`.

Reviewed By: rubennorte

Differential Revision: D26163562

fbshipit-source-id: c1aadb99bdefbaa36fece57ce74604e414f94d4d
2021-02-09 21:27:45 -08:00
Nadiia D 7d4612b076 Add testIDs and names to Animated examples
Summary:
Changelog:
[General][Internal] - Add testIDs to the Animated examples.

Reviewed By: kacieb

Differential Revision: D26312729

fbshipit-source-id: c9131bb0fda1533d78dd6cf61d8c604053c7884f
2021-02-09 21:07:52 -08:00
Nadiia D 2c19d85285 TextInput: test cursor placement
Summary:
Changelog:
[General][Internal] Added some test IDs for the TextIput examples.

Reviewed By: lunaleaps

Differential Revision: D26265361

fbshipit-source-id: 26d7a69f74f283daed2ddabaaf31113cd3089bf3
2021-02-09 21:07:52 -08:00
Nadiia D 05b54cbee9 TextInput: create shared test utils
Summary:
Changelog:
[General][Internal] Added some test IDs and names for the TextIput examples.

Reviewed By: lunaleaps

Differential Revision: D26263554

fbshipit-source-id: 958a030eafbbed9076f49ab05585f30ddef3ef23
2021-02-09 21:07:51 -08:00
Luna Wei 16efb8dd52 Render test titles and standardize on output
Summary:
Changelog:
[General][Added] - Show a test title if set and standardize the output

Note this will break existing screenshot tests so will need to re-run these

Reviewed By: nadiia

Differential Revision: D26318844

fbshipit-source-id: cef48d72a524ccc6f32b9d930c68fe4171270365
2021-02-09 11:59:52 -08:00
Valentin Shergin 33d6091cac Fabric: Using `SurfaceHandler` on iOS
Summary:
This diff migrates iOS renderer to using SurfaceHandler directly instead of calling Scheduler methods.

Major changes:
* RCTFabricSurface only stores a SurfaceHandler and platform-specific parts (such as a UIView instance and TouchHandler); all other pieces of state are stored in SurfaceHandler object.
* All the state changes initiated from RCTFabricSurface are performed via calling corresponding methods on SurfaceHandler (bypassing RCTSurfacePresenter, RCTScheduler, Scheduler, and UIManager).
* Every RCTSurfaceHandler is responsible for observing `UIContentSizeCategoryDidChangeNotification` and communicating the change down to SurfaceHandler. (Besides code simplifications it's more correct because on iOS the DPI actually depends on a particular UIScreen/UIWindow associated with UIView and *not* global for the whole app.)

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D24290778

fbshipit-source-id: 62b600c3f1b2e66a7513481404af941ef8b78bec
2021-02-09 08:10:43 -08:00
Samuel Susla 5c202cafd6 Simplify content mode conversion
Summary:
Changelog: [internal]

To avoid typecasting, let's return `UIViewContentMode`. This way we get rid of a condition to check if contentMode is repeat.

Reviewed By: JoshuaGross

Differential Revision: D26252431

fbshipit-source-id: 94ef7af1a76f13c91b696d57ceecc2453bbc9d8d
2021-02-09 04:03:48 -08:00
Tim Yung 1049835b50 RN: Simplify `Keyboard`
Summary:
Simplifies `Keyboard` by removing redundant methods and changing `addEventListener` to return an `EventSubscription`.

Changelog:
[General][Changed] - `Keyboard.addListener` now returns an `EventSubscription` object.
[General][Removed] - Removed `Keyboard.removeListener`. Instead, use the `remove()` method on the object returned by `Keyboard.addListener`.
[General][Removed] - `Keyboard` no longer inherits from `NativeEventEmitter`, so it no longer implements `removeAllListeners`, and `removeSubscription`.

Reviewed By: milroc

Differential Revision: D26163536

fbshipit-source-id: b4bd91627cd027a13fcba269a253823913eb7589
2021-02-08 17:49:31 -08:00
Tim Yung 88a41f180c LogBox: Intelligently Un-Collapse Stack Frames
Summary:
Tweaks LogBox so that if all stack frames are collapsed, start off without collapsing any of them.

It saves developers from one extra interaction to make the LogBox actually useful for errors where every frame is ignored.

Changelog:
[General][Changed] - LogBox will not initially collapse stack frames if every frame would be collapsed.

Differential Revision: D26266195

fbshipit-source-id: dcdbe0834da5fc3a0bf49fb7857de30dd7e4b8cb
2021-02-08 17:17:57 -08:00
Luna Wei 7f5ec15009 Update RNTester example headers
Summary:
Changelog:
[General][Changed] - Update RNTester example headers
* Removed platform availability on a example page
* Add the title of the example module since we aren't updating the native title bar

Since we already show platform information on the list of examples, it's redundant to show it again on the example page and this would give us more clearance for our examples below.

Where we already show platform information
| Android | iOS |
| {F370209520} | {F370209763} |

Reviewed By: nadiia, kacieb

Differential Revision: D26293966

fbshipit-source-id: a503db3703fc0c56a64c91880a83d222fe38faf4
2021-02-08 17:08:43 -08:00
Luna Wei 4ed54c6411 Move SectionList examples to RNTester
Summary:
Changelog:
[General][Added] - Add more SectionList examples to RNTester

Move the examples we're using for e2e tests to RNTester as well

Reviewed By: nadiia, kacieb

Differential Revision: D26290719

fbshipit-source-id: c61ccd3034ac21c779c3a94e5c0febcfbf9897f7
2021-02-08 17:08:43 -08:00