Summary:
@public
For now we only support trivial uniformed (all sides are equal) border rendering (which can be direclty mapped to CALayer features).
Support of the more complex and fancy borders is comming soon.
Reviewed By: mdvacca
Differential Revision: D8528923
fbshipit-source-id: 0883cdc2b855fc63d399e1a93010f259f0628f48
Summary:
@public
Another small but important piece of Accessibility Support.
Reviewed By: mdvacca
Differential Revision: D8528921
fbshipit-source-id: d4ba87bab702d76a90e9ddb751999193243cdc74
Summary:
@public
Trivial. It's also nice this we have a default encoding now.
Reviewed By: fkgozali
Differential Revision: D8528919
fbshipit-source-id: 0853eca828f22ead1a337fea3d7a2fc9a48e84c8
Summary: This diff checks if ReactShadowNode is sealed before updaing it.
Reviewed By: fkgozali
Differential Revision: D8584768
fbshipit-source-id: 64163d4bf124263d92153f68914c617f007fd90d
Summary: This diff introduces the concept of "Seal" ReactShadowNodes. This new field will be used to guarantee immutability of commited ReactShodow Nodes.
Reviewed By: fkgozali
Differential Revision: D8552709
fbshipit-source-id: dfd95730f10341af0dd762f8a8aa186563cf33e9
Summary: This diff cleans up the parent / owner references for children of ReactShadowNode / YogaNode during cloning. The reason of this behavior is to avoid retaining every generation of trees during cloning. This fixes a memory leak detected when running the ProgressBarExample.android.js in catalyst app
Reviewed By: fkgozali
Differential Revision: D8019894
fbshipit-source-id: b0d38f0c836ffec534f64fa1adbd7511ecf3473d
Summary:
This diff tries to fix an issue that started appearing in RN master when the latest metro version is used (more info here: c5ce762697 (commitcomment-29443117)).
The problem is that RN is still reading `projectRoots` from the Metro config and trying to call `concat()` on them. Latest Metro sets the default `projectRoots` to null, so this fails.
Also, a couple other things have been done:
* Make sure that the `projectRoot` and `watchFolder` objects from args are passed to Metro (so they contain the overrides from the CLI arguments).
* Add a `--projectRoot` CLI arg, replacing the `--root` one (this is not actually needed, since it does the same as `--watchFolders`
Differential Revision: D8567229
fbshipit-source-id: 3b76fd8e23d201a4097e9dfba3a512d64f348cb0
Summary:
@public
If some prop has `std::vector` type, it possible that on JS side we want to pass just one element of the array.
And in this case we sometimes drop array initialization (`[]`) part, so instead of passing `[{x:1, y:1}]` we pass `{x:1, y:1}`.
This diff adds support for that.
Reviewed By: mdvacca
Differential Revision: D8526572
fbshipit-source-id: 33d4369ac48cac3eb1c534f477d8259e76e0c547
Summary:
@public
This is iOS-specific implementation of <Image> view.
Not all props and features are supported yet.
Known issues:
- Animated GIFs;
- CA transitions during image appearance.
Reviewed By: mdvacca
Differential Revision: D8526570
fbshipit-source-id: a4b1dca583b139b8a09431565a79f051fae67a36
Summary:
@public
This diff implements basics of cross-platform part of <Image> component.
Known issues:
- Events does not work yet.
- Some quite specific image source parameters (like custom http headers) are not supported yet.
Reviewed By: fkgozali
Differential Revision: D8526575
fbshipit-source-id: ecc97d9fda2b2e65bb1b079af057f8e176a161e5
Summary:
@public
ImageManager coordinates all work related to loading image bitmaps for <Image> component.
The particular iOS implementation uses RCTImageLoader from RCTImage module under the hood.
Reviewed By: fkgozali
Differential Revision: D8526571
fbshipit-source-id: a0d927972d30113eed6e0cd169fceee17610181d
Summary:
@public
After reading about move-semantic and rvalue refs I realized that we (I) definitely overuse `auto &&` (aka universal reference) construction. Even if this is harmless, does not look good and idiomatic.
Whenever I used that from a semantical point of view I always meant "I need an alias for this" which is actually "read-only reference" which is `const auto &`.
This is also fit good to our policy where "everything is const (immutable) by default".
Hence I change that to how it should be.
Reviewed By: fkgozali
Differential Revision: D8475637
fbshipit-source-id: 0a691ededa0e798db8ffa053bff0f400913ab7b8
Summary:
@public
`ContextContainer` is general purpose DI container for Fabric.
We need this to communicate some enviroment-specific and/or platform-specific modules down to cross-platform C++ code.
The first one will be ImageManager. Soon.
Reviewed By: fkgozali
Differential Revision: D8475636
fbshipit-source-id: 0afc65063f818d0bab736cd2c55c6fdd21b629ac
Summary:
@public
This diff changes how we store and manage Yoga Config in layoutable shadow nodes.
Previously we have `shared_ptr` to single shared yoga config (one to many relationships); now we initiate and store yoga config with yoga node (one to one relationship).
Cons:
- Less memory efficient.
Pros:
- Much more flexible model. Configuration can be tweaked on a per-node basis.
- More performant. Dealing with `shared_ptr` is expensive because of atomic ref-counter. (This is not really applicable for the previous approach but would be applicable for any alternate approach where we want to have more granular control of the configuration.) Data locality is also great in the new model which should positively impact performance.
- Simplicity. Any alternate approach where we manage sets of nodes which share the same configuration is going to be quite complex.
Reviewed By: fkgozali
Differential Revision: D8475638
fbshipit-source-id: 5d73116718ced8e4b2d31d857bb9aac69eb69f2b
Summary:
@public
... and we initalize this in Surface.
We need this for requesting images with proper size/pixel-density, setup proper parameters for rasterizing CALayer's and rounding layout metric values.
Then we have to figure out how to wire this up with YGConfig.
Reviewed By: fkgozali
Differential Revision: D8475639
fbshipit-source-id: cec7af581b94efb4595dcf3f232252ce87a1fde3
Summary:
Added Smart Inversion Compatibility to Marketplace on iOS so that photos don't appear inverted
Added Property to View for Ignoring Color Inversion
Applied Property to Images on marketplace.
**Note: Android doesn't support smart inversion
Reviewed By: PeteTheHeat
Differential Revision: D8528543
fbshipit-source-id: 63caf592bc71e6fe9db7e70c72b56d32873be048
Summary:
@public
Added a property `accessibilityIgnoresInvertColors (boolean)` to Views which allows the Apple API `accessibilityIgnoresInvertColors` to be used in React Native.
Now, when a user has Display: Smart Invert enabled, you can set the property to be true, and things like photos and views with the property set to true will no longer be inverted when Smart Invert is enabled.
This property can also be applied to the Image Component.
Example Use Case:
```
<Image accessibilityIgnoresInvertColors={true} />
```
```
<View accessibilityIgnoresInvertColors={true} />
```
| Before | After |
| ------ | ----- |
| ![original](https://user-images.githubusercontent.com/165856/41738737-b62c6ebc-7547-11e8-8ea3-f82239998071.jpg) | ![feeditem](https://user-images.githubusercontent.com/165856/41738749-beef6de2-7547-11e8-9771-b44e513de0fd.jpg)
Reviewed By: PeteTheHeat
Differential Revision: D8549084
fbshipit-source-id: 82a3bc73c9e6d75d6b50ba013b88127f07692641
Summary:
@public
There are some race conditions between VM objects getting deallocated and the instanceHandle held by the eventEmitter can point to deallocated memory space, causing undefined behavior like a crash.
For now, keep a strong ref to the eventTarget inside EventEmitter to avoid that scenario. This is a temporary workaround.
Reviewed By: shergin
Differential Revision: D8576785
fbshipit-source-id: 87ef36f716270ceca906b32bb86e0046ceaca19e
Summary: This brings Image a bit more inline with the .ios.js counterpart.
Reviewed By: yungsters
Differential Revision: D8557495
fbshipit-source-id: 263da529d1a2541b0168745c0141c3fc622a1883
Summary: Need to test a potential issue with Animated.Image on Android. Adding a RNTester example to exercise it.
Reviewed By: yungsters
Differential Revision: D8559440
fbshipit-source-id: 4319d958de146c177cb0bd4b84679b773ce50833
Summary:
@public
This new version of metro replaces the `getProjectRoots()` config param by `getProjectRoot()` (which is used as the main folder for calculating relative paths of files, etc) and `getWatchFolders()` (which is used to know which files/folder to crawl when starting metro).
More info: 3bdf386d14
[skip-ci]
Reviewed By: yungsters, mmmulani
Differential Revision: D8538986
fbshipit-source-id: 2afc33950334a278364debb39f34ef0fe0535894
Summary: Improving the exported type of Image on android so we can work on migrating the implementation off of createReactClass and propTypes.
Reviewed By: yungsters
Differential Revision: D8530549
fbshipit-source-id: dab0cb5034464b7939a0b04e8912bae916690e8c
Summary:
We enforce this config locally in fbsource, lets ensure our flow strict files are run the same way in the github repo.
@public
Reviewed By: sahrens
Differential Revision: D8530133
fbshipit-source-id: 18528992ad6490826431359d5d8c6acd6710a8ae
Summary:
@public
A few people have been complaining, including me, that when we compile a react native project, there are a lot of warnings from xcode, suggesting to update the project build settings to the new recommendations.
I took the liberty to actually update the xcode projects, so we can finally have these gone, as well as replace some deprecated methods with the new suggested ones.
[IOS] [MINOR] [Xcode] - updated the Xcode projects with the latest suggestions from Xcode 9.3, and replaced a few deprecated methods of iOS with their new replacements.
Closes https://github.com/facebook/react-native/pull/19574
Reviewed By: shergin
Differential Revision: D8530135
Pulled By: hramos
fbshipit-source-id: b9c9ede0e07760cb2207caa6b468bd5c241848dc
Summary:
Use colon after Test Plan to ensure the plan is copied to Facebook's internal Phabricator instance successfully.
Closes https://github.com/facebook/react-native/pull/19813
Differential Revision: D8530181
Pulled By: hramos
fbshipit-source-id: 83be6ecaca54a3c6fd4e47b08b8632976f5635aa
Summary: These are the flow errors that resulted from this diff: P59723027
Reviewed By: sahrens
Differential Revision: D8454977
fbshipit-source-id: e10901d3ecfc541b25f2fefb18702629f0bbab71
Summary: This is necessary to provide things like `Image.prefetch` in Jest tests. Previously this only gave access to propTypes.
Reviewed By: sahrens
Differential Revision: D8526494
fbshipit-source-id: 11d49d95d6edf3f75c90438e0b629f5345bc980d
Summary:
@public
When JS first starts up, Fabric surface end up double registering itself, causing events to not work. So let's guard it so that registration happens only on reload case.
Reviewed By: shergin
Differential Revision: D8521002
fbshipit-source-id: 441f121786e860dc10e959e940b411c2afaf96dc
Summary:
@public
The bridge may send the reload event twice when reloading JS in some rare condition. The 2nd one was actually when the "new" bridge wasn't valid yet, so log an error if that happens. This may happen if the connection to Metro server gets into a weird state. Restarting Metro would solve the problem.
The issue was that `RCTBridgeWillReloadNotification` fired twice for each reload with metro connected.
Reviewed By: mmmulani
Differential Revision: D8509448
fbshipit-source-id: 647fb98c0a97503409a10451b8f152145947ae20
Summary:
In D8515300 we used the uiManagerType to call the setJSResponder method in UIImplementation or FabricUIManager.
There is a small chance that one of the reactTags received by parameter belongs to a View that is not managed by ReactNative, in that case we could be try to use FabricUIManager from UIManagerModule when Fabric is not running yet, causing a RN crash.
The fix consists in keep calling the UIImplementation.setJSResponder() method for any reactTag, and then perform a NOOP if the ReactShadowNode can not be found.
Reviewed By: fkgozali
Differential Revision: D8518192
fbshipit-source-id: 954fdd5dbed758ef73c16dad7da6b59ed83fe46a
Summary:
We use projectRoots to limit crawling of jest-haste-map in large codebases. Since this implies multiple projects roots, it makes it very hard (or impossible) to reliably cache dependency resolutions.
If we can replace this with a single project root and a set of watch roots, we can have relative path resolutions for all dependencies which van be cached.
Reviewed By: rafeca
Differential Revision: D8450498
fbshipit-source-id: 830c21e847c3236e42d5414a8587508cb73864bd
Summary:
AssetsLibrary.framework --> Photos.framework; ReactNative
Port RN off of AssetsLibrary where trivial, lazy load AssetsLibrary where remaining.
Reviewed By: fkgozali
Differential Revision: D7999924
fbshipit-source-id: 1d48a2d820984564459ed43680cd3f601399d352
Summary:
Before this fix, ReactNative screens that uses the Fabric renderer crashes when an event is dispatched. The root cause of the bug is that React JS executes the setJSResponder method in UIManagerModule, but this method is not implemented yet in Fabric.
This fix will have to be picked into current RC to fix events into the City Guides screen running the Fabric experiment
Reviewed By: fkgozali
Differential Revision: D8515300
fbshipit-source-id: 40fe2f77987470abed8164f848680a911efa4bd2
Summary:
These lines were causing erros with the e2e tests on ios.
There are some methods that are not going to be called, and some definitions that are not correct.
needed for #19574.
we will run the e2e tests.
[INTERNAL] [MINOR] [Tests] - Fix some definitions.
Closes https://github.com/facebook/react-native/pull/19790
Differential Revision: D8509228
Pulled By: hramos
fbshipit-source-id: 78650e347db52305a587e3461ac56877e3c79062
Summary:
Fixes https://github.com/facebook/react-native/issues/19766
On a clean project flow was complaining about `Cannot resolve module X` because of the removal of `providesModule`. This resolves the errors.
Reviewed By: rubennorte
Differential Revision: D8500303
fbshipit-source-id: 4e129ee4382f8ff36ab126e9f6c6530254cd382e