Commit Graph

14608 Commits

Author SHA1 Message Date
Valentin Shergin 2c3e4ec06b Fabric: `borderWidths` field was removed from ViewProps
Summary:
@public
Apperently, we don't need to store and parse this because we are already doing this for `yogaStyle` field.

Reviewed By: sahrens

Differential Revision: D9649549

fbshipit-source-id: a84a5518674f4c2d574a060cdbebb9562121f5f4
2018-09-07 11:17:53 -07:00
Valentin Shergin 2caa1e01fa `ScrollViewSimpleExample` added to iOS-specific list of examples
Summary: Trivial.

Reviewed By: TheSavior

Differential Revision: D9631869

fbshipit-source-id: 39dccf8d3d7e0055f9aaed946e40ea27db36c9e4
2018-09-07 11:17:53 -07:00
Valentin Shergin b960512a5e Fabric: Complete border drawing implementation in RCTViewComponentView
Summary:
@public
Now all configurations or border styles are supported by RCTViewComponentView (and all subclasses).

Reviewed By: sahrens

Differential Revision: D9631868

fbshipit-source-id: 3a5b141ac5ffa9c28f4ebb0718f2fc935b8f1a75
2018-09-07 11:17:53 -07:00
Valentin Shergin 44fb60938a Fabric: Fixed `colorComponentsFromColor` to able to accept empty color object
Summary:
@public
Empty (nullptr) color should be treated as `Clear` color ({0, 0, 0, 0} - black, fully tranparent), so `colorComponentsFromColor()` was changed to accomodate this (previously it crashed).

Reviewed By: rsnara

Differential Revision: D9631865

fbshipit-source-id: e211f34a89e9f5f86d9fca2789c7163db4feaab1
2018-09-07 11:17:53 -07:00
Valentin Shergin 16bd95b689 Expose `RCTBorderDrawing.h` as a public header
Summary:
@public
We will use that in RCTFabric module.

Reviewed By: sahrens

Differential Revision: D9631866

fbshipit-source-id: a8e4074189359ad6014d0506d6a1e020b5d0d330
2018-09-07 11:17:52 -07:00
Valentin Shergin a3954ed5cb Fabric: Virtual destructors for all abstract interface-like classes
Summary:
@public
Apparently, it's how it should be.

Reviewed By: rsnara

Differential Revision: D9631870

fbshipit-source-id: 46f58270104d699fbc9abe21062c12f791460536
2018-09-07 11:17:52 -07:00
Valentin Shergin ca1e9032a4 Fabric: Proper way to represent (and parse) borders in ViewProps
Summary:
@public
Previously, ViewProps class coundn't represent whole spectre of possible values of border metrics (e.g. the border color was unified).
Now it's complete and direction-specific.

Reviewed By: sahrens

Differential Revision: D9628361

