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
Summary:
Added in a prop for CurrentViewState that is used to set the state of the current view for both accessibility and regular view settings..
Ex:
AccessibilityRole = "button"
CurrentViewState = ['selected']
This will trigger talk back/voiceover to announce both the role and the state.
Unlike Accessibility Role, Accessibility States can take on more than one form, and are passed in an array.
Ex: AccessibilityState = ['selected', 'disabled']
Currently, two options are available: selected and disabled
Reviewed By: PeteTheHeat
Differential Revision: D8837848
fbshipit-source-id: ca30c950a2aa713813be8577ea4fa9ba9bfc698a
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 change adds iOS functionality to the role image button because a popular accessibilityTrait combination is image and button.
Reviewed By: ikenwoo
Differential Revision: D8847012
fbshipit-source-id: da386dbf82cb3854d14c228a1116da9f4067fe93
Summary:
Because we're now separating accessibilityTraits into accessibilityRole and accessibilityState, we're going to only allow one role to be set, and allow one preset combinations of roles that make sense.
This diff adds image button as a role.
Reviewed By: PeteTheHeat
Differential Revision: D8846958
fbshipit-source-id: dad3783654b20abeb29767cdad7450d1896058c2
Summary:
ImageEditor.cropImage creates a temporary file when downloading images https://fburl.com/07r68w9s
This temporary file can be stored on external storage on android. External storage is accessible to any other application on the device, which could possibly leak images.
Using external storage may be unavoidable. I've voiced my opinion and solicited others on T31548988. Once a good policy is agreed upon, we can implement it.
For now, I'm adding this comment to make it explicit how images are cached.
Reviewed By: achen1
Differential Revision: D8837808
fbshipit-source-id: 02341bc94a1c95340390a713b76fe85603fd8f1b
Summary:
@public
There is no reason to have it inside View; it deserves that.
Reviewed By: mdvacca
Differential Revision: D8757012
fbshipit-source-id: 881b54008b51614cd203ab97811494fa7c30e4ef
Summary:
@public
Quite trivial. We had to have this from the day one.
We don't need cache invalidation policy because all subtree is immutable.
Reviewed By: mdvacca
Differential Revision: D8709973
fbshipit-source-id: bd7fcf0ae1dcb23894321cb5d16da18cb1ab788f
Summary:
@public
Everything is better with C++ templates.
In this cases templates allow us to remove additional parameters and casts on the callsite.
Reviewed By: mdvacca
Differential Revision: D8754523
fbshipit-source-id: 2340b2cd96ab0a60d54d9aa30dea3c072b951a8a
Summary:
@public
* In case of `ShadowTree` we just pass original old node as a `commit` method argument;
* In case of `ConcreteViewShadowNode` we just don't need that because diffing algorithm does not use that information anymore.
Reviewed By: mdvacca
Differential Revision: D8753906
fbshipit-source-id: b8555083c7e72e9b3c0f9a8065745946d4cf44c7
Summary:
@public
Non-null owner pointer in Yoga node indicates that this node is already being used by some other subtree, so it must be cloned in case of possible (re)layout.
Theoretically, this node must/can be cloned by Yoga right before applying a new layout to this node, but Yoga has a special optimization that uses that fact that Yoga always cloning *all* children of a particular node altogether. This is not true for React; to meet React and Yoga worlds we double check the owner pointer in `addChild` and clone node preliminary if needed.
See also the previous diff for more context.
Reviewed By: mdvacca
Differential Revision: D8709952
fbshipit-source-id: 84ef0faa0f1d9cc9a8136b550cf325bc20508d53