Commit Graph

3655 Commits

Author SHA1 Message Date
David Vacca 6e13ca3015 Integrate Android Picker into RN Tester OSS app
Summary:
This diff integrates AndroidPicker into RN Tester OSS app

changelog: [inernal] internal

Reviewed By: fkgozali

Differential Revision: D23199578

fbshipit-source-id: 7c34b0ee4887ffc15dbdffad464230b19f176fc8
2020-08-21 14:18:48 -07:00
David Vacca 1663f27f95 Integrate Activity Indicator into RN Tester Android OSS app
Summary:
This diff integrates Activity Indicator into RN Tester Android OSS app

changelog: [internal] internal

Reviewed By: fkgozali

Differential Revision: D23198641

fbshipit-source-id: 93614a3f856b4fc162d4618b168d9c82d18a91eb
2020-08-21 14:18:48 -07:00
David Vacca a76c55e0f5 Integrate AndroidDrawerLayout component into RN Tester Android OSS APP
Summary:
This diff registers the AndroidDrawerLayout component into RN Tester Android OSS APP

Changelog: [internal]

Reviewed By: fkgozali

Differential Revision: D23198359

fbshipit-source-id: 4033c7e968a993a7f8fcaa3f57e7dd78bf84fe57
2020-08-21 14:18:48 -07:00
David Vacca 3790569a71 Integrate Modal into RN Tester Fabric OSS APP
Summary:
This diff integrates Modal into RN Tester Fabric OSS APP

changelog: [internal] internal

Reviewed By: fkgozali

Differential Revision: D23183507

fbshipit-source-id: bc2513c39c783d387a985c86a12b04dadac49933
2020-08-21 14:18:48 -07:00
David Vacca 9b811fb0bf Integrate ScrollView in RN Tester Android OSS APP
Summary:
This diff integrates ScrollView in RN Tester Android OSS APP

changelog: [internal] internal

Reviewed By: fkgozali

Differential Revision: D23179883

fbshipit-source-id: 8e892ae613a1f44c8d6cfb837bfdbc0771a89176
2020-08-21 14:18:48 -07:00
David Vacca 60a5223ff7 Integrate AndroidTextInput in RN Tester OSS App
Summary:
This diff integrates AndroidTextInput in RN Tester OSS App

changelog: [internal] Internal

Reviewed By: fkgozali

Differential Revision: D23179389

fbshipit-source-id: 709d71343ca374ca2ece00774f4f273145bffd20
2020-08-21 14:18:48 -07:00
David Vacca 8f306cd66a Update directory hierarchy of AndroidTextInput C++ files
Summary:
This diff updates the directory hierarchy of AndroidTextInput C++ files to be compatible with Android OSS build system

changelog: [internal] Internal

Reviewed By: PeteTheHeat

Differential Revision: D23179390

fbshipit-source-id: 1c52e4f882853799a58d44876cadd392b4a35050
2020-08-19 19:22:23 -07:00
David Vacca 2e88b25242 Integrate Image Fabric component into OSS
Summary:
This diff integrates image Fabric component into RN Tester app

changelog: [internal] internal

Reviewed By: fkgozali

Differential Revision: D23177896

fbshipit-source-id: 008e86e82a262827a31b9df74a50b58a97f2e1b7
2020-08-18 19:55:51 -07:00
David Vacca 50af304b3f Integrate Fabric Text in RN Tester OSS
Summary:
This diff integrates Text component into RN OSS

changelog: [internal] internal

Reviewed By: fkgozali

Differential Revision: D23177414

fbshipit-source-id: 0a415f8dd8339b84465a7c8d73f3d8abd80fbecc
2020-08-18 19:55:51 -07:00
David Vacca 19695ed6a9 Integrate UnimplementedView into RNTester OSS
Summary:
This diff integrates and render UnimplementedView into RNTester OSS

changelog: [internal] internal

Reviewed By: fkgozali

Differential Revision: D23170052

fbshipit-source-id: 9306311d114c280fdeeb20d545ef244369040e96
2020-08-18 17:00:02 -07:00
David Vacca d6ef2598bc Integrate Android C++ components files into RN Tester OSS
Summary:
This diff integrates Android C++ components files into RN Tester OSS

changelog: [internal] internal

Reviewed By: fkgozali

Differential Revision: D23170053

fbshipit-source-id: 3ba9d289e026359d83580fbddfd8caf8c226a29a
2020-08-18 17:00:01 -07:00
David Vacca 29513ac989 Fix output files generated by oss-android-codegen script
Summary:
This diff filters the iOS C++ friles that are generated by the oss-android-codegen script
Also, as part of this diff I'm inlcuding .cpp files into the output.