fbshipit-source-id: 6d3b3d4d7e3008e2168cbca732ff99fe5ea595e8
2018-09-07 11:17:52 -07:00
Daniel Ignat 6e7ffff4a5 If source.method is "post", use HTTP POST method (#21010)
Summary:
The React Native Web View takes a method option to determine if HTTP GET or HTTP POST should be used.
For iPhone this is not case sensitive, meaning that `method: "post"` is allowed.
For Android "post" is not understood and therefore the request will be using HTTP GET.

I suggest we ignore case for the method, or throw an Exception.
Pull Request resolved: https://github.com/facebook/react-native/pull/21010

Differential Revision: D9700895

Pulled By: hramos

fbshipit-source-id: 3fa904e7946dd40958cb44f9a234ee66cb68fab2
2018-09-07 10:26:21 -07:00
Ram N 27348f0f07 Remove getEagerNativeModules()
Summary: An experiment was added to A/B test eager modules. Removing this experiment, as the next diff on this stack has a different way to add eager modules per route.

Reviewed By: achen1

Differential Revision: D9685803

fbshipit-source-id: ca6c91ca377b6dfaf5accda1e1f6bbfe17b1d616
2018-09-07 10:26:21 -07:00
Ram N 6da93a302e Better error message when using getNativeModule(Class)
Summary:
Some of the native modules are accessed using `getNativeModule()` may not have an `ReactModule` annotation. As a result, such native modules cannot be found.

This diff adds a better error message, and also adds the annotation to Mobile Home's `PushNotificationManager` that is accessed using the `getNativeModule()`

Differential Revision: D9697256

fbshipit-source-id: 2e2f7d2f1eb705c9c515ff40d9acbc53055c26d8
2018-09-07 10:26:21 -07:00
Ram N 4b15eb53ec Fix broken systrace message markers
Summary: SystraceMessage needs to have a flush method

Reviewed By: shergin

Differential Revision: D9696709

fbshipit-source-id: 7f8c9422fbc2e3ca8c184015889a4d1aa1500a7c
2018-09-07 10:26:21 -07:00
Andrew Chen (Eng) f38ab24a19 Fix setupReactContext systrace
Summary: setupReactContext wasn't ending because D9664719 added incorrect end markers. Need to use either Systrace.endSection() or SystraceMessage.endSection().flush().

Differential Revision: D9695854

fbshipit-source-id: e0f7d492bc58536ce242962438edac7eec671867
2018-09-07 10:26:20 -07:00
Christoph Jerolimov c3e42b5531 Fix that BackHandler was not called on Android (#19077)
Summary:
This fixes issues #18954 and #15497

The transformation from Set to (an reversed) Array does not work on Android devices when the remote debugging was started with `react-native run-android`.

<!--
  Required: Write your motivation here.
  If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged.
-->

Add the following code to your App.js and run the app with `react-native run-android` in an Android device:

```
  componentDidMount() {
    BackHandler.addEventListener('hardwareBackPress', () => {
      console.warn('Callback called. Do not close app. Do nothing at all.');
      return true; // Do not close the app.
    });
  }
```

After adding this, the app should NOT close when you press the back button. Without this fix, the app closes (which is the default behaviour).

See also the comments from Victoriayangx in #18954 and #15497.

<!--
  Does this PR require a documentation change?
  Create a PR at https://github.com/facebook/react-native-website and add a link to it here.
-->

<!--
  Required.
  Help reviewers and the release process by writing your own release notes. See below for an example.
-->

[ANDROID] [BUGFIX] [BackHandler] - Fix that BackHandler was not called on Android

<!--
  **INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**

    CATEGORY
  [----------]      TYPE
  [ CLI      ] [-------------]    LOCATION
  [ DOCS     ] [ BREAKING    ] [-------------]
  [ GENERAL  ] [ BUGFIX      ] [ {Component} ]
  [ INTERNAL ] [ ENHANCEMENT ] [ {Filename}  ]
  [ IOS      ] [ FEATURE     ] [ {Directory} ]   |-----------|
  [ ANDROID  ] [ MINOR       ] [ {Framework} ] - | {Message} |
  [----------] [-------------] [-------------]   |-----------|

 EXAMPLES:

 [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
 [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
 [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
 [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
 [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
 [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->
Pull Request resolved: https://github.com/facebook/react-native/pull/19077

Reviewed By: yns88

Differential Revision: D9692298

Pulled By: hramos

fbshipit-source-id: 4526b07a4924055ebc9c42e02615c27aa5c97fbb
2018-09-07 10:26:20 -07:00
Nicolas Charpentier 0cce0a62c1 Add backface-visibility support on Android (#15970)
Summary:
`backfaceVisibility` was only available on iOS and 3D transformations were lacking on Android.

Backface Visibility is computed from ~the decomposed matrix of transform prop~ the view with their rotation degree values.

~`MatrixDecompositionContext` properties have been made public so we can access to decomposed matrix values from outside (`ReactViewGroup`).~

I'm not sure if this is the best implementation, so if it's not let's discuss it.

cc janicduplessis foghina

Tested in https://github.com/charpeni/react-native-backface-visibility.

| Before | Now |
| - | - |
| <img src="https://user-images.githubusercontent.com/7189823/30123717-e5361598-9300-11e7-8e2e-a87a7a8d896a.gif" width="260" /> | <img src="https://user-images.githubusercontent.com/7189823/30514997-4d203572-9aee-11e7-8542-bfde41678eb6.gif" width="244" /> |

| iOS | Android |
| - | - |
| <img src="https://user-images.githubusercontent.com/7189823/36995899-609513b4-2083-11e8-9834-ee44c1a292e1.gif" width="300" /> | <img src="https://user-images.githubusercontent.com/7189823/36995978-9ed3b158-2083-11e8-841e-b9e3357d2509.gif" width="240" /> |

[ANDROID] [FEATURE] [ReactViewGroup] - Add backface-visibility support on Android
Pull Request resolved: https://github.com/facebook/react-native/pull/15970

Differential Revision: D9411130

Pulled By: hramos

fbshipit-source-id: 62f646a4de37d83922286cb98893a95b55fa889e
2018-09-07 10:26:20 -07:00
Ram N 2f79960a69 Convert ReactPackages in FB4a to switch-case
Reviewed By: achen1

Differential Revision: D9511962

fbshipit-source-id: ea42b25f13b157866057d96d026317098e47ea63
2018-09-07 10:26:20 -07:00
Kevin Gozali 0df92afc1c Remove NavigatorIOS
Summary:
Legacy navigator impl. There are other alternatives that should be used instead.

Part of the slimmening effort as described here: https://github.com/react-native-community/discussions-and-proposals/issues/6

Reviewed By: TheSavior

Differential Revision: D9677824

fbshipit-source-id: 24ae500751d2a8c398f246d36604a58f0b3c113b
2018-09-07 10:26:20 -07:00
Rafael Oleza 9e63b5c5d2 Bump metro@0.45.1
Summary:
This version of metro contains experimental support for inlining import statements, which will unblock RAM bundling for opensource users that use imports, yay!!!

Publishing as a minor version, since there are no breaking changes. This way, this will also be available already in RN 0.57, since it depends on Metro 0.57 (https://fburl.com/t2j2k2sw).

/cc @[805780135:Eli White], @[1268286274:David Vacca], @[121800083:Héctor Ramos]

Reviewed By: mjesun

Differential Revision: D9682357

fbshipit-source-id: ddd450649e55ee37701667cdff0e81165875e76d
2018-09-07 10:26:20 -07:00
Ram N 875f70b8b6 Refactored NativeModuleRegistryBuilder
Summary: The logic in NativeModuleRegistryBuilder.processPackage was getting pretty complex with lot of branches. Moved the logic to get actual packages into each of the packages, instead of having it in NativeModuleRegistryBuilder.

Reviewed By: achen1

Differential Revision: D9618140

fbshipit-source-id: 4be82ec65b0bd92f11f8b77044004e10c9d3b1a1
2018-09-07 10:26:20 -07:00
Ram N b1d205a28f Add more systrace to RN startup
Summary:
Added systrace to the following sections
1. When Marketplace Home Fragment is created
2. On initialization of Catalyst Instance

Reviewed By: achen1

Differential Revision: D9665376

fbshipit-source-id: e48e9f50dad42c71fb2151538f65bc54939adc1e
2018-09-07 10:26:20 -07:00
gengjiawen d838b6c550 fix typo in README.md (#20993)
Summary:
The original facebook is misspelled.
pass all current ci.
none
 [GENERAL] [INTERNAL] [MISC] - fix typo in README.md
Pull Request resolved: https://github.com/facebook/react-native/pull/20993

Differential Revision: D9671977

Pulled By: hramos

fbshipit-source-id: 2c279cb681696460801e11012b4a456d5375ce24
2018-09-07 10:26:19 -07:00
Ram N 48169b28e2 Change class names to modules names in packages
Reviewed By: achen1

Differential Revision: D9508095

fbshipit-source-id: e3973ea417c803110eb8612c854a6374a849474b
2018-09-07 10:26:19 -07:00
Zack Gomez 5eaa2d29c0 Fix inability to remove 'Disabled' state from AccessibilityStates
Summary:
D8842691 split AccessibilityTraits into multiple RN properties.  However, the accessor code did not support REMOVING traits.
This results in buttons that were disabled (AccessibilityTraits & NotEnabled === true) never being enabled.

Fix the issue by making the split accessors properly mask in the bits, allowing you unset them without disturbing bits managed by the other accessor.

NOTE: setting AccessibilityTraits and AccessibilityRole or AccessibilityStates will still result in bugs.

Reviewed By: shergin

Differential Revision: D9661970

fbshipit-source-id: 77d70dd0754f2eaf8cbf895bfc13757c697a76d8
2018-09-07 10:26:19 -07:00
Andrew Chen (Eng) bbc1af6536 Give a name to the ReactContext thread
Summary: tired of looking around for this thread. named it "create_react_context"

Differential Revision: D9664714

fbshipit-source-id: 8839b5724fe2516fc46de3dd40971c52a5a8168f
2018-09-05 16:33:38 -07:00
Héctor Ramos 241e74dc5f Close after 3 days
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/20990

Differential Revision: D9664380

Pulled By: hramos

fbshipit-source-id: 63cc205b44ed7cfb55fef64ddce579a35e082300
2018-09-05 16:33:37 -07:00
Andrew Chen (Eng) cb6196073a Add systrace to UIManagerModule.createConstants
Summary:
- Differentiate when the constants are coming from lazy view managers or not
- Add systrace sections to each reactpackage iteration for lazy view managers

Differential Revision: D9664719

fbshipit-source-id: 3b8c6b3b40667a833471fcb957367501781b0f5d
2018-09-05 16:04:22 -07:00
Dulmandakh 1edeaef6ca FIx Android CI (#20901)
Summary:
This PR fixes Android CI
Pull Request resolved: https://github.com/facebook/react-native/pull/20901

Differential Revision: D9596497

Pulled By: hramos

fbshipit-source-id: 5662243645d5d8e51c6da4cb142ab6665a09daee
2018-09-05 16:04:22 -07:00
Peter Keller d985b2e661 Fix orientation change issue in HelloWord template (#20945)
Summary:
This commit is related to issue #16060
Tested through the iOS simulator. Solution came from https://moduscreate.com/blog/changing-the-react-native-rootview-background-color-ios-and-android/
Pull Request resolved: https://github.com/facebook/react-native/pull/20945

Differential Revision: D9661761

Pulled By: hramos

fbshipit-source-id: ca8dd3fd09a0b0e89e1598a8114800808efa7d21
2018-09-05 13:22:07 -07:00
Ranjan Shrestha 27a07cf13c Use the round launcher icon available since 7.1 (#20968)
Summary:
The default react-native template has ic_launcher_round icons on the resources but has not been used.

Thank you for sending the PR! We appreciate you spending the time to work on these changes.
Help us understand your motivation by explaining why you decided to make this change.

If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged.
Pull Request resolved: https://github.com/facebook/react-native/pull/20968

Differential Revision: D9661731

Pulled By: hramos

fbshipit-source-id: ad8f2f952df2c32aea2a8d3e69c445ed27387aa6
2018-09-05 13:02:22 -07:00
Peter Keller e30ec0fcba Fix typo in comment (#20947)
Summary:
Overwrite instead of owerwrite

Release Notes:
--------------
[CLI] [MINOR] [local-cli/upgrade/upgrade.js] - Typo in comment fixed
Pull Request resolved: https://github.com/facebook/react-native/pull/20947

Differential Revision: D9661739

Pulled By: hramos

fbshipit-source-id: 378b44599313ab535af55981ddd80b0fcdbee448
2018-09-05 12:49:02 -07:00
Ram N 38bea0bbf3 TM: Create Java implementation of Turbo Modules
Summary: Create a Java implementation for a sample module

Reviewed By: fkgozali

Differential Revision: D9445981

fbshipit-source-id: 7709f7655468dc21abcc42cba1036b8e920b2bdb
2018-09-05 09:20:03 -07:00
Gabe Levi 66bd4992b8 Deploy v0.80.0 to xplat/js
Reviewed By: samwgoldman

Differential Revision: D9646704

fbshipit-source-id: d5a19f653785c81929337876936ba5069fc0abc3
2018-09-05 08:48:31 -07:00
Emily Janzer 06bf7b1f00 Adding @CountEnum to simple enums in xplat/js
Summary: Using The Count to transform enums to ints in production builds: https://our.intern.facebook.com/intern/wiki/Android-java-transforms/the-count/

Reviewed By: achen1

Differential Revision: D9614432

fbshipit-source-id: 1b1a197ad8f4962712d6006ab07b3beb3eaf2432
2018-09-04 18:18:05 -07:00
Adam Comella 01d5eff425 iOS: Add a maxFontSizeMultiplier prop to <Text> and <TextInput> (#20915)
Summary:
**Motivation**

Whenever a user changes the system font size to its maximum allowable setting, React Native apps that allow font scaling can become unusable because the text gets too big. Experimenting with a native app like iMessage on iOS, the font size used for non-body text (e.g. header, navigational elements) is capped while the body text (e.g. text in the message bubbles) is allowed to grow.

This PR introduces a new prop on `<Text>` and `<TextInput>` called `maxFontSizeMultiplier`. This enables devs to set the maximum allowed text scale factor on a Text/TextInput. The default is 0 which means no limit.

Another PR will add this feature to Android.

**Test Plan**

I created a test app which utilizes all categories of values of `maxFontSizeMultiplier`:
  - `undefined`: inherit from parent
  - `0`: no limit
  - `1`, `1.2`: fixed limits

I tried this with `Text`, `TextInput` with `value`, and `TextInput` with children. For `Text`, I also verified that nesting works properly (if a child `Text` doesn't specify `maxFontSizeMultiplier`, it inherits it from its parent).

Lastly, we've been using a version of this in Skype for several months.

**Release Notes**

[GENERAL] [ENHANCEMENT] [Text/TextInput] - Added maxFontSizeMultiplier prop to prevent some text from getting unusably large as user increases OS's font scale setting (iOS)

Adam Comella
Microsoft Corp.
Pull Request resolved: https://github.com/facebook/react-native/pull/20915

Differential Revision: D9646739

Pulled By: shergin

fbshipit-source-id: c823f59c1e342c22d6297b88b2cb11c5a1f10310
2018-09-04 17:50:42 -07:00
Ram N fed5b6e27a Make C++ RN Modules explicitly specify that they are C++ modules
Summary:
Currently `ReactModuleSpecProcessor` looks at each of the modules, and sees if the module inherits from `CxxModuleWrapper` to see if it is a C++ module or not. With this change, we now require C++ modules to explicitly specify that they are C++ modules, instead of doing annotation processing magic.

Also note that annotation processor do not work with interfaces but with classes only, so this also removes the dependency of the annotation processor from the bridge buck target.

Reviewed By: achen1

Differential Revision: D9597352

fbshipit-source-id: fd847ac382699d2ab78f7d7c6e2dbd7c60d3f0c4
2018-09-04 16:33:15 -07:00
empyrical d283d8f80c Add DeltaBundler's Flow types to flow config (#20953)
Summary:
This PR adds a declaration to `flow-github/metro.js` that fixes this error in `ci/circleci: analyze`:

```
Error ----------------------------------------------------- node_modules/metro-config/src/configTypes.flow.js.flow:18:27

Cannot resolve module `metro/src/DeltaBundler/types.flow.js`.

   18| import type {Module} from 'metro/src/DeltaBundler/types.flow.js';
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```
Pull Request resolved: https://github.com/facebook/react-native/pull/20953

Differential Revision: D9642861

Pulled By: hramos

fbshipit-source-id: c73c546b1645a3df9bb5f541764135f8a0c76578
2018-09-04 12:49:31 -07:00
Andrew Clark 9862a77b6a Use file name whitelist to prevent RCE
Summary:
Use a whitelist to validate user-provided file names. This doesn't cover the entire range of valid filenames but should cover almost all of them in practice. Allows letters, numbers, periods, dashes, and underscores. Opting to use a whitelist instead of a blacklist because getting this wrong leaves us vulnerable to a RCE attack.

This is the same patch I submitted to create-react-app: https://github.com/facebook/create-react-app/pull/4866

See s163726 for more details

Reviewed By: LukasReschke

Differential Revision: D9504148

fbshipit-source-id: e3c7587f1b7f93bec90a58a38d5f6d58f1f59275
2018-09-04 11:32:51 -07:00
Emily Janzer b5d908bc73 Convert ReactMarkerConsts back to enum, use @CountEnum
Summary: Reverting D9304307 and also adding CountEnum annotation to ReactMarkerConstants. This way we get the typesafety of the enum with the optimization of converting to int in production builds. More on the count: https://our.intern.facebook.com/intern/wiki/Android-java-transforms/the-count/

Reviewed By: achen1

Differential Revision: D9623235

fbshipit-source-id: ab992e7edb6cf999f5f122faee31075a63782411
2018-09-04 10:33:32 -07:00
Valentin Shergin 917800c686 Fabric: RectangleEdges & RectangleCorners generics
Summary:
@public

EdgeInsets and CornerInsets are now just qualifications of those generics:

	using EdgeInsets = RectangleEdges<Float>;
	using CornerInsets = RectangleCorners<Float>;

We will need more concrete types like that in the future diffs.

Reviewed By: mdvacca

Differential Revision: D9614428

fbshipit-source-id: e4d48a11d9083958c3ada68e6368afb150c64f6b
2018-09-03 23:04:20 -07:00
Valentin Shergin 6186c61476 Fabric: Fixed `border*Width` style prop parsing
Summary:
@public
The code previously assumed that the border size prop is called simply `border*` whereas it's actually `border*Width`.

Reviewed By: mdvacca

Differential Revision: D9626468

fbshipit-source-id: 75226cfdfb286f861b0961076857bd697d4a740b
2018-09-03 23:04:20 -07:00
Valentin Shergin c49f0eff6f Fabric: Using proper defaults in Yoga style props parsing
Summary:
@public
Previously, we amitted `default` argument in  `convertRawProp` functions assuming that all default values are equal to results of their default constructors (which was something between "wrong" and "lucky coincidence"). Now we use a `YGStyle` default value as a source of all semantic default values of all layout props/styles.

Reviewed By: mdvacca

Differential Revision: D9626469

fbshipit-source-id: 5cfc9c518772556f59da46f608181145cc744928
2018-09-03 23:04:20 -07:00
Valentin Shergin 294d91b30a Fabric: ShadowTree is now stored as unique_ptr instead of shared_ptr
Summary:
@public
Now it's clear that we don't need to store/handle ShadowTree objects as `shared_ptr`s; Scheduler should own it. This diff changes that to using unique_ptr and removes a base class of ShadowTree.

Reviewed By: mdvacca

Differential Revision: D9403567

fbshipit-source-id: 6e411714b632a04233fd5b25c8ab7cdd260105fd
2018-09-03 23:04:20 -07:00
Valentin Shergin 1068da2ec7 Introducing `LayoutableShadowNode::isLayoutOnly` and (theoretical) view-flattening
Summary:
@public
Voalá, this small change actually implements view flattening. Obviously, it does not work right now because there are no `ShadowNode` classes which implement `isLayoutOnly`.
Surprisingly, correct implementing of `isLayoutOnly` is quite tricky, we will work on this in coming diffs.

Reviewed By: mdvacca

Differential Revision: D9403565

fbshipit-source-id: 1f16f912cb5c6841405a1fc3cf36aec28698c11f
2018-09-03 23:04:20 -07:00
Valentin Shergin 0792fba63f Fabric: Using ShadowView instead of ShadowNode in Mutations
Summary:
@public
This is quite a big diff but the actual meaningful change is simple: now we use ShadowView class instead of ShadowNode in mutation instructions.
Note:
 * In some places (especially during diffing) we have to operate with ShadowNodeViewPair objects (which represents a pair of ShadowNode and ShadowView). The reason for that is that we cannot construct child ShadowViews from parent ShadowViews because they don't have any information about children.
 * `ShadowTree::emitLayoutEvents` is now much simpler because ShadowView better represents the specifics of this kind of object.
 * The code in RCTMountingManager also became simpler.

This change will allow us to implement more cool tricks soon.

Reviewed By: mdvacca

Differential Revision: D9403564

fbshipit-source-id: dbc7c61af250144d6c7335a01dc30df0005559a2
2018-09-03 23:04:20 -07:00
Valentin Shergin 5c83855c75 Fabric: Introducting `ShadowView` and `ShadowViewMutation`
Summary:
@public
We need some another object like ShadowNode (but not ShadowNode) to represent an instance of the component in the mutation instructions. This is
the main motivation for introducing ShadowView.

Why not use ShadowNode? ShadowNode is designed to represent a node in ShadowTree, not be a part of a mutation instruction.
 * ShadowNode exposes some APIs that should not be exposed to the mounting layer;
 * ShadowNode is an immutable data structure, so we cannot mutate it in some way which can be meaningful for mounting;
 * We should not add to ShadowNode any functionality which is needed only for mounting;
 * ShadowNode is a bit more heavy object to share that it needs to be; it's exposed (embedded into Mutation) as a `shared_ptr` which is not optimal from the performance perspective;
 * Retaining ShadowNode from mounting code can unnecessarily extend its lifetime which can negatively affect memory usage.

Reviewed By: mdvacca

Differential Revision: D9403562

fbshipit-source-id: 72ad81ed918157a62cd3d1a03261f14447649d0b
2018-09-03 23:04:20 -07:00
Valentin Shergin 2a942b7ae8 Fabric: Defined `+` and `*` operators for Point and Size geometric types
Summary:
@public
Trivial. Those operations are very useful in layout algorithms.

Reviewed By: mdvacca

Differential Revision: D9403566

fbshipit-source-id: e76967aaaac3a36bf6d3e7a468b5ae7769a4dcac
2018-09-03 23:04:20 -07:00
Tim Yung 1cc29c53fb React: Upgrade to react-devtools@3.3.2
Summary: Upgrades `react-devtools` for React Native and Nuclide to v3.3.2.

Reviewed By: bvaughn

Differential Revision: D9565574

fbshipit-source-id: 320b21edee3bcf9b4541ca4936461cdb6f1373e1
2018-09-02 12:19:35 -07:00
Taras Tsugrii a8a63b1560 Remove unused loads from build files.
Summary: Unused loads hurt readability and take time to process.

Reviewed By: hramos

Differential Revision: D9494120

fbshipit-source-id: 455b56efadab1cb976344cffcb427772bfda2f71
2018-08-31 18:03:07 -07:00
Sergei Dryganets 09c78fe968 Incorrect ref API usage fixed. (#20913)
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
2018-08-31 12:50:02 -07:00
Héctor Ramos 792cd0902e Bump lodash dependency (#20892)
Summary:
Per [CVE](https://nvd.nist.gov/vuln/detail/CVE-2018-3721) warning.
Pull Request resolved: https://github.com/facebook/react-native/pull/20892

Differential Revision: D9616099

Pulled By: hramos

fbshipit-source-id: 245c09ca32934c5e5464f87bfca213f1b10f8fec
2018-08-31 12:19:04 -07:00
Jiaqi Wu e04206a88d Add native nav bar with title and button icon
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
2018-08-30 22:48:02 -07:00