Commit Graph

13949 Commits

Author SHA1 Message Date
David Vacca 27a38dedf1 Enable View flatening optimization by default
Summary: This diff enables view flattening optimizations by default

Reviewed By: wwjholmes, yungsters

Differential Revision: D8699050

fbshipit-source-id: d37d06fe330e223c49a0788e85f6338fd056fd19
2018-07-02 10:04:41 -07:00
Alexey Kureev c4a66a89a2 Code clean-ups and createServer migration
Summary:
Scope of the diff:

1. Middleware
`react-native-github/local-cli` and `react-native-internal-cli` uses a very similar set of middlewares (internal cli extends github version), so I decided to move it to a standalone file (middleware manager) in order to remove duplications and increase readability.

2. Types
Seems that after Flow upgrade to version 0.68 there were many type issues to resolve, so all of them were auto-mocked. This is fine, but I'd like to see Flow assists me with `Metro.createServer` -> `Metro.runServer` migration. Hence, I decided to resolve flow mocks, related to runServer.

3. `runServer` signature
In `react-native-github` repo I cleaned up `runServer` signature by removing `startCallback` and `readyCallback` from the function parameters and moved them to `runServer` instead.

4. Replace `createServer` by `runServer`
In `react-native-github` repo, `createServer` has been replaced by `runServer`. __Some of arguments are not mapped__.

Note that this diff will partially break argument mapping. This is intentional. @[100000044482482:ives] will fix it with a new config package.

Reviewed By: mjesun

Differential Revision: D8711717

fbshipit-source-id: a843ab576360ff7242099910d8f25a9cb0a388c0
2018-07-02 09:47:39 -07:00
Valentin Shergin ee535fafe3 Fabric: Making `fabric/textlayoutmanager` compilable on Android
Summary:
@public
This compiles, but it works only on iOS for now.

Reviewed By: mdvacca

Differential Revision: D8655540

fbshipit-source-id: 7e9a73fadb317dd62298af6f347344ac4229a8a5
2018-07-01 21:37:00 -07:00
Valentin Shergin 5786db3a26 Fabric: Making `fabric/graphics` compilable on Android
Summary:
@public
This compiles but this does not work.
To make it actually work we have to implement all missing functions in `Color.cpp` and co.

Reviewed By: fkgozali

Differential Revision: D8655537

fbshipit-source-id: 564fb7131445af81cf05407239dc6ba870cf6b83
2018-07-01 21:36:59 -07:00
Tim Yung 6a16bec882 RN: Fix Drawing Rect for ReactScrollView
Summary:
Fixes `ReactScrollView` so that it respects the drawing rect (i.e. the bounding box of the element).

In JavaScript, this is the backing view for `ScrollView` (vertical) on Android.

Reviewed By: fadinghorse

Differential Revision: D8710256