These files are only used and compiled in Android

changelog: [internal] internal

Reviewed By: fkgozali

Differential Revision: D23169268

fbshipit-source-id: 404607f3cd6e59197291ea67701774c9c492a282
2020-08-18 17:00:01 -07:00
Ramanpreet Nara 3f77367883 Delay turbomodulejsijni so load until we need it in TurboModulePerfLogger
Summary:
Twilight doesn't have TMPerfLogging enabled. However, the TurboModule infra uses the TMPerfLogger java class everywhere, which loads the turbomodulejsijni library on class load. For some reason, this class load doesn't work, and causes Twilight prod to crash.

To mitigate that crash, this diff delays the so load until it's absolutely necessary, which is by the time we call jniEnableCppLogging. This should never be called in Twilight, because it doesn't have TMPerfLogging enabled. Therefore, the crash should disappear on Twilight.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D23192072

fbshipit-source-id: b73ece580e4345dbf835b0fc2f7d43b90f202411
2020-08-18 12:13:35 -07:00
David Vacca 0e442d1c02 Build RN Tester with fabric enabled in sandcastle
Summary:
This diff extends test-react-native-oss-android-legocastle to test the build of RNTester with fabric enabled in Sandcastle

changelog: [internal] internal

Reviewed By: fkgozali

Differential Revision: D23141524

fbshipit-source-id: 396dae1c0a23ce03db1053de1627eacb09a6df94
2020-08-17 16:40:00 -07:00
David Vacca c291265508 Reintroduce CoreComponentsRegistry class
Summary:
This diff reintroduces the CoreComponentsRegistry class to register core components in the RN Tester app.

This class was previously deleted as part of D23091020 (https://github.com/facebook/react-native/commit/7fb1afae7f4b78970463e272b7d4f3230e84887d). Different from a past approach, this diff doesn't use inheritance for Hybrid classes (which seems to bring problems in Android 4 devices)

I'm planning to land this diff after I verify that D23091020 (https://github.com/facebook/react-native/commit/7fb1afae7f4b78970463e272b7d4f3230e84887d) fixed RC (maybe I will wait until sunday's cut)

changelog: [internal] internal

Reviewed By: fkgozali

Differential Revision: D23109856

fbshipit-source-id: 5220e522e197f701c782ab5089f9f1036ec90c19
2020-08-17 14:18:57 -07:00
David Vacca 7fb1afae7f Remove CoreComponentsRegistry class
Summary:
This diff removes the CoreComponentsRegistry class that was recently created to expose Fabric components in OSS

changelog: [internal] internal

Reviewed By: JoshuaGross, shergin

Differential Revision: D23091020

fbshipit-source-id: 9d851608ed0eddb98367265b5e346d5298f5f732
2020-08-12 22:52:20 -07:00
David Vacca c03b7dd772 Fix NoSuchMethodError in CoreComponentsRegistry class
Summary:
This diff fixes a NoSuchMethodError in CoreComponentsRegistry class.

changelog: [internal] internal

Reviewed By: JoshuaGross

Differential Revision: D23043627

fbshipit-source-id: bd87ba560cc57ca345bf694b457be09097c433fe
2020-08-10 18:42:05 -07:00
Joshua Gross 73242b45a9 NativeAnimatedModule: allow JS to control queueing of Animated operations
Summary:
In the past I tried a few heuristics to guess when a batch of Animated Operations were ready, and none of these were super reliable. But it turns out we can safely allow JS to manage that explicitly.

Non-Fabric still uses the old behavior which seems fine.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D23010844

fbshipit-source-id: 4c688d3a61460118557a4971e549ec7457f3eb8f
2020-08-09 01:39:29 -07:00
Joshua Gross 0af275e3be Diagnostics for non-Fabric ViewCommand crash
Summary:
Add additional logging.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D22980132

fbshipit-source-id: ab98d9aebe47dc65780ffbf6648e9341e1750121
2020-08-09 01:39:29 -07:00
David Vacca 0416f77ce4 Extend 'fabric' module to compile in OSS
Summary:
This diff extends fabric module to compile in OSS

NOTE: As a side effect of this diff, Fabric will be included into "reactnativejni" which is used by RN OSS.

I'm planning to remove this dependency in the near future - T71320460

changelog: [internal] internal

Reviewed By: JoshuaGross

Differential Revision: D22991877

