Summary: Unused loads hurt readability and take time to process.
Reviewed By: hramos
Differential Revision: D9494120
fbshipit-source-id: 455b56efadab1cb976344cffcb427772bfda2f71
Summary:
release method of local_ref and global_ref doesn't call deallocator, in fact, it leaves the caller responsible for deletion of the reference, while otherwise the reference is released on scope left.
Fixes#18292.
Pull Request resolved: https://github.com/facebook/react-native/pull/20913
Differential Revision: D9616237
Pulled By: hramos
fbshipit-source-id: 021aa3e4f039e6b7a98da3e4224c1ee49d5a4921
Summary: Add native android nav bar. Title and button info are from FBDynamicNavigationOption. Set through setBarOption.
Reviewed By: achen1
Differential Revision: D9367058
fbshipit-source-id: 0f3f790d2c4d3af97568927993964678bc028bc3
Summary: A cell syntax load crept into RN. Remove it so it works with oss
Reviewed By: scottrice
Differential Revision: D9596187
fbshipit-source-id: 1f3138b760f63ae4b1fa23a034e6b9a86396ff50
Summary: Added `snapToStart` and `snapToEnd` props to ScrollView which work together with `snapToOffsets` and determine whether the beginning and end of the list automatically count as snap offsets or not. If not, the list is allowed to free-scroll between its start/end and the first/last snap offset.
Reviewed By: sahrens
Differential Revision: D9442386
fbshipit-source-id: 47a5fdb20f884542434b01b1f0a486ed2b478c6e
Summary:
* Added snapToOffsets prop to ScrollView. Allows snapping at arbitrary points.
* Fixed pagingEnabled not being overridden by snapToInterval on iOS.
* Fixed Android *requiring* pagingEnabled to be defined alongside snapToInterval.
* Added support for decelerationRate on Android.
* Fixed snapping implementation. It was not calculating end position correctly at all (velocity is not a linear offset).
* Resolves https://github.com/facebook/react-native/issues/20155
* Added support for new content being added during scroll (mirrors existing functionality in vertical ScrollView).
* Added support for snapToInterval.
* Resolves https://github.com/facebook/react-native/issues/19552
Reviewed By: yungsters
Differential Revision: D9405703
fbshipit-source-id: b3c367b8079e6810794b0165dfdbcff4abff2eda
Summary: This diff reverts the changes in the name for AndroidHorizontalScrollView and AndroidHorizontalScrollContentView that caused a redbox for continuous OTA users
Reviewed By: fkgozali
Differential Revision: D9561972
fbshipit-source-id: 3d8e9ee8bb6081107bc8d315af16885bb003148e
Summary: And migrated ReactRootViewTestCase to use ReactNativeTestRule.
Reviewed By: mdvacca
Differential Revision: D9557362
fbshipit-source-id: 1469d0ad8c125b5ea729371d81956e61780c56cf
Summary: It's unclear if this was a recent regression or not (too lazy to find out), but instrumentation tests are failing because FrescoModule is never initialized (see task for trace). Based on the initial introduction of this class (D2448321) it appears that FrescoModule was always intended to be initialized on startup. Let's eagerly init Fresco in that case.
Reviewed By: fkgozali
Differential Revision: D9556864
fbshipit-source-id: 0b670dec46f5087b3794330931ddf5d7782c8367
Summary: This diff updates the size of RootShadowNode and re-render RN views when the Size of the Android React View changes
Reviewed By: achen1
Differential Revision: D9173758
fbshipit-source-id: 7cc6bbfb646025c3ec1773ab041eb9207623af71
Summary: This diff implements the HorizontalScrollView component for Android Fabric C++, as part of this diff I also re-named the components AndroidHorizontalScrollContentView for RCTAndroidHorizontalScrollContentView and AndroidHorizontalScrollView for RCTAndroidHorizontalScrollView. This might sound against our plan of removing the RCT preffix, but it is to make it simpler to map components between current implementation of RN and Fabric (otherwise we don't know when to add the RCT preffix in Android side to find the right View Manager), later we can just remove the preffix from C++, Android, iOS and JS.
Reviewed By: shergin, achen1
Differential Revision: D9122729
fbshipit-source-id: e9299552857c6dd0c18abfa5fa49a3d50e221729
Summary:
The full idea for eagerly creating Native Modules is articulated here https://fb.quip.com/vWcLAup3a6kR
TLDR:
1) Move lazy native module work from the mqt_js thread to the background thread which processes packages. This also moves it from post-network to pre-network.
2) For a quick test, decide which modules to eagerly create with a QE flag.
3) Eagerly create the modules by opting-out of the ReactModuleInfo pipeline which was built for lazy native modules.
Reviewed By: achen1
Differential Revision: D9503934
fbshipit-source-id: 0cd8337ad294cd0f8be692fecbf4292d204f3ec4
Summary:
Accessibility roles are enums that are looked up by matching a string accessibility role from JS to the enum's name using .toUpperCase(). .toUpperCase() causes issues in certain languages such as Turkish because the "i"s translate to "?".
D9402330 tried to address this by forcing the .toUpperCase to use Locale.US, but now it sometimes translates to "?"
Use .equalsIgnoreCase() instead to avoid translations.
Reviewed By: mdvacca, mmmulani
Differential Revision: D9497494
fbshipit-source-id: 0f8b7f2071b08ccb86655fee7bfd2d009ddde8eb
Summary:
Bump android gradle plugin to 3.1.4. We have been stay to 2.x too long. With 3.x we can have instant run and great performance and new features brought by google.
Also thanks to CFKevinRef great pr to make this possible.
pass all current ci. I have also tested RNTester release version works without crash.
https://github.com/facebook/react-native/pull/17967.
[GENERAL] [ANDROID] [FEATURE] - bump android gradle to 3.1.4
Pull Request resolved: https://github.com/facebook/react-native/pull/20767
Differential Revision: D9437576
Pulled By: hramos
fbshipit-source-id: 6084056a1390582a75a879918f2538b0480f6299
Summary:
I found that android support library 27.x (874cca1ac2) requires compileSdkVersion to be 27. Also found that many FB projects use SDK 27.
Pull Request resolved: https://github.com/facebook/react-native/pull/20777
Differential Revision: D9478431
Pulled By: hramos
fbshipit-source-id: ca100f6b5b39e7d112926124423f9510a0efc291
Summary:
This PR removes TextLayoutBuilder, which is not used anywhere.
Pull Request resolved: https://github.com/facebook/react-native/pull/20600
Reviewed By: achen1
Differential Revision: D9367345
Pulled By: hramos
fbshipit-source-id: 407a6a80f5c69650fcc7167b28214f7315beed2f
Summary:
This PR removes infer-annotation from the repo and uses latest version of it from maven.
Pull Request resolved: https://github.com/facebook/react-native/pull/20599
Differential Revision: D9437594
Pulled By: hramos
fbshipit-source-id: 93c33041dd8a61b220c352fb187a23bb2dd1b4db
Summary:
There are multiple UI thread passes during the layout process. The first is with all of the operations from React (createView, manageChildren, etc). The second is during onCollectExtraUpdates after the layout pass, when things like Text need to be precomputed before later being sent over to the views.
The onLayoutUpdateListener needs to run AFTER onCollectExtraUpdates operations are executed, so this is now queued up in the UIViewOperationQueue
Reviewed By: mdvacca
Differential Revision: D9416260
fbshipit-source-id: d1a4eaf38a4f6c82d41def34ffb94d303e8f50d4
Summary: We were using a locale-specific `toUpperCase()` for accessibility roles. In the Turkish locale, `"image".toUpperCase()` does not become `"IMAGE"`; it becomes some weird turkish alphabet word, and we throw an error. This diff uses US-locale to avoid the error.
Reviewed By: YaoPersonal
Differential Revision: D9402330
fbshipit-source-id: a3fd7c54eec4b313c7e9df9236adb7ae42854ed8
Summary:
When running Systrace, we currently only surface the JavaScript bundle that is pre-packaged in the binary.
This changes `ReactInstanceManager` so that we prefer a cached bundle if one exists. This allows running Systrace with local changes (as long as you load them into the client before running Systrace).
Differential Revision: D9389704
fbshipit-source-id: 031321b2e07539efc7f47a7c6947ab7b82dc7dfc
Summary: This diff initializes Fabric C++ UIManager code from java, it also registers android RootViews inside C++.
Reviewed By: shergin
Differential Revision: D8878148
fbshipit-source-id: 8b7924f715b135eda37bb2683206d3e321a2b7b2
Summary: This diff creates the C++ base classes for Fabric and it integrates them into the starting process of Fabric inside Catalyst App
Reviewed By: shergin
Differential Revision: D8878123
fbshipit-source-id: ce41ad6addfdfb58e602b2dbafebd8f05847e69f
Summary:
These changes will fix executing javascript with any special characters, by making use of the `evaluateJavascript` function on Android 4.4+, and by properly escaping the URI on Android <4.4.
Fixes#19611 • Fixes#20365 • Fixes#9749 • Closes#19655 • Closes#12321
This PR supersedes #19655 by patching the same problem in all the places, and fixing it for Android <4.4 as well.
Pull Request resolved: https://github.com/facebook/react-native/pull/20366
Differential Revision: D9242968
Pulled By: hramos
fbshipit-source-id: f2e1abc786ba333dbd8aaa8922e716fd99ec26e0
Summary:
ag -L --ignore __snapshots__ 'flow strict|noflow|generated|The controller you requested could not be found.' | ag '\.js$' | xargs ag -l 'flow' | sort > ~/temp
cat ~/temp | xargs ag -L 'flow strict' | xargs sed -i '' 's/flow$/flow strict-local/'
until flow check; do flow check --json | jq -r '.errors[].message[0].path' | sort | uniq | xargs hg revert; done
allow_many_files
The controller you requested could not be found.
The controller you requested could not be found.
Reviewed By: TheSavior
Differential Revision: D9004573
fbshipit-source-id: 936bd5741706b781be06bf08b6ad805a69407dfd
Summary:
Currently, we scan all native modules to see if they implement the OnBatchCompleteListerner. If they do, we add those modules to a list, and when C++ calls OnBactchComplete is called, we execute the callback on each of the modules.
The only native module implementing this callback today is the UIManagerModule. With Fabric, UIManager will also not be a native module anymore. This diff removes all the work done for creating the list and assumes that UIManagerModule is the only place that is interested in OnBatchComplete call - and calls it directly.
Reviewed By: achen1
Differential Revision: D9186651
fbshipit-source-id: 473586b37c2465ccd041985dcdd56132026f34f1
Summary:
This is a small missing piece from b6f2aad9c0 and will complete fresco version bump.
Pull Request resolved: https://github.com/facebook/react-native/pull/20580
Differential Revision: D9228658
Pulled By: hramos
fbshipit-source-id: 9cf1509a590cedfe4c3358006cfb62533058e946
Summary:
Implemented a version of accessibility Hints on android by adding hint text to the end of contentDescription. There is already an existing prop on js and iOS implementation.
Changes involve:
* adding a prop on native android code for accessibilityHints
* setting the accessibilityDelegate after the props are all loaded.
* Instead of directly updating the accessibility delegate, the prop setters now update state by setting the values of the variables. Once all props are set, the accessibility delegate is set based on the props
* BaseViewManager keeps track of whether or not accessibility props have been set
* AccessibilityDelegateUtil keeps track of what the props have been set to. (Renamed AccessibilityRoleUtil to AccessibilityDelegateUtil)
Currently, this is the easiest way of emulating the way accessibility hints work on iOS, and I think having an android counter part is better than having nothing.
It's different from iOS in that it will announce the hint before the role, and also cannot be turned off.
Ex:
if I set the accessibility like this:
```
<View
style={styles.container}
accessible={true}
accessibilityLabel="accessibility label"
accessibilityRole="button"
accessibilityStates={['selected']}
accessibilityHint="accessibility Hint">
<Text> Tester </Text>
</View>
```
Talk back will read:
`accessibility label, accessibility Hint, button, selected`
In the future for next steps, I plan on investigating the process of making a second announcement after the first
Reviewed By: achen1
Differential Revision: D9037226
fbshipit-source-id: 8d484e1114eb69aa5f5314b3755b351b8ea80b09
Summary:
@public
This reverts the Yoga/Java storage experiment. I will follow up with any learnings.
Reviewed By: pasqualeanatriello
Differential Revision: D9168405
fbshipit-source-id: fb227fb9353bd4c4e3bebbe9b04eec1132e532e8
Summary:
@public
Adds another version of property storage for `YogaNode`, using `sun.misc.Unsafe`.
Adopts the stub concept from Litho for `Unsafe`, as it is hidden by the Android SDK.
Reviewed By: pasqualeanatriello
Differential Revision: D9140103
fbshipit-source-id: a4b376eca341b724a00f873467ae8bf8eaac69f4
Summary: The method removes all settings for mLazyReactModules since Lazy and non lazy modules can exist in a single application now
Reviewed By: achen1
Differential Revision: D9012312
fbshipit-source-id: 0420149654f8146453250d83d4de4b4c2fd31e9f
Summary:
In OSS, during gradle build, the ReactModuleSpecProcess annotation-processor does not run. As a result, the `ReactModuleInfo` that we need for CoreReactPackage is not generated, resulting in a runtime error.
The fix is to make LazyReactPackage revert to what it was doing earlier. In `NativeModuleRegistryBuilder`, if we dont find `ReactModuleInfo` for any `ModuleSpec`, we eagerly instantiate the module and get all the `ReactModuleInfo` from it. By returning an emoy collection if the class is not available, we force the modules in `CoreReactPackage` to use this codepath instead.
The alternate fix would be to ensure that the annotation processor runs in gradle/OSS. However, the annotation processor will be removed eventually in the future, and we will also be move to generating them for JS, so that work will soon be irrelevant.
Reviewed By: fkgozali, achen1
Differential Revision: D9130517
fbshipit-source-id: 469cf0e32a2f3650f098547667b3cd09a63eb1a0
Summary:
/cc janicduplessis mdvacca
This addresses the same issue as #18830 which was reverted since it didn’t handle `removeClippedSubviews` properly.
When subview clipping is on, ReactViewGroup keeps track of its own children directly and accounts for the offset introduced by clipped views when calling ViewGroup methods that modify children.
Instead of accounting for just clipped children (views with no parent), it should account for any children that aren’t in the ViewGroup which also includes children that are being transitioned. If you look at the ViewGroup source code, [it explicitly retains the view parent until the transition finishes](https://github.com/aosp-mirror/platform_frameworks_base/blob/oreo-release/core/java/android/view/ViewGroup.java#L5034-L5036) which caused the `getParent()` checks to pass, even though those views should be ignored. I added a new `isChildInViewGroup` method that handles both clipped and transitioning views to fix this.
I reproduced the [earlier crash](https://github.com/facebook/react-native/pull/18830#issuecomment-382798628) by enabling clipping in [this test app](https://github.com/facebook/react-native/pull/18830#pullrequestreview-111758886) and adding a “clear views” button that resets the state to an empty items array with an animation.
- #18830
[ANDROID] [BUGFIX] [LayoutAnimation] - Removal LayoutAnimations no longer remove adjacent views as well in certain cases.
Pull Request resolved: https://github.com/facebook/react-native/pull/19775
Differential Revision: D9105838
Pulled By: hramos
fbshipit-source-id: 5ccb0957d1f46c36add960c0e4ef2a545cb03cbe
Summary:
- adds more property assignments
- reduces the number of layout roots that exist simultanously
Reviewed By: pasqualeanatriello
Differential Revision: D8989389
fbshipit-source-id: 6a0ac800a4caad61a2f4bf98caa314855b70875f
Summary: If source is null , source uri is null or source is not an array should respect style like in iOS
Reviewed By: yungsters
Differential Revision: D9018005
fbshipit-source-id: 5f695e8e3007c96e6004973e7fcbc6b57cc15249