Commit Graph

890 Commits

Author SHA1 Message Date
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