fbshipit-source-id: 0ab3ee410dd448bbd87130114bec27c6e6bc65c6
2020-08-07 19:49:19 -07:00
David Vacca bb15437db9 Create CoreComponentsRegistry
Summary:
This diff introduces the class CoreComponentsRegistry that is responsible of registering core components in fabric.
This is required to make RN Tester to work in Fabric, in the future we'll extract this registry into another module (once we figure it out what's the best way to do this)

changelog: [internal] internal

Reviewed By: JoshuaGross

Differential Revision: D22991876

fbshipit-source-id: 15e85e15aac5dd981161d9eae35eb2cee4fa66b6
2020-08-07 19:49:19 -07:00
David Vacca f441fe6d45 Refactor ComponentFactoryDelegate class
Summary:
This diff refactors the ComponentFactoryDelegate class. It also introduces a new class called ComponentRegistry that will be used to register components into fabric

changelog: [internal] internal

Reviewed By: JoshuaGross

Differential Revision: D22985313

fbshipit-source-id: e33a3d4fcb3a1c509b80c6ff1f43889480b1c2c3
2020-08-07 19:49:19 -07:00
David Vacca 61a16fe1b6 Refactor Runnable C++ class to compile in OSS
Summary:
This diff refactors the class Runnable into a struct to make it work in OSS

changelog: [internal] internal

Reviewed By: JoshuaGross

Differential Revision: D22963704

fbshipit-source-id: 2212c8f1e4a62b2bcad5c061709e29b247454fc1
2020-08-07 19:49:19 -07:00
Oleg Lokhvitsky 7e5cf51117 Back out "Remove complex NativeAnimated queueing mechanisms"
Summary:
changelog: [internal]
Original commit changeset: 9241fff84376

Reviewed By: JoshuaGross

Differential Revision: D22987878

fbshipit-source-id: e7fb8f51ab911ff881ed543f39b65afbe076a7aa
2020-08-06 17:13:56 -07:00
Joshua Gross cd372b1b06 Mechanisms to workaround certain Fabric crashes in prod
Summary:
New mechanism to soft-crash, or crash, and collect diagnostics in the mounting layer.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D22971260

fbshipit-source-id: 860cde3effa4a187f10f5dd1488dd41ace65e363
2020-08-06 11:18:05 -07:00
Joshua Gross 0713246e7b Switch to using safer UpdateState mechanism
Summary:
Update FabricViewStateManager so that the caller can bail out of updates by returning null.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D22966024

fbshipit-source-id: 31cd9ec8a9a9918fbb94844e30ed1a2fcc61997d
2020-08-05 22:01:19 -07:00
Joshua Gross 0c3988356e Improve MountingManager debug logging
Summary:
Improve logging slightly.

One issue I ran into is that the "after" view hierarchy looks identical to "before" unless you schedule for the next UI tick.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D22962116

fbshipit-source-id: c7a1e16e26d2aebefa3baf3acfef4e133b8fde70
2020-08-05 17:44:05 -07:00
Joshua Gross 065fbe3be5 Implement FabricViewStateManager for ReactEditText
Summary:
Implement FabricViewStateManager for ReactEditText.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D22941069

fbshipit-source-id: 44651d1a3500e4dcd36f94f339cb25ea25b1f3f9
2020-08-05 06:35:42 -07:00
Joshua Gross 33bccbe2ec Implement FabricViewStateManager for ReactScrollView
Summary:
Implement FabricViewStateManager for ReactScrollView.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D22941070

fbshipit-source-id: d464f48aabecd7684558271f2b734b416ed15998
2020-08-05 06:35:41 -07:00
Joshua Gross 534f0aefae Implement FabricViewStateManager for ReactHorizontalScrollView
Summary:
Implement FabricViewStateManager for ReactHorizontalScrollView.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D22941072

fbshipit-source-id: fe1a91888a3a447b746547862855ea0cf4c72fb4
2020-08-05 06:35:41 -07:00
Joshua Gross 2f6bda19ce Implement FabricViewStateManager for Modal
Summary:
Implement FabricViewStateManager for Modal.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D22941071

fbshipit-source-id: 72b1f313734881b27461762ce8c0806eccfd7b1c
2020-08-05 06:35:41 -07:00
Joshua Gross 774dec1e17 Introduce general API for setting C++ State from the View layer and getting a notification if it fails, with Android impl
Summary:
iOS will need to be implemented separately, but the shared C++ bits are in place.

Explanation: there is currently no way for the View layer to /know/ if an UpdateState call has succeeded or failed. Generally we just assume it succeeds, but if it fails we have no way of knowing or retrying.

