Summary: Moves the `ReactNativeART` workaround to callers. There are legitimate use cases where you don't want to re-mount this component repeatedly.
Reviewed By: fkgozali
Differential Revision: D8928633
fbshipit-source-id: 0aafc1136ce9acb290e26a4f1a958819439bf2f0
Summary:
Set clipChildren to false by default in ReactRootView.java so that Overflow: visible/hidden will work for the root view.
Moved sDefaultOverflowHidden from ReactViewGroup.java to ViewProps.java so that it can be used in both ReactViewGroup.java and ReactRootView.java.
Reviewed By: mdvacca
Differential Revision: D8727140
fbshipit-source-id: b593bed63e479cdbd22e4a025b936e6aeb28fc8c
Summary: Fix ReactHorizontalScrollView so that its children won't overflow. (Task: https://our.intern.facebook.com/intern/tasks/?t=31128239)
Reviewed By: achen1
Differential Revision: D8923947
fbshipit-source-id: 56c36b25c29a87a306d92544273603d0d086edc0
Summary:
Problem: The first ReactTextInputShadowNode layout calculation didn't consider the placeholder. When the layout with placeholder was actually being measured, its height was constraint by the previously calculated height, causing long placeholder content to be clipped.
Fix: Access the placeholder property in ReactTextInputShadowNode, set the dummyEditText's hint with placeholder before ReactTextInputShadowNode's first measurement.
Reviewed By: mdvacca
Differential Revision: D8903108
fbshipit-source-id: 8f3e518d0395ac875807f9ea989a0b5bbe4b2a26
Summary: Fix the calculation of offsetX in onLayout (ReactHorizontalScrollContainerView.java) that re-positions the updated layout. A private instance variable (oldWidth) is added in order to track the width difference between consecutive updates. (Issue report: https://github.com/facebook/react-native/issues/19979)
Reviewed By: mdvacca
Differential Revision: D8772780
fbshipit-source-id: 969dcead550f4a3d24d06416b63d960492b7a124
Summary:
Context:
After discussing with yungsters, `currentViewStates` is a very ambiguous name for a prop, especially because there are only two possible values. From a developer's perspective, it makes more sense to just call them `accessibilityStates` because the main use for them is to add states to Talkback and Voiceover.
Also, the actual implementation of what we're changing under the hood in Native Code is abstracted away from developers using React Native, so as long as behavior is as they would expect, it makes more sense to change the name into a clear one.
Changes in this Diff:
Renamed the view property exposed to native iOS code from `currentViewStates` to `accessibilityStates`
Also deleted setting the userInteractionEnabled view property, because we want to keep it as just an accessibility property.
Reviewed By: PeteTheHeat
Differential Revision: D8896821
fbshipit-source-id: 95674c9b7295f5b9e60994c297acdee83f6226d7
Summary:
Context:
After discussing with @[1038750002:yungsters], `currentViewStates` is a very ambiguous name for a prop, especially because there are only two possible values. From a developer's perspective, it makes more sense to just call them `accessibilityStates` because the main use for them is to add states to Talkback and Voiceover.
Defense for changing name in Android: The actual implementation of what we're changing under the hood in Native Code is abstracted away from developers using React Native, so as long as behavior is as they would expect, it makes more sense to change the name into a clear one regardless of how it is implemented.
Changes:
changed the Prop name from `currentViewStates` to `accessibilityStates` in the BaseViewManager file where the view property is being exposed.
Reviewed By: PeteTheHeat
Differential Revision: D8896389
fbshipit-source-id: 35dcd9239fae016b790e528947994681684bd654
Summary:
Context:
After discussing with @[1038750002:yungsters], `currentViewStates` is a very ambiguous name for a prop, especially because there are only two possible values. From a developer's perspective, it makes more sense to just call them `accessibilityStates` because the main use for them is to add states to Talkback and Voiceover.
Also, the actual implementation of what we're changing under the hood in Native Code is abstracted away from developers using React Native, so as long as behavior is as they would expect, it makes more sense to change the name into a clear one.
Changes in this Diff:
Changed the prop name `currentViewStates` to `accessibilityStates` in js files
Reviewed By: PeteTheHeat
Differential Revision: D8896223
fbshipit-source-id: dfdb48dce69303a347dfccd194af2fef9beb776c
Summary:
@public
Replacing the `YG_NODE_STYLE_PROPERTY_IMPL` macro with template code, in order to make code easier to edit and grep.
Reviewed By: astreet
Differential Revision: D8868184
fbshipit-source-id: f52537376fa8d4dd53aa98bb43e93279699dbdd5
Summary:
@public
Inlines macros used for declarations of `YGNodeStyle*` and `YGNodeLayout*` functions.
Benefits easier grepping and code base navigation.
Reviewed By: astreet
Differential Revision: D8868168
fbshipit-source-id: d6b1b70981a59a2214dc7d166435a1d1a844e1b7
Summary: This form of THIS_DIR resolves symlinks, which is better.
Reviewed By: davidaurelio
Differential Revision: D8661886
fbshipit-source-id: 90bf329e765d9623d103b03c5dd3b71fae9d9854
Summary:
@public
Bump Babel to version 7 beta 54
This version has reversed the windows path denormalization so we need it to be able to fix windows paths.
Reviewed By: rafeca
Differential Revision: D8894700
fbshipit-source-id: 3ae1480b77380cae8070621d4729b21a34c4b928
Summary:
Currently, `AccessibilityInfo.setAccessibilityFocus` is only available on iOS. The same behaviour can be achieved on Android by dispatching the proper accessibility event. I implemented the same function for Android, to make life slightly more convenient for the developer.
Today, developers must write something like this:
```
if (Platform.OS === 'ios') {
AccessibilityInfo.setAccessibilityFocus(reactTag)
} else {
UIManager.sendAccessibilityEvent(reactTag, 8)
}
```
With this change, the following is enough for both Android and iOS:
```
AccessibilityInfo.setAccessibilityFocus(reactTag)
```
Pull Request resolved: https://github.com/facebook/react-native/pull/20229
Differential Revision: D8874107
Pulled By: mdvacca
fbshipit-source-id: a6ffd7bb89ce56d6d65b06419633a71dcf3d0733
Summary: Trying to see what it takes to get server snapshot tests working on android. This will be landed after fixing few things.
Reviewed By: achen1
Differential Revision: D8237948
fbshipit-source-id: 926555ba752171dac4e5814f5c8e5c2c173a82c7
Summary: No need to type out the old version. This is exactly equivalent (unless I've misread and the old version did something other than memberwise copy).
Reviewed By: davidaurelio
Differential Revision: D8842326
fbshipit-source-id: c575ea4cee6caef9ea15aaf5967597385ed26ec3
Summary: It doesn't seem to be used internally, it hurts greppability, and there are setters for these properties as needed anyway.
Reviewed By: davidaurelio
Differential Revision: D8842084
fbshipit-source-id: f0275b490e585ea94df341c97c34b441ed91c4fb
Summary:
This fixes some regressions with local-cli introduced in c4a66a89a2.
- We didn't pass `assetRegistryPath` which caused the following error when loading the bundle:
```
error: bundling failed: Error: Unable to resolve module `missing-asset-registry-path` from `/Users/janic/Developer/react-native/RNTester/js/uie_thumb_normal@2x.png`: Module `missing-asset-registry-path` does not exist in the Haste module map
```
- The middlewares were not added to the metro server. This causes some packager server features to fail. The one I noticed is that the /status endpoint didn't exist anymore which causes CI to fail and also Android to not load the bundle from the packager initially. The remote debugging feature was also broken.
Pull Request resolved: https://github.com/facebook/react-native/pull/20162
Differential Revision: D8867610
Pulled By: hramos
fbshipit-source-id: 8a08b7f3175692ab6ee73c0a7c25075091ae4792
Summary:
@public
Previously, ContextContainer could store only `shared_ptr`s, but now it wraps all values in own `shared_ptr` container.
I wish we can use `unique_ptr` here, but apparently we cannot because `unique_ptr` does not support type-erasure (`std::unique_ptr<void>` is illigal).
Becasue ContextContainer is not supposed to be used in hot paths, the performance aspect of that does not actually matter.
Reviewed By: mdvacca
Differential Revision: D8853446
fbshipit-source-id: e5d0a5595fe44c59f1395d6ffccf9d3fed923c83
Summary:
@public
We need that because gonna add much more event-related stuff, so it deserves separate buck target.
Reviewed By: mdvacca
Differential Revision: D8831547
fbshipit-source-id: 616581b39b425a49302d5f7f86267e62b0d58389
Summary:
@public
We don't need to maintain an order of this collection, so using `unordered_map` is more appropriate.
Reviewed By: mdvacca
Differential Revision: D8826946
fbshipit-source-id: f6890097cc5d6a1e06f6b2cfd1b7d68a388da461
Summary:
@public
We need this in case when we want to store several intances of the same class in the container.
Reviewed By: mdvacca
Differential Revision: D8814808
fbshipit-source-id: 78ab15d78cf3878d03bf0a45bc42b968d87435e7
Summary:
@public
In most cases callsite knows probable index of replacing child node, hence it makes sense to provide this info to `replaceChild` to illuminate O(n) search in most cases.
Reviewed By: mdvacca
Differential Revision: D8814809
fbshipit-source-id: 0edf82878a72260365e2757beb3886ad07c7464d
Summary:
@public
This diff consists of many interdependent changes which support one simple idea: YogaLayoutableShadowNode is now using YGNode children to iterate on them (it previously relied on `ShadowNode::getChildren()`). All other changes are just an unavoidable consequence of that. Hence we don't need to filter child nodes every single time when we do layout anymore! The logic around `clone callback` is also drastically simpler now.
The new approach also implies that `LayoutableShadowNode` and `YogaLayoutableShadowNode` don't use `shared_ptr`s to refer to ShadowNode objects because new relationship does not imply ownership. No more `SharedShadowNode` objects in those two classes.
Reviewed By: mdvacca
Differential Revision: D8796159
fbshipit-source-id: 6f52f92d1826f3eb13b2f8a132c3ea77de155d82
Summary: There are several cases for creating an animated implementation of FlatList or SectionList (e.g. passing Animated.Event for onScroll with useNativeDriver enabled, see FlatListExample or SectionListExample), so we might as well add them to the exports.
Reviewed By: sahrens
Differential Revision: D8886446
fbshipit-source-id: 4b207500ea4d8d10de8c1b2639a5f492bc62e560
Summary:
@public
On Android, a color can be represented as 32 bits integer, so there is no need to instantiate complex color objects and then pass them as shared pointers. Hense instead of using shared_ptr, we use a simple wrapper class which provides a pointer-like interface.
Reviewed By: mdvacca
Differential Revision: D8742014
fbshipit-source-id: 14109b61fd84a34989538a15bc6fe4e2a8ce83a6
Summary:
Refines `StyleSheet.compose` so that subtypes of `DangerouslyImpreciseStyleProp` can flow through the function call without losing their type.
This makes it so that if you supply two `ViewStyleProp` types, you will get a `ViewStyleProp` type out of it.
Reviewed By: TheSavior
Differential Revision: D8851699
fbshipit-source-id: e38e572e363a71fddf63d6b6bf5a96b3cdae5915
Summary:
@public
This approach is basically copying exising implementation that we have in RCTTextView (D5806097).
Changes in `AttributedString` is quite trivial.
Reviewed By: mdvacca
Differential Revision: D8740000
fbshipit-source-id: 276afdf93d777f7ccb99ca8ee5a18a880de2acbf
Summary:
Added Native iOS functionality for prop currentViewStates.
On iOS, this property modifies both the view property userInteractionEnabled and also adds corresponding UIAccessibilityTraits to the view.
If disabled is passed in, userInteractionEnabled of the view will be set to false.
The value that is passed into currentviewStates is converted to a UIAccessibilityTrait Enum and masked in with existing UIAccessibilityTraits on that native view.
The native implementation for accessibilityRole is also changed to also mask new UIAccessibilityTraits with existing ones.
Reviewed By: PeteTheHeat
Differential Revision: D8842691
fbshipit-source-id: 919267300c70efed93a7a92377a0178bd8885eb5
Summary:
Added native android support for the prop accessibilityStates.
If 'selected' is passed in, it calls view.setSelected(true)
If 'disabled' is passed in, it calls view.setEnabled(false)
If both are passed in, both are set on the view.
Reviewed By: blavalla
Differential Revision: D8838407
fbshipit-source-id: a942dabcdc5d9e35f0316465e97317739a8b4b25
Summary:
This is a very similar fix than D8858846, but done in the RN CLI (soon we'll be able to just call `Metro.runBuild()` from RN which will remove this duplication).
This actually fixes the issues in the integtration tests (t31612131). It's just funny that two unrelated problems that are caused by the same issue located in two different places have been reported at the same time.
Differential Revision: D8859276
fbshipit-source-id: 805e111a406f2a7c1b3df3ab02accf4c4041a464
Summary:
This includes 8b8f5bc40e, which improves the watchman query to calculate the initial haste map to be much faster under Eden.
**Time to initialize Metro after resetting jest-haste-map cache (Eden checkout)**
* Before this diff: 3m14 (sometimes taking up to 15min!! after rebasing)
* With this diff: 12s (quite constant after rebasing)
(16X improvement)
**Time to initialize Metro with a warm jest-haste-map cache (Eden checkout)**
* Before this diff: 1.1s
* With this diff: 1.1s
(I haven't seen meaningful perf changes in non-eden checkouts)
Reviewed By: mjesun
Differential Revision: D8857820
fbshipit-source-id: 5ce9da04a69bd02d121a8efe65bf369c7fa1e834
Summary: This diff initializes Fabric C++ UIManager code from java, it also registers android RootViews inside C++.
Reviewed By: shergin
Differential Revision: D8794819
fbshipit-source-id: b4d1d0958a3f8e01d4a51be957d9a2e2f442489e
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: D8786185
fbshipit-source-id: d04208f0781387424fc0ddf7a6e5d46a6bd61f66
Summary:
The keep-alive-duration for the connection pool for mOnChangePollingClient
is a number in milliseconds, but was mistakenly given in minutes. This mistake
was introduced in 6bbaff2944.
I discovered this by chance while lurking around in the codebase.
Pull Request resolved: https://github.com/facebook/react-native/pull/19817
Differential Revision: D8873138
Pulled By: hramos
fbshipit-source-id: c81c1952721449442f18a0c2373f8b2780403749
Summary:
Because we're now separating accessibilityTraits into accessibilityRole and accessibilityState, we're going to only allow one role to be set, and allow on preset combinations of roles that make sense.
This adds android functionality for an added role that is image button.
Reviewed By: blavalla
Differential Revision: D8846987
fbshipit-source-id: 9fe36828f63b05bd2c9cf9680204b1995d678342