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

303 Коммитов

Автор SHA1 Сообщение Дата
Richard Hyatt 4a5a909264 iOS build - en0 and en1 used when generating ip.txt file (#25462)
Summary:
When `en0` is not assigned and `en1` is in use along with another interface present on the machine that uses a self-assigned address (169.254.xxx.xxx), the ip.txt file contains the self-assigned address. This causes the app reload/debug actions to fail when deployed to a physical device. see https://github.com/facebook/react-native/issues/25460

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

## Changelog

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

Test Plan:
execute `ifconfig`:

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

execute `ipconfig getifaddr en0`:  (produces nothing)

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

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

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

```
169.254.209.63
```

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

```
192.168.1.115
```

Differential Revision: D16099639

Pulled By: cpojer

fbshipit-source-id: bd480a5f638efc58611d22cef4ba5193052b713d
2019-07-03 02:39:49 -07:00
Kevin Gozali fde8a4cf93 TM iOS: Set up CocoaPods specs for the TM specs
Summary: This defines various sub specs to support building TurboModules that implement the codegen'ed specs.

Reviewed By: PeteTheHeat

Differential Revision: D16043221

fbshipit-source-id: 27ed532be929c11c8fe648632da8a72061cbc8b0
2019-07-01 15:20:01 -07:00
Wojtek Czekalski f491898a7f Fix rncore generation for React-Fabric.podspec following 98b03fa (#25437)
Summary:
This PR adjusts rncore generation to the flow parser based approach introduced in 98b03fa.

## Changelog

[Internal] [Fixed] - Fix iOS build of RNTester with fabric_enabled
Pull Request resolved: https://github.com/facebook/react-native/pull/25437

Test Plan:
As far as I see currently there's no automated testing for the RNTester build with `fabric_enbaled` set to `true`.

The quickest way to test this PR is building RNTester using cocoapods with `fabric_enabled`.

Differential Revision: D16071362

Pulled By: cpojer

fbshipit-source-id: 05d96686ea2d7c8c04f05eb7840c9eacff5a2738
2019-07-01 03:15:54 -07:00
Héctor Ramos 9ece5bda9b Use CocoaPods-based RNTesterPods for iOS tests (#25416)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/25416

Use CocoaPods-based RNTesterPods workspace to run iOS unit tests and integration tests.

This is necessary as new iOS projects now use CocoaPods by default. CocoaPods also powers the new package auto-linking feature.

In order to provide test coverage for this new default configuration, our iOS tests are being migrated to use a CocoaPods-managed RNTester workspace. This applies to both Circle CI, and Sandcastle.

Changelog:

[iOS] [Changed] - Use RNTesterPods for iOS Tests

Reviewed By: fkgozali

Differential Revision: D16052466

fbshipit-source-id: 724b0c51008882d3c06a9074693fe23e74abe86b
2019-06-28 19:18:10 -07:00
Daryl Johnas Sison 64282fd5b9 Revert D15958209: [RN] [RNTesterPods 5] Use CocoaPods-based RNTesterPods for iOS tests
Differential Revision:
D15958209

Original commit changeset: b51fb907812c

fbshipit-source-id: f0c499d8720ac91d5933c560281788e123269478
2019-06-28 00:57:57 -07:00
Héctor Ramos 39ab66793b Use CocoaPods-based RNTesterPods for iOS tests (#25416)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/25416

Use CocoaPods-based RNTesterPods workspace to run iOS unit tests and integration tests.

This is necessary as new iOS projects now use CocoaPods by default. CocoaPods also powers the new package auto-linking feature.

In order to provide test coverage for this new default configuration, our iOS tests are being migrated to use a CocoaPods-managed RNTester workspace. This applies to both Circle CI, and Sandcastle.

Reviewed By: fkgozali

Differential Revision: D15958209

fbshipit-source-id: b51fb907812cb2d4d78cce445d39bc253ae5acf8
2019-06-27 23:57:45 -07:00
Dan Abramov a52e6d1dbb Unify "Hot Reloading" and "Reload-on-Save" into "Fast Refresh"
Summary:
We have too many options in the Dev Menu, and they're really hard to pick from. They're also somewhat conflicting. This replaces two menu choices that have a similar purpose (faster iteration cycle) with one.

"Fast Refresh" tries to only update the affected modules, but falls back to doing a full reload if the update can't be handled by the React components.

If for some reason you prefer the "Reload-on-Save" behavior, please:

- Reach out to me so I can learn more about your use case.
- As a workaround, you can add `if (__DEV__) require.Refresh.forceFullRefresh = true` to your app's entry point to always do a full refresh.

Also note that I only removed the user-facing part of "Reload-on-Save". So if you have automation depending on it, that's gonna keep working.

I moved it above Systrace since it's a more generic feature.

As a total aside nit, I renamed "Enable Inspector" and "Disable Inspector" to "Show Inspector" and "Hide Inspector" because... that's what those options do, really.

Reviewed By: rickhanlonii

Differential Revision: D15958697

fbshipit-source-id: 20e856d56f661fe4d39b5ab47d8c44754bf70f67
2019-06-24 13:54:39 -07:00
Mehdi Mulani 46bdb4161c Delete fishhook
Summary: Fishhook was used to try to hide the log messages from RCTReconnectingWebSocket but that doesn't really work anymore. Deleting it now to unblock people trying to build for iOS 13.

Reviewed By: cpojer

Differential Revision: D15779390

fbshipit-source-id: ef18575d5d92ac374e189b1267dee3a9befc3551
2019-06-12 06:19:32 -07:00
Dulmandakh 146d1f7578 Bump Android NDK to r19c (#25140)
Summary:
In 2019-6-4 version of Docker Android image, we've added Android NDK r19c. So this PR will change CI to use NDK r19c.

I'll create a PR to website once this merged.

Note: I tried to build RN with NDK 19 while I was setting up my laptop after format, and it worked.

## Changelog

[Android] [Changed] - Bump Android NDK to r19c
Pull Request resolved: https://github.com/facebook/react-native/pull/25140

Differential Revision: D15631301

Pulled By: cpojer

fbshipit-source-id: b9a5600df1dadeba328932b694493960b242c2f7
2019-06-04 13:59:36 -07:00
Héctor Ramos 4a6676dc18 Cache CocoaPods specs-repo (#25095)
Summary:
The `test_end_to_end` job has been timing out due CocoaPods taking too long to check out the Specs repo. This repo is stored at `~/.cocoapods`, therefore by caching this folder we can keep the individual e2e test run from exceeding 10 minutes w/o output.

## Changelog

[Internal] [Added] - Cache CocoaPods
Pull Request resolved: https://github.com/facebook/react-native/pull/25095

Differential Revision: D15587702

Pulled By: hramos

fbshipit-source-id: 6669ff09a5021f012ac8a829db70442d8f7f07e8
2019-05-31 16:50:15 -07:00
Héctor Ramos 171cc0edb7 Migrate to Circle CI 2.1 (#25036)
Summary:
Migrate the Circle CI configuration to the 2.1 schema and take advantage of new config reuse features.

I've enabled pipelines in the facebook/react-native Circle CI project, a requirement for Circle CI 2.1 features.

### Overview

* Use executors to provide a common set of execution environments.
* Use commands to provide reusable steps (running yarn with cache, installing Android dependencies, ...)
* Use parametrized commands/jobs to reuse job definitions for `test_js` and `test_js_lts` where the only difference is the version of node provided by the environment.
* Reduce total execution time by [storing the git repo in a cache as opposed to using workspaces](https://circleci.com/blog/persisting-data-in-workflows-when-to-use-caching-artifacts-and-workspaces/)
* Fix various flaky end-to-end test failures related to CocoaPods and the CLI.
* Move `analyze` job to `analysis` workflow and rename to `analyze_pr`
* Rename `test_javascript` as `test_js`.
* Split up end-to-end test job into `test_ios_e2e` and `test_js_e2e`.

## Changelog

[Internal] [Changed] - Migrate to Circle CI 2.1 and fix e2e tests
Pull Request resolved: https://github.com/facebook/react-native/pull/25036

Differential Revision: D15565515

Pulled By: hramos

fbshipit-source-id: cfba2154a9fdc96400cbf778bd5d13e9411ee3f8
2019-05-30 15:11:13 -07:00
Rick Hanlon 9e97f71579 Organize files
Summary:
This diff reorganizes some of the code in react-native-codegen as requested in T44120025

There are two new dirs: `scr/cli` and `src/parsers`

```
buck_tests/
src/
  cli/
  generators/
  parsers/
```

We moved anything cli-ish from `buck_tests` to the `src/cli` directory:
```
src/
  cli/
    combine/
      combine_js_to_schema.sh
      combine_js_to_schema-cli.js
      combine_js_to_schema.js
    viewconfigs/
      generate-view-configs-cli.js
      generate-view-configs.js
      generate-view-configs.sh
```

And we created a new `src/parsers` directory that will contain the flow parser and the current schema parser:

```
src/
  parsers/
    flow/
      index.js
    schema/
      index.js
```

This should organize the code a little better and make it easier to contribute 👍

Reviewed By: cpojer

Differential Revision: D15414264

fbshipit-source-id: 376af2e91def033855f6ed72a9a9cc4369c33c7d
2019-05-22 06:02:03 -07:00
Héctor Ramos 9c3f4c021e Bots cleanup, avoid leaving inline reviews when N>5 (#24923)
Summary:
This PR cleans up some of our GitHub bots. The overall goal is to make the contribution process just a tad nicer.

### analysis-bot

* The bot will continue leaving GitHub Reviews when it finds lint issues, but will abstain from leaving inline comments if they would exceed 5 in number.
* The review comment left by the bot has instructions on how to reproduce the lint issues locally. This will educate PR authors on how to run lint and fix the issues without unnecessarily spamming the PR with 50+ comments, while still providing useful reviews to authors when only a handful of lint issues slip by.
* Code moved to `bots/` directory for ease of discovery and co-location with pull-bot.
* Added `yarn lint-ci` command. This seems like the right choice: it's running `yarn lint` and other linters, and it is only intended to run on CI.
* It's still possible to run `yarn lint-ci` locally, though the script will stop short of posting a review to GitHub unless the necessary envvars are provided.
* Added `yarn shellcheck` command. This can be run locally, though it requires `shellcheck` to be installed.
* Outside of this PR, I added instructions on using shellcheck to https://github.com/facebook/react-native/wiki/Development-Dependencies
* Updated Circle CI config to use these new commands, and streamlined the `analyze_pr` step.
* Documented analysis-bot in `bots/README.md`.

### pull-bot

* Bumped `danger-js` dependency. No breaking changes found in this minor bump from what I can tell.
* Documented pull-bot in `bots/README.md`.

### misc

* PR template: don't use jargon.

## Changelog

[Internal] [Changed] - GitHub Bots cleanup
Pull Request resolved: https://github.com/facebook/react-native/pull/24923

Differential Revision: D15399744

Pulled By: hramos

fbshipit-source-id: 32632e775f8554424072270e3f98542de84bfb8c
2019-05-21 19:38:54 -07:00
nossbigg 30a0a03b80 Fix ios/android e2e tests (#24974)
Summary:
Fixes broken ios/android e2e tests for CI.

Changes:
1. Use `npm pack` instead of `yarn pack` during e2e test
2. Update test string assertions in ios/android e2e tests
3. Use `Step One` as candidate for source code replacement to test for page changes (since the "Welcome to React Native" string exists in the `Header` component instead of being on `App.js`)

## Changelog

[Internal] [Fixed] - Fix ios/android e2e tests
Pull Request resolved: https://github.com/facebook/react-native/pull/24974

Differential Revision: D15431539

Pulled By: cpojer

fbshipit-source-id: 054af2c2fff6bbdb2263c15d7f5cd416aaa507fd
2019-05-21 05:44:29 -07:00
zhongwuzw 5954880875 Fixes syntax of autolink script (#24882)
Summary:
Oops, fixes syntax of autolink script landed in https://github.com/facebook/react-native/pull/24867.

## Changelog

[iOS] [Fixed] - Fixes syntax of autolink script
Pull Request resolved: https://github.com/facebook/react-native/pull/24882

Differential Revision: D15371272

Pulled By: cpojer

fbshipit-source-id: 8538be040b8b116b9651dc26749ab8febad0fe7c
2019-05-16 02:48:44 -07:00
Eric Lewis 90040290ef Add Fabric/Turbo Modules flags to iOS autolinking script (#24867)
Summary:
This makes it easier to enable fabric / turbo modules with the new fancy autolinking script.

## Changelog

[iOS] [Added] - Add Fabric/Turbo Module flags to iOS autolinking script
Pull Request resolved: https://github.com/facebook/react-native/pull/24867

Differential Revision: D15368550

Pulled By: fkgozali

fbshipit-source-id: 366cd9fb8b630011f9287ae762b985e4778de423
2019-05-15 22:30:41 -07:00
Pierre Reimertz f0770b6b37 fixes Xcode path issues containing whitespace when building Release (#24810)
Summary:
Some users (me included) have projects located in quirky places, resulting whitespaces in the path.
An example, , I symlink into my iCloud drive which result in the following path

```
/Users/r/Library/Mobile Documents/com~apple~CloudDocs/_/work/{a_company}/repos.nosync/app
```

This commit quotes the variable to make sure it gets properly passed to the CLI.

For reference, similar issue that has been resolved: 7d4e94edcc
Pull Request resolved: https://github.com/facebook/react-native/pull/24810

Differential Revision: D15316898

Pulled By: cpojer

fbshipit-source-id: 4ed2c8391d65d1680e836bfce8c51dfb5763caed
2019-05-13 07:29:50 -07:00
Héctor Ramos 9bd276c06b Rename Detox job, collect all e2e steps under test_end_to_end (#24689)
Summary:
Rename test_detox_end_to_end to test_end_to_end, then move JavaScript and iOS end-to-end tests to this job.

Fixes an issue in the end-to-end tests, but does not yet bring them back fully to green.

[General] [Changed] - Collect e2e tests under test_end_to_end job
Pull Request resolved: https://github.com/facebook/react-native/pull/24689

Differential Revision: D15202242

Pulled By: hramos

fbshipit-source-id: e7a9627896d2990cb6ddd0d3a91b915781ac2417
2019-05-03 14:38:10 -07:00
Ramanpreet Nara 913ff9f5ae Fix OSS build
Summary: iOS TurboModules work in OSS. I pulled out JSCallInvoker from `React-turbomodule-core`, as a part of D15055511. In this diff, I'm adding it back in.

Reviewed By: mdvacca

Differential Revision: D15195007

fbshipit-source-id: 64ee294a68c0a63ba400b8a829864c6619d3311a
2019-05-03 13:31:21 -07:00
Héctor Ramos 845eee403e Allow arbitrary location for third-party iOS dependency cache
Summary:
RNTester currently has four third party dependencies that are fetched from the network at build time:

- glog
- double-conversion
- boost
- folly

These dependencies are cached to ~/.rncache by default. This location may not be ideal for use in CI, therefore the cache location is now made configurable via a RN_CACHE_DIR envvar.

Reviewed By: cpojer

Differential Revision: D15141391

fbshipit-source-id: b51d749412c49500a657bd18e4c9520ddb30ea2c
2019-04-30 09:49:14 -07:00
Héctor Ramos b92f30dcc5 Fix `test_javascript` e2e tests (#24658)
Summary:
Fix regression in JavaScript e2e tests.

[General] [Fixed] - Fixed JavaScript e2e tests.
Pull Request resolved: https://github.com/facebook/react-native/pull/24658

Differential Revision: D15146466

Pulled By: cpojer

fbshipit-source-id: 05baa99e3b1cdd3ef02bc3f97cf2987dd8ba80f4
2019-04-30 03:08:46 -07:00
Kacper Wiszczuk 421ffb05ae Adjust test manual e2e script to work with new init (#24583)
Summary:
Since initialisation flow changed with default template, we need to adjust the script to make it work properly.

[General] [Fixed] - Adjust text manual e2e script to work with new init.
Pull Request resolved: https://github.com/facebook/react-native/pull/24583

Differential Revision: D15062374

Pulled By: cpojer

fbshipit-source-id: 8110597b27056570784439362f12963154460613
2019-04-25 02:03:10 -07:00
Héctor Ramos 0a16b53a78 Use Xcode 10.2.0 and iOS 12.2 in iOS tests (#24572)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/24572

Bumps to Xcode 10.2.0 and uses the iOS 12.2 simulator when running tests.

Changelog:

[iOS] [Changed] - iOS tests: Bump Xcode to 10.2.0, iOS to 12.2.

Reviewed By: cpojer

Differential Revision: D15049833

fbshipit-source-id: 40ee039f8be4db1365ad650b45e2e3e0a4ea80f3
2019-04-24 09:33:17 -07:00
Mike Grabowski 706f67a882 Use latest React Native CLI (#24517)
Summary:
Updates React Native to use latest CLI.

Changes:
- No more `--reactNativePath`, define it once in the configuration file. This reverts the previous PR that added this flag
- Add `platforms` and `commands` - React Native now defines platform like any other package. There's no longer concept of "out-of-tree" platform. All are treated equally. If React Native works, any other platform will work too.
- Updates `jest/hasteImpl.js` to use public CLI interface (`loadConfig`) instead of `findPlugins` and removes a weird conditional that checks for CI presence.

[INTERNAL] - Update React Native CLI
Pull Request resolved: https://github.com/facebook/react-native/pull/24517

Differential Revision: D15044762

Pulled By: cpojer

fbshipit-source-id: 379b61e842e619312c542173219a7d326663cf24
2019-04-24 05:09:10 -07:00
Orta Therox 326248e1f8 Adds a ruby file in RN which reflects what Podspecs should be imported by default (#24555)
Summary:
Simplifies the code anyone on iOS using RN has _to see_. In this case, React Native knows that everyone probably wants all these imports (unless they're using dev mode) and so we can auto-import the pod specs for a user from inside the lib.

Basically auto-link for the React side.

[iOS] [Added] - Adds a ruby function which imports the Pods for RN, so that users only have to include this function and it can change per RN version.
Pull Request resolved: https://github.com/facebook/react-native/pull/24555

Differential Revision: D15044780

Pulled By: cpojer

fbshipit-source-id: c3702a52104706def51da6f1d11ab966d57d1edb
2019-04-23 05:49:10 -07:00
Diego Sanchez 1f6de88230 Revert D14962710: [react-native][nbtd][Sandcastle][Facebook: Run RNTester Unit Tests on Sandcastle] Use Xcode 10.2.0 and iOS 12.2 in iOS tests
Differential Revision:
D14962710

Original commit changeset: 769cfb90aacc

fbshipit-source-id: a62ded9ac74f00332006b960862db5c258daff06
2019-04-23 02:33:55 -07:00
Héctor Ramos e106112202 Use Xcode 10.2.0 and iOS 12.2 in iOS tests
Summary:
Bumps to Xcode 10.2.0 and uses the iOS 12.2 simulator when running tests.

The `testBundleURL` test is temporarily disabled to allow the iOS unit tests to run successfully in the internal Facebook CI system.

Changelog:

[iOS] [Changed] - iOS tests: Bump Xcode to 10.2.0, iOS to 12.2.

Reviewed By: TheSavior

Differential Revision: D14962710

fbshipit-source-id: 769cfb90aacce33903ab6e8dbcc5b5727deacf41
2019-04-22 23:25:00 -07:00
Héctor Ramos d65daa0d3f Add react-native-oss-e2e job to Sandcastle, running JavaScript e2e tests from open source
Summary: Remove unused path variable from open source JavaScript test script.

Reviewed By: cpojer

Differential Revision: D14899083

fbshipit-source-id: 880102d404ca72c352a20654cb12263d98945a8b
2019-04-15 11:07:54 -07:00
Héctor Ramos 5bac2b761e Run the same JavaScript test script in Sandcastle and Circle (#24422)
Summary:
Consolidate JavaScript tests from open source into a single script that can be executed by both Circle CI and Sandcastle, the internal Facebook CI.

[General] [Changed] - Switch internal and external CI to use the same script when running JavaScript tests

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

Reviewed By: cpojer

Differential Revision: D14895773

fbshipit-source-id: d428929cc4e5219e02f5920259e08e0b3d24874c
2019-04-12 09:54:09 -07:00
Kacper Wiszczuk 265ae58038 Fix: use NODE_BINARY when starting packager (#24156)
Summary:
Fix packager script to use `NODE_BINARY` env variable.

Should fix #22868

[iOS] [Fixed] - Use `NODE_BINARY` env variable in `packager.sh` script
Pull Request resolved: https://github.com/facebook/react-native/pull/24156

Differential Revision: D14870783

Pulled By: cpojer

fbshipit-source-id: 27ecf8bf59883920ab51478b8a4d8f0780e34664
2019-04-10 07:39:23 -07:00
Héctor Ramos 3cc256ebaf Install local react-native package in e2e (#24381)
Summary:
Following 6df2edeb2a, the template for a new app no longer refers to a specific version of React Native, as the React Native CLI will set the correct version when `react-native init` is run. As it happens, the CLI cannot find a local react-native@1000 version when run as part of the JavaScript e2e tests. Therefore, I am working around using the CLI directly, and instead we're copying the contents of `template/` into a temporary directory for e2e tests. This is not dissimilar to what we already test internally at Facebook.

[General] [Fixed] - Fixed JavaScript e2e tests
Pull Request resolved: https://github.com/facebook/react-native/pull/24381

Differential Revision: D14865627

Pulled By: hramos

fbshipit-source-id: b036da7479200f3efe41b81b6b336333d5558182
2019-04-09 18:46:10 -07:00
Kudo Chien 8e375850de Use node package dependency to manage JSC version (#24276)
Summary:
In origin approach, we packed libjsc.so inside react-native.aar and it is difficult for user to choose different JSC variants. E.g., [the Intl supported version](https://github.com/react-native-community/jsc-android-buildscripts#international-variant).

This change list allows application to determine JSC versions or variants by npm/yarn package.

There is a |useIntlJsc| flag in build.gradle, it will use the same JSC version but with Intl support.

`yarn add jsc-android@canary`

[Android] [Changed] - Allow application to select different JSC variants

**MIGRATION**
Note that there are some changes in build.gradle.
Existing application needs to change their android/build.gradle and android/app/build.gradle.
Hopefully, the rn-diff-purge should handle the case well.
Pull Request resolved: https://github.com/facebook/react-native/pull/24276

Differential Revision: D14752359

Pulled By: cpojer

fbshipit-source-id: a4bfb135ad8e328f404a2d1a062412f40ebf4622
2019-04-04 14:22:14 -07:00
Héctor Ramos 8443487ad5 Avoid failing Obj-C tests when xcpretty is not installed (#24173)
Summary:
Fixes an issue where `scripts/objc-test-ios.sh` would fail if `xcpretty` is not installed. As this tool is not bundled with macOS, and it's not explicitly called out in our docs on testing, the script should not fail if it's not present.

In a related change, JUnit reports are written to a more sensible location when the script is run outside of Circle CI.

[iOS] [Fixed] - Fixed test script failure when xcpretty is not present
Pull Request resolved: https://github.com/facebook/react-native/pull/24173

Differential Revision: D14726101

Pulled By: hramos

fbshipit-source-id: 9f3081a75a4a262f55aef8498241fe7d1e04b931
2019-04-03 10:45:35 -07:00
Kacper Wiszczuk 6df2edeb2a Bump react-native version in template in release script (#24262)
Summary:
Since template has a fixed version in `template/package.json`, we want to automate this process.

[General] [Added] - Bump react-native in `template/package.json`
Pull Request resolved: https://github.com/facebook/react-native/pull/24262

Differential Revision: D14724831

Pulled By: cpojer

fbshipit-source-id: 164d13001a889941398f3db3b9b96eb9d5114cc3
2019-04-02 08:14:56 -07:00
Mr. Anonymous 9db347fabc Update projectRoot in launchPackager.bat (#24115)
Summary:
`launchPackager.bat` starts metro server but does not pass projectRoot to it. So metro server starts in the wrong directory, It is because `startServerInNewWindow` pass `react-native` directory instead of `projectRoot` in the third argument of `spawn()` in `runAndroid.js`

Its working for people
See https://github.com/facebook/react-native/issues/23908#issuecomment-475889443

[Android] [Fixed] - projectRoot in launchPackager.bat
Pull Request resolved: https://github.com/facebook/react-native/pull/24115

Differential Revision: D14597101

Pulled By: cpojer

fbshipit-source-id: fb4155b72e35062cfb41fe1b3ecca0e2b4e849ce
2019-03-25 07:27:11 -07:00
Ville Immonen cd8064bc5c Add CocoaPods Podfile to the project template (#23563)
Summary:
CocoaPods makes it easier to add new iOS dependencies to a project without having to manually edit Xcode projects. Editing Xcode projects is time consuming and merging changes to them difficult. Automating the changes to Xcode project `react-native link` is error prone. CocoaPods is a de-facto standard way to manage iOS dependencies and a central part of unimodules and upcoming improvements to `react-native link`.

This PR adds a `Podfile` to the default project template of React Native. To use a project with CocoaPods, after creating it, run `cd ios; pod install` and use the created `<projectname>.xcworkspace` file instead of the `.xcodeproj` file. (We could make this a part of `react-native init` so you only need to run one command when creating a project.)

[iOS] [Added] - Add CocoaPods Podfile to the project template
Pull Request resolved: https://github.com/facebook/react-native/pull/23563

Differential Revision: D14576505

Pulled By: cpojer

fbshipit-source-id: f6c9e93d61a52ad445d2931ccc4933d559a6ec1a
2019-03-22 03:29:11 -07:00
Matthieu Lemoine fe3aebf87b fix: Start Metro packager from project root (#24070)
Summary:
Fixes #23342.

Since Metro [v0.47](https://github.com/facebook/metro/releases/tag/v0.47.0), some babel plugins such as [babel-plugin-module-resolver](https://github.com/tleunen/babel-plugin-module-resolver) or [babel-plugin-import-graphql](https://github.com/detrohutt/babel-plugin-import-graphql) fail to resolve files if the packager is started through Xcode. They receive wrong filenames from Babel such as `${projectRoot}/node_modules/react-native/src/index.js` instead of `${projectRoot}/src/index.js`.

It happens because the start command of the local-cli is not executed in the projectRoot directory. In this case, the cwd will be `${projectRoot}/node_modules/react-native`.

This issue doesn't occur if you start the packager yourself using `node node_modules/react-native/local-cli/cli.js start` from your project root.

It comes from this [line](b640b6faf7/scripts/packager.sh (L11)). This script changed the working directory to `${projectRoot}/node_modules/react-native` and started Metro from there.

Starting Metro from the project root fixes this issue.

[iOS] [Fixed] - Start Metro packager from project root
Pull Request resolved: https://github.com/facebook/react-native/pull/24070

Differential Revision: D14563996

Pulled By: cpojer

fbshipit-source-id: cdeff34610f1ebb5fb7bc82a96f4ac9eec750d16
2019-03-21 11:17:40 -07:00
cpojer 156e483491 Remove `-p` calls from `shasum`. (#24036)
Summary:
Fixes #22873. Given that this code is meant to only work on macOS, we should be fine not using a portable hash. In the packages for which this matters at the bottom of this file, it produces the same hashes so it should be fine.

[General] [Fixed] - Don't use `-p` when invoking shasum.
Pull Request resolved: https://github.com/facebook/react-native/pull/24036

Differential Revision: D14521134

Pulled By: cpojer

fbshipit-source-id: 882e762b7817d9d46bdd405c9e2e9e8b4d7cfaf4
2019-03-19 08:53:45 -07:00
Casper Boone bce1e6f536 Fix and update end to end tests for Android (#23958)
Summary:
This PRs makes an attempt at fixing the set up of the Android end to end tests, and the tests themselves. The end goal is to re-enable the tests on CircleCI (see #23561 for more details).

The goal of this PR is to the end to end tests to a working state. Better tests can be added at a later point.

I changed the tests using the menu button. These tests made something silently crash/hang, after which it was no longer possible to get an element or even get the source. A fix for this needs further investigation.

Also, I enabled the tests in the CircleCI config, however CircleCI is currently failing on them with the following error:
```
info Running /opt/android/platform-tools/adb -s emulator-5554 reverse tcp:8081 tcp:8081
error: closed
info Could not run adb reverse: Command failed: /opt/android/platform-tools/adb -s emulator-5554 reverse tcp:8081 tcp:8081
info Starting the app on emulator-5554 (/opt/android/platform-tools/adb -s emulator-5554 shell am start -n com.endtoendtest/com.endtoendtest.MainActivity)...
Starting: Intent { cmp=com.endtoendtest/.MainActivity }

Too long with no output (exceeded 10m0s)
```
Some help here would be appreciated. An alternative is to not enable the tests yet on CircleCI in this PR.

[Android] [fixed] - Fix and update end to end tests for Android
Pull Request resolved: https://github.com/facebook/react-native/pull/23958

Differential Revision: D14502884

Pulled By: hramos

fbshipit-source-id: 4316c3fd817451d332e64a10d88389b74a60d3dd
2019-03-18 07:51:01 -07:00
Ali Akbar Azizi 43d3313788 Fix bat file (#23967)
Summary:
Add reactNativePath to cli.js

Add reactNativePath to cli.js

[GENERAL] [FIXED] - Internal - Update packagers to the latest CLI
Pull Request resolved: https://github.com/facebook/react-native/pull/23967

Differential Revision: D14502855

Pulled By: hramos

fbshipit-source-id: b9804e4fb364c004215227d938fe7101641f5b3c
2019-03-18 07:51:01 -07:00
Mike Grabowski 5558333c60 Update React Native to use latest CLI (#23940)
Summary:
Landing D14472633 again which failed because of a metro-buck issue.

Latest CLI requires `reactNativePath` to be explicitly set when `react-native` is not present under `node_modules` (which is the case when running from source).

Fixes #23936

This PR also updates CLI to latest version and removes private calls to `findPlugins` (it's now exposed under public interface).

We also remove custom `rn-cli.config.js` options that are no longer needed that we have `--reactNativePath`. I added them a month ago as a temporary workaround.

[GENERAL] [FIXED] - Internal - Update to the latest CLI
Pull Request resolved: https://github.com/facebook/react-native/pull/23940

Reviewed By: rickhanlonii

Differential Revision: D14501686

Pulled By: cpojer

fbshipit-source-id: c8dac71b3806d81c9d18b6d4a7e92d82962791f9
2019-03-18 06:22:53 -07:00
David Vacca 8d5ac8de76 Migration of RN-Android OSS tests to Android X
Summary:
This diff migrates RN to AndroidX.
As part of this diff I disabled few tests in RNAndroid OSS that will be re-enabled this week. As part of the refactor of BUCK files in OSS

Reviewed By: shergin

Differential Revision: D14200097

fbshipit-source-id: 932fcae251d1553e672acd67ecd0e703dcb364aa
2019-03-17 08:13:30 -07:00
ericlewis 97e6ea1371 Fabric: working podspecs & works in RNTester (#23803)
Summary:
This is the couple of hacks I used after I finished #23802 in order to get fabric working on RNTester. This is inspired from prior work by kmagiera.

The goal of this PR is to show others what I’m struggling with, and to eventually merge it sans hacks.

- Yarn Install
- Uncomment the commented out pods in RNTester's pod file
- Open RNTesterPods workspace
- Run App

- this is only for pods, the non-pod RNTester will no longer work until updated with fabric too.
- `SurfaceHostingView` & `SurfaceHostingProxyRootView` both try to start the surface immediately, this leads to a race condition due to the javascript not having loaded yet, the hack here is:
   1. Swizzle the `start` method on `RCTFabricSurface` to no-op when called.
   2. Add observer for `RCTJavaScriptDidLoadNotification`
   3. Call private method `_startAllSurfaces` on `_surfacePresenter` in AppDelegate when we receive `RCTJavaScriptDidLoadNotification`.

[General] [Added] - Use Fabric in RNTester
Pull Request resolved: https://github.com/facebook/react-native/pull/23803

Reviewed By: shergin, mdvacca

Differential Revision: D14450726

Pulled By: fkgozali

fbshipit-source-id: 8ae2d48634fecb60db539aaf0a2c89ba1f572c27
2019-03-15 23:59:22 -07:00
Adam Ernst 0ceaaf0cf6 Revert D14472633: [react-native][PR] Update React Native to use latest CLI
Differential Revision:
D14472633

Original commit changeset: b7ea92ee130d

fbshipit-source-id: ed5bce3ba4a39c8b60e787cb678747231583f6f5
2019-03-15 14:07:54 -07:00
Mike Grabowski 1fe4799a88 Update React Native to use latest CLI (#23940)
Summary:
Latest CLI requires `reactNativePath` to be explicitly set when `react-native` is not present under `node_modules` (which is the case when running from source).

Fixes #23936

This PR also updates CLI to latest version and removes private calls to `findPlugins` (it's now exposed under public interface).

We also remove custom `rn-cli.config.js` options that are no longer needed that we have `--reactNativePath`. I added them a month ago as a temporary workaround.

[GENERAL] [FIXED] - Internal - Update to the latest CLI
Pull Request resolved: https://github.com/facebook/react-native/pull/23940

Differential Revision: D14472633

Pulled By: cpojer

fbshipit-source-id: b7ea92ee130da6730aa0093265958aa1b8c2ab97
2019-03-15 11:07:48 -07:00
Michael Lee c0ea099c85 Clean up instances of scripts/signedsource.py
Summary: Reorganize signedsource tool

Reviewed By: scottrice

Differential Revision: D14414767

fbshipit-source-id: 6a0b0876b285ac00c7c409124d215bf4de683593
2019-03-14 13:42:27 -07:00
Peter van der Zee dcd4e90d9a Bump Prettier to 1.16.4
Summary:
@public
This bumps Prettier to v1.16.4
Only format source files were updated.

Reviewed By: mjesun

Differential Revision: D14454893

fbshipit-source-id: 72f9872fe764a79dbf0d9fab9bebb1456b039f2f
2019-03-14 07:00:27 -07:00
Bruno Lemos 22b3528e7b - Allow overriding ENTRY_FILE on react-native-xcode.sh script (#23667)
Summary:
1. Feature parity with Android, that already have this extensibility point on `build.gradle`:
7c9805ce16/react.gradle (L12)

2. Helps with using react-native on a monorepo project (yarn workspaces) without having to use the no-hoist feature (e.g. in my case the `ENTRY_FILE` is on `root/packages/mobile/index.js` instead of `root/index.ios.js`)

[iOS] [Added] - Allow overriding ENTRY_FILE on react-native-xcode.sh script
Pull Request resolved: https://github.com/facebook/react-native/pull/23667

Differential Revision: D14247236

Pulled By: hramos

fbshipit-source-id: 2f678c65eb898fc04549ab738b62e5864d753afd
2019-02-27 13:37:22 -08:00
Guillaume Hain 8d2e8fdca4 macOS : request interactive input when killing the packager (#19663)
Summary:
Do not request interactive input when running on a CI

When I'm running the build on my CI server, many Terminal windows are remaining on the server because of the `read` command.

This PR prevent this behaviour when the `CI` environment variable is defined so that it doesn't alter the behaviour on local machines.
Pull Request resolved: https://github.com/facebook/react-native/pull/19663

Differential Revision: D14206458

Pulled By: cpojer

fbshipit-source-id: 476067ebebb07c6e708469fa8829a06e05c58200
2019-02-24 22:48:17 -08:00
Eric Lewis 9ca7565563 Enable js e2e tests (#23571)
Summary:
Part of #23561. Small refactor to use 1 marker for the different tests, as it doesn't matter where it is- so long as we can detect it.

[General] [Fixed] - turn on JS e2e tests
Pull Request resolved: https://github.com/facebook/react-native/pull/23571

Differential Revision: D14172069

Pulled By: hramos

fbshipit-source-id: cdde369a09d3528d05fec01d015613b3397714e6
2019-02-21 13:16:42 -08:00