This can cause some UI bugs. To mitigate this, I'm introducing a "failure" notification callback mechanism. The JNI bridging for this is a little complicated to avoid passing Runnable across the JNI, but it
should be much simpler on iOS.

In development this seems to make View components much more reliable.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D22940187

fbshipit-source-id: 917f2932ae22d421f91fe8f4fca3f07dc089f820
2020-08-05 06:35:41 -07:00
Joshua Gross c8f571fdad Build ViewGroup mechanism for repeatedly retrying UpdateState until it succeeds
Summary:
With BackgroundExecutor+State Reconciliation, it is pretty common to have races where View layer UpdateState calls are thrown away.

Theoretically this is /always/ possible since C++ doesn't retry failed UpdateStates, we just try once and then bail. This is part 1 of improving our mechanisms for ensuring that State stays up-to-date from the View layer.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D22933927

fbshipit-source-id: 77b3b87402f772e3f149be0f9200e673bbed7b57
2020-08-04 17:12:41 -07:00
Joshua Gross 187fc09b9d Resolve crashes in NativeAnimated in Fabric
Summary:
Reduce crash volume.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D22934177

fbshipit-source-id: 5b959239a7c1cabe3b552e2b99b32c7735fe7bf8
2020-08-04 17:05:48 -07:00
Joshua Gross 7bf6196408 Collect more diagnostics when addViewAt crashes
Summary:
Making error more explicit to assist in debugging.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D22929047

fbshipit-source-id: 4f26668a96868e7c5865a587142c3bcd10a26c90
2020-08-04 14:15:34 -07:00
David Vacca 8616f868d5 Create android oss build system for react/config module
Summary:
This diff creates the Android OSS build system for the module react/config

As part of this diff I also moved the module to react/config folder

changelog: [internal] internal

Reviewed By: JoshuaGross

Differential Revision: D22877264

fbshipit-source-id: 5b3c42580d2b1d73dc0abb48bcf4ff063b2f581f
2020-08-03 14:21:26 -07:00
Joshua Gross e3302eeeab LayoutAnimations: call onSuccess, onFailure callbacks
Summary:
Hook up onSuccess and onFailure callbacks to LayoutAnimations.

Note that in non-Fabric RN, onSuccess is not known to work in Android. I could not find any uses of onFailure and it's not documented, so for now, it is only called if the setup of the animation fails.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D22889352

fbshipit-source-id: 4306debb350388dd2b7a2cbfe295eb99723988e2
2020-08-02 16:37:03 -07:00
David Vacca d39fe0fbf9 Remove fb/xplat_init dependency
Summary:
This diff removes the fb/xplat_init dependency from fabric onLoad class
This is necessary to make RM compile in OSS
changelog: [Internal] Internal

Reviewed By: RSNara

Differential Revision: D22875531

fbshipit-source-id: cc4cd2af875fe7eadfb3a8f4a9f16acf5fa415d8
2020-08-01 13:31:03 -07:00
David Vacca f78fcf4a3f Remove fb/xplat_init dependency
Summary:
This diff removes the fb/xplat_init dependency from fabric onLoad class

This is necessary to make fabric compile in OSS

changelog: [Internal] Internal

Reviewed By: RSNara

Differential Revision: D22874850

fbshipit-source-id: 0c61a366e09ab072215ba2fe651f96ef4c2e455a
2020-08-01 13:31:02 -07:00
David Vacca aee1ae9e92 EZ refactor in ReactViewBackgroundDrawable
Summary:
EZ refactor in ReactViewBackgroundDrawable to remove an unnecessary class variable

changelog: [internal] Internal

Reviewed By: RSNara

Differential Revision: D22874851

fbshipit-source-id: 16808809b196cba0dab5c9972359d7786939a7ce
2020-08-01 13:31:02 -07:00
Ramanpreet Nara 111aab590e Forward the NativeModule schema jsi::Value to TMM
Summary:
If `__turboModuleProxy` is called with a second argument, we'll now forward that `jsi::Value` to TurboModuleManager on iOS and Android, so that the TurboModuleManager can eventually use this `jsi::Value` to read data required to perform method invocation on the TurboModule object.

**Note:** This diff is basically a no-op right now.

Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D22828838

fbshipit-source-id: 19db2adcae6a58b4885fcd11bef23f9d5882bfce
2020-07-31 15:29:49 -07:00
Ramanpreet Nara a30fbc28c9 Give NativeAnimatedTurboModule its own TurboModule interface
Summary:
Unfortunately, the new codegen doesn't allow us to import types from other files. Therefore, I've inlined the interface specification of NativeAnimatedModule into NativeAnimatedTurboModule.

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D22858790