fbshipit-source-id: f3bd96e39b8569cfcb21e486944b70fdb57c12b6
2018-07-01 16:32:07 -07:00
gengjiawen 6dcadca712 Add back ImageEditingExample example (#19972)
Summary:
add back missing file.
pass all current ci.
none
 [GENERAL] [INTERNAL] [RNTester] - Add back ImageEditingExample example.
Closes https://github.com/facebook/react-native/pull/19972

Differential Revision: D8711888

Pulled By: TheSavior

fbshipit-source-id: 14070bfbf747f7f59c4039981a9bc83c1c10862b
2018-07-01 16:32:07 -07:00
Valentin Shergin 2166d2bb79 Fabric: Trivial implementation of prelumiary view allocation on iOS
Summary:
@public
We have this feature in the current version of RN, so it would be nice to support that in Fabric as well. This should save us tens of ms of views creation during mounting.
And that's quite easy to do!

Reviewed By: fkgozali

Differential Revision: D8701992

fbshipit-source-id: 4e3049df009ffd65bb43043de388e81795e5e559
2018-06-29 20:02:38 -07:00
Sebastian Markbage 5d9326be29 Remove instanceHandle, pass event target instead + add dispatchToEmptyTarget
Summary:
Removes the concept of instance handle. Instead we pass the event target
to createNode and don't pass it to subsequent clones.

The life time of the event target is managed by native (the event emitter).
It has to be released manually.

Reviewed By: shergin

Differential Revision: D8688330

fbshipit-source-id: e11b61f147ea9ca4dfb453fe07063ed06f24b7ac
2018-06-29 15:32:27 -07:00
gengjiawen 7b1bd4d4f3 remove useless config in circle ci (#19980)
Summary:
The gradle path is unnecessary.
pass all current ci.
none
 [GENERAL] [INTERNAL] [CI] - remove useless config in circle ci.
Closes https://github.com/facebook/react-native/pull/19980

Differential Revision: D8700298

Pulled By: hramos

fbshipit-source-id: ed50cab035f0d78dc482023460692a2ce137fb48
2018-06-29 13:02:58 -07:00
Valentin Shergin 62f9ced099 Fabric: Subtle changes that make GCC compiler happy
Summary:
@public
Most of them are legit issues which should not be compilable anyways (but Clang tolerates thems).

Reviewed By: mdvacca

Differential Revision: D8655539

fbshipit-source-id: 645729fb9d6a120ce1ab2b07542abcdacd72320d
2018-06-29 12:18:27 -07:00
Valentin Shergin 712c2ed5d2 Fabric: Getting rid of `std::to_string()`
Summary:
@public
Suddenly, it is not supported on Android.
Luckelly `folly:to<std::string>()` is as good as `std::to_string()`.

Reviewed By: mdvacca

Differential Revision: D8655538

fbshipit-source-id: 2b3b970f6a261253aaa6b22dba8338dc66b7195d
2018-06-29 12:18:27 -07:00
Tim Yung b81c8b51fc RN: Add Support for `overflow` on Android (Take 2)
Summary:
Adds support for the `overflow` style property on React Native for Android.

This is the second attempt to do this. See 6110a4cc75 (D8666509) for the first attempt.

Similar to the first attempt, this sets `setClipChildren(false)` by default on all `ViewGroup` instances. However, this differs in how it implements `overflow: hidden`. Instead of conditionally setting `setClipChildren`, this manually clips children to the `ViewGroup`'s bounds  (which was incidentally what we were doing for background + border radius already).

Reviewed By: achen1

Differential Revision: D8690805

fbshipit-source-id: 58757825cd9d138c18c8758918d85b4ca1915f87
2018-06-29 12:18:27 -07:00
Tim Yung cfce6ee9d7 RN: Android Constants for Overflow Style
Summary:
Tidies up the hardcoded strings for referencing the `overflow` style values.

Also, the `OVERFLOW` case in the optimized view flattening code path is unnecessary because `OVERFLOW` is already in the `LAYOUT_ONLY_PROPS` set.

Reviewed By: achen1

Differential Revision: D8690804

fbshipit-source-id: 3befbe93ed761e57e45f9b50e59bffc8a29a407f
2018-06-29 12:18:27 -07:00
Tim Yung f090840f45 RN: Revert D8666509
Summary:
Reverts D8666509. Unfortunately, I misunderstood `setClipChildren` on Android.

When set on a `ViewGroup`, `setClipChildren` configures whether its //children// — not itself — are clipped to their bounds. This is unlike `overflow` (as it behaves on iOS) which configures whether the view itself is clipped to its bounds.

But they are definitely related. In theory, I think we could implement `overflow` using `setClipChildren` by:

- Setting `setClipChildren(false)` by default. (This part, I got right.)
- When `overflow` is set to `hidden` on a `View`, we create an extra `ViewGroup` (child) within the normal `ViewGroup` (parent). Then, we can set `setClipChildren(true)` on the parent `ViewGroup` which will cause the child `ViewGroup` to be clipped to its bounds.

However, I think the tricky thing will be to create the child `ViewGroup` without incurring unintentional side effects.

I need to decide whether or not this is worth trying. The alternative is to add a new `clipChildren` boolean prop that is Android-only, but I really hate further bifurcating the platform. But for now, I am reverting my mistake.

Reviewed By: achen1

Differential Revision: D8690551

fbshipit-source-id: 1ba3bbcc5458ffbd5c475430ea0382b3fd0916b2
2018-06-29 12:18:27 -07:00
Tim Yung d9fa1d70dc RNTester: Better View Overflow Example
Summary:
Improves the examples in `ViewExample.js` that tests overflow behavior. Notable:

- Test view flattening behavior by setting `overflow` on views that only have other layout-only styles.
- Test the default behavior when `overflow` is not set at all.

Reviewed By: achen1

Differential Revision: D8690560

fbshipit-source-id: 6320ef51305952d13bf5724b369651fdfd32ff21
2018-06-29 12:18:27 -07:00
Tim Yung b283dcdd3e RNTester: Cleanup ViewExample.js
Summary: Minor cleanup of ViewExample.js in the RNTester.

Reviewed By: sahrens

Differential Revision: D8690133

fbshipit-source-id: d034f6d215679dac7f19fab90729bb7e7ef39edd
2018-06-29 12:18:27 -07:00
David Vacca 2f3f1b02cd Avoid cleaning up Owner of YGNode during clonning
Summary:
This diff refactors the cloning mechanism for YogaNode used from Fabric UI renderer and RN iOS graphs.
Previously, we were cleaning the owner of the child's cloned node inside the C++ implementation of YogaNode. This was a mistake because this modified the last commited YogaTree, causing side effect in RN iOS graphs.

Reviewed By: shergin

Differential Revision: D8672627

fbshipit-source-id: c9902d00690e0361fd58aed84b506c42258bd995
2018-06-28 22:48:35 -07:00
Rafael Oleza 519b0c319f Move babel-preset-react-native to metro repository
Summary:
@public

From now, `babel-preset-react-native` is going to be called `metro-react-native-babel-preset` and it's going to use the same versioning system that other metro packages.

This solves a few problems:

* Automated publishing of this package: Currently we have to publish this package manually from the RN repository, so it's hard to make changes to `babel-preset-react-native` and have them available on `metro` (the plugin version has to be manually updated, the package has to be manually published to npm and metro has to be change to depend on the new version).
* Transforming package code before publishing: By being in Metro repository, we're going to transform its source code before publishing it to npm automatically using the same infra as other metro packages, which is going to prevent issues like the current one with Node v6 due to trailing commas added by prettier: https://circleci.com/gh/facebook/metro/2125
* Workspace usage: Now, this package is not going to be installed via npm internally, but instead be used directly from the yarn workspace.

Reviewed By: mjesun

Differential Revision: D8677254

fbshipit-source-id: 14abdd218af64056625c5a997458bfe51d2101bc
2018-06-28 15:56:28 -07:00
Shane Osbourne dbc23466b3 fix: account for `ListHeaderComponent` length when calculating offset… (#17415)
Summary:
… in VirtualizedList - fixes #16612

Issue is detailed in #16612

<!--
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.

You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html

Happy contributing!

-->

I need `onViewableItemsChanged` to account for the length of any ListHeaderComponents

I couldn't find any tests that currently cover the use-case of a VirtualizedList + ListComponent + scroll with onViewableItemsChanged, so I have not added any tests - all previous tests pass however.

<!--
Help reviewers and the release process by writing your own release notes

**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 ]   [ {File}      ]
[ IOS      ]   [ FEATURE     ]   [ {Directory} ]   |-----------|
[ ANDROID  ]   [ MINOR       ]   [ {Framework} ] - | {Message} |
[----------]   [-------------]   [-------------]   |-----------|

[CATEGORY] [TYPE] [LOCATION] - 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
-->

[GENERAL][BUGFIX][VirtualizedList] - account for `ListHeaderComponent` length
Closes https://github.com/facebook/react-native/pull/17415

Differential Revision: D8683555

Pulled By: hramos

fbshipit-source-id: 05df7b79c16e3c07c12468e782f3c4b0bdce7403
2018-06-28 15:32:39 -07:00
Michał Mokijewski e131fffb37 fix undefined_arch error in Xcode 10 beta (#19841)
Summary:
Fixes #19774

I spotted that in  Xcode 10 beta `CURRENT_ARCH` is set to string `undefined_arch`.  This PR will add fallback based on platform name (simulators are `x86_64` and everything since iPhone 5s is `arm64`).
Closes https://github.com/facebook/react-native/pull/19841

Differential Revision: D8619897

Pulled By: hramos

fbshipit-source-id: ed2ebaca105c6dcb40099f1a4aebe34d0660130c
2018-06-28 15:32:39 -07:00
Ian Henshaw 3cd0737fe2 Fix for 17497 (#17498)
Summary:
Changed runAndroid.js to generate .packager.bat and launchPackager.ba…t to call it to setup the environment variable

<!--
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.

You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html

Happy contributing!

-->

Trying to use react-native on a Windows box with a virus killer that runs on port 8081...

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work. Bonus points for screenshots and videos!)
1) Start an android emulator
2) on a react-native project (with the changes), run `react-native run-android --port 9988`.
3) When the packager starts, verify that it states the correct port in the terminal window.
4) verify that the application correctly starts in the Emulator.

