Граф коммитов

17787 Коммитов

Автор SHA1 Сообщение Дата
James Treanor ca9e108110 Remove 's.static_framework = true' requirement for podspec (#25816)
Summary:
As part of the fix for https://github.com/facebook/react-native/issues/25349 I added `s.static_framework = true` to each podspec in repo (see https://github.com/facebook/react-native/pull/25619#discussion_r306993309 for more context).

This was required to ensure the existing conditional compilation with `#if RCT_DEV` and `__has_include` still worked correctly when `use_frameworks!` is enabled.

However, fkgozali pointed out that it would be ideal if we didn't have this requirement as it could make life difficult for third-party libraries.

This removes the requirement by moving `React-DevSupport.podspec` and `React-RCTWebSocket.podspec` into `React-Core.podspec` as subspecs. This means the symbols are present when `React-Core.podspec` is built dynamically so `s.static_framework = true` isn't required.

This means that any `Podfile` that refers to `React-DevSupport` or `React-RCTWebSocket` will need to be updated to avoid errors.

## Changelog

I don't think this needs a changelog entry since its just a refinement of https://github.com/facebook/react-native/pull/25619.
Pull Request resolved: https://github.com/facebook/react-native/pull/25816

Test Plan:
Check `RNTesterPods` still works both with and without `use_frameworks!`:

1. Go to the `RNTester` directory and run `pod install`.
2. Run the tests in `RNTesterPods.xcworkspace` to see that everything still works fine.
3. Uncomment the `use_frameworks!` line at the top of `RNTester/Podfile` and run `pod install` again.
4. Run the tests again and see that it still works with frameworks enabled.

Reviewed By: hramos

Differential Revision: D16495030

Pulled By: fkgozali

fbshipit-source-id: 2708ac9fd20cd04cb0aea61b2e8ab0d931dfb6d5
2019-07-25 11:46:43 -07:00
Moti Zilberman 71c84cf6be Implement globalEvalWithSourceUrl
Summary:
Implements a new host function on the global object in debug builds, called `globalEvalWithSourceUrl`. This performs a global `eval()` and attaches a URL/filename to the evaluated script (in stack traces, debuggers, etc).

It serves a similar purpose to the `//# sourceURL=` directive (which most JS engines support, but JSC doesn't) and to the old `nativeInjectHMRUpdate` function which was dropped in the JSC->JSI migration.

Reviewed By: cpojer

Differential Revision: D16491506

fbshipit-source-id: bd9a89311dcbb1d0baece77ead16b9ecfb13bfe3
2019-07-25 10:23:42 -07:00
Valentin Shergin 2c136192a3 Fabric: Removing workaround from RCTScrollViewComponentView.mm
Summary: We don't need it anymore.

Reviewed By: mdvacca

Differential Revision: D16454620

fbshipit-source-id: 3a92c62e93cf6968b8344003a19fe10b92a5d274
2019-07-25 10:00:29 -07:00
Fred Liu 983ba63025 Back out "[RN][Android] Release underlying resources when JS instance is GC'ed on Android"
Summary: Original commit changeset: 12f14fa4a582

Reviewed By: furdei

Differential Revision: D16494091

fbshipit-source-id: f3080873a11ebb376e819b102fc13efe97146a89
2019-07-25 08:43:07 -07:00
Christoph Nakazawa abd7faf354 Use prettyFormat for Metro logging
Summary: Right now we are using `JSON.stringify` which is very lossy with regards to JavaScript data types like functions, `undefined`, NaN and others. This diff switches the logging on the client side to use `prettyFormat` which is part of Jest. It allows to handle much richer log messages.

Reviewed By: gaearon

Differential Revision: D16458775

fbshipit-source-id: e1d2c125eb8357a9508521aa15510cb4f30a7fa9
2019-07-25 01:24:55 -07:00
David Vacca e42009b784 Deprecate UIManager.measureLayoutRelativeToParent
Summary:
UIManager.measureLayoutRelativeToParent will not be supported as part of fabric.
This diff deprecates this method in the current version or React Native.

Reviewed By: fkgozali

Differential Revision: D16471845

fbshipit-source-id: acfda9bfb2dd8553ff8e359ea2c8d7d88a14c6d2
2019-07-25 01:00:06 -07:00
James Treanor 8131b7bb7b CocoaPods frameworks compatibility: Step 2 (#25619)
Summary:
This is my proposal for fixing `use_frameworks!` compatibility without breaking all `<React/*>` imports I outlined in https://github.com/facebook/react-native/pull/25393#issuecomment-508457700. If accepted, it will fix https://github.com/facebook/react-native/issues/25349.

It builds on the changes I made in https://github.com/facebook/react-native/pull/25496 by ensuring each podspec has a unique value for `header_dir` so that framework imports do not conflict. Every podspec which should be included in the `<React/*>` namespace now includes it's headers from `React-Core.podspec`.

The following pods can still be imported with `<React/*>` and so should not have breaking changes: `React-ART`,`React-DevSupport`, `React-CoreModules`, `React-RCTActionSheet`, `React-RCTAnimation`, `React-RCTBlob`, `React-RCTImage`, `React-RCTLinking`, `React-RCTNetwork`, `React-RCTPushNotification`, `React-RCTSettings`, `React-RCTText`, `React-RCTSettings`, `React-RCTVibration`, `React-RCTWebSocket` .

There are still a few breaking changes which I hope will be acceptable:

- `React-Core.podspec` has been moved to the root of the project. Any `Podfile` that references it will need to update the path.
- ~~`React-turbomodule-core`'s headers now live under `<turbomodule/*>`~~ Replaced by https://github.com/facebook/react-native/pull/25619#issuecomment-511091823.
- ~~`React-turbomodulesamples`'s headers now live under `<turbomodulesamples/*>`~~ Replaced by https://github.com/facebook/react-native/pull/25619#issuecomment-511091823.
- ~~`React-TypeSaferty`'s headers now live under `<TypeSafety/*>`~~ Replaced by https://github.com/facebook/react-native/pull/25619#issuecomment-511040967.
- ~~`React-jscallinvoker`'s headers now live under `<jscallinvoker/*>`~~ Replaced by https://github.com/facebook/react-native/pull/25619#issuecomment-511091823.
- Each podspec now uses `s.static_framework = true`. This means that a minimum of CocoaPods 1.5 ([released in April 2018](http://blog.cocoapods.org/CocoaPods-1.5.0/)) is now required. This is needed so that the ` __has_include` conditions can still work when frameworks are enabled.

Still to do:

- ~~Including `React-turbomodule-core` with `use_frameworks!` enabled causes the C++ import failures we saw in https://github.com/facebook/react-native/issues/25349. I'm sure it will be possible to fix this but I need to dig deeper (perhaps a custom modulemap would be needed).~~ Addressed by 33573511f0.
- I haven't got Fabric working yet. I wonder if it would be acceptable to move Fabric out of the `<React/*>` namespace since it is new? �

## Changelog

[iOS] [Fixed] - Fixed compatibility with CocoaPods frameworks.
Pull Request resolved: https://github.com/facebook/react-native/pull/25619

Test Plan:
### FB

```
buck build catalyst
```

### Sample Project

Everything should work exactly as before, where `use_frameworks!` is not in `Podfile`s. I have a branch on my [sample project](https://github.com/jtreanor/react-native-cocoapods-frameworks) here which has `use_frameworks!` in its `Podfile` to demonstrate this is fixed.

You can see that it works with these steps:

1. `git clone git@github.com:jtreanor/react-native-cocoapods-frameworks.git`
2. `git checkout fix-frameworks-subspecs`
3. `cd ios && pod install`
4. `cd .. && react-native run-ios`

The sample app will build and run successfully. To see that it still works without frameworks, remove `use_frameworks!` from the `Podfile` and do steps 3 and 4 again.

### RNTesterPods

`RNTesterPodsPods` can now work with or without `use_frameworks!`.

1. Go to the `RNTester` directory and run `pod install`.
2. Run the tests in `RNTesterPods.xcworkspace` to see that everything still works fine.
3. Uncomment the `use_frameworks!` line at the top of `RNTester/Podfile` and run `pod install` again.
4. Run the tests again and see that it still works with frameworks enabled.

Reviewed By: PeteTheHeat

Differential Revision: D16465247

Pulled By: PeteTheHeat

fbshipit-source-id: cad837e9cced06d30cc5b372af1c65c7780b9e7a
2019-07-24 23:27:09 -07:00
Emily Janzer 7244bae47d Rename addRootView to startSurface
Summary: I'm only renaming the new `addRootView` that I added (which takes the moduleName, and uses startSurfaceWithConstraints), since the other one implements the UIManager interface method that's shared with paper.

Reviewed By: shergin

Differential Revision: D16432425

fbshipit-source-id: 392af42690052551504676df776bac6d1a968785
2019-07-24 20:15:39 -07:00
Emily Janzer 7266ebda56 Move RuntimeExecutor declaration to react/utils
Summary: Right now RuntimeExecutor is only used in Fabric. Moving it out of Fabric's uimanager/primitives.h and into react/utils so we can use it more broadly.

Reviewed By: shergin

Differential Revision: D16385366

fbshipit-source-id: 96063e536e1480bac078a9376fe55f7d8750477e
2019-07-24 19:48:33 -07:00
Eli White 91681016e8 Add utility methods for enabling high quality error messages
Summary:
These helper functions will be used by the ObjC generated code for support on commands.

This is an example of what that code might look like and how these functions will be used.
```
- (void)handleCommand:(NSString const *)commandName args:(NSArray const *)args
{
  if ([commandName isEqualToString:@"scrollTo"]) {
    if ([args count] != 2) {
      RCTLogError(
          @"%@ command %@ received %d arguments, expected %d.", @"ScrollView", @"scrollTo", (int)[args count], 2);
      return;
    }

    NSObject *arg0 = args[0];
    if (!RCTValidateTypeOfViewCommandArgument(arg0, [NSNumber class], @"number", @"ScrollView", @"scrollTo", @"1st")) {
      return;
    }

    int x = [(NSNumber *)arg0 intValue];

    NSObject *arg1 = args[1];
    if (!RCTValidateTypeOfViewCommandArgument(arg1, [NSNumber class], @"number", @"ScrollView", @"scrollTo", @"2nd")) {
      return;
    }
    int y = [(NSNumber *)arg1 intValue];

    [self scrollTo:x y:y];
  } else if ([commandName isEqualToString:@"scrollToEnd"]) {
    if ([args count] != 0) {
      RCTLogError(
          @"%@ command %@ received %d arguments, expected %d.", @"ScrollView", @"scrollToEnd", (int)[args count], 0);
      return;
    }

    [self scrollToEnd];
  }
}
```

Reviewed By: JoshuaGross

Differential Revision: D16474117

fbshipit-source-id: 2bb9f01d7c97cc59e9373b7759021c65980fcc0e
2019-07-24 19:39:29 -07:00
Eli White a24a9b9946 Back out "Back out D16434402, D16434634"
Summary: Reverting the revert and fixing the snapshot tests

Reviewed By: JoshuaGross

Differential Revision: D16467242

fbshipit-source-id: 23ed4122da226ea815d3766098da4400e7ad9442
2019-07-24 16:50:13 -07:00
Ramanpreet Nara 76ff31616e Add NativeModule Spec for PushNotificationManager
Summary: In OSS, we only had an iOS implementation of this NativeModule. Internally, we have several different Android implementations. The iOS and the Android implementations don't have the same APIs. So, I didn't name this Spec generically `NativePushNotificationManager`.

Reviewed By: mdvacca

Differential Revision: D16390844

fbshipit-source-id: 97b53042892f80089fc8cf5e1c8a06bd49696594
2019-07-24 15:24:50 -07:00
Ramanpreet Nara ccde2fda6a Add NativeModule Spec for StatusBarManager
Summary: This diff introduces NativeStatusBarManager.

Reviewed By: mdvacca

Differential Revision: D16371384

fbshipit-source-id: a5485f8dec53a8f3f5bd22ad76e9f8ee0fc56f4c
2019-07-24 15:24:49 -07:00
Jason Carreiro 136dde359c Back out D16434402, D16434634
Summary: build-break

fbshipit-source-id: d0786ba78689113be543535bd117c3d7f1de9996
2019-07-24 13:57:46 -07:00
Dan Abramov 17f8e5810f Enable by default
Summary:
This enables Fast Refresh by default.

More concretely:

* For clean installs, it's enabled by default. (You can opt out at any time via the dev menu.)

* For updated DEV apps (on device or simulator), it flips from disabled to enabled **but only if you never touched the setting before**.

* If you previously explicitly enabled and/or later disabled it, we keep your previous setting.

Reviewed By: yungsters

Differential Revision: D16442656

fbshipit-source-id: 1bfe0bf4bcf2830284f9c757fbfacc10db92acb4
2019-07-24 13:08:56 -07:00
Eli White fbd5dee1e4 Fix commands with no args
Summary: Fixing a typo

Reviewed By: JoshuaGross

Differential Revision: D16434634

fbshipit-source-id: 72a6b698bcd0ba9c10dfbdf264011e0a31ea06b6
2019-07-24 12:45:16 -07:00
Eli White 4eca2e226c Add receiveCommand to the Java Delegate
Summary: Adding support for receiving commands and calling methods defined on the interface in c7ee38149d

Reviewed By: JoshuaGross

Differential Revision: D16434402

fbshipit-source-id: a539050a1a2b2a67f9ba7145ed789de700461589
2019-07-24 12:45:15 -07:00
zhongwuzw 4ab9da134c Fixes iOS packager connection not work (#25803)
Summary:
Macro `ENABLE_PACKAGER_CONNECTION` invalid because of `__has_include` can't find the header now. Leads to packager connection not work anymore.

## Changelog

[iOS] [Fixed] - Fixes iOS packager connection not work
Pull Request resolved: https://github.com/facebook/react-native/pull/25803

Test Plan:
1. Init a new project.
2. Run and input `curl http://localhost:8081/reload` in terminal. Reload operation can execute.

Differential Revision: D16458384

Pulled By: TheSavior

fbshipit-source-id: 27e7e02b5666a2131e995accd34e4da7bad42335
2019-07-24 11:18:17 -07:00
Dan Abramov 5e960e30eb Don't show warnings unless we managed to connect
Summary:
On iOS we don't call `HMRClient.setup()` when Metro is off. So we don't bump into any odd cases.

But on Android, we do call `HMRClient.setup()` even if Metro is off. As a result, we might show a warning about Metro not running to a native engineer who doesn't care (because they don't intend to work on JS).

We could fix this on Android on the native side. And we probably should.

But we can also strengthen it here. The idea is that we should only show warnings about disconnecting from Metro *if we ever managed to successfully connect in the first place*. Otherwise, we can assume that you didn't mean to connect.

If the user is trying to determine the source of the problem, they can still do a full Refresh (on iOS this will show a message about needing Metro, on Android it would show a redbox). So this diff makes the disconnected behavior closer to how it worked before Fast Refresh.

Reviewed By: sahrens

Differential Revision: D16460439

fbshipit-source-id: bf962ff34c25d9734d9668dd583591acacb98253
2019-07-24 11:11:46 -07:00
Dan Abramov 2a3ac0429b Tweak messages and fix the warning condition
Summary:
Two changes:

1. If you're connected at startup, and then disconnect, we're supposed to show a yellow box. Looks like we weren't doing it for a few days because the field we were checking has turned into a method.

2. I changed the wording back to remove "Metro" since the packager may be Haul, for example. So I'm just calling it "development server". Does that seem reasonable? I also removed mentions of Fast Refresh since it's not actually relevant to the problem.

Reviewed By: cpojer

Differential Revision: D16459080

fbshipit-source-id: c9c1f19718d522c745e4107a3e7e3a6c63f82642
2019-07-24 11:11:46 -07:00
Peter Argany 8a80d613f5 Deprecate RCTImageLoader category of RCTBridge [2/N]
Summary: We no longer want to access RCTImageLoader from the bridge.

Reviewed By: shergin

Differential Revision: D16389383

fbshipit-source-id: 8e006bf0e2e2651f3ac036c09e589213ac9d29f9
2019-07-24 10:51:13 -07:00
Rick Hanlon e9af5726c5 Update java prop file names to include ViewManager
Summary:
Changes the java props class and file names to include "ViewManager" as in:
- ExampleViewManagerInterface
- ExampleViewManagerDelegate

Reviewed By: JoshuaGross, makovkastar

Differential Revision: D16418965

fbshipit-source-id: f8b2f8fe4145c0ada9dc7c5234fcc41935783374
2019-07-24 10:36:24 -07:00
Rick Hanlon ac21f04532 Add @Nullable for Java props
Summary: Adds Nullable for object in the java props codegen

Reviewed By: JoshuaGross

Differential Revision: D16418332

fbshipit-source-id: f698eea3d1f920429488d4988068db7e18f5e3cb
2019-07-24 10:36:24 -07:00
Rick Hanlon df0d6e28e5 Add default prop handling
Summary: Adds handling for default props for java props

Reviewed By: JoshuaGross

Differential Revision: D16417825

fbshipit-source-id: 00ad2ace33409e9c204de16970ff0b7f756fda71
2019-07-24 10:36:24 -07:00
Rick Hanlon 34505dba05 Update Java prop casting
Summary: Updates the casting for Java props

Reviewed By: JoshuaGross

Differential Revision: D16417805

fbshipit-source-id: 7881ff984527555a4905b62d83751ed2a43b1070
2019-07-24 10:36:24 -07:00
Rick Hanlon 58d3cb2fff Remove switch statement if there are no props
Summary: Don't generate the switch statement if there are no props

Reviewed By: JoshuaGross

Differential Revision: D16417803

fbshipit-source-id: 87eda785c836f5e406e27d3c2990ec7f69422bdb
2019-07-24 10:36:23 -07:00
Michał Osadnik d143edc298 Add test determining if ObjC files are compiling
Summary: Add compilation rule for objC emptyFile which includes generated objC files generated from fixtures.

Reviewed By: RSNara

Differential Revision: D16439245

fbshipit-source-id: 6529b2232625a72e2430f1d415511196abc08ecb
2019-07-24 08:33:56 -07:00
Michał Osadnik 451171acb1 generate bindings for objcpp TM
Summary: In this diff I add generetion of bindings for objcpp TM.

Reviewed By: RSNara

Differential Revision: D16438572

fbshipit-source-id: e92163b1b42306eec931e465b89b176f0fd8a658
2019-07-24 08:33:56 -07:00
Michał Osadnik 69888b0820 Add generating of objcpp headers
Summary: In this diff I add generator for Objcpp headers

Reviewed By: RSNara

Differential Revision: D16438346

fbshipit-source-id: 63a632d4bf40811a8838f3dcd2a92b2f7cf3ce3a
2019-07-24 08:33:56 -07:00
Christoph Nakazawa 81ec2112a1 Use HMRClient to send console logs to Metro
Summary:
This change switches the sending of log messages to Metro from HTTP over to WebSocket. This is what I should have done from the beginning *however* I only spent very little time on this initially, didn't realize that it would be a popular feature *and* we didn't have a persistent WebSocket connection on the client before that was always on. Together with D16442656 we can finally make this happen!

This change:
* Changes the `fetch` call to `HMRClient.log`
* Removes the middleware and integrates logging with `HmrServer` directly in Metro.
* Simplifies the logging logic as WebSockets guarantee messages are processed in order.

This also fixes an issue makovkastar identified when using the `MessageQueue` spy: because we send messages back and forth over the bridge, using `console.log` within `MessageQueue`'s spy method will actually cause an infinite logging loop. This is the proper solution to that problem instead of hacking around it using custom headers.

Note: in a follow-up we will rename these modules to drop the `HMR` prefix. We have not come up with a better name yet and are open to ideas.

Reviewed By: sebmck

Differential Revision: D16458499

fbshipit-source-id: 4c06acece1fef5234015c877354fb730b155168c
2019-07-24 08:11:34 -07:00
Guilherme Iscaro 5b953e51fa Revert Picker item original color (#25750)
Summary:
Since the Android's Picker implementation uses an ArrayAdapter,
it means that the views that were created may be reused for other items
in order to save memory. With this in mind, if one sets the Picker.Item
prop color for only certain items there might be an state that
some items that does not have the color set will end up appearing
with the wrong color. This happens because, this new item is
reusing a view of an item that had the color prop set.
In order to avoid this problem, once a new view is created
the ReactPickerAdapter will save the original color and
re-apply if the item does not have the color prop.

## Changelog

[Android] [Fixed] - Picker.Item displays wrong colors
Pull Request resolved: https://github.com/facebook/react-native/pull/25750

Test Plan:
On android execute the code below. Only the FIRST item should be red.

```javascript
import React from 'react';
import { StyleSheet, View, Picker } from 'react-native';

const values = new Array(100);

for (let i = 0; i < values.length; i += 1) {
  values[i] = (i * i).toString();
}

const App = () => {
  const [selected, setSelected] = React.useState(0);
  const onValueChange = React.useCallback((_, idx) => {
    setSelected(idx);
  }, []);
  return (
    <View style={styles.container}>
      <Picker onValueChange={onValueChange} selectedValue={values[selected]}>
        {values.map((v, i) => (
          <Picker.Item
            key={v}
            value={v}
            label={v}
            {...(!i ? { color: 'red' } : {})}
          />
        ))}
      </Picker>
    </View>
  );
};

export default App;

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    paddingHorizontal: 20,
  },
});

```

### Without the patch

You should see various items with the red color (when only the first one should be red)
![picker-not-working](https://user-images.githubusercontent.com/984610/61584012-fe902300-ab16-11e9-8131-62c471b7f753.gif)

### With the patch
Only the first item is red.

![picker-working](https://user-images.githubusercontent.com/984610/61584013-09e34e80-ab17-11e9-9ae0-95a513581779.gif)

Closes https://github.com/facebook/react-native/issues/25456

Differential Revision: D16430961

Pulled By: mdvacca

fbshipit-source-id: 48b41845d465df2e3dd34fc4a76950ddc75a010a
2019-07-23 23:38:39 -07:00
David Vacca e12800b119 Implement Legacy measure API on Fabric
Summary: This diff exposes the legacy measure() method on Fabric. This method will be replaced by getRelativeLayoutMetrics in the future, but we are exposing this in order to make Fabric migration easier.

Reviewed By: JoshuaGross, shergin

Differential Revision: D16432928

fbshipit-source-id: 25cc21fb48ec0749081f112af9230bfe53314d6b
2019-07-23 18:45:24 -07:00
David Vacca a4a36188af Expose SetJSResponder and clearJSResponder to JS
Summary: This diff exposes the new methods SetJSResponder and clearJSResponder in the UI ManagerBinding interface

Reviewed By: shergin

Differential Revision: D16420689

fbshipit-source-id: 606bede1de6b9d5fd5a56e832ad27100b6998c55
2019-07-23 18:45:24 -07:00
David Vacca 0e78035b76 Create JS ResponderHadler example
Summary: This diff creates a new example in RN Tester for JSResponderHandler

Reviewed By: shergin

Differential Revision: D16420686

fbshipit-source-id: 2e450af0a5ed9ce459a2a13d3ecce0807483018b
2019-07-23 18:45:24 -07:00
Will Holen 691679a790 Improve error message when registering empty bundles
Summary:
This change lets `registerBundle(bundleId, file)` throw an exception
when the file is empty, improving on the current behavior of an
eventual SIGABRT saying "MAP_FAILED: Invalid argument"

Reviewed By: ridiculousfish

Differential Revision: D16451938

fbshipit-source-id: b8b2d0bfed476319c379122fad59a5bf0a8c813b
2019-07-23 17:43:34 -07:00
Dan Abramov 8b5ed7abdd Fixing error on first mount should fall back to reload
Summary:
This updates `react-refresh` to 0.3.0 which brings a new feature: we can now detect if the root fails on _the initial mount_. In that case we currently can't recover with Fast Refresh because we don't know which element to retry mounting. (In the future, we can lift this limitation, but it would require more changes in React renderer.)

Before this diff, after you fix an error on initial mount, you would see a blank screen (because nothing managed to mount).

After this diff, after you fix an error on initial mount, you would fall back to a full reload.

This diff doesn't affect errors on updates. We can recover from those, just like before.

Reviewed By: cpojer

Differential Revision: D16440836

fbshipit-source-id: 4a414202a9eab894acd7baa0525c25ff003dd323
2019-07-23 16:19:15 -07:00
Michał Osadnik 05d3e86244 update name of generated module
Summary: Because of namespace conflicts I add `Cxx` suffix for generated names of modules.

Reviewed By: RSNara

Differential Revision: D16437997

fbshipit-source-id: ef9dbf1a5df9658365546be13f902d2fce5b57d7
2019-07-23 15:19:00 -07:00
Stepan Furdei 6625356b7e Migrate ARTGroupShadowNode.java to Android target API 28
Summary: React Native is using API deprecated in Android API 28. This blocks migrating RN apps to target API 28 which is Google's requirement starting August 2019. Specifically, using the deprecated flags is causing a crash. Here's Google's suggestion for a fix https://developer.android.com/reference/android/graphics/Canvas.html#clipRect(float,%2520float,%2520float,%2520float,%2520android.graphics.Region.Op)

Differential Revision: D16436758

fbshipit-source-id: 92042695f8a1798464b374bff9fa0e5e83e7f461
2019-07-23 14:26:43 -07:00
zhongwuzw 0fcaca8e26 Fixes template build failed in release mode (#25751)
Summary:
Fixes https://github.com/facebook/react-native/issues/25745, Xcode stripped dead code in Release mode, and in template test code, it should only run in Debug mode, so we can use a macro to fix this issue.

## Changelog

[iOS] [Fixed] - Fixes template build failed in release mode
Pull Request resolved: https://github.com/facebook/react-native/pull/25751

Test Plan:
1. Create a new project using `react-native init AwesomProject`.
2. Change project target scheme to `Release`.
3. Build and it should success.

Differential Revision: D16442643

Pulled By: TheSavior

fbshipit-source-id: f08ed70523aa1aa418064465f8df367a06e8974f
2019-07-23 11:08:41 -07:00
zhongwuzw cf77067f0c Remove old GIF code (#25636)
Summary:
[After we migrated to new GIF implementation](https://github.com/facebook/react-native/pull/24822), we can remove old implementation now.

## Changelog

[iOS] [Deprecated] - Remove old GIF code
Pull Request resolved: https://github.com/facebook/react-native/pull/25636

Test Plan: GIF still works.

Reviewed By: shergin

Differential Revision: D16280044

Pulled By: osdnk

fbshipit-source-id: 00979280e6c17c93859ce886dd563b0d185c84aa
2019-07-23 07:10:56 -07:00
Min ho Kim 84f5ebe4f9 Fix typos (#25770)
Summary:
Fix typos mostly in comments and some string literals.

## Changelog

[General] [Fixed] - Fix typos
Pull Request resolved: https://github.com/facebook/react-native/pull/25770

Differential Revision: D16437857

Pulled By: cpojer

fbshipit-source-id: ffeb4d6b175e341381352091134f7c97d78c679f
2019-07-23 03:23:11 -07:00
Dan Reynolds d544fa20b7 add support for stringifying error object messages to stringifySafe (#25723)
Summary:
Error objects logged as part of the arguments to `console.error` such as from [rejected es6 promises](https://github.com/zloirock/core-js/blob/v2/modules/es6.promise.js#L110) contain the error that the user would want to see as the error object's message, but is not captured by `stringifySafe`. Here we modify it to if the logged value is an error object print the error similar to chrome:

```
const error = new Error('error');
stringifySafe(error); // Error: error
```

Versus the current behavior which does not recognize the error type and instead tries to stringify the it as an object:

```
JSON.stringify(new Error('error')) // "{}"
```

## Changelog

[JavaScript] [Changed] - Add support for stringifying error object messages to safeStringify
Pull Request resolved: https://github.com/facebook/react-native/pull/25723

Test Plan:
Tests:
<img width="802" alt="Screen Shot 2019-07-18 at 8 39 52 PM" src="https://user-images.githubusercontent.com/2192930/61501171-39218080-a99c-11e9-8e87-48ea413b3d01.png">

Lint:
<img width="406" alt="Screen Shot 2019-07-18 at 8 43 35 PM" src="https://user-images.githubusercontent.com/2192930/61501318-dc729580-a99c-11e9-9264-c0232515352c.png">

Differential Revision: D16437956

Pulled By: cpojer

fbshipit-source-id: ca3ce9c98ad585beb29c2bfeb81bbd14b2b1c700
2019-07-23 02:46:19 -07:00
Dan Abramov b40aa7f8d8 Don't dismiss initial runtime error
Summary: If there's a redbox at the start, we shouldn't dismiss it. Instead, redboxes should only be dismissed on explicit edits.

Reviewed By: yungsters

Differential Revision: D16421934

fbshipit-source-id: 770c5b5fc85e6b6ce00a4477aa87d6e91b14fc3c
2019-07-22 20:38:16 -07:00
Brian Vaughn a3a22fa91d Update react-devtools-core to ^3.6.2
Summary:
Update to the latest React DevTools v3 release, which adds the ability to detect when the (v3) frontend is connected with a v4 backend and shows update instructions to the user.

## Changelog:

[General] [Added] - Updated embedded react-devtools-core package to the latest version in preparation for the upcoming v4 DevTools release.

Reviewed By: rickhanlonii

Differential Revision: D16419553

fbshipit-source-id: a36b0ba5bf6992a490f1234b9a92b8abd4c9b3e6
2019-07-22 19:45:03 -07:00
David Vacca 4ab9e2d825 Fix PanResponderExample
Summary: This diff fixes the PanResponderExample in RN Tester app

Reviewed By: shergin

Differential Revision: D16420688

fbshipit-source-id: efdc6b3c82c54a8984a7bb106230d9f832e454dd
2019-07-22 15:39:01 -07:00
David Vacca 2992518b2e Deprecate UIManagerModule.removeSubviewsFromContainerWithID
Summary:
The method UIManagerModule.removeSubviewsFromContainerWithID will not be part of fabric. This diff deprecates it to avoid future usage before the migration.
This can not be removed, as it is currently used from React-VR

Reviewed By: shergin

Differential Revision: D16420687

fbshipit-source-id: a06810cabb434e35e5a371444114db2633a35a29
2019-07-22 15:39:01 -07:00
David Vacca a863949413 Deprecate UIManagerModule.replaceExistingNonRootView
Summary:
The method UIManagerModule.replaceExistingNonRootView will not be part of fabric. This diff deprecates it to avoid future usage before the migration.
This can not be removed, as it is currently used from React-VR

Reviewed By: shergin

Differential Revision: D16420685

fbshipit-source-id: c534e2ee6371698638751f1482bb619db1569733
2019-07-22 15:39:00 -07:00
Eli White c7ee38149d Add command methods to GeneratePropsJavaInterface
Summary: These methods will be called when commands are dispatched.

Reviewed By: JoshuaGross

Differential Revision: D16388806

fbshipit-source-id: a09d257474aa3306b99f8dcdfdd23808f60eb4bd
2019-07-22 12:52:58 -07:00
Peter Argany 7d15a6be2c Remove all calls to bridge.imageLoader [1/N]
Summary: We no longer want to access RCTImageLoader from the bridge category. Instead, let's use the `moduleForClass` API.

Reviewed By: shergin

Differential Revision: D16389113

fbshipit-source-id: c638f4b9851698afc53aaaa2b302d21cc19f76e7
2019-07-22 11:13:51 -07:00
Rick Hanlon 42cf8a9241 Retry add JS view config for View
Summary: Adds the JavaScript view config for View

Reviewed By: TheSavior

Differential Revision: D15862368

fbshipit-source-id: 8a6a77cf57e84744044a2d6034aff2be6e600f5f
2019-07-22 09:30:31 -07:00