Commit Graph

977 Commits

Author SHA1 Message Date
Nat Mote b118f4ec3d Upgrade xplat/js to Flow v0.81
Reviewed By: dsainati1, pakoito

Differential Revision: D9920018

fbshipit-source-id: 208fa08109d307dc09f0e0357f5caa6dfcfa5ddf
2018-09-18 13:47:57 -07:00
Rafael Oleza 7a69f1aa27 Pass the maxWorkers config param correctly to Metro
Summary:
@public

The React Native CLI is not passing the default `maxWorkers` param to Metro, making it run in a single thread and making the development process really slow.

This fixes https://github.com/facebook/metro/issues/253

Reviewed By: mjesun

Differential Revision: D9915500

fbshipit-source-id: d15030af582e99fe20535c07e751cfe12e444f2f
2018-09-18 08:19:38 -07:00
Héctor Ramos 68c7999c25 Downgrade to compileSdkVersion 26
Summary:
Go back to using compileSdkVersion 26 and targetSdkVersion 26, temporarily. We can re-add this once Android SDK 27 becomes available in Facebook's internal repository.

The Android SDK Build Tools 27.0.3 **are** available, so we can continue using those.

Reviewed By: axe-fb

Differential Revision: D9886607

fbshipit-source-id: 6c1c9c1e1309c3a0483cc4c0bd8dcb4a5f29fc7e
2018-09-18 08:02:50 -07:00
Martin Konicek 52dd7dbbcf Remove built-in navigation template (#21155)
Summary:
This is an updated (rebased) version of the very old #16579.

I added a [template](https://github.com/facebook/react-native/tree/master/local-cli/templates/HelloNavigation) for react-navigation directly into the React Native repo a long time ago. The feature `react-native init --template foo` supports both:
- Remote templates (`react-native-template-foo` in npm as well as HTTP URLs)
- Local templates that ship with react-native itself

In retrospect, adding the local template wasn't a good idea. Templates should live outside of the React Native repo and be versioned independently. This way templates can be fixed independently of React Native releases, and people can use new templates without having to upgrade React Native.
Pull Request resolved: https://github.com/facebook/react-native/pull/21155

Differential Revision: D9885719

Pulled By: hramos

fbshipit-source-id: d2982f374d3c451c09e348ce5fcdca9d0be5a474
2018-09-17 15:17:58 -07:00
Jean Lauliac e327f88f02 react-native: make automated fs-based tests platform-independent
Summary:
@public

These tests are using a mock memory FS to start with, so there is no reason at all they should depend on the host OS or filesystem details. This changeset fixes that so that we fully mock the `fs` and `path` modules dependending on the mock platform (not the host platform). I also added an example of how we can test both platforms (regardless of the host platform) in `findPackageClassName`. Follow up changeset will be to do the same for all the other affected tests.

Related to https://github.com/facebook/react-native/issues/20260.

Reviewed By: mjesun

Differential Revision: D9771024

fbshipit-source-id: b368b43e8e54292d33b6183eec9a9ea69f2e6e76
2018-09-17 05:46:47 -07:00
gengjiawen 4f49404e15 bump android target version to 27 (#20843)
Summary:
bump target version to 27
pass all current ci.
none
[GENERAL] [ANDROID] [FEATURE] - bump android target version to 27
Pull Request resolved: https://github.com/facebook/react-native/pull/20843

Differential Revision: D9845999

Pulled By: hramos

fbshipit-source-id: 3c532a2d5a2b7d201bacab54cf3d60e1efffb653
2018-09-15 05:47:09 -07:00
empyrical 4b106be477 Give RNPM the ability to look for plugins in `@scoped` modules (#21082)
Summary:
This PR gives RNPM the ability to look for plugins in `scoped` modules.

The regexes for finding RNPM plugins will match these hypothetical examples:

 * `rnpm-plugin-foo`
 * `org/rnpm-plugin-foo`

The regexes for finding React Native plugins will match these hypothetical examples:

 * `react-native-foo`
 * `org/react-native-foo`
 * `The controller you requested could not be found./module` (will be useful in the slimmening)
 * `The controller you requested could not be found./module`

RNPM plugins will be able to benefit from this immediately, but React Native plugins will run into this Metro issue currently:

https://github.com/facebook/metro/issues/241
Pull Request resolved: https://github.com/facebook/react-native/pull/21082

Differential Revision: D9809094

Pulled By: hramos

fbshipit-source-id: 4b0694ad4119b37dd5664af52c48e48ebe4d7404
2018-09-13 04:31:38 -07:00
Héctor Ramos 1151c096da Update copyright headers to yearless format
Summary: This change drops the year from the copyright headers and the LICENSE file.

Reviewed By: yungsters

Differential Revision: D9727774

fbshipit-source-id: df4fc1e4390733fe774b1a160dd41b4a3d83302a
2018-09-11 15:33:07 -07:00
Michael Lee c5daf3fed9 Reformat BUCK files to follow new buildifier format
Summary: buildifier was updated and now we sort loads!

Reviewed By: zertosh

Differential Revision: D9771824

fbshipit-source-id: 0001aa5f656d4aa40b3498d5bfd792a3d14e56e1
2018-09-11 15:20:48 -07:00
Kræn Hansen d14922e5c9 Fixed status code when run-android fails (#21012)
Summary:
Fixes #21011
Pull Request resolved: https://github.com/facebook/react-native/pull/21012

Differential Revision: D9721471

Pulled By: hramos

fbshipit-source-id: 91f24c6009bd4f5399cffad960feed7213516145
2018-09-11 13:02:29 -07:00
Mike Grabowski 5d55f0368e Fix Metro preset version (#21034)
Summary: This pull request removes the hard-coded version of the `metro-react-native-babel-preset` as defined in the `init` command. That way, the version always matches React Native version specified in its `package.json`, making it match Metro version.

Differential Revision: D9759540

Pulled By: hramos

fbshipit-source-id: 90835442e2db1900851cbfb8c3c625229184d851
2018-09-10 16:19:11 -07:00
Matei Radu 4dfdec9b28 Update link command for Android project (#20853)
Summary:
Motivation:
--------------
PR #20767 bumped the version of the Android Gradle Plugin to v3 which uses the newer Gradle dependency configurations `implementation` and `api` which make `compile` obsolete.

While the PR updated the template Gradle configuration, it did not cover the `link` command which will still link native modules using `compile` resulting in a warning message beeing displayed during an app build.

Since `compile` will be eventually removed by Gradle, this commit updates the `link` command to attach native modules using `implementation`.
Pull Request resolved: https://github.com/facebook/react-native/pull/20853

Differential Revision: D9733888

Pulled By: hramos

fbshipit-source-id: 22853480d7ba7be65e3387effda2fd6c72b6906a
2018-09-08 04:31:37 -07:00
Jean Lauliac e8551520b5 local-cli: remove 'unbundle' naming in CLI (#21013)
Summary:
This also relink the require() onto `RamBundle.js` from Metro so we can remove `unbundle.js` from there completely.
Pull Request resolved: https://github.com/facebook/react-native/pull/21013

Reviewed By: hramos

Differential Revision: D9721443

Pulled By: jeanlauliac

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

Differential Revision: D9661761

Pulled By: hramos

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

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

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

Differential Revision: D9661731

Pulled By: hramos

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

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

Differential Revision: D9661739

Pulled By: hramos

fbshipit-source-id: 378b44599313ab535af55981ddd80b0fcdbee448
2018-09-05 12:49:02 -07:00
Gabe Levi 66bd4992b8 Deploy v0.80.0 to xplat/js
Reviewed By: samwgoldman

Differential Revision: D9646704

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

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

See s163726 for more details

Reviewed By: LukasReschke

Differential Revision: D9504148

fbshipit-source-id: e3c7587f1b7f93bec90a58a38d5f6d58f1f59275
2018-09-04 11:32:51 -07:00
Héctor Ramos 792cd0902e Bump lodash dependency (#20892)
Summary:
Per [CVE](https://nvd.nist.gov/vuln/detail/CVE-2018-3721) warning.
Pull Request resolved: https://github.com/facebook/react-native/pull/20892

Differential Revision: D9616099

Pulled By: hramos

fbshipit-source-id: 245c09ca32934c5e5464f87bfca213f1b10f8fec
2018-08-31 12:19:04 -07:00
George Zahariev 2f745ec2c2 Fix future sketchy-null errors after bug fix in '@flow strict' files
Reviewed By: wcheng86

Differential Revision: D9599872

fbshipit-source-id: dabcfd6fb7b6ec5a13801e84fe55d7d3c7ba9adb
2018-08-30 21:01:55 -07:00
empyrical 03476a225e Add support for out-of-tree platform plugins (#20825)
Summary:
This pull request adds the ability for a platform developer to provide a `"haste"` key under the `"rnpm"` key in their `package.json` which allows the packager to pick up that platform's javascript files. The intent is to remove the need to have custom platforms hardcoded in. This is inspired by the `"jest": { "haste": {} }` key used by jest.

For example, React Native Dom would have an entry like:

```json
{
  "rnpm": {
    "haste": {
      "providesModuleNodeModules": [
        "react-native-dom"
      ],
      "platforms": [
        "dom"
      ]
    }
  }
}
```

Support for more keys (path blacklists perhaps?) could be added in the future.

This succeeds #20662, as per a discussion I had with matthargett.

I've got an open discussion over here as well: https://github.com/react-native-community/discussions-and-proposals/issues/21
Pull Request resolved: https://github.com/facebook/react-native/pull/20825

Differential Revision: D9596429

Pulled By: hramos

fbshipit-source-id: a02f0da0bea8870bdc45d55e23da8ccbc36249f2
2018-08-30 16:38:07 -07:00
Rafael Oleza f661e0fb6e End metro server gracefully when there are some edge errors
Summary: This diff fixes a couple of edge cases that caused Metro to keep the process running when there were some specific errors (specially around the `dependencies` command and the transformer path).

Reviewed By: jrwats

Differential Revision: D9551834

fbshipit-source-id: 959cefcec9e2687dff89c94a871ae74c50d2dd77
2018-08-30 03:33:03 -07:00
Rafael Oleza f8f1870248 Make the --transformer CLI argument override the babelTransformerPath
Summary: D9070810 introduced a breaking change, making the `--transformer` CLI argument able to override the generic transformer instead of `babelTransformer`. Since we still have some scripts that assume `--transformer` is being used for overriding the babelTransformer path, we cannot do this breaking change yet, so this diff reverts the CLI handling to the old behaviour.

Reviewed By: jrwats

Differential Revision: D9550157

fbshipit-source-id: 8b4e26fcb5bca6e4b2f63b1e1a014bce23a31452
2018-08-28 19:01:57 -07:00
Lars Graubner 8dc209a523 improve contrast ratio in debugger-ui dark mode (#20559)
Summary:
The font colors in the debugger-ui dark mode are not accessible. This PR ensures [Level AAA Conformance to Web Content Accessibility Guidelines 2.0](https://www.w3.org/WAI/WCAG2AAA-Conformance) which makes it better to read for everyone.
Pull Request resolved: https://github.com/facebook/react-native/pull/20559

Differential Revision: D9495584

Pulled By: hramos

fbshipit-source-id: 1a9bdd015935fb27e2d74d2399e687787282a987
2018-08-24 02:32:29 -07:00
Rafael Oleza e4621f4ce1 Expose the actual transformer in the config
Summary:
This diff exposes the new more generic way to configure transformers in `Metro` via the config parameter `transformerPath`.

The new generic transformers can be used to transform any kind of file, since they don't call any JS-specific method and their API is generic. They only need to implement a single `transform` method:

```
async function transform(
  absolutePath: string,
  relativePath: string,
  fileContents: Buffer,
  options: TransformOptions, // very soon these will be configurable
): Promise<{
  output: Array<mixed>,
  dependencies: Array<{
    name: string,
    data: mixed, // very soon
  }>,
}> {
  // ...
}
```

Metro already had a `transformModulePath` config param, which was used to configure how babel was called in order to generate the AST. In order to avoid confusion, but keep the current open source transformer worker, I've renamed this param to `babelTransformerPath`. We can add a layer of compatibility and detect old config params in order to show a deprecation warning.

Reviewed By: pvdz

Differential Revision: D9070810

fbshipit-source-id: aebde879736026c09537f5d236eae24c06640abf
2018-08-23 15:48:04 -07:00
gengjiawen e2f2e41f09 refine android config (#20731)
Summary:
By this change we can unify version early, like we can make kotlin version share in buildscript and app dependency the same time ([butterknife](https://github.com/JakeWharton/butterknife/blob/master/build.gradle) use the same).
pass all current ci and one of my project https://github.com/gengjiawen/ReactNative64bitDemo.
none
 [GENERAL] [ANDROID] [TEMPLATE] - refine android config
Pull Request resolved: https://github.com/facebook/react-native/pull/20731

Differential Revision: D9482954

Pulled By: hramos

fbshipit-source-id: d864adbdbc624bc311ccc5f44a15d0334d2d8a59
2018-08-23 12:17:57 -07:00
gengjiawen 6e356895e7 bump android gradle to 3.1.4 (#20767)
Summary:
Bump android gradle plugin to 3.1.4. We have been stay to 2.x too long. With 3.x we can have instant run and great performance and new features brought by google.

Also thanks to CFKevinRef great pr to make this possible.
pass all current ci. I have also tested RNTester release version works without crash.
https://github.com/facebook/react-native/pull/17967.
 [GENERAL] [ANDROID] [FEATURE] - bump android gradle to 3.1.4
Pull Request resolved: https://github.com/facebook/react-native/pull/20767

Differential Revision: D9437576

Pulled By: hramos

fbshipit-source-id: 6084056a1390582a75a879918f2538b0480f6299
2018-08-22 23:19:42 -07:00
Dulmandakh 044b399e65 Bump compileSdkVersion to 27 and buildToolsVersion to 27.0.3 (#20777)
Summary:
I found that android support library 27.x (874cca1ac2) requires compileSdkVersion to be 27. Also found that many FB projects use SDK 27.
Pull Request resolved: https://github.com/facebook/react-native/pull/20777

Differential Revision: D9478431

Pulled By: hramos

fbshipit-source-id: ca100f6b5b39e7d112926124423f9510a0efc291
2018-08-22 23:19:42 -07:00
Elias Toivanen e61176d650 Bugfix: Check NodeJS version successfully even for old runtimes (Fixes #20769) (#20779)
Summary:
Fixes #20769

Release notes
--------------
[CLI] [BUGFIX] [local-cli/server/checkNodeVersion.js] - Disable auto-formatting in `local-cli/server/checkNodeVersion.js` since it introduces ES6 and ES7 syntax (trailing comma in argument list) which in turn makes ES5 engines crash with a `SyntaxError`.
Pull Request resolved: https://github.com/facebook/react-native/pull/20779

Differential Revision: D9468346

Pulled By: hramos

fbshipit-source-id: 24761a377a5fd104e11ed6b6e86da15e96a0e38b
2018-08-22 20:34:41 -07:00
Rafael Oleza 9a77ff593b Fix default projectRoot + watchFolders computation
Summary:
@public

This diff fixes the `projectRoot` calculation on React Native when the app does not have a config file. This should fix the issues reported in https://github.com/facebook/react-native/issues/20712

Reviewed By: hramos

Differential Revision: D9444982

fbshipit-source-id: 4cb41fa5224d2addf92976cc119e49dea6a6346b
2018-08-22 20:34:39 -07:00
Rafael Oleza 8a21abcd6b Prevent cross origin requests to development server
Summary:
This diff adds a middleware to the RN development server to prevent processing requests coming from a third-party website.

The way we choose to do it is to block any request that has an origin header and it's different than localhost. This will still allow simulators to work properly while blocking potential external websites to do malign CORS requests.

This is just a first quick measure to block a potential attack vector while we implement full authentication in the RN development server

Reviewed By: mjesun

Differential Revision: D9238674

fbshipit-source-id: b7bdc40dabc2f4d92f5ac84515f93b89efa4e833
2018-08-22 12:31:19 -07:00
Dulmandakh 874cca1ac2 Bump Android Support Library to 27.1.1 (#20586)
Summary:
This PR bumps Android Support Library version to 27.1.1.

FYI, originally was a part of https://github.com/facebook/react-native/pull/20026.
Pull Request resolved: https://github.com/facebook/react-native/pull/20586

Differential Revision: D9414901

Pulled By: hramos

fbshipit-source-id: 580338e62a924c214accc5d944f17c81ad9e3f9f
2018-08-20 18:08:52 -07:00
jamsch d846696f49 Add missing "--terminal" argument to run-android (#20584)
Summary:
Commit 79e498b7fb claims that "--terminal" has been added as an argument to the "run-android" script which it hasn't. Instead it adds a new environment variable "process.env.REACT_TERMINAL" which seems to be undocumented and nowhere else in the repository.

This commit now allows Linux and OSX users to specify their custom terminal :

    react-native run-android --terminal=x-terminal-emulator

Additionally the metro bundler child process "detached" option has been set to false if no terminal has been specified on Linux which fixes an issue where the packager would be running in the background and would have to manually be closed by finding the process.

Fixes #18122
Pull Request resolved: https://github.com/facebook/react-native/pull/20584

Differential Revision: D9234990

Pulled By: hramos

fbshipit-source-id: 60e4cc57b2790c419d5a4f9027add04313ddf6f8
2018-08-20 15:02:42 -07:00
Eric Rozell 7062e5bdb5 Apply `--reset-cache` argument to `bundle` command (#20706)
Summary:
The `--reset-cache` argument was not working correctly with the `bundle` command. This ensures the `--reset-cache` arg is passed to metro.

Fixes #20703

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

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

Differential Revision: D9400548

Pulled By: hramos

fbshipit-source-id: 2c7ed0226cfcdffa8cc77506500c314552baef3f
2018-08-20 10:02:58 -07:00
Panagiotis Vekris d4870babe6 v0.79.1 in xplat/js
Summary: The controller you requested could not be found.

Reviewed By: gabelevi

Differential Revision: D9390604

fbshipit-source-id: 68ba89ba197f74322e4c85c3bfc1f334fb740852
2018-08-18 22:19:34 -07:00
Eric Rozell c5297c75cb Do not override `metro.config.js` settings (#20705)
Summary:
React Native overrides the `metro.config.js` settings for, e.g., `hasteImplModulePath`, which prevents us from adding a `metro.config.js` file to the repo for `react-native-windows` to allow us to resolve Haste modules at the top-level of the repo. This change ensures that if a user has a `metro.config.js` file, those settings are not overwritten by React Native.
Pull Request resolved: https://github.com/facebook/react-native/pull/20705

Differential Revision: D9390146

Pulled By: hramos

fbshipit-source-id: 5ccc137490410ace72d7b0e68f2bafcbb233c59f
2018-08-18 05:31:41 -07:00
Héctor Ramos cf190bf601 Fix Flow errors (#20696)
Summary:
Revert change to flow strict-local in OSS.
Pull Request resolved: https://github.com/facebook/react-native/pull/20696

Differential Revision: D9367630

Pulled By: hramos

fbshipit-source-id: 17e4d1ab6d00b2e14033b223d878d5fcd1c098f4
2018-08-16 17:32:08 -07:00
Linus Unnebäck 35bd17f1d6 Switch babel preset to metro-react-native-babel-preset (#20653)
Summary:
Fixes #20567
Pull Request resolved: https://github.com/facebook/react-native/pull/20653

Differential Revision: D9296819

Pulled By: hramos

fbshipit-source-id: 88953afb9778e3c8cde5576b068888fd882c2220
2018-08-13 10:32:11 -07:00
Rafael Oleza 0f08635991 Fix passing the --reset-cache CLI argument to Metro
Summary:
@public

While debugging a RN 0.57 blocking issue, we found that the `--reset-cache` cli arg is not being passed to Metro (more info: https://github.com/facebook/react-native/issues/20567#issuecomment-412513942).

This diff fixes this issue

Reviewed By: mjesun

Differential Revision: D9295634

fbshipit-source-id: a53ec7abff2b7e684a1fd88c3b53ff0b54a1c3c4
2018-08-13 07:31:35 -07:00
Janic Duplessis 5892d5c3cf Enable metro hmr server in local-cli (#20605)
Summary:
The `hmrEnabled` flag was not passed to the metro runServer config which caused HMR to be broken.
Pull Request resolved: https://github.com/facebook/react-native/pull/20605

Differential Revision: D9272070

Pulled By: hramos

fbshipit-source-id: 3765031d9e7806be11781fba92663ce7c4ff2ffb
2018-08-10 14:32:30 -07:00
Wayne Cheng f536a0c268 Adding flow strict local to remaining possible files in xplat/JS
Summary:
ag -L --ignore __snapshots__ 'flow strict|noflow|generated|The controller you requested could not be found.' | ag '\.js$' | xargs ag -l 'flow' | sort > ~/temp
  cat ~/temp | xargs ag -L 'flow strict' | xargs sed -i '' 's/flow$/flow strict-local/'
  until flow check; do flow check --json | jq -r '.errors[].message[0].path' | sort | uniq | xargs hg revert; done

allow_many_files
The controller you requested could not be found.
The controller you requested could not be found.

Reviewed By: TheSavior

Differential Revision: D9004573

fbshipit-source-id: 936bd5741706b781be06bf08b6ad805a69407dfd
2018-08-09 08:54:44 -07:00
Justin Chapman d154e9ec9d Allow for undefined userConfig (#18660)
Summary:
Fixes #18249

This PR fixes an error that occurs when running `react-native link` in projects laid out as described on the React Native website section on integrating with existing apps (https://facebook.github.io/react-native/docs/integration-with-existing-apps.html) where an `ios/` subdirectory exists but an `android/` subdirectory does not exist

<img width="1050" alt="screenshot 2018-04-02 14 57 27" src="https://user-images.githubusercontent.com/2475286/38210733-3f4bd9ea-3686-11e8-9bd3-d299812a015c.png">

None

[CLI] [BUGFIX] [local-cli/core/android/index.js] - Allow for undefined userConfig
Pull Request resolved: https://github.com/facebook/react-native/pull/18660

Differential Revision: D9235171

Pulled By: hramos

fbshipit-source-id: 230dd54f8911046f7e01633f99c4f02070fa0172
2018-08-08 21:16:57 -07:00
gengjiawen 51b12dd375 fix gradle wrapper issue (#19976)
Summary:
Just change gradle.properties version number to change gradle version is not the right way. Because sometimes the gradlew and gradlew.bat or even the jar need to be updated too.
I also add the wrapper task to `build.gradle`, so next time, we just need to change the version number and execute `gradlew wrapper`.
pass all current ci.
none
 [GENERAL] [BUGFIX] [Android] - fix gradle wrapper issue
Pull Request resolved: https://github.com/facebook/react-native/pull/19976

Differential Revision: D9229655

Pulled By: hramos

fbshipit-source-id: 63d1ddea6174f87778612a4e6711baac5787b0f8
2018-08-08 15:03:01 -07:00
Joshua Wang c298e0ae06 Update template to Xcode 9.4 and fix project settings warnings (#19626)
Summary:
Motivation: Fix Xcode Project Settings Warnings
![screenshot 2018-06-08 10 58 23](https://user-images.githubusercontent.com/5353594/41173274-1a4fbb3e-6b0b-11e8-973b-8290794a4f8b.png)

Should still build and pass all tests since project settings changes should be safe changes.

No documentation change is required

[IOS][MINOR][XcodeProjs] Upgraded Project settings to be compatible with Xcode 9.4
Pull Request resolved: https://github.com/facebook/react-native/pull/19626

Differential Revision: D9211230

Pulled By: hramos

fbshipit-source-id: ef8692871bffbdb5dd0214f65220fd171c203c6c
2018-08-07 19:46:23 -07:00
Mayank Patke ccf5dfbe3f v0.78 in fbsource
Summary: The controller you requested could not be found.

Reviewed By: pakoito

Differential Revision: D9174188

fbshipit-source-id: 4ec9ef5b6f802964a83b6bc0bd29db7f47b37c21
2018-08-07 16:03:09 -07:00
Tvrqvoise 6d65e8b4ed Add support for linking scoped packages (#18766) (#19828)
Summary:
Currently, when the cli tries to determine the package name, it accidentally trims out the entire package name.  This makes it appear to the rest of the program as if `react-native link The controller you requested could not be found./my-package` was just `react-native link`.  This adds a little regex to prevent that from happening, so that scopes can be passed as parts of packages.

Fixes #18766
Pull Request resolved: https://github.com/facebook/react-native/pull/19828

Differential Revision: D8704742

Pulled By: hramos

fbshipit-source-id: d8183f9b55e8656b8a0acae842e1361a1f428102
2018-08-06 12:32:25 -07:00
Tom Atterton 5219585ef9 Ignore DevDependencies when generating template. (#20542)
Summary:
Regarding [Add devDependenices support for templates](c4ab03a18e).

Once a project is created using the custom template command with devDependencies inside, the devDependenices.json file is also copied to the new projects directory.

By adding this to the ignore paths we stop the devDependenices being copied into the new projects directory.
Pull Request resolved: https://github.com/facebook/react-native/pull/20542

Differential Revision: D9182795

Pulled By: hramos

fbshipit-source-id: 543c8ca67612a981c22fc83c8d54a25ddc0ca5fc
2018-08-06 12:32:24 -07:00
Janic Duplessis 44c1012cca Enable optional chaining and nullish coalescing in flowconfig template (#20517)
Summary:
Follow up to a9792ac4c8 and #20516

This makes sure new projects typecheck properly since RN can use this syntax.
Pull Request resolved: https://github.com/facebook/react-native/pull/20517

Differential Revision: D9169268

Pulled By: TheSavior

fbshipit-source-id: f2b08598bdc6979931e987c9a275d75f08751754
2018-08-03 16:32:11 -07:00
Ives van Hoorne 140b230e84 Change react-native config loading to provide an override for the default config.
Summary:
Instead of overriding the config at the end we now do it right after applying default
config and before the user config is applied.

Reviewed By: rafeca

Differential Revision: D9131758

fbshipit-source-id: 15e575fc11a781187f3ee2fa7cf81c227cf6a088
2018-08-02 05:31:48 -07:00
Dulmandakh 6117a6c720 Bump Android NDK to r17b (#20357)
Summary:
This PR bumps Android NDK version to r17b (latest). Cleaned up redundant **LOCAL_EXPORT_CPPFLAGS** rules in .mk files
Pull Request resolved: https://github.com/facebook/react-native/pull/20357

Differential Revision: D9068424

Pulled By: hramos

fbshipit-source-id: 8578637e38e807288b819a36cb75ea9feefcc09f
2018-07-30 14:02:11 -07:00
Ives van Hoorne 9176fc00b5 Add extra flowtype stubs for metro (#20429)
Summary:
We ignore some `metro` flowtypes, which made `flow check` fail on `metro-config`. I now also added the `metro` stubs needed by `metro-config` to make `flow check` pass.

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

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

Reviewed By: hramos

Differential Revision: D9036903

Pulled By: CompuIves

fbshipit-source-id: 6e348e929b7c36520787bb860f5a18aa588455c3
2018-07-27 20:32:47 -07:00
Vincent Riemer c4bcca6685 Whitelist react-native-dom in haste/cli config defaults (#20393)
Summary:
This adds `react-native-dom` to `hasteImpl.js` because it's not currently possible to configure it from an out of tree platform. Also adds the relevant `providesModuleNodeModules` and `platforms` values to the default RN CLI config. This should hopefully be able to be removed once better support for out of tree platforms is implemented.
Pull Request resolved: https://github.com/facebook/react-native/pull/20393

Differential Revision: D9007186

Pulled By: hramos

fbshipit-source-id: 67077860dc1fb191d80300fb980599ed76d5f91c
2018-07-25 17:47:42 -07:00
Ives van Hoorne aaf797ad67 Use new config internally in Metro
Summary: Change the internals of Metro to use the new configuration instead of `ServerOptions`.

Reviewed By: rafeca

Differential Revision: D8734685

fbshipit-source-id: 1215f799419fcaa0e5fb7814683da1cbba96795c
2018-07-25 05:47:58 -07:00
Ives van Hoorne a32620dc3b Use new configuration in react-native public cli
Summary: Change the public react-native CLI to use the new configuration of Metro.

Reviewed By: rafeca

Differential Revision: D8801217

fbshipit-source-id: 112e4812b430ebee1ed41489f803b90c182ccdb4
2018-07-25 05:47:58 -07:00
Ives van Hoorne f0daaf3568 Convert internal react-native-cli
Summary: In this diff I change the internal react-native cli to use our new configuration. Another change here is that Metro starts using the new configuration already as its entry points (like `metro#runMetro`).

Reviewed By: rafeca

Differential Revision: D8728612

fbshipit-source-id: 9f43dee31ebaccd35cf6274d5c4dec0a227a6eec
2018-07-25 05:47:57 -07:00
Avik Chaudhuri 1f545743b9 @allow-large-files flow 0.77 fbsource release
Reviewed By: pakoito

Differential Revision: D8950363

fbshipit-source-id: 15b72b586076cf9523a40f36e489066542bec7d5
2018-07-23 11:48:44 -07:00
Jean Lauliac ebf5aeab28 BREAKING: metro: rename 'unbundle' to 'ram bundle'
Summary:
@public

Let's get rid of the "unbundle" terminology and instead use "RAM bundle", short for "Random Access Bundle" format. THIS IS A BREAKING CHANGE FOR OSS, as the command becomes `ram-bundle` instead of `unbundle`. It realy shouldn't be a command to start with (only a "format" specifier for the `bundle` command), but I don't want to do that change at this point.

Reviewed By: davidaurelio

Differential Revision: D8894433

fbshipit-source-id: 5565f9ae94c7c2d7f6b25f95ae45b64f27f6aec8
2018-07-20 09:33:57 -07:00
Janic Duplessis f05943de0a Fix local-cli assetRegistryPath and middlewares (#20162)
Summary:
This fixes some regressions with local-cli introduced in c4a66a89a2.

- We didn't pass `assetRegistryPath` which caused the following error when loading the bundle:
```
error: bundling failed: Error: Unable to resolve module `missing-asset-registry-path` from `/Users/janic/Developer/react-native/RNTester/js/uie_thumb_normal@2x.png`: Module `missing-asset-registry-path` does not exist in the Haste module map
```
- The middlewares were not added to the metro server. This causes some packager server features to fail. The one I noticed is that the /status endpoint didn't exist anymore which causes CI to fail and also Android to not load the bundle from the packager initially. The remote debugging feature was also broken.
Pull Request resolved: https://github.com/facebook/react-native/pull/20162

Differential Revision: D8867610

Pulled By: hramos

fbshipit-source-id: 8a08b7f3175692ab6ee73c0a7c25075091ae4792
2018-07-18 15:34:15 -07:00
Héctor Ramos e64e13fce3 Bump minimum Node version to 8.3 (#20236)
Summary:
Node rest/spread syntax started working without the harmony flag in 8.3 (https://github.com/facebook/react-native/pull/20178#issuecomment-404961149).

Release Notes:
[GENERAL] [BREAKING] [Node] - Bump minimum req. Node version to 8.3
Pull Request resolved: https://github.com/facebook/react-native/pull/20236

Differential Revision: D8876357

Pulled By: hramos

fbshipit-source-id: 1f5f791ef318e70c6be8b23d887a1d650a68e594
2018-07-17 21:02:19 -07:00
Rafael Oleza 8ef90df28c Clean metro server correctly after bundle errors
Summary:
This is a very similar fix than D8858846, but done in the RN CLI (soon we'll be able to just call `Metro.runBuild()` from RN which will remove this duplication).

This actually fixes the issues in the integtration tests (t31612131). It's just funny that two unrelated problems that are caused by the same issue located in two different places have been reported at the same time.

Differential Revision: D8859276

fbshipit-source-id: 805e111a406f2a7c1b3df3ab02accf4c4041a464
2018-07-17 03:16:52 -07:00
Martin Sherburn 578b0b2a51 Fixed issue with reloading bundle from remote debugger
Summary: This is a follow up to D8316215. That diff had a flaw in that once appExecuted was set to true it would never be reset back to false. This fixes that so if another bundle is loaded after the first one it will work.

Reviewed By: rafeca

Differential Revision: D8661523

fbshipit-source-id: 5f6024102248383f64952fd33b37368732d5f900
2018-07-11 04:31:14 -07:00
Gabe Levi eac34e3021 Flow v0.76.0
Summary: No new errors in this version. Just removed a bunch of unused suppressions

Reviewed By: TheSavior

Differential Revision: D8754160

fbshipit-source-id: 2f02240b6d65edecba5d9ed603c7703462547a7f
2018-07-09 08:17:51 -07:00
Alexey Kureev 5067540487 Fix react-native CLI (internal and external one)
Summary:
- Fix wrong debugger-ui path
- Override host and port using args

Reviewed By: yungsters

Differential Revision: D8731159

fbshipit-source-id: ca8ad76a02eda9e0b9cdb1a952aa5631d660868f
2018-07-03 23:48:12 -07:00
Dulmandakh 33d20da41b @allow-large-files [react-native][PR] Upgrade Gradle to 4.4 (#19899)
Summary:
Bump gradle to 4.4, version used by android studio 3.x and gradle plugin 3.x. This will help make migration easier and smoother.

CI: https://circleci.com/gh/dulmandakh/react-native/591

FYI: I found that gradle 4.8 works fine with gradle plugin 2.3, but gradle plugin 3.x displays warnings and asks to disable on demand configuration.
Closes https://github.com/facebook/react-native/pull/19899

Reviewed By: fkgozali

Differential Revision: D8697929

Pulled By: hramos

fbshipit-source-id: 21eb625ee1e4a1fa02aa22de4c36a07269ca467b
2018-07-03 18:18:30 -07:00
Miguel Jimenez Esun bbc8bb1f9d Do not use morgan internally
Summary: `morgan` produces non-json output, which affects `js1 run` when ran with the `--json` flag.

Reviewed By: Kureev

Differential Revision: D8724830

fbshipit-source-id: 11377f6ef39341c658a7f905383398423a721630
2018-07-03 13:47:08 -07:00
Rubén Norte 54942746d4 Hotfix to include react-native-windows in hasteImpl accepted paths (#20007)
Summary:
Closes https://github.com/facebook/react-native/pull/20007

We removed support for providesModule annotations and maintained support for Haste names in installed modules via `providesModuleNodeModules`, but our default `hasteImpl` doesn't take them into account. We need to find a better way to override core components from plugins but meanwhile this adds an exception for react-native-windows in the default `hasteImpl` to unblock their upgrade to the latest RC.

Fixes https://github.com/facebook/metro/issues/188

Reviewed By: mjesun

Differential Revision: D8695207

fbshipit-source-id: 2ad6cb1e93e600880a148776ac45f6ebd7d205d3
2018-07-02 11:17:41 -07:00
gengjiawen fdce938455 fix missing prettier file (#20001)
Summary:
fix missing prettier file
pass all current ci.
https://github.com/facebook/react-native/pull/19987
 [GENERAL] [INTERNAL] [TOOL] - fix missing prettier file.
Closes https://github.com/facebook/react-native/pull/20001

Differential Revision: D8714374

Pulled By: hramos

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

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

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

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

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

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

Reviewed By: mjesun

Differential Revision: D8711717

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

<!--
Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

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

Happy contributing!

-->

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

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

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

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

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

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

[CATEGORY] [TYPE] [LOCATION] - MESSAGE

 EXAMPLES:

 [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
 [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
 [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
 [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
 [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
 [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->
[INTERNAL] [BUGFIX] [./scripts] - Fixed runAndroid to enable the use of a package on port <> 8081 for Windows.
Closes https://github.com/facebook/react-native/pull/17498

Differential Revision: D8682067

Pulled By: hramos

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

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

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

Differential Revision: D8675341

Pulled By: hramos

fbshipit-source-id: 4ed06cd7ef7ae70f153d7f335ef8a9d1371f6ce0
2018-06-27 20:33:09 -07:00
Alexey Kureev c972a5c298 Fix: D8450498 breaks test_end_to_end job (#19910)
Summary:
Closes https://github.com/facebook/react-native/pull/19910

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

Reviewed By: hramos

Differential Revision: D8650733

fbshipit-source-id: 502ca469cdbfa04dab5127c1e330dc1d34fc02f8
2018-06-26 19:01:56 -07:00
iyegoroff 6bbc1b7b96 Show packager error stack (#19705)
Summary:
Motivation: get more info from packager errors to easier debug them

add `throw new Error('error')` here 635f2740c2/local-cli/cliEntry.js (L116) and run
`react-native start` to see error stack
<!--
  Required: Write your test plan here. If you changed any code, please provide us with
  clear instructions on how you verified your changes work. Bonus points for screenshots and videos!
-->
[CLI] [ENHANCEMENT] [local-cli/cliEntry.js] - Show packager error stack

<!--
  **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
-->
Closes https://github.com/facebook/react-native/pull/19705

Differential Revision: D8628322

Pulled By: hramos

fbshipit-source-id: 531217addea122d9761e4f5dd5c666a3b4b56a38
2018-06-25 18:18:02 -07:00
Dulmandakh b569154ae6 bump build tools to 26.0.3 (#19831)
Summary:
This will bump android build tools to 26.0.3, and will remove warning about newer version of build tools in Android Studio, thus improve developer experience.
Closes https://github.com/facebook/react-native/pull/19831

Differential Revision: D8620094

Pulled By: hramos

fbshipit-source-id: fa1c6739bb7556736c1b323acea88fe87e82f4d7
2018-06-25 17:17:25 -07:00
Rafael Oleza 33ba5e8fa2 Stop using projectRoots from RN cli
Summary:
This diff tries to fix an issue that started appearing in RN master when the latest metro version is used (more info here: c5ce762697 (commitcomment-29443117)).

The problem is that RN is still reading `projectRoots` from the Metro config and trying to call `concat()` on them. Latest Metro sets the default `projectRoots` to null, so this fails.

Also, a couple other things have been done:

* Make sure that the `projectRoot` and `watchFolder` objects from args are passed to Metro (so they contain the overrides from the CLI arguments).
* Add a `--projectRoot` CLI arg, replacing the `--root` one (this is not actually needed, since it does the same as `--watchFolders`

Differential Revision: D8567229

fbshipit-source-id: 3b76fd8e23d201a4097e9dfba3a512d64f348cb0
2018-06-22 08:17:57 -07:00
Sam Goldman 6264b6932a Deploy Flow v0.75.0 to fbsource
Summary:
bypass-lint
allow-large-files

Reviewed By: gabelevi

Differential Revision: D8579147

fbshipit-source-id: 12280dd4872551247ff9baafab3d766d3d7a544a
2018-06-21 20:01:40 -07:00
Eli White eea4842972 Flow strictify possible files in RN core
Summary:
This was done by running the command on: https://our.intern.facebook.com/intern/wiki/Flow_Strict/

```
ag -L --ignore __snapshots__ 'flow strict$|noflow|generated|partially-generated' | ag '\.js$' | xargs ag -l 'flow' | sort > ~/temp
cat ~/temp | xargs ag -L 'flow strict' | xargs sed -i 's/flow$/flow strict/'
cat ~/temp | xargs ag -L 'flow strict$' | xargs sed -i 's/flow strict-local$/flow strict/'
until flow; do flow --json | jq -r '.errors[].message[0].path' | sort | uniq | xargs hg revert; done
```

Reviewed By: sahrens

Differential Revision: D8530207

fbshipit-source-id: c28c7ac5ed3e9b80f3d126d5f30463be8a8a744d
2018-06-20 00:47:21 -07:00
Alexey Kureev c5ce762697 Replace projectRoots with projectRoot + watchRoots
Summary:
We use projectRoots to limit crawling of jest-haste-map in large codebases. Since this implies multiple projects roots, it makes it very hard (or impossible) to reliably cache dependency resolutions.

If we can replace this with a single project root and a set of watch roots, we can have relative path resolutions for all dependencies which van be cached.

Reviewed By: rafeca

Differential Revision: D8450498

fbshipit-source-id: 830c21e847c3236e42d5414a8587508cb73864bd
2018-06-19 13:47:32 -07:00
Eli White 843a433e87 Update react-native init's flowconfig
Summary:
Fixes https://github.com/facebook/react-native/issues/19766

On a clean project flow was complaining about `Cannot resolve module X` because of the removal of `providesModule`. This resolves the errors.

Reviewed By: rubennorte

Differential Revision: D8500303

fbshipit-source-id: 4e129ee4382f8ff36ab126e9f6c6530254cd382e
2018-06-18 16:02:34 -07:00
Michał Mokijewski a130239257 Make run-ios command play nicely with multiple Xcode versions (#19781)
Summary:
I started using Xcode 10 beta and spotted that even though react-native cli is using cli tools from Xcode 10 for building it tries to open simulator from Xcode 9.4. Turned out that path to simulator app is hardcoded and doesn’t care about active developer directory.

1. You have to have more than one Xcode version (ie. 9.4 and 10 beta).
2. Change active developer directory to Xcode beta (`xcode-select -s /Applications/Xcode-beta.app/Contents/Developer`).
3. Without fix `react-native run-ios` will open simulator from Xcode 9.4, with fix it'll open simulator from active developer directory.

[CLI][IOS] [BUGFIX] [./local-cli] - use simulator from active developer directory
Closes https://github.com/facebook/react-native/pull/19781

Differential Revision: D8475915

Pulled By: TheSavior

fbshipit-source-id: d607f1f9eb9e565d4a017c21de50b5e569d171f9
2018-06-17 23:01:49 -07:00
Dulmandakh 699e5eebe8 bump gradle-plugin@2.3.3, gradle@3.5.1, gradle-download-task@3.4.3 (#19697)
Summary:
bump gradle-plugin@2.3.3, gradle@3.5.1, gradle-download-task@3.4.3, as we landed build tools 26.0.2 with 065c5b6590

Will improve Android build performance.

Everything will work as normal, but build faster.

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

[ANDROID] [ENHANCEMENT] [TOOLS] - bump gradle-plugin@2.3.3, gradle@3.5.1, gradle-download-task@3.4.3
Closes https://github.com/facebook/react-native/pull/19697

Differential Revision: D8433743

Pulled By: hramos

fbshipit-source-id: da72aeb314bed7f63807a0c69bebd24c633cc807
2018-06-14 17:02:18 -07:00
Dulmandakh 6d56a234e3 add google maven repo in android project template (#19712)
Summary:
This PR will add Google maven repo to RN project template that contains com.android.support:appcompat-v7:26.1.0, thus fixes `react-native run-android` using version 0.56.0-rc.1

CI is Green - https://circleci.com/gh/dulmandakh/react-native/235

new Android projects will build and run just fine.
Closes https://github.com/facebook/react-native/pull/19712

Differential Revision: D8433730

Pulled By: hramos

fbshipit-source-id: b7d5a1cd5a97b1c4aad2a307158d6dbfcf9a42a5
2018-06-14 16:21:42 -07:00
Dulmandakh 065c5b6590 use android build-tools 26.0.2 and set compileSdk to 26 (#19662)
Summary:
Android Target API Level 26 will be required starting from August 2018, it's so soon 😄.Read https://android-developers.googleblog.com/2017/12/improving-app-security-and-performance.html

This PR uses android build tools 26.0.2, support library 26.1.0 (with android lifecycle) and setting compileSdkVersion to 26, but leaving minSdkVersion and targetSdkVersion intact, which will make targeting 26 easy.

Circle CI: https://circleci.com/gh/dulmandakh/react-native/209

Everything will build and work just fine.

[ANDROID] [ENHANCEMENT] [TOOLS] - Use android build-tools 26.0.2 and set compileSdk to 26, and use support library version 26.1.0.
Closes https://github.com/facebook/react-native/pull/19662

Differential Revision: D8398855

Pulled By: hramos

fbshipit-source-id: a4066eb04cb5f947efe1f3202b638c1092b79aae
2018-06-13 10:39:55 -07:00
Rafael Oleza 39d9d71adb Expose getResolverMainFields() config param
Reviewed By: mjesun

Differential Revision: D8380198

fbshipit-source-id: 3d5b7a5873095db2b90a23b5054fb94579df3f1a
2018-06-12 13:58:10 -07:00
gengjiawen 123512c5de fix No bundle url present in iOS (#19643)
Summary:
fix No bundle url present in iOS.
Related issue: https://github.com/facebook/react-native/issues/14118, https://github.com/facebook/react-native/issues/12754.
Pass all current ci
none
 [GENERAL] [BUGFIX] [iOS] - fix No bundle url present in iOS
Closes https://github.com/facebook/react-native/pull/19643

Differential Revision: D8374583

Pulled By: hramos

fbshipit-source-id: 62d621f431d2067825dc701f87044ecb1d720f14
2018-06-11 22:49:00 -07:00
Maël Nison 3bed272a62 Upgrade to Flow v0.74.0
Reviewed By: panagosg7

Differential Revision: D8322344

fbshipit-source-id: 1208528009785f7f797201777287af525d0a9ca1
2018-06-10 18:00:07 -07:00
Héctor Ramos e315ec9891 Fix iOS e2e tests: bump react-native-babel-preset to ^5 (#19625)
Summary:
We opt in to version ^5 of the React Native Babel Preset, as required after the bump to Babel 7. This fixes the Objective-C end-to-end test failure in master. (Fixes #19538)

See 34bd776af2 (commitcomment-29024085) for prior discussion.

There have already been several changes made to the repo during the transition to Babel 7. This PR brings all tests back to green and allows us to move forward with the 0.56 branch cut.

We also bump our tests to use Xcode 9.4.0 and iOS 11.4, the latest stable versions of both.

Once the 0.56 branch makes it to stable, we can change `react-native-babel-preset@latest` on npm to point to `react-native-babel-preset@5.0.1` (or newer), and undo the change made to `init.js` we made as part of this diff.

Wait for Circle CI to run: https://circleci.com/workflow-run/e39a66d7-bf8a-4b31-a22f-eef30a2c53bc

[GENERAL] [BREAKING] [Babel] - Bump React Native Babel Preset version used by RN CLI to Babel v7 compliant release
Closes https://github.com/facebook/react-native/pull/19625

Reviewed By: TheSavior

Differential Revision: D8343861

Pulled By: hramos

fbshipit-source-id: 42644d5b0bfb40a8bc592ae3461c5008deef8232
2018-06-10 17:08:56 -07:00
Martin Sherburn e5aa5b7c50 Fixed concurrency issue in remote debugger
Reviewed By: rafeca

Differential Revision: D8316215

fbshipit-source-id: 70b5000a9bf09897bb9b9d505bfc5dcc7c4c3a41
2018-06-08 03:02:01 -07:00
Peter van der Zee 29fb2a8e90 Bump Prettier to 1.13.4 on xplat
Summary:
Bump Prettier to use version 1.13.4
All code changes are caused by running Prettier and should only affect files that have an `format` header.
All other changes caused by yarn.

Reviewed By: ryanmce

Differential Revision: D8251255

fbshipit-source-id: 0b4445c35f1269d72730f2000002a27c1bc35914
2018-06-06 05:32:06 -07:00
Rafael Oleza f68a04b05b Remove duplicated attachWebsocketServer module
Reviewed By: jeanlauliac

Differential Revision: D8248752

fbshipit-source-id: b829de4b0d75d154dd80196b589fe70b0050be4d
2018-06-04 02:35:11 -07:00
Rafael Oleza bdb8089268 Change default metro transformer
Differential Revision: D8234984

fbshipit-source-id: 83cecfbfa3300f7703ea197009d985bbbc58127a
2018-06-01 07:16:42 -07:00
Trevor Brindle c39b8041d1 cli: upgrade envinfo for new features in `react-native info`
Summary:
envinfo has done a good job reporting issues in the issue template so far, and I've done a lot of work between version 3.x and 5.x that react-native could benefit from. This adds:
- better information organization, including versions and paths
- Platform/CPU/RAM
- Android and iOS SDK version detection
- npm package globbing (select all babel* packages
- global npm packages (with globbing)

envinfo also can report IDE versions, other binaries, languages and browsers if needed, and in different formats. Take a look here if interested: https://github.com/tabrindle/envinfo

- run `react-native info` // standard info
- run `react-native info --packages` // all packages in package.json
- run `react-native info --packages jest,eslint,babel-polyfill` // specified packages
- run `react-native info --packages *babel*` // globbed packages

Sample standard output:
```
  System:
    OS: macOS High Sierra 10.13
    CPU: x64 Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
    Memory: 97.59 MB / 16.00 GB
    Shell: 5.4.2 - /usr/local/bin/zsh
  Binaries:
    Node: 8.11.0 - ~/.nvm/versions/node/v8.11.0/bin/node
    Yarn: 1.5.1 - ~/.yarn/bin/yarn
    npm: 5.6.0 - ~/.nvm/versions/node/v8.11.0/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 11.0, macOS 10.13, tvOS 11.0, watchOS 4.0
    Android SDK:
      Build Tools: 27.0.3
      API Levels: 26
  IDEs:
    Android Studio: 3.0 AI-171.4443003
    Xcode: 9.0/9A235 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.3.2 => 16.3.2
    react-native: 0.55.0 => 0.55.0
  npmGlobalPackages:
    create-react-native-app: 1.0.0
    react-native-cli: 2.0.1
```

https://github.com/facebook/react-native/pull/14428 - original inclusion of `react-native info`

[CLI] [ENHANCEMENT] [local-cli/info/info.js] - add more info to react-native info cli command, like global npm packages, binary paths, and SDK versions
Closes https://github.com/facebook/react-native/pull/19331

Differential Revision: D8049650

Pulled By: hramos

fbshipit-source-id: 35c677f369bcad1a014eb083b2ce60ba33fee0ea
2018-05-29 17:30:16 -07:00
glevi@fb.com 4fd594674f Upgrade xplat/js to Flow v0.73
Reviewed By: pakoito

Differential Revision: D8153280

fbshipit-source-id: 193b35f12ecfb002283912c29ce08319b52802e6
2018-05-25 13:54:04 -07:00
matheuspiment 94393f8652 update android ic_launcher
Summary:
Update the android app icon with the new version.

1. Create a new project using react-native init MyProject
2. Observe the app icon on android

[ANDROID] [MINOR] [ic_launcher.png] - Update the Android app icon with the new version
Closes https://github.com/facebook/react-native/pull/19131

Differential Revision: D8164345

Pulled By: hramos

fbshipit-source-id: 4a2fc308a6b85219561ba99ee8277b5d71dc4bbf
2018-05-25 11:15:58 -07:00
Sujay Jaju 843cfc3b20 Fix #18244 Support CRLF build.gradle for Linking
Summary:
Fix for #18244
Add support for build.gradle with CRLF based line ending when running react-native link

<!--
Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

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

Happy contributing!

-->

`react native link` fails if andorid/app/build.gradle has CRLF based line endings.

Minor 3 character code change.
Ran `react native link` on Windows and Mac to verify.

None

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

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

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

[CATEGORY] [TYPE] [LOCATION] - MESSAGE

 EXAMPLES:

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

Differential Revision: D8044774

Pulled By: hramos

fbshipit-source-id: 93fad3db7022784ee949936777aa5ac25e3a64a3
2018-05-25 11:15:58 -07:00
Jean Lauliac 23741470ca metro-memory-fs: enforce explicit cwd()
Reviewed By: mjesun

Differential Revision: D8137985

fbshipit-source-id: 2154cd758c079678d84f9c371d23bafb9511ec93
2018-05-25 08:04:34 -07:00
Miguel Jimenez Esun 390ded871c Move out "genMockFunction" and "genMockFn" to "fn"
Summary: In the upcoming Jest version `genMockFunction` and `genMockFn` are deprecated, so we need to kill them.

Reviewed By: rafeca

Differential Revision: D8107155

fbshipit-source-id: 4f46ab58e6e34224eb95e9355385da44f005ea94
2018-05-23 13:40:06 -07:00
Héctor Ramos 3e0ebc7663 Revert bump to API 26 and fix Android tests failures
Summary:
This reverts a3931e9531

The open source `test_android` job is not configured to use Android 26 quite yet. I've spent a couple of days trying to get our Android tests back in working order, with no luck.

I'm reverting the change that bumped React Native to use build tools 26 + Android SDK 26. I encourage contributors interested in making this change happen to work on getting our Android tests working with API 26.

This will allow us to focus on getting `test_android` back to green, and _then_ we can work on bumping to API 26 while keeping tests green.

Reviewed By: fkgozali

Differential Revision: D8066226

fbshipit-source-id: 9bfd58a7f081c0971b78b331073e70545c21ca6d
2018-05-23 13:06:12 -07:00
Kevin Gozali f50df4f5ec iOS OSS: deployment target 8.0 => 9.0
Summary: Moving target deployment to iOS 9.0+ from now on, removing customization for iOS 8.

Reviewed By: shergin

Differential Revision: D8053439

fbshipit-source-id: 292c58f15c6e6caf8b28d15c1521812d6ed675c5
2018-05-22 01:16:45 -07:00
Dulmandakh a3931e9531 android compileSdkVersion 26, use buildToolsVersion 26.0.3
Summary:
Starting August 2018, Google Play will require targetSdkVersion 26 for new applications, and November 2018 for application updates.

This PR will use Android build tools 26.0.3 and compilerSdk 26, then support library version 26.0.2 to make targeting 26 easier in the future.

I think this PR will help to people compile and test their applications, thus make transition easier (smoother). Also we'll have opportunity and time to migrate code to target 26.

https://github.com/facebook/react-native/issues/18095

React Native on android must work as usual

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

Differential Revision: D8010354

Pulled By: mdvacca

fbshipit-source-id: 63ba03585e918b38c2a2adb5d2f2e85d7ce46fae
2018-05-15 09:28:41 -07:00
Aaron Abramov 9fbff62b5f Use `hg root` for all CWD in test environment
Reviewed By: mjesun

Differential Revision: D7852925

fbshipit-source-id: 4baf8cddc43d388269577a337cfe5f329c86d0f6
2018-05-14 13:46:51 -07:00