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

17392 Коммитов

Автор SHA1 Сообщение Дата
Michał Pierzchała 5b448eca4f - Bump CLI to ^2.2.0 (#25555)
Summary:
We've released a bunch of versions since the initial 2.0 release, with a lot of bug fixes (especially for Windows) and some features added.

Changes since 2.0: https://github.com/react-native-community/cli/compare/v2.0.1...v2.2.0
Latest release: https://github.com/react-native-community/cli/releases/tag/v2.2.0

## Changelog

[Internal] [Changed] - Bump CLI to ^2.2.0
Pull Request resolved: https://github.com/facebook/react-native/pull/25555

Test Plan: None

Differential Revision: D16161897

Pulled By: cpojer

fbshipit-source-id: 542c4bffa7c6b0537f1c7135f43c98dd3db358e4
2019-07-09 03:42:19 -07:00
Christoph Nakazawa a622421634 Add `registerEntryPoint` to HmrServer
Summary: This diff changes a few things around so that a diff coming on top of this stack will be smaller. The aim of this change is to add a method `registerEntryPoint` which will allow a client to subscribe to updates for multiple bundles.

Reviewed By: gaearon

Differential Revision: D16131963

fbshipit-source-id: d460d6647b15a711021c7a3a51f52486a1aea535
2019-07-09 03:21:25 -07:00
Oleksandr Melnykov 88e18b6c8d Release underlying resources when JS instance is GC'ed on Android
Summary:
[Android] [Added] - Release underlying resources when JS instance is GC'ed on Android

D15826082 was reverted because it introduced a crash in Ads Manager for Android (see P67222724).

This diff fixes the crash and re-applies D15826082. The problem was that `jni::findClassStatic` in the destructor of BlobCollector.cpp couldn't find the Java class `com/facebook/react/modules/blob/BlobModule` and crashed the app.

JNI didn't seem to have access to the Java class loader probably because the destructor was called from a non-Java thread (https://our.intern.facebook.com/intern/wiki/Fbjni/environment-and-thread-management/?vitals_event=wiki_click_navigation_link#threads). The fix is to wrap the code in the destructor inside `ThreadScope::WithClassLoader `, which will allow to run code that has full access to Java as though you were running in a Java thread.

Reviewed By: shergin

Differential Revision: D16122059

fbshipit-source-id: 12f14fa4a58218242a482c2c3e2149bb6770e8ec
2019-07-09 02:20:55 -07:00
Valentin Shergin d656878e0d Fabric: Removing AccessibleShadowNode
Summary: Accessibility is essential but seems we don't have any use of AccessibleShadowNode in Fabric.

Reviewed By: sammy-SC

Differential Revision: D16139595

fbshipit-source-id: a6aec6d22c4a6050d7ee5e6b21ef4ad04d80ffce
2019-07-08 21:10:48 -07:00
Valentin Shergin 2111f205ae Fabric: Removing `SharedYogaStylableProps` and small codestyle changes
Summary: Trivial. We don't use it.

Reviewed By: sammy-SC

Differential Revision: D16139556

fbshipit-source-id: bac282c1aa228c10d27ebd636cf71fcc33b322e9
2019-07-08 21:10:47 -07:00
Ashok Menon 424f93022d Use iosfwd instead of iostream
Summary:
The instrumentation header only needs the forward declarations for ostream, so
we can use just include `iosfwd`, as suggested by Riley in an earlier diff.

Reviewed By: kodafb

Differential Revision: D16152451

fbshipit-source-id: 2afbc40e623b180dfc5917fc8093ab15bf647968
2019-07-08 14:56:44 -07:00
Moti Zilberman 1a2937151b Make writable arrays and maps only shallowly writable
Summary:
@public

The `WritableArray` and `WritableMap` interfaces currently require that nested arrays and maps also be writable. Nothing in our code actually relies on this, so we can relax this restriction and get useful properties.

For instance, it is now possible to construct a `JavaOnlyMap` (or array) that reuses `ReadableMap` and `ReadableArray` values by reference ( = structural sharing) instead of forcing a deep copy.

Reviewed By: kathryngray

Differential Revision: D16132580

fbshipit-source-id: 9f41189ebea2a82e775a7a4da8c357a5ce9c5b9d
2019-07-08 13:25:02 -07:00
Moti Zilberman e0ae655787 Remove JsonWriter, support bridge types in JsonWriterHelper
Summary:
@public

* Removes `JsonWriter`; it's apparently a buggy fork of [`android.util.JsonWriter`](https://developer.android.com/reference/android/util/JsonWriter) which has existed since API level 11. Our version doesn't insert commas before objects or arrays within an array. Instead of fixing it, we can just use the Android one.
* Extends `JsonWriterHelper` to support serialising `ReadableMap`, `ReadableArray` and `Dynamic` values into a `JsonWriter`.

Reviewed By: kathryngray

Differential Revision: D16131713

fbshipit-source-id: d258af42b669f10218cae8b086e7adc3226d16c0
2019-07-08 13:25:01 -07:00
Michał Osadnik a269c1f6c2 Add support for callback
Summary: This part of writing codegen was straightforward. I've added check for 'FunctionTypeAnnotation' and then reuse exisiting methods' parser for generating schema for callback.

Reviewed By: TheSavior

Differential Revision: D16131213

fbshipit-source-id: 2ec0e241f2174dee3a93857563db0626013d004e
2019-07-08 09:40:21 -07:00
Michał Osadnik a7664dbaf1 Add support for nullable params
Summary:
I'm not very confident with this part, but actually in existing codegen we wrap param into another object marked as `NullableTypeAnnotion`. It makes logic a little  more complicated. Also it allows for multiple `?` before type which is useless in code generation as well as nullable types inside arrays which also does not have impact on a final code generation.
I suggest adding `nullable` field into param which covers all existing cases (and probably all cases needed).

Reviewed By: TheSavior

Differential Revision: D16121609

fbshipit-source-id: 6e086d4d26bbd0aab3015ec7ecae106ebbaa5a2c
2019-07-08 09:40:21 -07:00
Michał Osadnik 233c64c675 Add support for complex objects
Summary: Add support for Object reusing mostly the code for arrays

Reviewed By: TheSavior

Differential Revision: D16122314

fbshipit-source-id: c1b201c659e6fdc98bed553fb16280ed5ce9e647
2019-07-08 09:40:20 -07:00
Michał Osadnik 702489caa8 Add support for basic objects
Summary: This implementation is a bit different than current one since previously object annotation was always wrapped into `GenericTypeAnnotation` object which is not needed in every of current use cases.

Reviewed By: TheSavior

Differential Revision: D16121727

fbshipit-source-id: e0de1852e13c66f459efd7a3bcde449e412d8b95
2019-07-08 09:40:20 -07:00
Michał Osadnik b848af3b08 Add support for optional methods
Summary:
This diff adds an optional property.

#Facebook
Following this doc: https://our.intern.facebook.com/intern/wiki/React_Native/rctexport-interface-support/?vitals_event=wiki_click_navigation_link
I suppose it's vital to support this property as well. However i don't know if it's really useful, so thus I made a separated diff for it.

Reviewed By: TheSavior

Differential Revision: D16121408

fbshipit-source-id: 15491575e999ee4fcddfd176f52d927789458061
2019-07-08 06:24:19 -07:00
Michał Osadnik 929c5d7c10 Add support for promises
Summary:
This diff add support for promises. It wraps promise's type into a special type annotation.

#Facebook
Currently the shape of promises parsing is:

```
{
  name: 'getValueWithPromise',
  optional: false,
  typeAnnotation: {
    type: 'FunctionTypeAnnotation',
    params: [
      {
        name: 'error',
        typeAnnotation: {
          type: 'BooleanTypeAnnotation',
        },
      },
    ],
    returnTypeAnnotation: {
      type: 'GenericTypeAnnotation',
      typeId: {
        hasteModuleName: 'NativeSampleTurboModule',
        name: 'Promise',
      },
      typeParameters: [
        {
          type: 'StringTypeAnnotation',
        },
      ],
    },
    returnTypeNameOverride: null,
  },
  rawTypeAnnotation: '(error: boolean) => Promise<string>',
  documentation: null,
};

```

which is a bit unclear for me. I suggest sth way more easier:

```
{
  "modules": {
    "SampleTurboModule": {
      "nativeModules": {
        "SampleTurboModule": {
          "properties": [
            {
              "name": "getValueWithPromise",
              "typeAnnotation": {
                "type": "FunctionTypeAnnotation",
                "returnTypeAnnotation": {
                  "type": "PromiseTypeAnnotation",
                  "resolvingType": {
                    "type": "StringTypeAnnotation"
                  }
                },
                "params": [
                  {
                    "name": "error",
                    "typeAnnotation": {
                      "type": "BooleanTypeAnnotation"
                    }
                  }
                ]
              }
            }
          ]
        }
      }
    }
  }
}
```

However, I'd be happy to see some feedback / other solutions as well!

Reviewed By: TheSavior

Differential Revision: D16130941

fbshipit-source-id: c7dfd3f260b7c3028ce0e6208e96c62bd099ca7b
2019-07-08 06:13:05 -07:00
Michał Osadnik 690bcdf45e Add suport for array as a param and returning value
Summary: Now `Array<T>` is supported as a returning values or a param of function's definition. Also, Array of Array is allowed.

Reviewed By: TheSavior

Differential Revision: D16121246

fbshipit-source-id: 59c484120c4025a152e3ba8044eecf11dbbea1f7
2019-07-08 04:54:04 -07:00
Samuel Susla faf9130560 fabric: Migrate ModalHostView
Summary: Implements `ModalHostView` in Fabric.

Reviewed By: shergin

Differential Revision: D16090949

fbshipit-source-id: fe2c87063863e7f3c6c8dcc934a2cdb0b1aedaac
2019-07-08 03:56:31 -07:00
Samuel Susla db17e969fa codegen: fix array of enums generation
Summary: While working on D16090949 I discovered that the code being generated for an array of enums was not correctly converted to mask. The type that holds the mask can't be enum class but other container type, I used `uint32_t`.

Reviewed By: shergin

Differential Revision: D16109338

fbshipit-source-id: 237077adaafe631eda973bc76cefa49035bbcd66
2019-07-08 03:56:31 -07:00
Michał Osadnik 59b8ee86c8 Prepare generic mechanism for extracting types from external type definitions
Summary: This diff a adds generic mechansm for extracting types from types' difinitions defined in other part of the file.

Reviewed By: TheSavior

Differential Revision: D16131742

fbshipit-source-id: 006b6980fa9f6a064d5bb8734ba2740b802b6989
2019-07-08 03:23:20 -07:00
Valentin Shergin 06ce568155 Fabric: Use state in Paragraph component
Summary:
All props to Eric Lewis! cc ericlewis

This revert of revert of land of changes originally published in #24873 (with some slight fixes). The change removes usage of LocalData from the `<Text>` component.

After this change we only have ---one (maybe two)--- three components left using LocalData.

Reviewed By: mdvacca

Differential Revision: D15962376

fbshipit-source-id: 19f41109ce9d71ce30d618a45eb2b547a11f29a2
2019-07-07 22:46:21 -07:00
Valentin Shergin 71f0079809 Fabric: New extendend signature of `ViewManager::updateState()`
Summary: Now, the signature of `updateState` method practically copies the signature of `updateLocalData`. We need that to support all features that `updateLocalData` does support now (to migrate from it).

Reviewed By: mdvacca

Differential Revision: D15962377

fbshipit-source-id: 61e0af6c191e0c6a358c5859613e9c512f91d29a
2019-07-07 22:46:20 -07:00
Valentin Shergin 142af1751b Fabric: Unconditional state management in Binding::schedulerDidFinishTransaction
Summary: Originally, moving the mount instruction generation under the `if` was a perf optimization but now, since we converge `LocalData` and `State`, this is no longer possible (because we need to treat State as LocalData in some cases).

Reviewed By: mdvacca

Differential Revision: D15962378

fbshipit-source-id: 37f9fadb72ac53450c2d499452610d9835f2964d
2019-07-07 22:46:20 -07:00
Dan Abramov abc663dd5a Add a shim for HMRClient in prod bundles
Summary:
Running a PROD JS bundle with a DEV binary used to redbox with Fast Refresh on. The error said "HMRClient is not a registered callable module".

This isn't a new issue: https://www.google.com/search?q=%22hmrclient%20is%20not%20a%20registered%22. However, now it happens every time because `setup()` is now called unconditionally in a DEV native build.

Because a combination of DEV binary + PROD JS is technically possible, I'm adding a tiny shim that will make it a no-op instead of crashing. It will also explain what's wrong if you *intentionally* try to turn on Fast Refresh.

Reviewed By: sahrens

Differential Revision: D16145378

fbshipit-source-id: 0b9c0a6f30c02ca7f4a0133048450bdde3576ad2
2019-07-07 13:25:10 -07:00
Ram N 8e3ccaadf2 Re-add Start/Stop Sampling profiler in Dev Menu for Android
Reviewed By: yinghuitan

Differential Revision: D16069122

fbshipit-source-id: 179ba7ec709731f4b861dc4367df357e93e025f2
2019-07-06 11:23:58 -07:00
Michał Osadnik e8c5495961 Add support for primitive returning type
Summary:
In this I add support for primitive types as return
- String
- Number
- Boolean
- Any
- Void

Reviewed By: TheSavior

Differential Revision: D16108273

fbshipit-source-id: 2dbd1d5a852a8cf5baf378a73d860492fe2f87cb
2019-07-05 13:15:54 -07:00
Michał Osadnik 3a5bdc17bb Add support for primitive types parsing for params
Summary:
In this diff I add handling basic primitives:
- Bool
- Number
- String

as params basing on prev schema.

Also, added flow types.

Reviewed By: TheSavior

Differential Revision: D16107737

fbshipit-source-id: 82b1534667e5cfe5b91a3306fdb6d0db44cd3a62
2019-07-05 13:15:53 -07:00
Mehdi Mulani 3468af54ce Android support for changing bundle location
Summary: With this, you can load the bundle from another server on the fly. This makes it much easier to hit a named server.

Reviewed By: makovkastar

Differential Revision: D16076020

fbshipit-source-id: 46d78ccd55b9b11481628f4585030494f9282003
2019-07-05 08:44:25 -07:00
Bruno Lemos 10d80b8a78 Move inline static styles at VirtualizedList to StyleSheet.create (#25501)
Summary:
I know StyleSheet.create doesn’t do anything special on react-native yet but it does on react-native-web and possibly other targets.

This small change is mainly so react-native-web don’t need to keep making this change on their code base when updating the rn version.

## Changelog

[Internal] [Changed] - Move inline static styles at VirtualizedList to StyleSheet.create
Pull Request resolved: https://github.com/facebook/react-native/pull/25501

Test Plan:
It’s basically the same code, just moved.
Also it’s the same change that it’s on react-native-web project: 45f94eb43d/packages/react-native-web/src/vendor/react-native/VirtualizedList/index.js (L1650-L1654)

Differential Revision: D16130700

Pulled By: cpojer

fbshipit-source-id: 20639e2e1a795ff4819c16af15569bf12759a62c
2019-07-05 02:42:12 -07:00
Yike Xue 169beaa7c2 remove duplicate lines in xplat/js/react-native-github/React/React.xcodeproj/project.pbxproj
Summary: D14477611. The duplicat line may cause the test failure in T46242216 : https://fburl.com/9svdqopu

Reviewed By: sammy-SC, cpojer

Differential Revision: D16082601

fbshipit-source-id: fbd4f4b1ffe6b08faff4b65d7fd44faffc611393
2019-07-04 14:36:28 -07:00
Kevin Gozali 6853b9bdfa Fixed iOS Podfile template to add React-CoreModules and its deps
Summary:
With React-CoreModules separated from React-Core, the Podfile needs updating to sync with https://github.com/facebook/react-native/blob/master/scripts/autolink-ios.rb
See fde8a4cf93 for the original change.

Note: the template Podfile should be updated to use the same autolink scripts

This fixes the CI failure like this: https://circleci.com/gh/facebook/react-native/99956

Reviewed By: hramos

Differential Revision: D16114264

fbshipit-source-id: d75dff570310f21eb8fbdf030439532a0abe978d
2019-07-04 11:21:56 -07:00
Kevin Gozali 987e5197f0 TM iOS: autogenerate plugins map based on FB build system
Summary: This adds internal script to automatically sync the plugins definition. For github consumption, the CoreModulesPlugins.* will stay checked in, nothing change.

Reviewed By: RSNara

Differential Revision: D16102352

fbshipit-source-id: 8f74ea9dde046183ae620682fd7e181b4cc95a94
2019-07-04 11:21:56 -07:00
Kevin Gozali 9c56be2721 TM iOS: Introduce OSS-compatible RCTCoreModulesClassProvider()
Summary: To look up TurboModule Class based on its name, this new function `RCTCoreModulesClassProvider()` can be used to find a TurboModule impl in the app. For now this is manually maintained and sync'ed with FB internal version. Only modules that live under React/CoreModules/ should be handled here.

Reviewed By: PeteTheHeat

Differential Revision: D16100291

fbshipit-source-id: 6b7556dec1fa83d1e081c7e8c0fe295187934274
2019-07-04 11:21:55 -07:00
Kevin Gozali 5275f150b8 Use @generated in header comment so IDE can notify developers
Summary: These files are generated by tool, not for manual edit. So let this marker tell IDEs so.

Reviewed By: hramos, cpojer

Differential Revision: D16097171

fbshipit-source-id: 1f98a4d4e21acca0a7fbd386ff174dd9197c2129
2019-07-04 11:21:55 -07:00
Kevin Gozali 737b784b8c TM iOS: removed CoreModulesAppleHeader BUCK workaround
Summary:
We should be able to just use `header_path_prefix` and normal `glob(["**/*.h"])` patterns, and that should be compatible with the build system.
This also allows `RCTPlatform.mm` to import `"RCTPlatform.h"` directly without any namespace.

Reviewed By: RSNara

Differential Revision: D16096779

fbshipit-source-id: b17b79baf958f1e9a63085a928b64663cb29bbbb
2019-07-04 11:21:55 -07:00
Christoph Nakazawa c92cc11bed Remove `_` from module local variables in HMRClient
Summary: Dropping these for readability.

Reviewed By: gaearon

Differential Revision: D16121694

fbshipit-source-id: 2f6e3fb862a93d284631114c6736173e6ffbee91
2019-07-04 11:21:54 -07:00
Radosław Pietruszewski 3724810d21 Initial UIKitForMac support (#25427)
Summary:
This PR adds initial support for Project Catalyst a.k.a. UIKitForMac. This is not yet meant for production, but this is enough for RNTester to successfully compile and mostly work :)

Some APIs are not supported on the Mac -- e.g. telephony, and deprecated APIs are removed on Mac ���-- those had to be ifdef'd out via platform checks.

The biggest limitation right now is that I couldn't get Web Socket code to successfully compile, and so there are a lot of temporary platform checks  for that , and the RCTWebSocket.xcodeproj is marked as not supporting UIKitForMac. Again -- temporary, until someone with more knowledge knows how to fix this.

https://github.com/react-native-community/discussions-and-proposals/issues/131

## Changelog

[iOS] [Added] - Fixed compilation for macOS (Project Catalyst) -- not meant for production use yet
Pull Request resolved: https://github.com/facebook/react-native/pull/25427

Test Plan:
- Open RNTester/RNTester.xcodeproj with Xcode 10.2, run it like a normal iOS app -- make sure it compiles and runs correctly (no regression)
- Open the same project with Xcode 11 beta 2 (or higher) on macOS Catalina beta, select "My Mac" as device target, and run -- see that it actually compiles and runs. **Note** there are unfortunately some required steps:
   - change build configuration to Release (because packager doesn't work correctly yet)
   - change development team to yours if Xcode tells you to
   - go to RNTester project → Build phases → Link binary with libraries, and change `platforms` for `libRCTWebSocket.a` to `iOS` (without Mac compatibility). I can't commit that change because it breaks compatibility with earlier Xcode versions

The two extra steps for successful compile will disappear once web socket compilation for Catalyst is fixed

Reviewed By: mmmulani

Differential Revision: D16088263

Pulled By: sammy-SC

fbshipit-source-id: 9c0b932b048e50a8e0f336eaa0612851b1909cae
2019-07-04 10:30:33 -07:00
Christoph Nakazawa 5dade01ca6 Remove setupDevtools file
Summary: There is a `setUpDeveloperTools.js` and a `setupDevtools.js` files. While they do set up different devtools it is very confusing to have these two files. This diff inlines one in the other which should bring more clarity.

Reviewed By: gaearon

Differential Revision: D16121236

fbshipit-source-id: 45641c7af9639ede6dc237ac53b763cd804a05c2
2019-07-04 09:22:09 -07:00
Christoph Nakazawa 76e10c4e8b Improve console logging to Metro
Summary:
This adds a few more methods that are forwarded to Metro, most notably `console.group`, `console.groupCollapsed` and `console.groupEnd`. When using `console.group`, node.js's `console` implementation will use indentation for log messages. `console.groupCollapsed`, for now, will simply not print anything to the console. This removes all of the Relay information that was impossible to look at in Metro before.

In the future, I'd like to consider somehow including collapsed groups in the output with a way to interact and navigate through them but for now, if people would like to debug Relay queries, they should use whatever they have been using before Metro had logs.

Reviewed By: gaearon

Differential Revision: D16108266

fbshipit-source-id: 97337d93eed0b8cb464df78b59ade1fe340b7f6f
2019-07-04 07:44:28 -07:00
Christoph Nakazawa 1f25d3c4ce Simplify AppRegistry logging
Summary:
This simplifies the first log message for every single reload. Here are the changes:
* I dropped the "application" word because at Facebook we consider these views "surfaces". However, the method is explicitly called "runApplication" because in open source most people will only have a single "application". Removing the word and instead relying on the user specified string avoids the naming problem and doesn't take away from the information.
* I removed the `__DEV__` and performance optimization log. The way RN is set up, developers will always have the correct settings for these in either dev or prod and printing them every time is superfluous. Also, it had a typo. How is it possible nobody ever noticed this?
* I also simplified the invariant below to be half as long. I think it still has the same amount of information with fewer words (this is shown in a RedBox where there isn't that much space)

Reviewed By: rubennorte

Differential Revision: D16108248

fbshipit-source-id: 57351c68fa855c02bfbb1db6416d8db61eab4c19
2019-07-04 07:10:55 -07:00
Michał Osadnik 11ff5670a9 Prepare a skeleton for native modules schema json generating
Summary: It's a skeleton for preparing schema json from native modules. Right not it does nothing, but it should considered as a kind of workplace for further work

Reviewed By: TheSavior, cpojer, RSNara

Differential Revision: D16107216

fbshipit-source-id: 12717d015e7409d980ef16cccd81330fa978b0b1
2019-07-04 05:41:16 -07:00
Michał Pierzchała 7a6bb389df – Bump CLI to ^2.0.1 (#25472)
Summary:
Bump the React Native CLI to ^2.0.1 as it's just released now. Comes with fixes to autolinking, helpful warnings and upgrading.

## Changelog

[Internal] [Change] - Bump CLI to ^2.0.1
Pull Request resolved: https://github.com/facebook/react-native/pull/25472

Test Plan: Nothing breaks

Differential Revision: D16107705

Pulled By: cpojer

fbshipit-source-id: 1019330d434294c434b9a9d835dff67e7b3939dd
2019-07-04 03:31:11 -07:00
Oleksandr Melnykov 24b2a66145 Use HYPHENATION_FREQUENCY_NONE instead of HYPHENATION_FREQUENCY_NORMAL to measure text
Summary:
[Android] [Fixed] - Use HYPHENATION_FREQUENCY_NONE instead of HYPHENATION_FREQUENCY_NORMAL to measure text

The text must be measured with HYPHENATION_FREQUENCY_NONE instead of HYPHENATION_FREQUENCY_NORMAL, since ReactTextView has hyphenation frequency set to HYPHENATION_FREQUENCY_NONE. These two values must match, otherwise the measured height of text we return from the Yoga measure function might be wrong.

Even though the TextView [documentation](https://developer.android.com/reference/android/widget/TextView#setHyphenationFrequency(int)) says that the default hyphenation frequency is HYPHENATION_FREQUENCY_NORMAL before Android Q, it's not true for TextViews instantiated in code (the default value is set from the theme which is missing in case of ReactTextView).

See the screenshots below where the text is measured incorrectly which causes the last line to be cut off.

I extracted the value to a class member variable because I'm planning to expose the hyphenationFrequency prop for the Text component so that it can be configured on Android (as requested by this Github issue: https://github.com/facebook/react-native/issues/17199).

Reviewed By: shergin

Differential Revision: D16109430

fbshipit-source-id: 278c8182c0f819be27bc1d2468559b9e9ae1f807
2019-07-04 03:10:24 -07:00
Samuel Susla 61563cd902 Delete visible property from ModalHostViewNativeComponent
Summary: Visible property isn't used by native modal, neither in iOS nor in Android

Reviewed By: osdnk

Differential Revision: D16107927

fbshipit-source-id: 6f8b8db11abc0942f5af3abcc0245bc066da8c6b
2019-07-04 03:01:58 -07:00
Christoph Nakazawa 1c5944be16 Disable logging from performance logger unless it is enabled
Summary: D16107933 disabled the logs around setup unless they are explicitly enabled and this diff disables all logs from this module entirely unless they are explicitly turned on at the top of the file.

Reviewed By: gaearon

Differential Revision: D16108151

fbshipit-source-id: 355aaf8624fb0778884f25f02d58fe4e1237d686
2019-07-04 02:54:46 -07:00
Christoph Nakazawa c31fa2a45d Do not show setup logs from `createPerformanceLogger` unless logs are enabled for it
Summary: This module logs helpful messages in `__DEV__` but it only logs actionable performance logs when the flag on top of the file is enabled. This diff changes those to only log when the toggle on top of the file is enabled as well.

Reviewed By: gaearon

Differential Revision: D16107933

fbshipit-source-id: 7671bc521af984d617a0f5ffc0eacd1aa5674a62
2019-07-04 02:54:45 -07:00
Karan Thakkar d57cdac62b Add generated `xcshareddata` folder to gitignore (#25451)
Summary:
A new project created with `0.60.0-rc.3` generates an `xcshareddata` when you open the workspace in Xcode at `ios/ProjectName.xcworkspace/xcshareddata`. This does not need to be tracked in git.

## Changelog

[IOS] [ADDED] - Add generated `xcshareddata` folder to gitignore
Pull Request resolved: https://github.com/facebook/react-native/pull/25451

Test Plan: N/A

Differential Revision: D16110125

Pulled By: hramos

fbshipit-source-id: 52ac4d2d7734956817f875c3c7bbf341cba2ea28
2019-07-03 16:29:47 -07:00
Richard Hyatt 4a5a909264 iOS build - en0 and en1 used when generating ip.txt file (#25462)
Summary:
When `en0` is not assigned and `en1` is in use along with another interface present on the machine that uses a self-assigned address (169.254.xxx.xxx), the ip.txt file contains the self-assigned address. This causes the app reload/debug actions to fail when deployed to a physical device. see https://github.com/facebook/react-native/issues/25460

Code change looks at the value assigned to `en1` if `en0` is not set. If `en1` is not available on the machine or not set, then it will be empty. If both `en0` and `en1` are not set, the existing code was modified exclude addresses that are self-assigned, as they will most likely be unavailable to the connected device (iPhone, iPad, etc.).

## Changelog

[Internal] [Fixed] - en0 and en1 are used when generating the ip.txt file for iOS device debug builds
Pull Request resolved: https://github.com/facebook/react-native/pull/25462

Test Plan:
execute `ifconfig`:

```
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
	options=1203<RXCSUM,TXCSUM,TXSTATUS,SW_TIMESTAMP>
	inet 127.0.0.1 netmask 0xff000000
	inet6 ::1 prefixlen 128
	inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
	nd6 options=201<PERFORMNUD,DAD>
gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
stf0: flags=0<> mtu 1280
XHC20: flags=0<> mtu 0
XHC0: flags=0<> mtu 0
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
	options=10b<RXCSUM,TXCSUM,VLAN_HWTAGGING,AV>
	ether 38:f9:d3:0d:aa:fe
	nd6 options=201<PERFORMNUD,DAD>
	media: autoselect (none)
	status: inactive
en2: flags=8963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
	options=60<TSO4,TSO6>
	ether 42:00:84:a8:f6:00
	media: autoselect <full-duplex>
	status: inactive
en3: flags=8963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
	options=60<TSO4,TSO6>
	ether 42:00:84:a8:f6:01
	media: autoselect <full-duplex>
	status: active
bridge0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
	options=63<RXCSUM,TXCSUM,TSO4,TSO6>
	ether 42:00:84:a8:f6:00
	inet6 fe80::e:80be:b322:79b7%bridge0 prefixlen 64 secured scopeid 0x9
	inet 169.254.209.63 netmask 0xffff0000 broadcast 169.254.255.255
	Configuration:
		id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0
		maxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200
		root id 0:0:0:0:0:0 priority 0 ifcost 0 port 0
		ipfilter disabled flags 0x2
	member: en2 flags=3<LEARNING,DISCOVER>
	        ifmaxaddr 0 port 7 priority 0 path cost 0
	member: en3 flags=3<LEARNING,DISCOVER>
	        ifmaxaddr 0 port 8 priority 0 path cost 0
	nd6 options=201<PERFORMNUD,DAD>
	media: autoselect
	status: active
ap1: flags=8802<BROADCAST,SIMPLEX,MULTICAST> mtu 1500
	ether 3a:f9:d3:9a:14:05
	media: autoselect
	status: inactive
en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
	ether 38:f9:d3:9a:14:05
	inet6 fe80::1444:113e:d65:5fb3%en1 prefixlen 64 secured scopeid 0xb
	inet 192.168.1.115 netmask 0xffffff00 broadcast 192.168.1.255
	nd6 options=201<PERFORMNUD,DAD>
	media: autoselect
	status: active
p2p0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 2304
	ether 0a:f9:d3:9a:14:05
	media: autoselect
	status: inactive
awdl0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1484
	ether 6a:fe:9d:f0:39:3f
	inet6 fe80::68fe:9dff:fef0:393f%awdl0 prefixlen 64 scopeid 0xd
	nd6 options=201<PERFORMNUD,DAD>
	media: autoselect
	status: active
utun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 2000
	inet6 fe80::c992:4ed:9399:85bc%utun0 prefixlen 64 scopeid 0xe
	nd6 options=201<PERFORMNUD,DAD>
utun1: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1380
	inet6 fe80::f5de:860a:fd07:ee87%utun1 prefixlen 64 scopeid 0xf
	nd6 options=201<PERFORMNUD,DAD>
utun2: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1380
	inet6 fe80::3115:b6a0:6625:23ee%utun2 prefixlen 64 scopeid 0x11
	nd6 options=201<PERFORMNUD,DAD>
en5: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
	ether e2:33:8e:95:93:9b
	inet6 fe80::cea:8f7a:b379:ebcd%en5 prefixlen 64 secured scopeid 0x10
	inet 169.254.167.11 netmask 0xffff0000 broadcast 169.254.255.255
	nd6 options=201<PERFORMNUD,DAD>
	media: autoselect (100baseTX <full-duplex>)
	status: active
```

execute `ipconfig getifaddr en0`:  (produces nothing)

execute `ipconfig getifaddr en1`:
```
192.168.1.115
```

execute `ipconfig getifaddr en99`:  (produces nothing - non-existent case)

existing code `ifconfig | grep 'inet ' | grep -v ' 127.' | cut -d\   -f2  | awk 'NR==1{print $1}'` yields:

```
169.254.209.63
```

modified code ` ifconfig | grep 'inet ' | grep -v ' 127.' | grep -v ' 169.254.' | cut -d\   -f2  | awk 'NR==1{print $1}'` yields:

```
192.168.1.115
```

Differential Revision: D16099639

Pulled By: cpojer

fbshipit-source-id: bd480a5f638efc58611d22cef4ba5193052b713d
2019-07-03 02:39:49 -07:00
Nicolas Charpentier 029aad3a4a Upgrade Gradle to 5.5 (#25461)
Summary:
Upgrade Gradle to 5.5, changelog is available here: https://docs.gradle.org/5.5/release-notes.html

```
./gradlew wrapper --gradle-version 5.5 --distribution-type all
```

## Changelog

[Android] [Changed] - Upgrade Gradle to 5.5
Pull Request resolved: https://github.com/facebook/react-native/pull/25461

Test Plan: Ran RNTester, everything is working as expected.

Differential Revision: D16106927

Pulled By: cpojer

fbshipit-source-id: 3fca03b6c7ad8989a9a1c707dea980c831cc1872
2019-07-03 02:29:47 -07:00
Michał Osadnik b7782fb57c Add codegen to AndroidDrawer
Summary:
Using Ricky's last changes I managed to subscribe for both new and old event name.

Fixed event to proper one for codegen in native code.

Reviewed By: TheSavior

Differential Revision: D16065660

fbshipit-source-id: b5d3762d673a34bbdf5a8e60ff4d51617c8adb81
2019-07-03 02:29:47 -07:00
Dan Abramov aa860fb5df Update react-refresh to 0.2.0
Summary: Version bump for a minor Babel transform bugfix.

Reviewed By: motiz88

Differential Revision: D16093422

fbshipit-source-id: c1c2181a1cd75d78765e9d951e0bc001eff77bb9
2019-07-02 18:40:15 -07:00
Ramanpreet Nara d4e0f98a5e Protect getLegacyCxxModule from being stripped
Summary: We should annotate `ReactPackageTurboModuleManagerDelegate.getLegacyCxxModule` with `DoNotStrip`, so that ProGuard doesn't strip the method. `ReactPackageTurboModuleManagerDelegate.getModule` doesn't need the annotation because it's used in `TurboModuleManager`.

Reviewed By: fkgozali

Differential Revision: D16097376

fbshipit-source-id: 4b2622e8541fed0ab8fe13b5d0f5d25b58ea39ef
2019-07-02 15:03:14 -07:00