Commit Graph

934 Commits

Author SHA1 Message Date
empyrical 2da60a8f45 Prettify remaining unprettified files (#21327)
Summary:
This PR is the result of running `yarn prettify` on the codebase - which caught a few files that were not prettified. This will make instructing people to run prettify a bit less complicated, since unrelated files will not show up in diffs.
Pull Request resolved: https://github.com/facebook/react-native/pull/21327

Differential Revision: D10046057

Pulled By: TheSavior

fbshipit-source-id: 2c771a3c758c72816c707e32ee2f4587e466f277
2018-09-25 19:50:08 -07:00
gengjiawen 0a2825f8b3 add x86_64 arm64-v8a support. Fixes #2814 (#18754)
Summary:
add arm64 support, related issue : https://github.com/facebook/react-native/issues/2814.
If we are okay with binary aar android-jsc, then the pr can be directly merged. Otherwise merge facebook/android-jsc#30 first and do a new release.

RNTester all variant works. You can also test the apk from here: https://github.com/gengjiawen/react-native/releases/tag/v0.56beta.

https://github.com/facebook/android-jsc/pull/30.

 [ANDROID] [ENHANCEMENT] [ABI] - add x86_64 arm64-v8a support.

Differential Revision: D9491481

Pulled By: hramos

fbshipit-source-id: d6ec6992768eb0c0866a0317273e09fae5b8935e
2018-09-24 11:32:56 -07:00
Jean Lauliac 9c242c8a2f react-native-github: set path mock to posix by default
Summary:
@public

Otherwise tests using `path` but not `fs` have an empty mock, as it happens on https://github.com/facebook/metro/issues/235#issuecomment-423722747

Reviewed By: mjesun

Differential Revision: D10008513

fbshipit-source-id: 673e2ca79c8105a68818985dc08fe7ccd5d13881
2018-09-24 06:32:24 -07:00
Héctor Ramos 5068dfcad3 Use Android SDK 27 in React Native
Summary:
Upgrade React Native to Android SDK 27 again, following the reversal in D9886607 (68c7999c25).

The SDK 27 is actually available internally in an alternate location that is suitable for use cases like React Native's. For future reference, SDK 28 is also available for use in this location.

Reviewed By: axe-fb

Differential Revision: D9929066

fbshipit-source-id: 9413f891d5587293a30544351340e9407a2dce55
2018-09-20 07:56:23 -07:00
gengjiawen 58fe324163 fix ci path problem on Windows (#21203)
Summary:
fix ci path problem on Windows
pass all current ci.
none
 [GENERAL] [INTERNAL] [CI] - fix ci path problem on Windows
Pull Request resolved: https://github.com/facebook/react-native/pull/21203

Differential Revision: D9943608

Pulled By: hramos

fbshipit-source-id: 66e3e196a6c0015e0472851abeee32de9fef140c
2018-09-19 10:47:41 -07:00
Vitor Capretz 6d09df5b72 ios-simulator: change default iphone version (#21148)
Summary:
this is just a suggestion, but as the iPhone 6 is discontinued by Apple
and the new iPhone line will match the X version, it could be good to update the default simulator.

it could also be the iPhone 8, feel free to suggest other changes!

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/21148

Differential Revision: D9928120

Pulled By: hramos

fbshipit-source-id: 005faa3a8e00b67f98a778c92ecc01b064e14199
2018-09-18 20:57:45 -07:00
Joel Arvidsson 9fca769e76 Fix ignored --projectRoot/watchFolders arguments (#21165)
Summary:
Due to Kureev's cleanup in c4a66a89a2 some arguments are no longer properly passed to metro, but just the default values. This broke the `--projectRoot` and `--watchFolders` arguments used by storybook to change the bundle entrypoint.

This PR simply fixes the regression by assigning these values from argv instead of reading config defaults.

Related: the undocumented `REACT_NATIVE_APP_ROOT` env var is broken, not sure for how long, but I can fix it as a part of this PR or make a new one.
Pull Request resolved: https://github.com/facebook/react-native/pull/21165

Differential Revision: D9929642

Pulled By: hramos

fbshipit-source-id: 00485a0429bd4301de03e5cb455e928878c4ba8f
2018-09-18 19:03:04 -07:00
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