(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/react-native-website, and link to your PR here.)

<!--
Help reviewers and the release process by writing your own release notes

**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 ]   [ {File}      ]
[ IOS      ]   [ FEATURE     ]   [ {Directory} ]   |-----------|
[ ANDROID  ]   [ MINOR       ]   [ {Framework} ] - | {Message} |
[----------]   [-------------]   [-------------]   |-----------|

[CATEGORY] [TYPE] [LOCATION] - 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
-->
[INTERNAL] [BUGFIX] [./scripts] - Fixed runAndroid to enable the use of a package on port <> 8081 for Windows.
Closes https://github.com/facebook/react-native/pull/17498

Differential Revision: D8682067

Pulled By: hramos

fbshipit-source-id: 6604b827077b3a6a2da9914c1fd36dad6ef30e43
2018-06-28 14:17:38 -07:00
Ziqi Chen 5f8b44fd22 added check for iOS 11 on ignore inverted colors
Summary:
Added Check for iOS 11 before setting property for `accessibilityIgnoreInvertColor`

Builds on top of
https://our.intern.facebook.com/intern/diff/D8549084/

Reviewed By: shergin

Differential Revision: D8599698

fbshipit-source-id: c5cc26b4c1c20fb9cca5bfe7143fa9dcb217a2d7
2018-06-28 12:09:58 -07:00
mmacdougall 75a0273de2 - Correct fishhook import in RCTReconnectingWebSocket Fixes #16039 (#16271)
Summary:
RCTReconnectingWebSocket is not compiling correctly because of an incorrect import (https://github.com/facebook/react-native/issues/16039).

Everything build and run as usual.

[IOS] [BUGFIX] [Fishhook] - Correct fishhook import in RCTReconnectingWebSocket Fixes #16039
Closes https://github.com/facebook/react-native/pull/16271

Differential Revision: D8679758

Pulled By: hramos

fbshipit-source-id: b05dda3a01a68ace87f11889b84ce6b323e5c16a
2018-06-28 11:49:32 -07:00
Dulmandakh bfb68c09ee android targetSdkVersion is 26 (#19944)
Summary:
This PR sets gradle targetSdkVersion to 26, which will satisfy new requirements from Play Store. Also removed redundant config from manifest files.
Closes https://github.com/facebook/react-native/pull/19944

Differential Revision: D8679682

Pulled By: hramos

fbshipit-source-id: 5c900d47be1d8b81ce340e38a05d9b309da143c3
2018-06-28 11:49:32 -07:00
Tim Yung 6110a4cc75 RN: Add Support for `overflow` on Android
Summary:
Adds support for the `overflow` style property on React Native for Android.

This switches overflowing views to be visible by default with the ability to override this at the container level using `overflow: 'hidden'`. This is the same behavior as React Native on iOS.

One major caveat to this solution is that it uses `setClipChildren` which does not extend the hit target to the overflow draw regions. While this is a pitfall, the current state of React Native on Android where `overflow` is hidden by default (which is the opposite of iOS) is also a huge pitfall. But I think this moves us in the right direction because where you *don't* need the touch behavior, you are now able to leverage overflow draws.

Reviewed By: himabindugadupudi

Differential Revision: D8666509

fbshipit-source-id: 5e98e658e16188414016260224caa696b4fbd390
2018-06-28 01:31:56 -07:00
Dulmandakh 0a3055d98a gradle to set project-wide properties (#19845)
Summary:
Change HelloWorld app template to use project-wide properties. See https://developer.android.com/studio/build/gradle-tips#configure-project-wide-properties.

RN community and third-party native module developers adopted this, so it'll make RN package development and usage easy.

CI is green https://circleci.com/gh/dulmandakh/react-native/507
Closes https://github.com/facebook/react-native/pull/19845

Differential Revision: D8675341

Pulled By: hramos

fbshipit-source-id: 4ed06cd7ef7ae70f153d7f335ef8a9d1371f6ce0
2018-06-27 20:33:09 -07:00
Greg Price 5017b86b52 Fix extreme TextInput slowness on Android (#19645)
Summary:
This reverts 5898817fc "Implement letterSpacing on Android >= 5.0".
Testing shows that that commit is the cause of #19126, where in a
controlled TextInput after some text is first added, then deleted,
further interaction with the TextInput becomes extremely slow.

Fixes #19126.

Tried the repro case from #19126 without this change, then with it.
The issue reproduces, then doesn't.
Closes https://github.com/facebook/react-native/pull/19645

Differential Revision: D8675230

Pulled By: hramos

fbshipit-source-id: e2c2d352ee781898721b2dff4738572d1a6b7471
2018-06-27 20:01:59 -07:00
Kevin Gozali b3ef1c3a56 android: allow registering custom packager command handlers
Summary:
@public
Apps may need to listen for custom commands via the packager connection. This allows registering such listeners.

Reviewed By: raluca-elena

Differential Revision: D8654477

fbshipit-source-id: 5f17298a88fec31b8939236fef48ee46c0ba2ee8
2018-06-27 15:34:54 -07:00
Tim Wang bc2f12c68c Upgrade Jest to version 23.2.0 (#19876)
Summary:
@public

[Jest 23.2.0](https://github.com/facebook/jest/blob/master/CHANGELOG.md#2320) landed fix for `MockNativeMethods` access in react-native jest preset.

[GENERAL] [BUGFIX] [./package.json] - Upgrade Jest to version 23.2.0 and resolve `MockNativeMethods` access in `react-native` jest preset.

Closes https://github.com/facebook/react-native/pull/19876

Reviewed By: mjesun

Differential Revision: D8618905

Pulled By: hramos

fbshipit-source-id: 8463868b1e5dbcf430c76c0551e58d38e4c85a04
2018-06-27 13:06:12 -07:00
Dulmandakh b5fca80605 bump glog to 0.3.5 (#19890)
Summary:
bump glog to 0.3.5.

Version 0.3.4 added support for libc++ or clang. Starting with revision 11, Android NDK recommends and defaults to clang, so it'll add support for it.

notable changes in 0.3.4 and 0.3.5:
* add libc++ support
* reduce dynamic allocation from 3 to 1 per log message
* style fix for C++11
* Add CMake support
Closes https://github.com/facebook/react-native/pull/19890

Differential Revision: D8662179

Pulled By: hramos

fbshipit-source-id: ae2554d36e5b922e8649fc2ac7afc273a34cc127
2018-06-27 12:03:21 -07:00
Gregory Menezes 0d78415d7f Update buck website
Summary: Closes https://github.com/facebook/react-native/pull/19930

Differential Revision: D8663544

Pulled By: hramos

fbshipit-source-id: 09202851f2be7ea103057a7286aa960add536775
2018-06-27 12:03:21 -07:00
Dulmandakh f32032e460 bump double conversion to 1.1.6 (#19885)
Summary:
bump double conversion to 1.1.6.

Version 1.1.2 added ARM 64 support, so it's a step to add support for 64bit in RN.
Closes https://github.com/facebook/react-native/pull/19885

Differential Revision: D8662108

Pulled By: hramos

fbshipit-source-id: 446d83eab4df90efed9c08eac912e7f857b7f253
2018-06-27 11:50:02 -07:00
Miguel Jimenez Esun 770dd38bbb Upgrading Metro to 0.39.2
Summary: Upgrade to v0.39.2

Reviewed By: rafeca

Differential Revision: D8664421

fbshipit-source-id: 9c71928ab45cb7ef8f882d25cfca1ff0b1687039
2018-06-27 11:17:26 -07:00
Peter van der Zee 5bf3476133 Upgrade Prettier to 1.13.6 on fbsource
Reviewed By: zertosh

Differential Revision: D8638504

fbshipit-source-id: c6991b2e884e14868ddc1d9047a78191219d673f
2018-06-27 03:32:42 -07:00
David Vacca 506f920838 Remove UIImplementationProvider class and refactor UIManagerModule
Summary:
@public
This diff deprecates and deletes the UIImplementationProvider class.

It is not required to create an UIImplementation provider anymore, from now on the UIImplementation is created inside the UIManagerModule.

If you are using the UIImplementationProvider to create a ReactInstanceManager
e.g.:

```
    ReactInstanceManager =
        getReactInstanceManagerBuilder()
            ...
            .setUIImplementationProvider(...)
            ...
            .build();
```

Then you should just remove that line:
```
    ReactInstanceManager =
        getReactInstanceManagerBuilder()
            .set.....
            .build();
```

Reviewed By: achen1

Differential Revision: D8650376

fbshipit-source-id: 8d883295d8bf6578a99685edf6a2a84c6d0df0cf
2018-06-26 23:46:57 -07:00
David Vacca a373bf705d Remove implementation of Nodes (react/flat package)
Summary:
This diff removes the Nodes implementation from the source code. Why I'm deleting this code:
- I enabled nodes in catalyst app and it doesn't render even the first screen (see error images)
- This code is not being used at all inside facebook
- The last relevant commit I found was done in April 2017.
- Deleting this code make it easy to do refactors, as we don't have to modify this code.

When rendering an Image:
{F131075074}

When clicking on "RELOAD":
{F131075075}

Based on these errors I assume that this is not being used in Open Source. CC @[121800083:hramos]

Reviewed By: hramos

Differential Revision: D8640978

fbshipit-source-id: 243ee6440ebdbd24fd9f3daadc1066fd8487d9cc
2018-06-26 23:46:57 -07:00
Alexey Kureev c972a5c298 Fix: D8450498 breaks test_end_to_end job (#19910)
Summary:
Closes https://github.com/facebook/react-native/pull/19910

Because of the way react-native local-cli communicates with metro, getWatchFolders function was always returning an empty array that triggered an error.

Reviewed By: hramos

Differential Revision: D8650733

fbshipit-source-id: 502ca469cdbfa04dab5127c1e330dc1d34fc02f8
2018-06-26 19:01:56 -07:00
Douglas 569061dd83 Suppress spurious warning about RCTCxxModule (#19880)
Summary:
<!--
  Required: Write your motivation here.
  If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged.
-->

On a relatively stock / default setup of RN on iOS you'll see the warning "Class RCTCxxModule was not exported. Did you forget to use RCT_EXPORT_MODULE()?" pop up on every launch. This change resolves that issue.

Fixes #14806 .

This supersedes PR #19794 .

Try a fresh project by following the RN iOS tutorial, and observe that there are no more warnings after making this change.

[IOS] [MINOR] [CxxBridge] - Fix "Class RCTCxxModule was not exported"
Closes https://github.com/facebook/react-native/pull/19880

Differential Revision: D8653809

Pulled By: hramos

fbshipit-source-id: c48529c2d74ddd40a90bc0e06e405078e25b72e3
2018-06-26 17:47:28 -07:00
Tim Yung bfea0e5524 RN: Fix Element Inspector w/ Start + End Styles
Summary:
Fixes how the element inspector displays start and end styles (e.g. `marginStart` or `paddingEnd`).

@public

Reviewed By: TheSavior

Differential Revision: D8607581

fbshipit-source-id: e949927fd86e9b21a8ecf26fbf3e4863ad1486bd
2018-06-26 13:33:43 -07:00
Tim Yung 537a99539b YellowBox: Fix Off-By-1 Content Rendering Bug
Summary:
Fixes an off-by-one bug that was causing trailing single characters to be truncated from YellowBox.

This snuck in during the revamp of YellowBox. Whoops!

@public

Reviewed By: TheSavior

Differential Revision: D8607388

fbshipit-source-id: d0efac4dec361456ef58347a60eb1486a888624a
2018-06-26 13:33:42 -07:00
Tim Yung 8b6f1c37ce RN: Fix Element Inspector w/ Negative Margins
Summary:
There is a bug with the React Native element inspector when the inspected element has negative margins because negative margins actually subtract from the content width and height. This fixes the bug.

@public

Reviewed By: TheSavior

Differential Revision: D8607389

fbshipit-source-id: 2cea0d9160b5437fe775b2ba25373072bafd70b9
2018-06-26 13:33:42 -07:00
Valentin Shergin 80f7891287 Fabric: Embracing non-trivial default values of some Props
Summary:
@public
This is follow up for D8601600 and D8247652 (the last one has detailed explanation of the problem).
From this commit I propose that we have to follow simple rule:
If some prop has a default value which differs from the default value of its type, we have to specify it as {<value>} in .h file and explicitly in .m file, for all other props the default value must not be specified explicitly (in .h files it must be specified as {}).
The reason is that we have to embrase those cases and establish behaviour: if we change the default value in .h file, it always means that we have to change the value in .cpp file too.

Reviewed By: fkgozali

Differential Revision: D8601776

fbshipit-source-id: 3379aace4e2d72febb2b942a3da1cb24decf54be
2018-06-26 11:48:13 -07:00
Valentin Shergin d629e4b0e5 Fabric: Releasing image bitmap as part of `prepareForRecycle`
Summary:
@public
When some `RCTImageComponentView` is going to be recycled, it makes sense to free an associated bitmap because it will not be reused anyways.

Reviewed By: mdvacca

Differential Revision: D8601751

fbshipit-source-id: 1318622b66460b8e5588a4420c91c516fe2b1106
2018-06-26 11:48:12 -07:00
Valentin Shergin 97bc0c03ba Fabric: `fromDynamic` for float numbers was moved to `core` module
Summary:
@public
Otherwise, it can mess with implementation for `int`s and causes some errors where `float` implementation was requested but `int` was applied.

Reviewed By: mdvacca

Differential Revision: D8601752

fbshipit-source-id: cfe51b7785ff29ee4ad88f0f1cbfed335557d5ef
2018-06-26 11:48:12 -07:00
Sergei Dryganets 8ce758f48a Android ndk-build fix for ndk-r14+ (#18814)
Summary:
According to [ndk release notes](https://github.com/android-ndk/ndk/wiki/Changelog-r14-beta1#ndk-build) flag APP_ALLOW_MISSING_DEPS should be set to true in order to fix ndk-build tool.

If it builds it will work. On older ndk flag is ignored.

[ANDROID] [MINOR] [Application.mk]  - build with android-ndk-14+ supported
Closes https://github.com/facebook/react-native/pull/18814

Differential Revision: D8643513

Pulled By: hramos

fbshipit-source-id: d96f8c039a754b9b95839f0a0bd98fcfdaf39bd4
2018-06-26 11:02:10 -07:00
Himabindu Gadupudi 4ad13075c3 Image with null source should still respect `style`
Summary: D8576087 has all the details. Merge conflict messed up the diff hence a new one.

Reviewed By: yungsters

Differential Revision: D8628053

fbshipit-source-id: 8b211864f8f9d6b56f9469396eaa1d8291bbb56f
2018-06-26 11:02:10 -07:00
Dulmandakh 04366a9867 clean buck binary_jar warnings (#19769)
Summary:
This PR clears buck binary_jar warnings on CI.

CI is green https://circleci.com/gh/dulmandakh/react-native/458

Will see no binary_jar warnings on CI
Closes https://github.com/facebook/react-native/pull/19769

Reviewed By: mdvacca

Differential Revision: D8474558

Pulled By: hramos

fbshipit-source-id: a1e34a749218a6f87576475e49cbab52b0d3fafb
2018-06-26 10:46:52 -07:00
Miguel Jimenez Esun 14cd15ef54 Enforce component name
Summary: When snapshotting, do not get affected by the building process.

Reviewed By: rafeca

Differential Revision: D8638527

fbshipit-source-id: 8335fc55c0c85f2ff110db338a5000c7af4b29aa
2018-06-26 07:47:11 -07:00
Pascal Hartig fb2ec1ea47 Upgrade fbjni
Summary:
Sync fbjni with `libaries/fbjni`.

This includes a hack to fix a deadlock we found for cmake-debug variants only. This still gets us back in sync with other fbjni consumers which is going to save us trouble in the future if Yoga ever wants to make use of a newer feature.

Manual changes made in addition to the hand-crafted CMakeLists and cxx buck rules:

- `jni::isObjectRefType` has SDK lookup disabled.
- `fbjni/` path is changed back to `fb/` to retain compatibility with Yoga.

Reviewed By: priteshrnandgaonkar

Differential Revision: D8531991

fbshipit-source-id: 776f519e2e5f9bea37f55990348f7ed81c4860b4
2018-06-26 05:02:05 -07:00
David Vacca a07b66026d Improve performance for node reordering in FabricReconciler
Summary: This diff improves performance of re-layout and delivery of OnLayout events for Fabric surfaces.

Reviewed By: fkgozali

Differential Revision: D8622718

fbshipit-source-id: 703b6c3ca70b570e8fb79ae1c1e8d9e8fcd38658
2018-06-25 21:46:34 -07:00