Summary:
This diff fixes the scrolling of Android Horizontal Scroll View, the root cause was that Binding was mounting a ScrollView instead of an AndroidHorizontalScrollView component.
This will be automatically fixed when all the View components are autogenerated.
Reviewed By: shergin
Differential Revision: D14594622
fbshipit-source-id: 7c477ca167188ea9c473f61145461d3cf1696e17
Summary: Simple diff that refactors the usage of the sComponentNames to not require components to be part of the mapping when the name in JS is the same as the name in Native side.
Reviewed By: shergin
Differential Revision: D14594659
fbshipit-source-id: d1948b27e04686fefbf9b6e2b06d4f9317b97062
Summary: Adds debug logging in FabricUIManager and the mounting layer of Fabric.
Reviewed By: shergin
Differential Revision: D14594521
fbshipit-source-id: a5c0ee39e1bac8a340849ca3e044694cbee5427e
Summary: This diff exposes the collapsable prop as part of LayoutShadowNode, fixing the bug of the collapsable prop being filtered by JS in Fabric
Reviewed By: shergin
Differential Revision: D14594522
fbshipit-source-id: a892ba8228e76f11232acc6fe5c8d75e991d8fc6
Summary:
This diff removes the `WebView` export from React Native. Internally, we are requiring `WebView` directly now and externally people will have to use the community maintained module. This diff does not yet move the WebView files from the repo, this will happen in a follow-up.
Note that I had to remove a test for Cookies that displayed data in a WebView. I don't think there is an easy way to retain this (debugging) information that likely very few people ever take a look at so I think it is fine.
Reviewed By: TheSavior
Differential Revision: D14613077
fbshipit-source-id: b1d412f970d09d7d70ecac2c23e62cfdd09d7c8e
Summary:
Add the ability to build on top of the OkHttpClient.Builder by defining a lambda that gets called on network requests
[Android][Added] - Public method `setCustomClientBuilder` to the native `com.facebook.react.modules.network.NetworkingModule`, that allows customizing the OkHttpClient per-request for greater control over HTTP requests.
Reviewed By: hramos
Differential Revision: D14288613
fbshipit-source-id: 34df0ff3e18eeea1d565ccfcf97408379900120b
Summary:
I was working to use more Android Support Library in RN core, but wasn't able to finish it. So this PR is for only Systrace and TraceCompat only.
[Android] [Changed] - Use TraceCompat in Systrace
Pull Request resolved: https://github.com/facebook/react-native/pull/23780
Differential Revision: D14423742
Pulled By: hramos
fbshipit-source-id: e3c3e2dfd95eac3d2484313f9be69df1c85904cf
Summary:
We want the ability to use Linkify on android text elements. This only adds this property to Text and not TextInput since there are some functional differences with how the types could be used between iOS and android - iOS allows one or many types while Linkify restricted us to providing only one option (using the masks).
Performance is affected ONLY FOR TEXT ELEMENTS USING THIS FEATURE since Linkify is searching for patterns.
Pull Request resolved: https://github.com/facebook/react-native/pull/19216
Differential Revision: D14621883
Pulled By: cpojer
fbshipit-source-id: cb692021d314140b9a92b29e23384afd7fd1b09e
Summary: This diff fixes a NoSuchElementException that was being thrown at ReactChoreographerDispatcher.doFrame(). The root cause was a lack of syncronization in removeFrameCallback().
Reviewed By: shergin
Differential Revision: D14619386
fbshipit-source-id: 80bc9e44866218d2a8703b3186f6958c145f260b
Summary:
[Android] [Fixed] - LayoutAnimations cause invalid view operations
The dating team has found a consistent repro where following an order of steps will get you the following exception:
https://lookaside.facebook.com/intern/pixelcloudnew/asset/?id=2113362972287761
The exception is due to the fact that the following operation
`delete child tag 17 from parent tag 481 which is located at index 2`
cannot be performed because parent tag 481 only has 2 children.. and they also happen to not have the tag 17 as a child. Somehow the operations and the tree they act upon are out of sync.
RN receives operations from React via the native module `UIManagerModule`. The operations use tags (an identifier for a view) and indices to determine what view is updated. These operations (grouped together as a batch) are then passed to the UI thread where we perform them on the platform views.
LayoutAnimations are implemented per batch in RN. When LayoutAnimations are on, qualified view updates are animated. Because the delete operation is animated, RN doesn't remove the view from the platform view hierarchy immediately but asynchronously -- after the animation is complete. This is problematic for other view operations that rely on an index on where to insert or delete a view because during the creation of those operations, it was assumed all prior operations were performed synchronously.
This is what was occurring in the repro and there were silent view errors occurring before the exception was thrown.
This diff proposes a solution to track all pending delete operations across operations.
We introduce a map that is keyed on view tags and has a value of a sparse array that represents child index -> count of views that are pending deletion.
`{11: [0=1], 481: [2=1]}` where this would be interpreted as for index 0 under view tag 11, there is one async view deletion that has not completed and under tag 481 there is one async view deletion at index 2.
We use the map to adjust indices on add / delete operations. We also update the count when the deletion animation is complete and remove the tag from the map when it is deleted.
Regarding worst case sizing of the map => O(# of platform views rendered)
Reviewed By: mdvacca
Differential Revision: D14529038
fbshipit-source-id: 86d8982845e25a2b23d6d89ce27852fd77dbb060
Summary:
Allow interpolation of strings with useNativeDriver. This allows animating much more of react-native-svg. This PR adds support for native animation of lengths with units, path data, colors etc. Plus, fixing the redundantly created nodes and (and thus, previously incorrect) connection of native animated nodes, improving performance.
Docs will need to change, specifying that string interpolation works with the native driver as well.
[GENERAL] [Added] Add support for native driven string interpolation in Animated
[GENERAL] Fix exception: Expected node to be marked as "native"
[GENERAL] Fix connection of AnimatedNodes and creation of redundant AnimatedNodes
Pull Request resolved: https://github.com/facebook/react-native/pull/18187
Differential Revision: D14597147
Pulled By: cpojer
fbshipit-source-id: 82a948a95419236be7931a8cc4ff72f41e477e9c
Summary:
Moved layout outputs transfer logic from YogaNodeJNIBase to YogaNodeJNI.
This change set is for adding experiment for layout outputs batching using a float array
Reviewed By: davidaurelio
Differential Revision: D14368107
fbshipit-source-id: 75ca330c1e7f07adc0ab8e7a5927d93977088918
Summary:
setNativeProps ends up calling UIManager.updateView which fails to find the view tag in the Paper UIManager and crashes.
This diff simply checks if the tag is managed by fabric, and calls `fabricUIManager.synchronouslyUpdateViewOnUIThread` if it is.
Not the ideal fix, but it generally works (js-driven animations work as well as in Paper) and it's better than crashing or not working at all.
Reviewed By: JoshuaGross
Differential Revision: D14414523
fbshipit-source-id: 0acd404f55094f8ce8eda39cb87ab58c727fb068
Summary: Removes useArrayNativeAccessor and everything needed to support it, similar to D14486283
Reviewed By: mdvacca
Differential Revision: D14487244
fbshipit-source-id: 7cfa91f7cf322c648c82be5951f3622cd6468961
Summary:
This was quite a rabit hole of remove deps -> delete dead code -> repeat.
Waaay simpler now with less duplicate lookups, redundant type verification, and extra function calls.
Reviewed By: mdvacca
Differential Revision: D14486283
fbshipit-source-id: 035db30181755d046a1ae99760468b954b2449df
Summary:
Changes our property access pattern to iterate through props once and pass the Object value directly rather than looking the value up in the map with the key.
Note some ViewManagers methods (especially yoga related ones on shadow nodes) expect a `Dyanamic`, so this diff also creates Dynamic's only when needed by the hand-written code, and introduces a new `DynamicWithObject` to create them that simply wraps the underlying object (as opposed to `DynamicWithMap` which wraps the map and does a lookup any time the `Dynamic` is accessed.
Reviewed By: mdvacca
Differential Revision: D14453300
fbshipit-source-id: df98567b6eff1e6b7c611f179eb11e413fb94e5d
Summary: This diff fixes an IllegalStateException that is thrown when the user click is on a edit text and tap 'Next' on the keyboard to focus on the next view, but the next view is hidden.
Reviewed By: lunaleaps, mmmulani
Differential Revision: D14598410
fbshipit-source-id: 2999cc468ed24bedff163eedcfaec50f6ee005d6
Summary: This is based on the work done in D8686586. Removed the logger instance from JSIExecutor constructor and installed it into the runtimeInstaller at all call sites.
Reviewed By: mhorowitz
Differential Revision: D14444120
fbshipit-source-id: 0476fda4230c467573ea04102a12101bcdf36c53
Summary: This diff removes BatchedExecutionTime from the metrics that are measured in Fabric. This does not add much value and it is not easy to compare against current version of RN
Reviewed By: shergin
Differential Revision: D14541976
fbshipit-source-id: c488e0951815306a978dd7a4246ec8a16d663218
Summary:
@public
After changing native methods to return `long` rather than `YogaValue`, we switch them to JNI fast calls, as there is no more interaction with the Java GC.
Reviewed By: pasqualeanatriello
Differential Revision: D14576815
fbshipit-source-id: b5a33caef7343ba1de3d9634a50dc82ab3148cc7
Summary:
@public
Passing primitive data via JNI is more efficient than passing objects.
Here, we avoid creating `YogaValue` (Java) instances via JNI, and rather pass a `long` back to Java. The instance is then created by extracting the necessary bytes on the Java side.
Reviewed By: foghina
Differential Revision: D14576755
fbshipit-source-id: 22d09ad50c3ac6c49b0a797a0dad639ea4829df9
Summary:
@public
Moving all native methods in a single class provides the benefit of not having to load native bindings eagerly when just creating config objects in the startup paths, or setting Java-only values on them.
Loading native bindings triggers additional class loads (`YogaConfig` / `YogaNode`), and can lead to problems in multi-dex scenarions.
Reviewed By: pasqualeanatriello
Differential Revision: D14560658
fbshipit-source-id: 14e31e3c3b560675b5a752a38ae75ab80a565ea1
Summary:
It crashes with IllegalStateException in case you pass a wrong URL.
It crashes if it meets unexpected symbols in the header name and value,
while standard says it is not recommended to use those symbols not that
they are prohibited.
The headers handing is a special use case as a client might have an auth token in the header. In this case, we want to get 401 error response
from the server to find out that token is wrong. In case of the onerror
client will continue to retry with an existing token.
[ANDROID][Fixed] - Networking: Passing invalid URL not crashes the app instead onerror callback of HttpClient is called. Invalid symbols are stripped from the headers to allow HTTP query to fail with 401 error code in case of the broken token.
Pull Request resolved: https://github.com/facebook/react-native/pull/21231
Reviewed By: axe-fb
Differential Revision: D10222129
Pulled By: hramos
fbshipit-source-id: b23340692d0fb059a90e338fa85ad4d9612275f2
Summary:
@public
Yoga's Java license headers were not in the correct format.
Reviewed By: muraziz
Differential Revision: D14541087
fbshipit-source-id: 5b3cff398875bd59dadeaddbb43020700ef027e2
Summary:
Google recommends to use Gravity.START and Gravity.END instead of Gravity.LEFT and Gravity.RIGHT to support RTL better.
[Android] [Changed] - Improve RTL support
Pull Request resolved: https://github.com/facebook/react-native/pull/24069
Differential Revision: D14541569
Pulled By: cpojer
fbshipit-source-id: 5c104d8bd666e1270d5410216c7f2efa6152692a
Summary:
Added a child class of YogaNodeJNIBase which will be used to separate layout outputs transfer logic.
This change set is for adding experiment for layout outputs batching using a float array
Reviewed By: davidaurelio
Differential Revision: D14368098
fbshipit-source-id: e0f10fb61cd09ee47cf9ce41fb400f4cfb3dd795
Summary:
@public
Contexts of nodes only hold a bit mask after we got rid of weak JNI refs.
We can simply store that data in a pointer-sized unsigned int.
Here, we replace all context heap allocations with usage of the node context (`void *`) as bitmask. We also add a couple of utility operators in order to keep the code comprehensible.
Reviewed By: fabiomassimo
Differential Revision: D14425742
fbshipit-source-id: f32c2184a1f09268c39dbb8cd09ac96517339674
Summary:
Renamed class from YogaNodeJNI to YogaNodeJNIBase.
This change set is for adding experiment for layout outputs batching using a float array where we will have two separate classes which will override how layout outputs are transferred to java YogaNode object.
We needed two separate classes because having everything in one class was causing memory issues as both the individual fields for width, height etc. and float array for batching needs to be present in code.
Reviewed By: davidaurelio
Differential Revision: D14368069
fbshipit-source-id: 0e98e28c8c7a9788345ccb92b2cd0f2cd4a53525
Summary: Refactor the fix from d4aa1e7a52 into something that follows the same convention used in 36957dcedd
Reviewed By: mdvacca
Differential Revision: D14485427
fbshipit-source-id: e6118284fcffa4b43c8392c94991764a07094403
Summary:
There is a small gap in the SynchronizedWeakHashSet implementation - the containsKey method of the WeakHashMap is modifying hence calling it during the iteration might cause ConcurrentModificationException. Added a command DO_IF_CONTAINS to safely handle this case.
[Android] [Bugfix] - Should fix a ConcurrentModificationException in onResume.
Pull Request resolved: https://github.com/facebook/react-native/pull/24015
Reviewed By: mdvacca
Differential Revision: D14507342
Pulled By: fkgozali
fbshipit-source-id: 2998bffb06e2cbacd8df1780964355842b1cc4a0
Summary:
Use AndroidX in ReactAndroid/build.gradle, and remove androidx dependency from template and RNTester app because it's already exposed/exported from ReactAndroid.
[Android] [Changed] - Land AndroidX in gradle
Pull Request resolved: https://github.com/facebook/react-native/pull/24014
Differential Revision: D14508774
Pulled By: mdvacca
fbshipit-source-id: c96b97876571a5a7f2b400dd29188cfdf1f84a4c
Summary:
Currently, the behavior of saving in the `CameraRoll` module varies depending on the platform.
On iOS, remote URIs are supported and will save a remote image to the local storage. However, on Android it can only be used for local images, making this function much less useful.
This change allows the Android version of the `CameraRoll` module to have the same behavior, at least for http and https scheme URIs, which will probably cover the vast majority of the use cases.
Reviewed By: sahrens
Differential Revision: D14483943
fbshipit-source-id: e63ca786240e6657c8c8e0292be9fb08efa40ef1
Summary:
This PR adds support to use Conscrypt as Security Provider if available runtime. Consscrypt supports TLS 1.2 on Android 4.x and TLS 1.3 on all Android versions. Fixes issues (ex https://github.com/facebook/react-native/issues/23151) with HTTPS connections on Android 4.x.
Just add below to your project build.gradle and it'll use it.
```gradle
implementation('org.conscrypt:conscrypt-android:2.0.0')
```
[Android] [Changed] - Add TLS 1.3 support to all Android versions using Conscrypt.
Pull Request resolved: https://github.com/facebook/react-native/pull/23984
Differential Revision: D14506000
Pulled By: cpojer
fbshipit-source-id: 58bf18f7203d20519fb4451bae83f01e2f020a44
Summary:
This fixes#23816, which states that `getSize()` does not function correctly on Android. The original PR for this is now outdated as there have been merges into master that would create merge conflicts.
[Android] [Fixed] - Added correct handling for `getSize()` to avoid warnings being thrown.import
Pull Request resolved: https://github.com/facebook/react-native/pull/23961
Differential Revision: D14505183
Pulled By: cpojer
fbshipit-source-id: 3d8976fd518de0903d7736a8cbd8371987eb1b2d
Summary:
This will create a cross-platform and safe way to programmatically open the app's settings into the iOS /Android Settings app.
Right now it's possible to open the app's settings, but _**only for iOS**_ via `Linking.openURL("app-settings:")`
To do the same for Android, you need to either create NodeModule or install a dependency such as [react-native-open-settings](https://github.com/lunarmayor/react-native-open-settings).
Why this new method is useful: since Android 6, app permissions work similar to iOS. It's granular and it's requested in the app runtime.
https://developer.android.com/guide/topics/permissions/overview#runtime_requests_android_60_and_higher
> If the device is running Android 6.0 (API level 23) or higher, and the app's targetSdkVersion is 23 or higher, the user isn't notified of any app permissions at install time. Your app must ask the user to grant the dangerous permissions at runtime. When your app requests permission, the user sees a system dialog telling the user which permission group your app is trying to access. The dialog includes a Deny and Allow button.
Thus, if the user checks the **"Never ask again box"** and taps **"Deny"**, for some specific permission, the only way to change the permission is going to the Android Setting app.
And that's where this new method becomes useful. It'll allow our apps to programmatically send the the user to settings app.
Also, `openSettings()` doesn't receive a parameter to redirect to specific subsections of the Settings app because there's no public API to do it on iOS ([there's a way to have, via private API, but it causes the app to get rejected.](https://github.com/mauron85/cordova-plugin-background-geolocation/issues/394))
Create `Linking.openSettings()` for iOS and Android;
[General] [add ] - Add openSetting method to Linking module
Pull Request resolved: https://github.com/facebook/react-native/pull/23965
Differential Revision: D14502910
Pulled By: cpojer
fbshipit-source-id: d27d62282b9df499845c78d983d3b6936c36ea39
Summary:
This diff migrates RN to AndroidX.
As part of this diff I disabled few tests in RNAndroid OSS that will be re-enabled this week. As part of the refactor of BUCK files in OSS
Reviewed By: shergin
Differential Revision: D14200097
fbshipit-source-id: 932fcae251d1553e672acd67ecd0e703dcb364aa
Summary:
fixes#23962, where trackColor is reset when value changed. This PR will set trackColor corresponding trackColor every-time value changes.
[Android] [Changed] - Fix Switch trackColor
Pull Request resolved: https://github.com/facebook/react-native/pull/23977
Differential Revision: D14495206
Pulled By: hramos
fbshipit-source-id: d712f540cd3f8359d6e85f79c12732689870a112
Summary:
Upgrade mobile `BUCK` and `.bzl` files to use C++14.
Let's see what happens.
Reviewed By: mzlee
Differential Revision: D14223329
fbshipit-source-id: ff642ca017103d9415c4d7f5beaf5ded07ef7ff1
Summary: JS Deltas have been killing productivity of RN engineers lately. There's been several posts and questions asked that end in "Turn off JS Deltas". Disabling them until we can make them more stable.
Reviewed By: fkgozali
Differential Revision: D14491774
fbshipit-source-id: 29b1c8e5e72369882c2890e3b6347ecd2fe4bed1