Commit Graph

2978 Commits

Author SHA1 Message Date
gengjiawen 5dd9d72ec0 Fix ReactAndroid bundle issue (#22799)
Summary:
Related change: 0a293a014b.

Changelog:
----------

[Bugfix] [Android] - fix 64bit so bundle issue.
Pull Request resolved: https://github.com/facebook/react-native/pull/22799

Differential Revision: D13669711

Pulled By: hramos

fbshipit-source-id: 0234b4731db0c74c8e4b8b738a19ae971fadb702
2019-01-15 16:49:44 -08:00
Monte Thakkar 7fbccdea22 Updated RedBox screen (#22242)
Summary:
[Re: RedBox screen is a bit scary - Discussions and Proposals](https://github.com/react-native-community/discussions-and-proposals/issues/42)

Per hramos:
> The RedScreen was inspired by Ruby on Rails's error screen

> I do see the RedBox screen could be made less jarring while still successfully displaying all the information we need.

Hence jamonholmgren came up with the idea that only the header & footer of the RedBox screen could be red. This makes the content a bit more readable as well as makes the screen a little less intimidating.

Also frantic made the suggestion that since the bottom buttons are not as important, they don't need to stand out. Hence only the header of the RedBox screen which displays the error is made red.

Screenshots:
----------

<div style="flex-direction: row">
<img width="325" alt="orginal" src="https://user-images.githubusercontent.com/7840686/48322916-b4958b80-e5de-11e8-9276-33378d1b41c5.png">
<img width="320" alt="redbox_v2_ios" src="https://user-images.githubusercontent.com/7840686/48665300-cce32b80-ea60-11e8-8e8f-88f74bad30ca.png">

</div>

<div style="flex-direction: row">
<img width="300" alt="original_android" src="https://user-images.githubusercontent.com/7840686/48322958-d5f67780-e5de-11e8-891c-1b20bd00e67b.png">
<img width="300" alt="redbox_v2_android" src="https://user-images.githubusercontent.com/7840686/48665312-f13f0800-ea60-11e8-9fb6-47e03c809789.png">

</div>
Pull Request resolved: https://github.com/facebook/react-native/pull/22242

Reviewed By: hramos

Differential Revision: D13564287

Pulled By: cpojer

fbshipit-source-id: fcb6ba5e20d863f4b957d20f3787f5b7a365bfdb
2019-01-15 06:29:49 -08:00
Adam Comella 1bdb250906 Android Text: More robust logic for handling inherited text props (#22917)
Summary:
Purpose
----------

This commit fixes a bug and prepares us for adding support for the `maxContentSizeMultiplier` prop (it's currently only supported on iOS).

Details
----------

Today we don't explicitly track inheritance of text props. Instead we rely on `SpannableStringBuilder` to handle this for us. Consider this example:

```
<Text style={{fontSize: 10}}>
  <Text style={{letterSpacing: 5}}>
    ...
  </Text>
</Text>
```

In today's implementation, the inner text doesn't know about `fontSize` (i.e. its `mFontSize` instance variable is `Float.NaN`). But everything works properly because the outer `Text` told `SpannableStringBuilder` to apply the font size across the entire string of text.

However, today's approach breaks down when computing the value to apply to the `SpannableStringBuilder` depends on multiple props. Suppose that RN Android supported the `maxContentSizeMultiplier` prop. Then calculating the font size to apply to the `SpannableStringBuilder` would involve both the `fontSize` prop and the `maxContentSizeMultiplier` prop. If `fontSize` was set on an outer `Text` and `maxContentSizeMultiplier` was set on an inner `Text` then the inner `Text` wouldn't be able to calculate the font size to apply to the `SpannableStringBuilder` because the outer `Text's` `fontSize` prop isn't available to it.

The `TextAttributes` class solves this problem. Every `Text` has a `TextAttributes` instance which stores its text props. During rendering, a child's `TextAttributes` is combined with its parent's and handed down the tree. In this way, during rendering a `Text` has access to the relevant text props from itself and its ancestors.

This design is inspired by the [`RCTTextAttributes`](7197aa026b/Libraries/Text/RCTTextAttributes.m) class from RN iOS.

Bug Fix
----------

This refactoring happens to fix a bug. Today, when setting `fontSize` on nested Text, `allowFontScaling` is always treated as though it is true regardless of the value on the root `Text`. For example, the following snippets should render "hello" identically, Instead, the bottom snippet renders "hello" as though `allowFontScaling` is true.

```
<Text allowFontScaling={false} style={{fontSize: 50}}>hello</Text>
<Text allowFontScaling={false}><Text style={{fontSize: 50}}>hello</Text></Text>
```

(The repro assumes you've increased your device's font setting so that the font size multiplier is not 1.0.)

Introducing the `TextAttributes` class fixed this. It forced us to think about how inheritance should work for `allowFontScaling`. In the new implementation, `Text` components use the value of `allowFontScaling` from the outermost `Text` component. This matches the behavior on iOS (the `allowFontScaling` prop gets ignored on virtual text nodes because it doesn't appear [in this list](3749da1312/Libraries/Text/Text.js (L266-L269)).)
Pull Request resolved: https://github.com/facebook/react-native/pull/22917

Reviewed By: mdvacca

Differential Revision: D13630235

Pulled By: shergin

fbshipit-source-id: e58f458de4fc3cdcbec49c8e0509da51966ef93c
2019-01-14 16:28:19 -08:00
Ram N e6f7d69428 Move Android TurboModules to github
Summary:
This commit moves all the turbo module files for Android to Github.

Note that gradle build is not yet enabled.
Sample Turbo Modules will be added in a later commit.

Other missing features

- Support for `CxxModule`
- Remove usage of folly::dynamic for arguments and result conversion
- Support for Promise return types.

Reviewed By: mdvacca

Differential Revision: D13647438

fbshipit-source-id: 5f1188556d6c64bfa2b2fd2146ac72b0fb456891
2019-01-14 15:48:09 -08:00
Dulmandakh 64de0c0aef bump okhttp to 3.12.1 (#22877)
Summary:
Bump OkHTTP to 3.12.1.

Changelog:
----------
[Android] [Changed] - bump OkHTTP 3.12.1
Pull Request resolved: https://github.com/facebook/react-native/pull/22877

Differential Revision: D13639172

Pulled By: hramos

fbshipit-source-id: 780d10207877637592ea3eb25eff445bc2986f91
2019-01-14 10:34:30 -08:00
David Vacca adc1a95a3b Reuse ViewManagerRegistry between UIManagerModule and FabricUIManager
Summary: This diff reuses the ViewManager registry between UIManagerModule and Fabric, previously View Managers were being initialized twice (one for each UIManager), increasing Fabric TTI by ~77ms

Reviewed By: shergin

Differential Revision: D13640912

fbshipit-source-id: d7a9591084c66e4a2fc2384b2dae1b7fc5a228d0
2019-01-11 18:45:45 -08:00
Taras Tsugrii c458242d87 Reformat xplat build files according to new formatting rules.
Summary: drop-conflicts

Reviewed By: zertosh

Differential Revision: D13610808

fbshipit-source-id: 52c2a90bba3d9b0ac383f6e4a76b4fb3e60bf382
2019-01-10 20:00:42 -08:00
Arthur Lee 6c501eb666 Fix status bar default on Android
Summary: On Android, the status bar color is not always black by default. The existing code causes the status bar to revert to black once the last `<StatusBar>` component is unmounted from the "stack". This diff reverts the bar background color to what it was before, instead of assuming black.

Reviewed By: yungsters

Differential Revision: D13368136

fbshipit-source-id: ef0154f776607b57bb9400b72d521f5f485b0075
2019-01-10 14:53:22 -08:00
Ram N 93fa4efe06 Implement callback method
Summary: Implement callbacks in Turbo Module

Reviewed By: mdvacca

Differential Revision: D6744474

fbshipit-source-id: c896dbc936c3051d9f0e4582da042cd34da996bc
2019-01-09 10:48:02 -08:00
Adam Comella f6f8b092f9 Android TextInput: Improve application of styles for `value` prop (#22461)
Summary:
Prior to this change, when you passed text to `TextInput` via the `value` or `defaultValue` props, React Native didn't apply any of the styles in `buildSpannedFromShadowNode` to the text. This is because `spannedFromShadowNode` appends `value` after calling `buildSpannedFromShadowNode`. Many styles worked because their logic is included in both `buildSpannedFromShadowNode` and `ReactTextInputManager`. However, some only appear in `buildSpannedFromShadowNode` such as `textDecorationLine` (it would be good to understand why we need to duplicate styling logic in `buildSpannedFromShadowNode` & `ReactTextInputManager` and to know whether `ReactTextInputManager` should be handling `textDecorationLine`).

Also, this commit improves consistency between iOS and Android if you specify both `value` and children on a `TextInput`. Prior to this, iOS concatenated the strings such that the `value` prop came before the children whereas Android put the children before the `value` prop. Now Android matches iOS's behavior and puts the `value` prop before the children.

These appear to be regressions. The `value` prop used to be appended before calling `buildSpannedFromShadowNode` (this behavior appears to have been changed by accident in 80027ce6db (diff-4f5947f2fe0381c4a6373a30e596b8c3)).

The fix is to append the `value` prop before calling `buildSpannedFromShadowNode`. Additionally, we have to expose a new `start` parameter on `buildSpannedFromShadowNode` so that we can tell it to include the text from the `value` prop in the range that it styles. Without this, the start of the styled text would be immediately after `value` because `value` is appended before calling `buildSpannedFromShadowNode`
Pull Request resolved: https://github.com/facebook/react-native/pull/22461

Reviewed By: mdvacca

Differential Revision: D13282065

Pulled By: shergin

fbshipit-source-id: 4c99094741441cf54cdec0075bfd08ff7d889e66
2019-01-08 15:58:43 -08:00
David Aurelio 3e24710155 Apply clang-format rules
Summary:
@public

Formats Yoga's source according to our clang-format configuration

Reviewed By: SidharthGuglani

Differential Revision: D13596650

fbshipit-source-id: c3722d4eafd63b7596a8b1e85c0197e9d2d6cb7d
2019-01-08 12:51:43 -08:00
Luna Wei b5e6ae0fc4 Unify native props
Summary: Unify native props for Switch

Reviewed By: TheSavior, mdvacca

Differential Revision: D13563403

fbshipit-source-id: d219febf197bd024d1ef2acda9f42e40bdf39532
2019-01-07 15:39:21 -08:00
David Vacca 3d12ad5b1a workaround to prevent NPE in ReactViewGroup.dispatchProvideStructure
Summary:
This diff adds a workaround to prevent a NPE to be thrown when the user tap on Android assistant.
The Android stacktrace doesn't help to determine what is the root cause
This is affecting few users in the route: react_MarketplaceProductDetailsFromPostIDRoute

see https://our.intern.facebook.com/intern/logview/details/facebook_android_crashes/b4858cd35bd3496922e5dad4cca70fff/?trace_key=d46b402c3f0cc48c33613b279439a8bf for more details

Reviewed By: fkgozali

Differential Revision: D13586092

fbshipit-source-id: 70f44ab3e32b0c0334e61e8e358c1441944d2727
2019-01-04 18:59:20 -08:00
David Vacca dc114260d9 Integrate Fabric rendering system with ReactChoreographer
Summary:
This diff moves the dispatching of views to the React Choreographer, this help to sort the mount of views following the order specified in the ReactChoreographer class.
This also enables synchronous and correct order for mounting of views that are dispatched in the UI Thread.

Reviewed By: sahrens

Differential Revision: D13444487

fbshipit-source-id: d8a43f473b07c9ccf7ea3bc9ab90545ec3c9ecee
2019-01-02 17:24:32 -08:00
Christoph Nakazawa 117dcd9c58 Fix error message in NativeViewHierarchy
Summary: It was pointed out to me in https://github.com/facebook/react-native/pull/22508 by raphael-liu that the error message refers to the wrong tag. I didn't merge the PR because I don't have good insight into the effects it could cause, but we should at least fix the error message.

Reviewed By: TheSavior

Differential Revision: D13564266

fbshipit-source-id: fa76f0888364df329d052dbcc2050f906d39dcef
2019-01-01 19:45:33 -08:00
Luna Wei 3407a74957 ReactViewGroup.dispatchDraw NullPointerException handling
Summary: Add a catch statement for NPE around ViewGroup's dispatchDraw and log it

Reviewed By: mdvacca

Differential Revision: D13554441

fbshipit-source-id: a94d3db71678e17ef6bcda46689a069b85e460c5
2018-12-28 10:34:38 -08:00
Daniel Zlotin f3e5cce474 Use new JavaScriptCore from npm (#22231)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/22231

- Use clang instead of the deprecated gcc
- Use libc++ instead of the deprecated gnustl
- Updated gradle and android plugin version
- Fixed missing arch in local-cli template
- `clean` task should now always succeed
- `clean` task deletes build artifacts
- No need to specify buildToolsVersion. It's derived.
- Elvis operator for more readable code
Pull Request resolved: https://github.com/facebook/react-native/pull/22263

Reviewed By: hramos

Differential Revision: D13004499

Pulled By: DanielZlotin

fbshipit-source-id: da54bb744cedb4c6f3bda590f8c25d0ad64086ef
2018-12-27 14:51:03 -08:00
David Vacca 5957c8b370 Fix dispatching of events when EventDispatcher is not initialized
Summary:
This diff fixes a NPE that can occur when we force the dispatching of events when the EventDispatcher is not initized.

The fix consists on avoid posting the frame callback, if the internals of EventDispatcher are not initialized yet (same behavior used by the dispatchEvent method)

Reviewed By: fkgozali

Differential Revision: D13549147

fbshipit-source-id: ef3baeb536e8772fbd83024352a37af01c21d589
2018-12-26 21:15:02 -08:00
Kevin Gozali b748e83fbf android: worked around onTouchEvent exception
Summary: Catch `IllegalArgumentException: ReactViewPager.onTouchEvent` and ignore it (but log something) to work around this known bug in the Android SDK per https://github.com/chrisbanes/PhotoView/issues/31#issuecomment-19803926. Note that `onInterceptTouchEvent()` is already doing the same thing.

Reviewed By: yungsters

Differential Revision: D13550425

fbshipit-source-id: 9fa3a7a0ca0cd95aafa3bcae6a59e0d1e690b564
2018-12-26 14:54:34 -08:00
Tim Yung 19d69f9c22 RN: Workaround HorizontalMeasurementProvider Crash
Summary: Adds a workaround to `ReactTextView` for a crash that happens in `getOffsetForHorizontal`: https://issuetracker.google.com/issues/113348914

Reviewed By: mdvacca

Differential Revision: D13548917

fbshipit-source-id: 1c346283cd036c88d60a4b10890ade46c7e80eca
2018-12-26 11:46:38 -08:00
Taras Tsugrii 4d9f02f568 Do not use glob for static paths.
Summary:
```
>>> Lint for xplat/js/react-native-github/ReactAndroid/src/main/java/com/facebook/react/uimanager/BUCK:

   Warning  (BUILDIFIERLINT2) constant-glob
    Glob pattern `DisplayMetricsHolder.java` has no wildcard ('*'). Constant
    patterns can be error-prone, move the file outside the glob.
    (https://github.com/bazelbuild/buildtools/blob/master/WARNINGS.md#constant-glob)

              50 rn_android_library(
              51     name = "DisplayMetrics",
              52     srcs = glob([
    >>>       53         "DisplayMetricsHolder.java",
              54     ]),
              55     required_for_source_only_abi = True,
              56     visibility = [
```

Reviewed By: hramos

Differential Revision: D13519693

fbshipit-source-id: 1cb9721f541c22480e4dbdad03978092453b42ba
2018-12-20 11:17:02 -08:00
Max Sherman 8e79a74bc2 Add reset logic for RN perf counters
Reviewed By: alexeylang

Differential Revision: D13419565

fbshipit-source-id: 0b355ca2b672fd3ac8844e326c57cb5718da04c5
2018-12-20 10:39:31 -08:00
Alexander Kawrykow c1c2a5bce5 Increase idle timeout for react app tests
Summary:
Some snapshot tests (particularly those for which there is a lot of test data) can still timeout with "Timed out waiting for bridge and UI idle!" error.
Increasing the timeout to 4 minutes from 2 minutes

Differential Revision: D13523429

fbshipit-source-id: 18f04ea93e342d123eea4c4cd812bd3b1cc85ee0
2018-12-20 09:36:07 -08:00
Alex Dvornikov ae121690eb Update JSStackTrace to support segment ids
Reviewed By: jeanlauliac

Differential Revision: D13504222

fbshipit-source-id: ffda11697838ea03d15a28704d401e1051058b49
2018-12-18 16:23:39 -08:00
David Aurelio 6f70d4c0ac Roll back `-ffast-math`
Summary:
@public

`-ffast-math` does not have measurable performance benefits.

By using `NaN` for *undefined* values again, we can squeeze `YGFloatOptional` into 32 bits.
This will also enable us to store `YGValue` (or a variant of it) in 32 bits.

Reviewed By: astreet

Differential Revision: D13403925

fbshipit-source-id: b13d026bf556f24ab4699e65fb450af13a70961b
2018-12-13 07:16:45 -08:00
Ram N 96e4a72679 Add definations for ReadableArray and WritableArray
Summary: In TurboModules, we need to call into WritableArray and ReadableArray interfaces, not their implementations. By adding these interfaces, we can invoke the corresponding Java classes directly.

Reviewed By: fkgozali

Differential Revision: D6981870

fbshipit-source-id: 12b12b204a7d38b24363452ab574d88b827c907f
2018-12-13 07:09:24 -08:00
Ram N dc52cc5a8f Add defination for ReadableMap interface
Summary: In ReactNative, Native Modules usually use `ReadableMap` interface to take in arguments to methods, not `ReadableNativeMap`. Adding this interface defination to C++, so that with TurboModules, we could use it with `getMethod` definations.

Reviewed By: fkgozali

Differential Revision: D6721049

fbshipit-source-id: cb6e82d618338e54199c7dd066a846e71e742bc6
2018-12-12 10:36:51 -08:00
David Vacca f8bc32abb0 AutoFormat ReactWebViewManager
Summary: easy diff to auto format ReactWebViewManager using our current java code guidelines

Reviewed By: fkgozali

Differential Revision: D13425320

fbshipit-source-id: e59407751c324896e9d6aea8a356949e7cadccaa
2018-12-11 21:28:53 -08:00
David Vacca d1b90ee9e2 Allow to toggle Android WebView HardwareAcceleration from JS
Summary:
This diff exposes a new prop for WebView in Android to disable HardwareAcceleration.
Disabling hardware acceleration is sometimes required to workaround chromium bugs: https://bugs.chromium.org/p/chromium/issues/detail?id=501901

Reviewed By: fkgozali

Differential Revision: D13425243

fbshipit-source-id: e3cd53c72d01f74624b60834496f3cc44076b6b5
2018-12-11 21:28:53 -08:00
Comical DERSKEAL 448a665286 Update CompositeReactPackage.java (#21421)
Summary:
Fixed a typo in function doc.

Release Notes:
--------------
[INTERNAL][MINOR][CompositeReactPackage.java] - Updated a function documentation.

<!--
  **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/21421

Differential Revision: D13422878

Pulled By: hramos

fbshipit-source-id: ce08080d67652159c7f8bbb1ac8b0bfada814b4b
2018-12-11 18:46:26 -08:00
David Vacca aeaeac88f8 Disables StateListAnimator for React Slider Android 6 and 7
Summary:
This diff disables the StateListAnimator for the ReactSlider component in Android 6 and 7
This is this is a hack to prevent T37452851 and https://github.com/facebook/react-native/issues/9979

Reviewed By: yungsters

Differential Revision: D13404685

fbshipit-source-id: d4c4f8796664c890f6a6b3502d3493370e17c300
2018-12-11 11:54:59 -08:00
David Vacca 39b6890346 Fix crash when removing root nodes
Summary: If a children of a root node is being removed and the Root Node is empty, it was likely already removed and cleaned previously, likely due to a race condition caused by RN's async nature. In those cases, let's avoid crashing the app and instead silently ignore the root view removal.

Reviewed By: fkgozali

Differential Revision: D13405817

fbshipit-source-id: 0179d10a88a2d19f1db5ea35b48cb83d9d7429a6
2018-12-11 03:28:04 -08:00
Salakar 794d2264f9 Allow 'userInfo' for native promise.reject + add native error stack support (#20940)
Summary:
As mentioned [here](https://github.com/react-native-community/react-native-releases/issues/34#issuecomment-417718601), Android is missing native Promise reject with a `userInfo` `WritableMap` support and also `nativeStack` support (which addresses `TODO(8850038)`). This PR adds Android support for both of these.

React Native on iOS ([here](https://github.com/facebook/react-native/blob/master/React/Base/RCTUtils.m#L433)) and Windows ([here](https://github.com/Microsoft/react-native-windows/pull/732)) already support this so this is a relatively minor addition to bring Android in line with the other platforms. (JS support is also [here](https://github.com/facebook/react-native/blob/master/Libraries/BatchedBridge/NativeModules.js#L145-L148))

Existing methods remain unchanged other than general cleanup of variable names (`e -> throwable`) and adding code comments/docs.

Additionally, the `ShareTestModule` implementation of Promise (SimplePromise) was updated to reflect these changes - other line changes in this file are from formatting in Android Studio - if this is an issue let me know.

 - Currently inconsistent with other platforms.
 - Blocking a couple of issues over at [invertase/react-native-firebase](https://github.com/invertase/react-native-firebase) - save for re-writing everything to Promise resolve only - which is no small change and isn't a great solution either.
Pull Request resolved: https://github.com/facebook/react-native/pull/20940

Differential Revision: D13412527

Pulled By: cpojer

fbshipit-source-id: 2ca6c5f3db9ff2c2986b02edda80bc73432f66d3
2018-12-10 21:15:55 -08:00
Christoph Nakazawa 63a6bb7637 Remove remaining references to local-cli
Summary: This removes the remaining references to `local-cli`. We already have a `cli.js` file on the root that was just forwarding to the local-cli folder, so I removed that. It also seems that `setupBabel.js` is no longer necessary in RN.

Reviewed By: TheSavior

Differential Revision: D13396218

fbshipit-source-id: a945cb91dae39c4b58c5cabcca6b0f0328fc4717
2018-12-10 19:08:10 -08:00
Elliott Sprehn 167d7861cb Don't crash on second resolve or reject in PromiseImpl. (#20303)
Summary:
Promise semantics per JS should allow calling resolve or reject repeatedly without crashing. Only the first one should do anything, but others should be allowed. This change fixes the Java bridge for Android. A separate change is needed for iOS.

Issue #20262
Pull Request resolved: https://github.com/facebook/react-native/pull/20303

Differential Revision: D13396975

Pulled By: cpojer

fbshipit-source-id: 81f14f73654fa7c44e043f574a39fda481ace44b
2018-12-10 05:56:22 -08:00
David Aurelio 90f582ffb9 Back out Stack D13119110..D13236159
Summary: backout, causes failures

Reviewed By: adityasharat

Differential Revision: D13376210

fbshipit-source-id: 1fa8823f2dce601c47738f34ddb2674288197e79
2018-12-07 13:01:28 -08:00
David Vacca 69c8aa64e5 Fix NPE when opening Google Search Assist when a RN Dialog is displayed
Summary:
This fixes app crashes on opening android search assistant when a RN modal is visible. The root cause is that ViewGroup.dispatchProvideStructure() method uses the private variable 'mChildren' to access the children of a view group instead of the publicApi.

This fixes the top crash for the react_MarketplaceProductDetailsNonIPadRoute route.

This also fixes github issues:
https://github.com/facebook/react-native/issues/15932
https://github.com/facebook/react-native/issues/13201
https://github.com/facebook/react-native/issues/15440

that were closed without a fix

Reviewed By: PeteTheHeat

Differential Revision: D13375993

fbshipit-source-id: d603cb4ef65a423c63a6ef2b51235702c7dbffcb
2018-12-07 09:55:40 -08:00
Lea Bärtschi cbe7d41f3f Remove trailing slash from origin header if no port is specified (#22290)
Summary:
Fixes #16304

The standard format for origin HTTP headers does not allow a trailing slash. In order to not get warnings when connecting a websocket, I removed the trailing slash when generating the default origin HTTP header for the websocket connect request.

Release Notes:
----------
[Android] [Fixed] - Fixed default origin header for websocket connections to match the standard format (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin) in WebSocketModule
Pull Request resolved: https://github.com/facebook/react-native/pull/22290

Differential Revision: D13374345

Pulled By: cpojer

fbshipit-source-id: 1173241f2b6912fd6df5e196053a950bb42ff01b
2018-12-06 21:36:19 -08:00
ferrannp e8a6cb5e18 Android: Adding sendIntent on Linking module (#22302)
Summary:
This PR implements "Add a standardized way to send intents on Android" discussed in https://github.com/react-native-community/discussions-and-proposals/issues/34.
Pull Request resolved: https://github.com/facebook/react-native/pull/22302

Differential Revision: D13374186

Pulled By: cpojer

fbshipit-source-id: 2f0b9b9f46e99f382b6c35b1914e75df23a7fd74
2018-12-06 21:13:58 -08:00
David Aurelio 57a38263bf Roll back `-ffast-math`
Summary:
@public

`-ffast-math` does not have measurable performance benefits.

By using `NaN` for *undefined* values again, we can squeeze `YGFloatOptional` into 32 bits.
This will also enable us to store `YGValue` (or a variant of it) in 32 bits.

Reviewed By: SidharthGuglani

Differential Revision: D13119110

fbshipit-source-id: 4e6964240bf74ebc22d8783107b89d536a1a0842
2018-12-06 07:38:43 -08:00
David Vacca 844e11967d Fix dispatch of OnLayout event for first render
Summary: This diff ensures that Events delivered from the C++ side are actually processed. This is done forcing the execution of AsyncEventBeat.beat() in these cases

Reviewed By: shergin

Differential Revision: D13313955

fbshipit-source-id: b2785647913a640c2d557f4fa08d447845a540e9
2018-12-05 18:00:39 -08:00
Max Sherman 1fe947d956 Record thread cpu time for native modules thread
Summary: I want the same instrumentation we did for the JS thread for the NM thread.  This diff adds thread cpu time.

Reviewed By: alexeylang

Differential Revision: D13328876

fbshipit-source-id: 7b310956c52907ffbd881f864e1f8e774853d7f5
2018-12-05 12:43:17 -08:00
Dulmandakh 9d00d4d5bb Bump Android SDK to 28, Build Tools to 28.0.2, Gradle to 4.7, Gradle Plugin to 3.2.0 (#21632)
Summary:
This PR is bumping compileSdkVersion to 28, buildToolsVersion to 28.0.2, Gradle to 4.7, Android Gradle plugin to 3.2.0.

Gradle 4.7 added support for Java 10 and 11.

allow-large-files

Release Notes:
--------------
[ANDROID] [ENHANCEMENT] [SDK] - bump to 28

Pull Request resolved: https://github.com/facebook/react-native/pull/21632

Reviewed By: mdvacca

Differential Revision: D13084836

Pulled By: hramos

fbshipit-source-id: e0f493881e80e87faf8c3ef1ac77044495966a49
2018-12-05 09:06:31 -08:00
Max Sherman 2330843fa7 Add API for instrumentation to learn the starting wall time of bg threads
Summary: Computing things like "page faults since this thread was created" or "cpu time spent on this thread since it was created" is pretty easy - just measure it when you want it.  However, if you want to know "how much wall time has elapsed since this thread was created" you need to record some timing info when the thread is created.  This diff adds a an API for querying that from the RN thread holder abstraction.

Reviewed By: alexeylang

Differential Revision: D13246235

fbshipit-source-id: d36af61dbe27f662980fe508b2644e9d5255bb7e
2018-12-03 11:50:36 -08:00
David Vacca 0f3be77b7d fix possible NPE in StatusBarModule
Summary:
This diff fixes a NPE happening in StatusBarModule when the style passed by parameter is null.
Even if JS shoulnd't send a null value, this method should not crash with an NPE. I'm not changing behavior, only avoiding NPE when status is null

Reviewed By: RSNara

Differential Revision: D13287057

fbshipit-source-id: cc5ac4e97083d63f2bf65c03bac0dc9bce976423
2018-11-30 19:29:48 -08:00
Emily Janzer a2ead1c7b5 Decouple JSBundleLoader from CatalystInstanceImpl
Summary: Right now JSBundleLoader is tightly coupled to CatalystInstanceImpl; this diffs adds an interface, JSBundleLoaderDelegate, that CatalystInstanceImpl implements so that we can use the bundle loader with other classes.

Reviewed By: mdvacca

Differential Revision: D13216752

fbshipit-source-id: fc406ef30f12ed9d3ed13a062dedd7b33f3b7985
2018-11-30 16:51:26 -08:00
Ram N fe97458b03 Add more information in ending Marker Tags
Summary: Added more information to ending tags so that they can be connected with the starting tags.

Reviewed By: mdvacca

Differential Revision: D7121038

fbshipit-source-id: 72d51952955e22a4c8d66c4f9e75a3fd9d34df7f
2018-11-30 11:30:58 -08:00
David Aurelio ea734dcfbf Adjust yearless format for MIT license
Summary:
@public

Adjust license headers throughout the project

Reviewed By: SidharthGuglani

Differential Revision: D13255691

fbshipit-source-id: 98be2aa372a94e7a54a65e3d64e5c6a436b18083
2018-11-29 11:37:51 -08:00
Panagiotis Vekris ef2084c6bd 0.87.0 in xplat/js
Summary: allow-large-files

Reviewed By: samwgoldman

Differential Revision: D13230018

fbshipit-source-id: f07e2371a3b7382de0592cc7c7b20e7f4faa6889
2018-11-28 17:32:50 -08:00
Alexandre Kirszenberg e81adb99f3 DeltaClient: split DeltaBundle's modules into added and modified
Summary:
The reasoning behind this change is that right now, having both added and modified modules inside of a single `modules` field doesn't allow for basic operations like combining two deltas.

For instance, say I have three different bundle revisions: A, B and C.

Module 42 was added in B, and then removed in C.

A->B = `{modules: [42, "..."], deleted: []}`
B->C = `{modules: [], deleted: [42]}`
A->C = `{modules: [], deleted: []}`

However, were we to compute A->C as the combination of A->B and B->C, it would result in `{modules: [], deleted: [42]}` because we have no way of knowing that module 42 was only just added in B.

This means that the `deleted` field of delta X->Y might eventually contain module ids that were never present in revision X, because they were added and then removed between revisions X and Y.

The last time I changed the delta format, we had a few bug reports pop out from people who had desync issues between their version of React Native and their version of Metro. As such, I've tried to make this change backwards compatible in at least one direction (new RN, old Metro). However, this will still break if someone is using a newer version of Metro and an older version of RN. I created T37123645 to follow up on this.

Reviewed By: rafeca, fromcelticpark

Differential Revision: D13156514

fbshipit-source-id: 4a4ee3b6cc0cdff5dca7368a46d7bf663769e281
2018-11-28 02:50:56 -08:00