fbshipit-source-id: 759bb960240afaba6b70c2730c3359b7e8c46c83
2020-07-31 13:48:41 -07:00
David Vacca 3093010ea5 move fabric to ReactCommon/react/renderer
Summary:
This diff moves fabric C++ code from ReactCommon/fabric to ReactCommon/react/renderer
As part of this diff I also refactored components, codegen and callsites on CatalystApp, FB4A and venice

Script: P137350694

changelog: [internal] internal refactor

Reviewed By: fkgozali

Differential Revision: D22852139

fbshipit-source-id: f85310ba858b6afd81abfd9cbe6d70b28eca7415
2020-07-31 13:34:29 -07:00
Ramanpreet Nara 826067736f Instrument TurboModuleManager.getModule
Summary:
This instruments the following marker:
- MODULE_CREATE

**Note:** This marker isn't necessary to test the JS TurboModule codegen, since the JS codegen should only affect the C++ portion of the TurboModule infra. However, I implemented this while I was in this area of the code, for completeness.

Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D22679888

fbshipit-source-id: aa04822bd5a7c889813fcd13ca23c0b7a1d8444a
2020-07-31 12:49:15 -07:00
Ramanpreet Nara 9c35b5b8c4 Dispatch promise methods to the NativeModules thread
Summary:
In D17480605 (https://github.com/facebook/react-native/commit/689233b018bd533a7eecd38e38a7fb84b849cf88), I made all methods with void return types dispatch to the NativeModules thread. This diff makes the same change to methods with promise return types.

**Note:** The changes are disabled for now. I'll add an MC so that we can test this in production in a later diff.

Changelog:
[Android][Fixed] - Make promise NativeModule methods dispatch to NativeModules thread

Reviewed By: PeteTheHeat

Differential Revision: D22489338

fbshipit-source-id: d5b030871f9f7b3f48eb111225516521493cb05e
2020-07-31 12:49:14 -07:00
Anton Bryukhov aa1d31ebca Use recent Vibrator Android API (#29534)
Summary:
Android's `VibrationModule` uses deprecated `vibrate(long milliseconds)` and `vibrate(long[] pattern, int repeat)` methods. Deprecation notes: [[1]](https://developer.android.com/reference/android/os/Vibrator#vibrate(long)) [[2]](https://developer.android.com/reference/android/os/Vibrator#vibrate(long[],%20int)).
Changes in this pull request use recent `Vibrator` API for devices with API Level >= 26 (since mentioned methods were depreceted in API Level 26).

## 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] [Internal] - Use non-deprecated `Vibrator` API in `VibrationModule`

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

Test Plan: API is the same as before, but it uses recent `Vibrator` API.

Reviewed By: makovkastar

Differential Revision: D22857382

Pulled By: mdvacca

fbshipit-source-id: 6793a7d165fa73d81064865861ed55af2de83d52
2020-07-31 11:25:37 -07:00
David Vacca 9b34aa261c Cleanup unsed code in ReactScrollView
Summary:
This diff cleansup unsed code in ReactScrollView

changelog: [Android][Deprecated] Remove code used by Android API level < 16

Reviewed By: JoshuaGross

Differential Revision: D22771910

fbshipit-source-id: d02f7da209d3f313b22f3d4b8f6c413b32f7bc44
2020-07-31 10:44:06 -07:00
David Vacca b133427778 Cleanup unsed code on AccessibilityInfoModule
Summary:
This diff cleansup unused code on AccessibilityInfoModule class

changelog: [Android][Deprecated] Remove code used by deprecated Android API levels

Reviewed By: JoshuaGross

Differential Revision: D22771912

fbshipit-source-id: f32808fa93f75c10324e8875b85fe4e541b284b8
2020-07-31 10:44:05 -07:00
David Vacca b7d8641a28 Cleanup ForwardingCookieHandler class
Summary:
This diff cleansup the class ForwardingCookieHandler, refactoring constants and adding annotations to avoid lint errors

changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D22771914

fbshipit-source-id: 4fdff2df5ea103f93519c2f4504288202114b1fc
2020-07-31 10:44:05 -07:00
David Vacca f829722b54 Remove old android APIs code from ReactViewGroup
Summary:
This diff removes code that was used to support android APIs < kitkat
changelog: [Android][Deprecated] Remove calls to Android API < Kitkat

Reviewed By: JoshuaGross

Differential Revision: D22771913

fbshipit-source-id: b9bba9e94fbc8e18889b821050dcd6eace4c202d
2020-07-31 10:44:05 -07:00