Commit Graph

615 Commits

Author SHA1 Message Date
Adam Miskiewicz b0bdbeb5c3 Fix flowconfig in starter project
Summary:
In the .flowconfig in the starter project, we're missing the correct suppression comments.

This should fix the flow issues in the e2e tests.
Closes https://github.com/facebook/react-native/pull/12533

Differential Revision: D4603657

Pulled By: ericvicenti

fbshipit-source-id: a07ec947d3ba746279c58e2d95c2293f54e06933
2017-02-22 19:52:08 -08:00
Martin Konicek df008a31e4 CLI template: Bump version of react-navigation dependency
Summary: Beta 1 is old, bump to the latest version.

Reviewed By: mkonicek

Differential Revision:
D4601561
Ninja: OSS only

fbshipit-source-id: f0aa7aa861dc2a2cb40ac171259c69b7d47d0dc4
2017-02-22 15:31:07 -08:00
Lukas Piatkowski a2addbd932 BREAKING: Change the js1 - packager - RN App protocol to version 2
Reviewed By: cwdick

Differential Revision: D4551991

fbshipit-source-id: 395c38ee5c71ddc24d8743e7ec90cc89de087503
2017-02-16 04:30:00 -08:00
Michael Bolin f9df89ac95 Fix copy/paste bug in open source BUCK file for React Native.
Reviewed By: bestander, lacker

Differential Revision: D4562337

fbshipit-source-id: 2ca24344435b650a9c740eba9b196e70015b5cdb
2017-02-15 09:46:24 -08:00
Moses Gunesch c6c1c02b75 Don't add duplicate font entries to plist during link (iOS)
Summary:
**Test plan**

1. Add fonts using `react-native link` and a `"rnpm"` config in package.json
2. Manually delete one or more fonts from Xcode's Resources folder using Remove References option
3. Run `react-native link` again

With the patch in this PR, the plist will not accidentally get populated with duplicate entries.
Closes https://github.com/facebook/react-native/pull/12048

Differential Revision: D4560432

fbshipit-source-id: aba3733acfd5373f8d654406b06b8338b137bc07
2017-02-14 17:16:54 -08:00
Dan Abramov 934cd82941 Move DevTools integration into its own repo
Summary:
The way React DevTools integration was set up in RN was not entirely supported by the React team, and we had to disable it in c3b25c9059 so that we can move forward with enabling Fiber support in React Native.

Here, I am moving the DevTools client setup from RN repo to [React DevTools repo](https://github.com/facebook/react-devtools/blob/master/packages/react-devtools-core/README.md#requirereact-devtools-coreconnecttodevtoolsoptions) so that we can keep it in sync with the rest of React DevTools. This is also a part of a larger effort to consolidate DevTools code (https://github.com/facebook/react-devtools/issues/489). It allows us to remove the double injection of the hook, an lets us replace the `eval` hack with a regular dependency. The implementation [lives here now](https://github.com/facebook/react-devtools/blob/master/packages/react-devtools-core/src/backend.js).

This change re-enables Nuclide Inspector with React Native Stack reconciler and prepares it for compatibi
Closes https://github.com/facebook/react-native/pull/12316

Reviewed By: zertosh

Differential Revision: D4545322

Pulled By: gaearon

fbshipit-source-id: ab949916c1a92c6b41cd41e7e1edf9697a71de2e
2017-02-14 14:03:46 -08:00
Lukas Piatkowski d8f48d1b51 Refactor the packager server for further protocol changes
Reviewed By: cwdick

Differential Revision: D4543321

fbshipit-source-id: f7d5823b0d340f8ca17b3dd6caf4e158fa918bcf
2017-02-14 09:45:57 -08:00
Michael Bolin 6a4f7c0993 Eliminate the need for `import re` in a BUCK file.
Reviewed By: mzlee

Differential Revision: D4550304

fbshipit-source-id: 59a101a35ea33aa8043046f64b675fab0f6f889a
2017-02-13 22:32:37 -08:00
Jeff Morrison 64f3688473 fbobjc deploy
Reviewed By: gabelevi

Differential Revision: D4544571

fbshipit-source-id: 0b0776d91dea647b0b84a9ca400019aef49963f4
2017-02-13 10:30:39 -08:00
Max Sherman a97f665629 Guard against small window where sending a message can crash the packager
Reviewed By: davidaurelio

Differential Revision: D4541015

fbshipit-source-id: 025039c593f7f0f6e40f5fd38ccc07e50f7d04b0
2017-02-10 09:30:08 -08:00
Alex Kotliarskyi a6e4977662 Don't include assets that are not used on the platform
Reviewed By: fkgozali

Differential Revision: D4534622

fbshipit-source-id: 7c6024177cca4c69cb5631f4a7b0f00315f7fca7
2017-02-09 11:15:25 -08:00
Martin Konicek ab81db65c5 CLI: Add README to app template, lint
Reviewed By: mkonicek

Differential Revision:
D4522116
Ninja: oss only

fbshipit-source-id: d17e0e8badcfe97eaea092e5d5274e02904a534d
2017-02-07 10:32:29 -08:00
Martin Konicek 4551e9347a CLI: Update Navigation app template
Summary:
Update the template that will be used by `react-native init --template navigation`. The goal is to make it easier for people to get started by demonstrating a few very basic concepts such as navigation, lists and text input.

**Test plan (required)**

<img src="https://cloud.githubusercontent.com/assets/346214/22697898/ced66f52-ed4a-11e6-9b90-df6daef43199.gif" alt="Android Example" height="800" style="float: left"/>

<img src="https://cloud.githubusercontent.com/assets/346214/22697901/cfeab3e4-ed4a-11e6-8552-d76585317ac2.gif" alt="iOS Example" height="800"/>
Closes https://github.com/facebook/react-native/pull/12260

Differential Revision: D4521758

Pulled By: mkonicek

fbshipit-source-id: d7d9e481dd3373917ac68ec9169b9ac3267547a9
2017-02-07 09:16:08 -08:00
Martin Konicek a54d449e94 CLI: Add support for project templates
Summary:
Currently it is not trivial for people to get started with React Native. `react-native init MyApp` just creates a simple app with a single screen. People have to spend time figuring out how to add more screens, or how to accomplish very basic tasks such as rendering a list of data or handling text input.

Let's add an option: `react-native init --template navigation` - this creates a "starter" app which can be easily tweaked into the actual app the person wants to build.

**Test plan (required)**

- Checked that 'react-native init MyApp' still works as before:

<img width="487" alt="screenshot 2017-02-02 16 56 28" src="https://cloud.githubusercontent.com/assets/346214/22559344/b2348ebe-e968-11e6-9032-d1c33216f490.png">

<img width="603" alt="screenshot 2017-02-02 16 58 04" src="https://cloud.githubusercontent.com/assets/346214/22559370/c96a2ca6-e968-11e6-91f7-7afb967920fc.png">

- Ran 'react-native init MyNavApp --template'. This prints the available templates:

```
$ react-native init MyNavApp
Closes https://github.com/facebook/react-native/pull/12170

Differential Revision: D4516241

Pulled By: mkonicek

fbshipit-source-id: 8ac081157919872e92947ed64ea64fb48078614d
2017-02-06 12:31:25 -08:00
Eric Vicenti bc74dd1e14 Eject CLI command to re-create native folders
Summary:
The iOS and Android native folders of a React Native app can be difficult to maintain. This introduces a new workflow for creating and maintaining the native code of your app.

Now it will be possible to:

1. Remove the native iOS or Android folders
2. Create an `app.json` for your app, with at least a `name` and `displayName`
3. Run `react-native eject`, and the native code for your app will be generated

Then, as usual, you can run `react-native run-ios` and `react-native run-android`, to build and launch your app

For apps that don't have any native code, it will be possible to ignore the `ios` and `android` folders from version control.

Eject step tested in RN app by deleting native folders.

mkonicek, what is the best way to test `react-native init`?

As follow-up items, we can enable the following:

- Configuring app icon and launch screen from the `app.json`
- Automatically run `react-native link` for native libraries
- A
Closes https://github.com/facebook/react-native/pull/12162

Differential Revision: D4509138

Pulled By: ericvicenti

fbshipit-source-id: 0ee213e68f0a3d44bfce337e3ec43e5024bacc66
2017-02-03 12:58:46 -08:00
Mike Grabowski 2f5556df39 Remove build artifacts
Summary:
Ignores `bundle.js` that is a webpack bundle and got most likely accidentally released. Already cherry-picked to 0.42

Fixes #12183
Closes https://github.com/facebook/react-native/pull/12185

Differential Revision: D4507535

Pulled By: mkonicek

fbshipit-source-id: 2ab404534b345cf531f408b654c34a30abd01458
2017-02-03 06:58:35 -08:00
Christoph Pojer a2c84d14ce Remove `react-packager` indirection.
Summary:
This moves the `src` directory one level up and removes the `react-packager` folder. Personally, I always disliked this indirection. I'm reorganizing some things in RNP, so this seems to make sense.

Not sure if I forgot to update any paths. Can anyone advice if there are more places that need change?

Reviewed By: jeanlauliac

Differential Revision: D4487867

fbshipit-source-id: d63f9c79d6238300df9632d2e6a4e6a4196d5ccb
2017-02-02 05:44:15 -08:00
Jirat K 1c249e4804 Use Yarn for Install/Uninstall CLI if available
Summary:
Make `react-native install` and `uninstall` cli to use yarn if available (fixes #11122)

**Test plan Yarn**

1. Publish to Sinopia: https://github.com/facebook/react-native/tree/master/react-native-cli
2. react-native init AwesomeApp
3. react-native install react-native-fit-image
4. react-native uninstall react-native-fit-image

**Test plan NPM**
1. Publish to Sinopia: https://github.com/facebook/react-native/tree/master/react-native-cli
2. react-native init AwesomeAppNPM --npm
3. react-native install react-native-fit-image
4. react-native uninstall react-native-fit-image

**output (yarn.lock)**

```
> react-native install react-native-fit-image
yarn add v0.16.1
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 📃  Building fresh packages...
success Saved lockfile.
success Saved 1 new dependency
└─ react-native-fit-image@1.4.6
  Done in 4.11s.
rnpm-install info Module react-native-fit-image has been successfully
Closes https://github.com/facebook/react-native/pull/11174

Differential Revision: D4441872

fbshipit-source-id: 05bd30e1ad14bdbe861259c88e1f18df77cfa54f
2017-02-02 05:13:33 -08:00
Pavlos Vinieratos 5e6f39aace allow for dark background in the debugger view
Summary:
I prefer a darker environment when coding, and having the Chrome window be dark except the part that I cannot hide, is making my eyes hurt. This is for the people that prefer the darker color scheme when developing.
Closes https://github.com/facebook/react-native/pull/11878

Differential Revision: D4494415

Pulled By: mkonicek

fbshipit-source-id: 423473ec073e6ddd0d14322c22ee37abed1c55bc
2017-02-02 04:43:51 -08:00
Peggy Rayzis a45246e354 Fix .gitignore of HelloWorld template to commit third party JARs
Summary:
Hi RN team! Thanks for all that you do. 🎉

**Motivation:**
I noticed in the [Buck docs](https://buckbuild.com/article/exopackage.html) (scroll down to Step 2) that it expects third party JARs to live in version control. Currently, the HelloWorld template ignores these dependencies from version control, which is a bit confusing.
Closes https://github.com/facebook/react-native/pull/11738

Differential Revision: D4494423

Pulled By: mkonicek

fbshipit-source-id: 37b946ad9c30af2b47b409bae6830bba5917491a
2017-02-02 04:13:59 -08:00
Martin Konicek 3ee3d2b4b2 CLI: Add basic Navigation template (Chat)
Summary:
Basic template using 'react-navigation' to make it easy to get started.

Not duplicating all the files in `android` and `ios` folders. These will be taken from the `HelloWorld` template. Let's not duplicate all of these files (it's a lot and they are large, especially the Xcode projects).

**Test plan (required)**

The app works locally. This PR is just a preparation for a next PR that will add support for 'react-native init --template Navigation'. Will have a proper test plan there.
Closes https://github.com/facebook/react-native/pull/12153

Differential Revision: D4494776

Pulled By: mkonicek

fbshipit-source-id: b43eafd7a1424477f9493a3eb4083ba4dd3d3846
2017-02-02 03:28:35 -08:00
Martin Konicek e3d4ace3ae BREAKING: [CLI] New app template: Resize UI when keyboard is shown on Android
Summary:
When building the Chat example for react-navigation, I realized the default Android behavior doesn't actually work:

<img width="868" alt="screenshot 2017-02-01 15 15 25" src="https://cloud.githubusercontent.com/assets/346214/22512559/518e3bf0-e891-11e6-9a86-2dafac5b250f.png">

(From https://developer.android.com/guide/topics/manifest/activity-element.html)

In my app there's a `<ListView>` and a `<TextInput>` below it. Without this PR the UI pans which is a very bad user experience.

Keyboard is hidden:

<img width="437" alt="screenshot 2017-02-01 15 21 15" src="https://cloud.githubusercontent.com/assets/346214/22512814/23fc93d4-e892-11e6-9e45-94041dbe8eba.png">

Keyboard is shown:

<img width="439" alt="screenshot 2017-02-01 15 26 56" src="https://cloud.githubusercontent.com/assets/346214/22513062/e4e1835c-e892-11e6-93b7-fe5616135b91.png">

 ---

Let's use "adjustResize", it seems to be a reasonable default in most cases and people can always change the constant in their AndroidManifest.xml
Closes https://github.com/facebook/react-native/pull/12154

Differential Revision: D4496428

fbshipit-source-id: c300ebe55bd93f8b243e0d7d0d6a132bc3a5a1c1
2017-02-01 12:58:28 -08:00
Charles Dick 76e3d45c34 Add cell size to JSC heap capture visualization
Reviewed By: bnham

Differential Revision: D4469000

fbshipit-source-id: 3e572bb7bdd83f79009d2059d543e03e6a57bba0
2017-02-01 10:58:30 -08:00
John Shelley b5421410ba Android - Update Gradle to 2.2.3
Summary:
Currently React Native's local cli is a bit behind in its android gradle plugin version. This PR is an attempt to update the local cli, to allow for better support moving forward.
* Updates the gradle plugin version to 2.2.3
* Updates the gradle wrapper to 2.14.1
* Uses the `all` for the project wrapper to include sources for API completion

**Test plan (required)**

* Perform all required steps here: https://github.com/facebook/react-native/tree/master/react-native-cli
   * Run the local npm tests and e2e tests (no longer available)
   * Test the local cli by using Sinopia

Make sure tests pass on both Travis and Circle CI.

TO NOTE: In a previous issue (https://github.com/facebook/react-native/issues/11500) I was able to update to 2.2.3 comfortably, however there may be other issue I am not aware of. This PR is intended to start discussion on what it will take to update.
Closes https://github.com/facebook/react-native/pull/11930

Differential Revision: D4489926

Pulled By: mkonicek

fbshipit-source-id: 35ff5ac6b1b8893854538d6b9fe2c2e042ecca9f
2017-01-31 13:13:32 -08:00
rh389 7a4166c31d Deal with 0.38 'FlowFixMe's
Summary:
Largely typing fixes to deal with the glut of new `FlowFixMe` suppressions introduced with flow 0.38 in a4bfac907e

Tested with flow itself. CC gabelevi
Closes https://github.com/facebook/react-native/pull/11985

Differential Revision: D4452045

Pulled By: ericvicenti

fbshipit-source-id: acc46c4c406ae706a679e396be1d40ae2f4ce5a1
2017-01-31 13:13:32 -08:00
Harshil Shah bce6ece5f6 Add symlinks under node_modules as part of projectRoots
Summary:
Support symlinks under `node_modules` for all local-cli commands. PR https://github.com/facebook/react-native/pull/9009 only adds symlink support to the packager.

But other cli commands like `react-native bundle` creates its own instance of packager that doesn't have symlinks as part of its project roots, which results in the bundler breaking since it cannot find modules that you have symlinked.

This change ensures all `local-cli` commands add symlinks to its project roots.

Test plan (required)

1.  Create a symlink in node_modules (for instance use npm/yarn link)
2. Run `react-native bundle`.
Closes https://github.com/facebook/react-native/pull/11810

Differential Revision: D4487741

fbshipit-source-id: 87fe44194134d086dca4eaca99ee5742d6eadb69
2017-01-31 03:43:39 -08:00
Ciprian Pãtru f9c6d47b94 Prevent "/inspector/json" to be repeatedly output to the console
Differential Revision: D4474847

fbshipit-source-id: d14fe55041b7c5c04b4c8e8fce282fd62d694492
2017-01-30 11:13:41 -08:00
Andrew Imm a1cd5e0d05 Use a project's custom platforms when creating a production bundle
Reviewed By: davidaurelio

Differential Revision: D4463579

fbshipit-source-id: 0f1514b25239b2fe62fca6fd02a475db98cff3a8
2017-01-26 16:13:49 -08:00
Christoffer Bo Petersen 4368719476 Remove unused imports
Summary:
When installing template by `react-native init AwesomeProject` and adding checkstyle to the Gradle setup, it will complain about unused imports
Closes https://github.com/facebook/react-native/pull/12076

Differential Revision: D4470930

fbshipit-source-id: 50a105886607fd1d3a458453fa1a844e9746dafa
2017-01-26 14:13:30 -08:00
Alex Kotliarskyi 8b4272b2fd Change favicon depending on the Chrome debugger state
Reviewed By: yungsters

Differential Revision: D4465694

fbshipit-source-id: fc740f176d6e1fe25dfc79c9ccd8a1ea2be35bb3
2017-01-26 11:58:32 -08:00
Jean Lauliac be490d2f0c Backed out changeset 35b573bece59
Reviewed By: davidaurelio

Differential Revision: D4461681

fbshipit-source-id: f5c45f713f2fe68443986a2822aa325b01dd5075
2017-01-26 03:43:33 -08:00
Charles Dick 936c62a265 JSC Heap Capture add other roots to visualization
Reviewed By: amnn

Differential Revision: D4422659

fbshipit-source-id: a32e87d2d39b6ff571f02d613b32db630e5e6de1
2017-01-26 03:28:31 -08:00
Lukas Piatkowski c5f862b913 The jscProfileMiddleware require some FB only modules, so moving to internal
Reviewed By: cwdick

Differential Revision: D4441898

fbshipit-source-id: 0ab5aa4158fccf190e76d3582a8a12d9b1d23fa8
2017-01-25 10:43:54 -08:00
Jing Chen 7cb5b6e523 Revert stacked revisions on packager that causes packager to instacrash
Reviewed By: fkgozali, bestander

Differential Revision: D4456911

fbshipit-source-id: 35b573bece59c59c0700ef2d8ab26c0b7150d3cf
2017-01-24 11:43:36 -08:00
Jean Lauliac ccf94aa65a packager: GlobalTransformCache: remove global variable
Reviewed By: davidaurelio

Differential Revision: D4449333

fbshipit-source-id: b9546b90d2fd5ddca9c1ee2719c6c454b60bdfa4
2017-01-24 03:43:36 -08:00
Janic Duplessis 10a29aa954 Support copy to clipboard on Windows
Summary:
Also fix lint errors about Buffer being undefined by adding env: node to the eslint config for local-cli.

Tested on windows 10.
Closes https://github.com/facebook/react-native/pull/11959

Differential Revision: D4438903

Pulled By: hramos

fbshipit-source-id: 28d5edd662dd1e63dedf1274ff0a21af4df84f5e
2017-01-19 16:28:39 -08:00
Gabe Levi e2ce98b7c6 Fix the suppress comment regex for react_native
Reviewed By: davidaurelio

Differential Revision: D4435640

fbshipit-source-id: c680aee6931979859f04c0dca47037ba6f6cba73
2017-01-19 10:28:28 -08:00
Andres Suarez d4e8b19e71 Enable emoji in flow
Reviewed By: gabelevi

Differential Revision: D4428957

fbshipit-source-id: 487dbbb2512ff9dbd42e37fb81e14dfb8bea301b
2017-01-19 07:43:31 -08:00
Gabe Levi a4bfac907e Deploy v0.38.0
Reviewed By: jeffmo

Differential Revision: D4428858

fbshipit-source-id: 10dc69349a2b563e1fa444a8b0612e3b2d4ccd1c
2017-01-18 11:13:30 -08:00
Lukas Piatkowski bbd5750bb4 Sampling Profiler to return urls that open file in nuclide
Reviewed By: cwdick

Differential Revision: D4422768

fbshipit-source-id: 2e8c4af6e6fae4256fe886b79f5ea6c87986d581
2017-01-18 04:28:38 -08:00
rh389 e0c3d56d3a Fix template release build: Add -ObjC and -lc++ to tests target
Summary:
Fixes https://github.com/facebook/react-native/issues/11861 - the release config is currently broken for projects created by `react-native init` in `master`, 0.40 and 0.39.

I'm still investigating when and how this got broken but this seems to be a clean fix. I've added `-ObjC` as well to match the main target but I'm not sure yet whether that's necessary.

To test:
```
react-native init fooproject --version react-native@rh389/react-native#missinglinkerflags
```
Open in XCode, Edit scheme (⌘<), Change `Build Configuration` to `Release`, build.

Update: The `-lc++` flag became necessary when 33deaad196 landed because of the libstdc++ dependencies of `RCTLog`. Still not sure about `-ObjC`. javache ?
Closes https://github.com/facebook/react-native/pull/11889

Differential Revision: D4421685

Pulled By: javache

fbshipit-source-id: 954edaef773f8cef7b7ad671fa4d1f2bfc2f20f2
2017-01-16 13:13:31 -08:00
Andrew Imm 09a83f976e Allow project-specific config for RN CLI using providesModuleNodeModules
Reviewed By: davidaurelio

Differential Revision: D4409046

fbshipit-source-id: 5af0d08542935a784f4737653ccac49fd7517aff
2017-01-12 21:13:36 -08:00
Mike Grabowski 545072b02d Fully support new import system on iOS
Summary:
A bit late to the party, but upgraded, tests replaced, all green.

Also updated `pbxproj` so that we are testing against React 0.40 init result, not against something old.

To cherry-pick and land once ships.
Closes https://github.com/facebook/react-native/pull/11868

Differential Revision: D4411362

fbshipit-source-id: c485fd76114979d34a7e288bb70e1ecb9b3baf76
2017-01-12 14:58:28 -08:00
David Aurelio 0849f84df2 create better debuggable source maps
Summary:
Introduces a new mechanism to build source maps that allows us to use real mapping segments instead of just mapping line-by-line.

This mechanism is only used when building development bundles to improve the debugging experience in Chrome.

The new mechanism takes advantage of a new feature in babel-generator that exposes raw mapping objects. These raw mapping objects are converted to arrays with 2, 4, or 5 for the most compact representation possible.
We no longer generate a source map for the bundle that maps each line to itself in conjunction with configuring babel generator to retain lines.

Instead, we create a source map with a large mappings object produced from the mappings of each individual file in conjunction with a “carry over” – the number of preceding lines in the bundle.

The implementation makes a couple of assumptions that hold true for babel transform results, e.g. mappings being in the order of the generated code, and that a block of mappings always belongs to the same source file. In addition, the implementation avoids allocation of objects and strings at all costs. All calculations are purely numeric, and base64 vlq produces numeric ascii character codes. These are written to a preallocated buffer objects, which is turned to a string only at the end of the building process. This implementation is ~5x faster than using the source-map library.

In addition to providing development source maps that work better, we can now also produce individual high-quality source maps for production builds and combine them to an “index source map”. This approach is unfeasable for development source maps, because index source map consistently crash Chrome.

Better production source maps are useful to get precise information about source location and symbol names when symbolicating stack traces from crashes in production.

Reviewed By: jeanlauliac

Differential Revision: D4382290

fbshipit-source-id: 365a176fa142729d0a4cef43edeb81084361e54d
2017-01-12 14:28:41 -08:00
Mike Grabowski 4969f26252 Improve `unlink` on rnpm
Summary:
We don't need to look for `thisDependency` as we already have it. Small improvement as I am working on other fixes.
Closes https://github.com/facebook/react-native/pull/11867

Differential Revision: D4411177

fbshipit-source-id: 1413eb5457cb4d7916ead90f438ffe158f644cad
2017-01-12 13:58:34 -08:00
Jean Lauliac ff50420b0f packager: create the reporter higher in the stack
Reviewed By: davidaurelio

Differential Revision: D4392283

fbshipit-source-id: 4cd470ca0cbddcbb515407b5249272a758849b82
2017-01-09 10:13:33 -08:00
Mike Grabowski 30e89b49f1 Merge `rnpm config` with the `cli config`, step 1
Summary:
This is step one on merging the `rnpm` config with the `cli config`. The plan is to remove two sources of truth (rnpm package.json config and rn-cli Javascript config)

Rationale:
As of now, we have `rnpm` config, that used to live in the `local-cli/core/config/index.js` and the `rn-cli` config, living in `default.config.js` and `utils/Config.js`.

This PR moves all the things into one file, called `local-cli/core', simplifies things, enhances types (Config now has better types, added missing properties and fixed descriptions).

One notable addition is that users can now opt-in to override the commands that are loaded at the package level. Previously it was only possible to add a command by writing a plugin. Now, you can just tweak the `rn-cli.config.js`.

This is one of the several improvements I have on my roadmap, with better documentation for the CLI as well.
Closes https://github.com/facebook/react-native/pull/11564

Differential Revision: D4360095

fbshipit-source-id: feaec7c88df63e51cef1f9620c7eedeb738d3d00
2017-01-09 07:58:33 -08:00
Mike Grabowski 2c5bf97928 Feat/run android specify activity
Summary: Follow up to #11049 that got overwritten.

Differential Revision: D4390912

fbshipit-source-id: 0678ea2206a629093dda083816d40f538e627513
2017-01-09 04:13:32 -08:00
joaogranado 52dea5db64 Add no-packager option to run-android and run-ios commands
Summary:
Currently, while running `react-native run-android` command, React Native's packager is launched, and there is not any way to disable the current behaviour. This is handled somehow on iOS by adding an environment variable `RCT_NO_LAUNCH_PACKAGER` (see #6180).

This is a cross-platform solution that adds the `--no-packager` option both to `run-ios` and `run-android`, which prevents the packager from being launched.

This was tested by building with and without the option, on both environments (Android and iOS) using the device and simulator, working as expected.
Closes https://github.com/facebook/react-native/pull/11735

Differential Revision: D4392170

Pulled By: ericvicenti

fbshipit-source-id: 1c31f109f18715b84cd5ab1b6d5fd758cd0a6efb
2017-01-09 03:28:29 -08:00
Jean Lauliac 8f87ab648c packager: remove validateOpts for Bundler class
Reviewed By: davidaurelio, cpojer

Differential Revision: D4380831

fbshipit-source-id: e3b5b2c39e83bf0b49028820e0f17daef27d7b3c
2017-01-06 06:13:54 -08:00
Jean Lauliac 28f1c67ced packager: centralize babelRegisterOnly callsites
Reviewed By: davidaurelio

Differential Revision: D4380987

fbshipit-source-id: db34e56b2025fb072798ef2cc3e52f3d1cb7c33c
2017-01-06 06:13:54 -08:00
Chris Hopman da59258372 Add --sourcemap-sources-root to RN packager
Reviewed By: davidaurelio

Differential Revision: D4357122

fbshipit-source-id: dc19474aa54ea4684a6b1c586a9d1e5da0980327
2017-01-04 20:58:33 -08:00
David Aurelio 78118d5023 Revamp debug logging
Summary:
- Switch namespace prefix from `ReactNativePackager:` to `RNP:`
- Add logging for handled requests
- Log transform cache key
- Add logging for transform cache hits/misses

Reviewed By: jeanlauliac

Differential Revision: D4377867

fbshipit-source-id: 9ec2060432f8c5e68561d3fe8ec7127f76c4a081
2017-01-04 07:13:32 -08:00
Jean Lauliac 05aef26893 packager: enable @flow in bundle/buildBundle.js
Reviewed By: cpojer

Differential Revision: D4377362

fbshipit-source-id: decd5ff9b245c9dfd4bb9af6e41717ee860fc1ba
2017-01-03 10:58:29 -08:00
Mark Oswald 440ad3b647 Followup of #9568, some cleanup
Summary:
As mkonicek suggested in [#9568](https://github.com/facebook/react-native/pull/9568#issuecomment-267600043) I did some cleanup

**Test plan (required)**

Only one functional change:
> Run `react-native run-android --deviceId`

Before it was beginning to build the app and then failing because of the missing device "true" :-)
Now it's showing a message and stopping the build:
```
❯ react-native run-android --deviceId
Starting JS server...
Parameter missing (device id)
```
Closes https://github.com/facebook/react-native/pull/11703

Differential Revision: D4376615

Pulled By: ericvicenti

fbshipit-source-id: 3c6e0f12220ab22539c7bc3d390367e02c96728a
2017-01-02 11:13:41 -08:00
dlowder-salesforce d625a72f63 Apple TV support 6: Add tvOS target to react-native-cli template project
Summary:
**Motivation**

New iOS project generation with react-native-cli should allow developers to build for Apple TV as well as iPhone/iPad.

**Test plan**

Added to `scripts/run-ci-e2e-tests.js` and `.travis.yml` to have the new tvOS target automatically built and tested in Travis CI.
Closes https://github.com/facebook/react-native/pull/11591

Differential Revision: D4375593

Pulled By: mkonicek

fbshipit-source-id: 4e241caa400a88e6b2f91416fa26b48ae01cb7b6
2016-12-30 18:43:59 -08:00
Tomas Roos 8680681a3d Updated imports to libyoga*.a in HelloWorld
Summary:
Fixes #11605

HelloWorld refers to CSSLayout even thought master has moved on and the library is now called Yoga.
Closes https://github.com/facebook/react-native/pull/11606

Differential Revision: D4365469

fbshipit-source-id: e0eaac400449f0ba767bf98f3bd8e8185fb6fd12
2016-12-22 23:58:28 -08:00
Rob Hogan 59276468f2 Fix CLI Error when there is no windows project
Summary:
Running `master` (at 260d68bf8b) I noticed `react-native link` fails when there is no windows project due to a bug in the code that fetches windows project configs (introduced 445182c707).

There's a guard to return early if `csSolution` (the relative path of the windows solution) is null but it needs to be a line earlier, because `path.join` errors when passed a non-string.

Tested locally on a non-windows project, `react-native link` errored previously and now succeeds.
Closes https://github.com/facebook/react-native/pull/11590

Differential Revision: D4362419

fbshipit-source-id: b3b9f6784d8b1d1a7c53abe0ee421b1dc6048571
2016-12-22 10:58:36 -08:00
Riku Ayanokoji 260d68bf8b add yarn-error.log to gitignore
Summary:
Due to react-native-cli use yarn if yarn is available, we need to add yarn-error.log to .gitignore.
Closes https://github.com/facebook/react-native/pull/11583

Differential Revision: D4359507

fbshipit-source-id: 0c7582215a31e0d03dced138c8275225910713ee
2016-12-21 15:28:39 -08:00
Jean Lauliac ede04abf8f packager: make output simpler, more legible
Reviewed By: cpojer

Differential Revision: D4339417

fbshipit-source-id: f174ee11bc220de5e8da1d8227e9a9ceb5319e8d
2016-12-19 10:58:32 -08:00
Steve Kellock f49093f397 Fixes launching Visual Studio Code due to args being a nested array.
Summary:
**Motivation**

Visual Studio Code appears to have been accidentally borked in RN 38 & 39.

[Here you see](a643784144 (diff-9ad1aafc931637a94d74b60c06b46871R153)) args become an array to support the new `shell-quote` support.

Problem is, `getArgumentsForLineNumber` also returns an array.

[And because we](a643784144 (diff-9ad1aafc931637a94d74b60c06b46871R161)) `push` instead of `concat`, we get hawt array-on-array action.

Surprisingly Atom works.  But Code doesn't like this at all.

**Test plan (required)**

On RN 0.38 and 0.39, what's happening when I click on the simulator stack frame, Code opens with the array as a string...

![image](https://cloud.githubusercontent.com/assets/68273/20971724/83a3d7c4-bc60-11e6-8170-a1c2a4adee60.png)

I've tested Vim, Code and Atom (all on 10.11.6) as well as all combinations of `REACT_EDITOR` both set
Closes https://github.com/facebook/react-native/pull/11345

Differential Revision: D4339963

Pulled By: lacker

fbshipit-source-id: 030cb9e3d84fd6861f28e3652bebfe2eef28dd62
2016-12-16 10:28:35 -08:00
John Shelley 901178d53c BREAKING: Android - ReactNativeHost getUseDeveloperSupport to public #2
Summary:
AaaChiuuu
See: https://github.com/facebook/react-native/pull/11329
Closes https://github.com/facebook/react-native/pull/11505

Differential Revision: D4338559

Pulled By: AaaChiuuu

fbshipit-source-id: 6cd1fd366a2bc30d496b7e907242e7f89a384a19
2016-12-15 21:13:38 -08:00
David Gröger 85c8333bc8 run-android-on-specific-device
Summary:
At the moment the run-android command from the react-native cli does run all available devices at once. However it would be extreme useful to have the option to choose only one specific device/simulator.
Therefore i've created a new flag for the command 'run-android': --deviceIdFromList 'deviceIdFromList' in order
to install and launch apps on a specific device/simulator from the command line.

'deviceIdFromList'  is the id listed on the output of the command 'adb devices'.

I've tested my code with the following commands:
react-native run-android --deviceIdFromList "Not existing id"
react-native run-android --deviceIdFromList
react-native run-android --deviceIdFromList "id of a simulator"
react-native run-android --deviceIdFromList "id of a device"

Output:
![not-existing-device](https://cloud.githubusercontent.com/assets/9102810/17931086/d843abc8-6a09-11e6-995d-8c737dd5ed5c.png)
![empty-flag](https://cloud.githubusercontent.com/assets/9102810/17931087/d8443930-6a09-11e6-94f3-d
Closes https://github.com/facebook/react-native/pull/9568

Differential Revision: D4335133

Pulled By: mkonicek

fbshipit-source-id: a827628316be1b5751225851323b1131f451574c
2016-12-15 19:43:32 -08:00
Martin Konicek 8832479e28 Update template app's Flow config to Flow v0.37
Reviewed By: mkonicek

Differential Revision:
D4328558
Ninja: OSS only

fbshipit-source-id: 269b09deffd49e8fab7ca15912f833bf806199c1
2016-12-14 12:28:30 -08:00
Jeff Morrison d926aecd77 fbsource
Reviewed By: samwgoldman

Differential Revision: D4314897

fbshipit-source-id: fbe11da4c63bf34d010220d74177cb3ca4cbee6d
2016-12-13 18:58:34 -08:00
Martin Konicek 8c7f36021a Fix instructions in 'react-native init'
Summary: This was buggy and didn't print the folder we need to cd into.

Reviewed By: mkonicek

Differential Revision:
D4313396
Ninja: OSS only

fbshipit-source-id: 0e15baf818065b63e939def60a1366e2251aac7d
2016-12-12 09:13:30 -08:00
Gant 445182c707 react-native link (aka rnpm) support for Windows
Summary:
Seeing as [Windows is a supported platform](72157cf991/packager/defaults.js (L22)) until platforms can better manager their own CLI and packager needs.

Linking 3rd party libraries should be supported first, because then I'd like to do a follow up PR with grabbou to identify how we can effectively move RNPM functionality out of react-native core and eventually housed in each external platform's repo.  The goal would be working with cpojer and hopefully andrewimm to help keep external platform needs in their respective repos, for rnpm/packager _et al._  Seeing as this is a major discussion point, I've made this PR first.  Making small steps towards this goal, seems to be the approved methodology from all.

Additionally, I have a merged PR that makes an excellent place for documenting the CLI when it advances, as preparatio
Closes https://github.com/facebook/react-native/pull/11282

Differential Revision: D4311391

fbshipit-source-id: be9a836344be4aed6c4732b0ce4947c2a16b6dad
2016-12-10 16:58:28 -08:00
David Aurelio 6786cbd3e4 Add fbjs definitions to flow config
Reviewed By: zertosh

Differential Revision: D4291805

fbshipit-source-id: 3dcb8ffe6132bd04a3048edae64e9d273c2dcae4
2016-12-08 02:43:25 -08:00
Eric Palakovich Carr 38d275f8b5 Red Box should open PyCharm at line number of error
Summary:
This is a simple one line change.  When a red box is launching the editor, if `launchEditor.js` is aware of your editor it can also add a line number to open the file at.  So if the stacktrace shows an error on like 56 in `ako.js` then it'll try`wstorm /Users/somelady/src/project/ako.js:56` instead of `wstorm /Users/somelady/src/project/ako.js`.

This adds PyCharm's command line launcher, which is named `charm`.  There is existing logic to handle other JetBrains editors, so I just did a simple one line addition.

**Test plan (required)**

* Install PyCharm (if needed)
* Set environment variable `REACT_EDITOR` to `charm`
* Open PyCharm
* Add/replace the current `charm` command via `Tools -> Create Command-line launcher...` in PyCharm.
* Run a React Native project with an error in the source code.
* In the generated red box, click on one of the entries in the stack trace
* File should open in PyCharm at the correct line number.
Closes https://github.com/facebook/react-native/pull/11275

Differential Revision: D4295724

Pulled By: javache

fbshipit-source-id: 29dec525f76c2f0a3ee203cac67408eecc8ac6b6
2016-12-07 17:13:42 -08:00
Pieter De Baets 59407f3660 Redo exported headers and include paths for opensource
Summary:
Xcode really sucks, per some discussion on e1577df1fd and https://developer.apple.com/library/content/technotes/tn2215/_index.html, if you use the headers phase, and mark headers in your static library as public, they will actually end up in the final package that's built and you can't submit to the app store! This changes our xcode setup to use a copy files phase instead.

I've also changed the header include path to be $(BUILT_PRODUCTS_DIR)/include, which is added to the include path by Xcode by default, so 3rd party libraries should not be impacted by these changes anymore.

Reviewed By: mkonicek

Differential Revision: D4291607

fbshipit-source-id: 969b9ebcbeb8161f85427f8c429e198d9d0fae30
2016-12-07 15:28:29 -08:00
Martin Konicek d3065f6895 CLI: Show npm / yarn output during 'react-native-init' when installing React and Jest
Summary:
I missed this while doing the Yeoman wipeout.

Currently we just print:

    Installing React...
    Installing Jest...

This diff makes it print the output of those commands.

**Test Plan**

Published react-native to Sinopia, ran `react-native init MyApp`, saw the output:

    Installing Jest...
    ⸨░░░░░░░░░░░░░░░⸩ ⠸ normalizeTree: ...

Reviewed By: bestander

Differential Revision: D4286640

fbshipit-source-id: e554f03a4729c2de85eba527f10f4b727de722e4
2016-12-06 13:58:31 -08:00
Jan Kassens 460a044f6c delete signedsource.js
Summary:
This module is not actually used inside of React Native. Projects that use this,
can now depend on https://www.npmjs.com/package/signedsource

Reviewed By: yungsters

Differential Revision: D4272511

fbshipit-source-id: 93eb74aa4ccfa8ef8743de2cfa92b5403de91e0a
2016-12-05 16:28:32 -08:00
Martin Konicek caa9ab19bf Fix a bug in determining if yarn is available
Reviewed By: mkonicek

Differential Revision:
D4276707
Ninja: OSS

fbshipit-source-id: 79cb2942f27179681d1a8ebfd3bc5a97f544f7af
2016-12-05 06:13:33 -08:00
Tim Yung ebe0c85fbe JS: Modernize SignedSource
Reviewed By: cpojer

Differential Revision: D4271506

fbshipit-source-id: b3eff94de9ce2c179d62d57eace9a40797aed397
2016-12-03 12:13:28 -08:00
Tim Yung dd97443f2b RN: Delete Dead `sign` Module
Reviewed By: cpojer

Differential Revision: D4271550

fbshipit-source-id: ffab21055f3e51fccf8640a568703aa8cc20bd0f
2016-12-03 11:58:33 -08:00
Andrew Imm 67828a52bd Allow custom platforms for the RN Packager on a per-project basis
Reviewed By: cpojer

Differential Revision: D4255979

fbshipit-source-id: bf900b67ee30e2f994e96c9a6103ed2e53a87f88
2016-12-02 09:43:31 -08:00
Charles Dick 59dd2133cb ignore heap captures
Reviewed By: mkonicek

Differential Revision: D4265530

fbshipit-source-id: 0933fea4ee2c2ee89805ab9c8d8819a928087c7b
2016-12-02 08:28:32 -08:00
Nicolas Cuillery f917c073aa Remove trailing space in template file
Summary:
Simple removal of a trailing space in a template file which leads to a warning when using `react-native-gitupgrade`:
<img width="1187" alt="capture d ecran 2016-12-02 a 12 44 26" src="https://cloud.githubusercontent.com/assets/4425455/20832904/2c039f80-b88d-11e6-855a-78287d29585f.png">

**Test plan**
To repro:
- Install the `react-native-git-upgrade` package (see #11110)
- Upgrade from 0.39.0 to 0.40.0-rc.0

Ping mkonicek
Closes https://github.com/facebook/react-native/pull/11270

Differential Revision: D4265540

Pulled By: mkonicek

fbshipit-source-id: 7b05f2de4711818b25fcd09260ae9c75d187d9ad
2016-12-02 07:43:59 -08:00
Richard Evans 0b5ff0d2b1 Make run-ios find if a device is booted better
Summary:
**Motivation**
This morning I was trying to test on iPhone 7 with iOS 10 so I booted that device and ran "react-native run-ios" expecting it to notice I had a simulator running and install my app to it. Instead it switched my device to the iPhone 6s iOS 9.2. After digging it was found that run-ios did not handle multiple versions of iOS being installed very well when it came to checking for the booted device. This PR resolves that.

**Test plan (required)**
Tests were added for the situation of multiple iOS versions being installed and a slight change to the code was completed to make the new tests pass and continue to keep the old tests passing.
Closes https://github.com/facebook/react-native/pull/10558

Differential Revision: D4163616

Pulled By: hramos

fbshipit-source-id: 26b44fb73ef402ce252e7a754036279e15359170
2016-12-01 09:58:32 -08:00
Lukas Piatkowski 81b1a2c6a5 Propagate bytecode offset in SamplingProfiler and use it to name unnamed functions
Reviewed By: cwdick

Differential Revision: D4251568

fbshipit-source-id: 2343d8f6a5b2f247a7af1bbd0112bed8edadcbfe
2016-12-01 09:43:37 -08:00
Lukas Piatkowski 48b95f08fb Refactory of SamplingProfiler, CpuProfileGenerator and jscProfilerMiddleware
Reviewed By: cwdick

Differential Revision: D4251541

fbshipit-source-id: ccd221beadd87f6a8cf27a1d68ae06599cf54333
2016-12-01 09:43:37 -08:00
Joel Sánchez 921921237f Add alternative lsof command for killing a process running on port 8081.
Summary:
I was running RN 0.31 on ArchLinux (kernel 4.7), and "react-native start"
was refusing to run on the default (and sometimes required, as I have
noticed) port. I tried executing the suggested lsof command, but that did not
work. Somewhere I found the lsof command I include in this commit, and that
worked (it was a node.js process). So I'm including it, since I found it
helpful.
Closes https://github.com/facebook/react-native/pull/9402

Reviewed By: lacker

Differential Revision: D4144400

Pulled By: hramos

fbshipit-source-id: 6203549455555efc59b7bab0a3ec23957d80b956
2016-11-30 17:13:30 -08:00
Charles Dick 48d3cd7d26 Pull aggrow from facebookincubator/tracery-prerelease
Reviewed By: bnham

Differential Revision: D4250937

fbshipit-source-id: b5f2cfdeb06c04399670e463b8b2498e2fe0074b
2016-11-30 12:58:35 -08:00
Charles Dick 3094c36c81 remove old heap capture in preparation for pull from tracery-prerelease
Reviewed By: bnham

Differential Revision: D4250926

fbshipit-source-id: 7cfbb8d8aae5ef150f0260c92e946d569e41f7fb
2016-11-30 12:58:35 -08:00
Christoph Pojer 6554ad5983 Kill fastfs
Summary:
This kills fastfs in favor of Jest's hasteFS. It gets rid of a ton of code, including the mocking code in ResolutionRequest which we don't need any more. Next step after this is to rewrite HasteMap, ModuleCache, Module/Package. We are getting closer to a nicer and faster world! :)

Here is what I did:
* Use Jest's HasteFS instead of fastfs. A fresh instance is received every time something changes on the FS.
* HasteFS is not shared with everything any more. Only one reference is kept in DependencyGraph and there are a few smaller functions that are passed around (getClosestPackage and dirExists). Note: `dirExists` now does fs access instead of an offline check. This sucks but stat calls aren't slow and aren't going to be a bottleneck in ResolutionRequest, I promise! When it is time to tackle a ResolutionRequest rewrite with jest-resolve, this will go away. "It gets worse before it gets better" :) The ModuleGraph equivalent does *not* do fs access and retains the previous way of doing things because we shouldn't do online fs access there.
* Add flow annotations to ResolutionRequest. This required a few tiny hacks for now because of ModuleGraph's duck typing. I'll get rid of this soon.
* Updated ModuleGraph to work with the new code, also created a mock HasteFS instance there.
* I fixed a few tiny mock issues for `fs` to make the tests work; I had to add one tiny little internal update to `dgraph._hasteFS._files` because the file watching in the tests isn't real. It is instrumented through some function calls, therefore the hasteFS instance doesn't get automatically updated. One way to solve this is to add `JestHasteMap.emit('change', …)` for testing but I didn't want to cut a Jest release just for that. #movefast

(Note: I will likely land this in 1.5 weeks from now after my vacation and I have yet to fully test all the product flows. Please give me feedback so I can make sure this is solid!)

Reviewed By: davidaurelio

Differential Revision: D4204082

fbshipit-source-id: d6dc9fcb77ac224df4554a59f0fce241c01b0512
2016-11-30 04:28:32 -08:00
Martin Konicek eb45367956 Update Flowconfig in CLI template to Flow v0.36.0
Summary: Flow was updated in bf901d926e, need to update the config file for the template too.

Reviewed By: mkonicek

Differential Revision:
D4240152
Ninja: OSS tests only

fbshipit-source-id: c20704c43a5d603105125a0316b7926cdc7cd7fd
2016-11-28 14:13:33 -08:00
Tim Yung ebc65cecd6 Packager: Options Cleanup
Reviewed By: matryoshcow

Differential Revision: D4235221

fbshipit-source-id: 6930a106ed02bec1d77a790641c3dcad46c779b9
2016-11-28 12:43:34 -08:00
Nicolas Cuillery 7d89b773a7 New upgrading process, relying on Git
Summary:
The upgrading process based on Yeoman is a pain. For each file, Yeoman (or the brand new copyAndReplace solution a477aec) compares the newly generated content with the existing one and prompts the user if it differs, with very basic options: overwrite or skip.

I have digged into this problem and came with [rn-diff](https://github.com/ncuillery/rn-diff) (you may have read [this article](https://medium.com/ncuillery/easier-react-native-upgrades-with-rn-diff-5020b5c3de2d#.llvy2dym5)). This repository helps people to upgrade RN on their projects. An alternative upgrading process using `git apply` instead of Yeoman is described [here](https://github.com/ncuillery/rn-diff/blob/master/USAGE.md).

This PR is the integration of this process into the core. I got rid of the drawbacks mentioned in the link below in order to make it a clean, elegant, one-step operation.

This process is based on some Shell operations that:
- Generate the blank sources of both old and new versions
Closes https://github.com/facebook/react-native/pull/11110

Differential Revision: D4237107

Pulled By: mkonicek

fbshipit-source-id: 15e82e030b762415c925ccb2a62ddb354a6e18b9
2016-11-28 08:28:35 -08:00
David Aurelio 8ad2ab3b5e BREAKING: expose `getTransformOptions` directly in configuration
Summary:
Instead of exposing a `getTransformOptionsModulePath` function in configurations, we can simply expose a `getTransformOptions` *function*. The necessity of exposing a path comes from the olden days, where we had a server listening on a socket, and a client, talking to that server.

Since that architectural gem no longer exists, we can use functions directly, rather than passing paths to modules around.

Reviewed By: cpojer

Differential Revision: D4233551

fbshipit-source-id: ec1acef8e6495a2f1fd0911a5613c144e8ffd7c3
2016-11-28 07:28:33 -08:00
yicheng 8b931ae09f Update meta.js (new Buffer when init)
Summary:
Thanks for submitting a pull request! Please provide enough information so that others can review your pull request:

> **Unless you are a React Native release maintainer and cherry-picking an *existing* commit into a current release, ensure your pull request is targeting the `master` React Native branch.**

Explain the **motivation** for making this change. What existing problem does the pull request solve?
Warning about new Buffer when init
Prefer **small pull requests**. These are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it.

**Test plan (required)**

Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI.

Make sure tests pass on both Travis and Circle CI.

**Code formatting**

Look around. Match the style of the rest of the codebase. See also the simple [style guide](https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md#s
Closes https://github.com/facebook/react-native/pull/11153

Differential Revision: D4234591

fbshipit-source-id: a9373f3151de8a50c18342f45fb9684a5c7416a6
2016-11-27 02:58:29 -08:00
Jean Lauliac 5d30045211 packager: add GlobalTransformCache
Reviewed By: davidaurelio

Differential Revision: D4175938

fbshipit-source-id: 1f57d594b4c8c8189feb2ea6d4d4011870ffd85f
2016-11-24 09:58:31 -08:00
Felix Krause 5e008c932c Add fastlane to default .gitignore
Summary:
Taken from the [github/gitignore repo](https://github.com/github/gitignore/blob/master/Objective-C.gitignore)
Closes https://github.com/facebook/react-native/pull/11113

Differential Revision: D4231705

fbshipit-source-id: 3d768b6b73cb53a313a2260f825cfef94b809ece
2016-11-24 08:28:25 -08:00
David Aurelio ca58e0af82 BREAKING kill deprecated asset support
Summary:
This removes support for `require('image!…')`, which has been deprecated for a long time.

It is still possible to use images that are already bundled by the native app using the `nativeImageSource` module.
Check http://facebook.github.io/react-native/docs/images.html for detailed documentation.

Reviewed By: matryoshcow

Differential Revision: D4231208

fbshipit-source-id: 05ec4c1ca0fabdc3fbb652f8ad1acdf240a67955
2016-11-24 05:43:38 -08:00
Pieter De Baets e1577df1fd Move all header imports to "<React/..>"
Summary:
To make React Native play nicely with our internal build infrastructure we need to properly namespace all of our header includes.

Where previously you could do `#import "RCTBridge.h"`, you must now write this as `#import <React/RCTBridge.h>`. If your xcode project still has a custom header include path, both variants will likely continue to work, but for new projects, we're defaulting the header include path to `$(BUILT_PRODUCTS_DIR)/usr/local/include`, where the React and CSSLayout targets will copy a subset of headers too. To make Xcode copy headers phase work properly, you may need to add React as an explicit dependency to your app's scheme and disable "parallelize build".

Reviewed By: mmmulani

Differential Revision: D4213120

fbshipit-source-id: 84a32a4b250c27699e6795f43584f13d594a9a82
2016-11-23 07:58:39 -08:00
Mike Grabowski 9fb520e3b2 Add ability to specify main Activity in run-android
Summary:
Follow up to #8190

Tested with custom parameter as well as w/o (using default value). All worked well.

Differential Revision: D4220565

Pulled By: mkonicek

fbshipit-source-id: e8a98542d3ff96d60ff6045b328f5b464f78ee74
2016-11-23 06:43:50 -08:00
Martin Konicek 3aa25f7917 Allow git to merge pbxproj files
Summary:
Follow on in https://github.com/facebook/react-native/pull/10864.

**Motivation**

ncuillery Is has a lot of experience with upgrading RN projects (see his [talk](http://www.slideshare.net/ncuillery/introducing-the-new-reactnative-upgrade)) and is rewriting 'react-native upgrade' to use git.

He tells me that we actually want git to merge changes in the .pbxproj file. In his words: "Making the project.pbxproj invisible for "git diff" means that react-native-git-upgrade will never be able to upgrade the project.pbxproj."

Note the git docs explicitly recommend not to use git to merge .pbxproj files: https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes#Binary-Files

ncuillery do we have an alternative? Some ideas:

1. Use a 3rd-party tool in 'react-native upgrade' to merge the .pbxproj file?
2. We could always re-generate and overwrite the .pbxproj file (never merge) and then run 'react-native link' to update native 3rd-party dependencies in the Xcode project?
3. Last resort: stay away
Closes https://github.com/facebook/react-native/pull/11047

Differential Revision: D4220521

fbshipit-source-id: 823c735856b519be114aa4349ca1392910f00445
2016-11-22 17:58:29 -08:00
Wojciech Ogrodowczyk 145692a940 Fix typo when running an unknown simulator
Summary:
Just fixes a typo in an error message when running a simulator that XCode doesn't recognise.
Closes https://github.com/facebook/react-native/pull/11060

Differential Revision: D4220364

Pulled By: mkonicek

fbshipit-source-id: da7b9a529ad8cd77c6e144f4bbf3ea594a9efee4
2016-11-22 11:58:37 -08:00
David Aurelio f3779502d3 Add flow types for output modules
Summary: Adds flow types for output functionality for easier maintenance and interop with new code

Reviewed By: matryoshcow

Differential Revision: D4211863

fbshipit-source-id: 591407d3a6d49536054ae94ba31125c18a1e1fa1
2016-11-21 13:28:30 -08:00
Martin Konicek 9712d335e2 Fix handling of dotfiles in 'react-native init' and 'react-native upgrade'
Summary:
Followup for CLI rewrite (a477aec10d). See the comment in the code for details.

**Test plan (required)**

- Published to Sinopia locally ([docs](https://github.com/facebook/react-native/tree/master/react-native-cli))
- Ran 'react-native init MyApp', the correct files were created (no more .npmignore, but have .gitignore):

      $ cd MyApp
      $ ls -a
      .			.flowconfig		__tests__		ios
      ..			.gitattributes		android			node_modules
      .babelrc		.gitignore		index.android.js	package.json
      .buckconfig		.watchmanconfig		index.ios.js		yarn.lock

- Changed .flowconfig, ran 'react-native upgrade'. Saw a prompt "Do you want to overwrite .flowconfig", tried answering first 'n' and then 'y'. When answering 'y' the file was overwritten by the version from the template as expected.
Closes https://github.com/facebook/react-native/pull/11051

Differential Revision: D4214831

Pulled By: ericvicenti

fbshipit-source-id: 7c6aae4f97c7d45e7241bf017ed2f6527d5d29fe
2016-11-21 12:58:29 -08:00
Ovidiu Viorel Iepure 8dbb025959 Fix lint in local-cli
Summary: Fix more lint warnings in local-cli

Reviewed By: davidaurelio

Differential Revision: D4213265

fbshipit-source-id: a7f251f2af1e1de67a2b51908713e7a18faf6f18
2016-11-21 10:28:34 -08:00
Ovidiu Viorel Iepure 812591ac42 Use native Promise in local-cli
Summary: Switch to native promises in the local cli

Reviewed By: davidaurelio

Differential Revision: D4213142

fbshipit-source-id: aff99f8bb3dc237cecc852cdb09dee9b49b05753
2016-11-21 10:28:34 -08:00
Pieter De Baets 7c91f894ba Fix CSSLayout import hack, update podspec
Summary: Correct header import paths, update podspec so we point at the copy in ReactCommon (and can eventually remove the copy under React)

Reviewed By: astreet

Differential Revision: D4204501

fbshipit-source-id: e979a010092f025b2cdc289e1e5f22fc7b65a8d1
2016-11-21 09:13:36 -08:00
Martin Konicek b74da13a75 Fix after using hg
Summary:
I had to re-do my CLI pull request internally using hg because shipit couldn't import binary files even after debugging with the OSS team. While using hg I messed up. This should fix it:

- Remove files added by mistake when using 'hg addremove'
- Add Xcode project that was ignored by hg (probably at fb we don't want people to check in Xcode projects since we use Buck)

**Test Plan**
Travis tests on this pull request.
Closes https://github.com/facebook/react-native/pull/11043

Differential Revision: D4212755

Pulled By: bestander

fbshipit-source-id: c762472ed31b9845425c1766510dce7761a35ae0
2016-11-21 04:58:29 -08:00
Cristian Carlesso c8a5b42b45 Remove unused jest-react-native leftovers
Reviewed By: cpojer

Differential Revision: D4212163

fbshipit-source-id: 61d86d03ea817088b378c21d16a35104bc33920b
2016-11-21 00:13:25 -08:00
Tim Yung 0ec0b9df8e RN: Logger for Hot Module Reloading Logs
Summary: Uses `Logger` for the HMR Server output so that we get timestamps for free and the packager server output does not look as crappy.

Reviewed By: cpojer

Differential Revision: D4210827

fbshipit-source-id: e1ae64c359150b98c33e7b074f1111d37a2bc39b
2016-11-20 19:58:30 -08:00
Martin Konicek a477aec10d Rewrite 'react-native init' and 'react-native upgrade' without using Yeoman in preparation for templates support
Summary:
This is the manually imported version of https://github.com/facebook/react-native/pull/10786

This was mostly straigthforward by replacing the local-cli folder with the version I had in my local git checkout,
plus a few other files I listed with git diff --name-only.

Reviewed By: hramos

Differential Revision: D4201118

fbshipit-source-id: 4d0fb54b0edda9de1abba427958e420fd2ac105c
2016-11-18 18:28:51 -08:00
David Aurelio 112bdc99dc Add `--indexed-unbundle` flag to force iOS ra-bundle format
Summary: This adds a new flag to the `unbundle` command: `--indexed-unbundle` allows to output the indexed file format even when building for android.

Reviewed By: cpojer

Differential Revision: D4189485

fbshipit-source-id: e56192456de764eb38c25b574ceaaf52eb8a6fca
2016-11-17 02:43:26 -08:00
Christoph Pojer a9338d6af1 New file watching implementation
Summary:
This is the next incremental step to rewrite node-haste. I apologize for the size of this diff but there is really no smaller way to do this. The current architecture passes a single file watcher instance into many classes that each subscribe to file changes. It's really hard to keep track of this. The new implementation reduces the listeners to two (will eventually be just one!) - one in DependencyGraph and one in it's parent's parent's parent (ugh! This doesn't make any sense). This should make it much more straightforward to understand what happens when a file changes.

I was able to remove a bunch of tests because jest's watcher takes care of things like ignore patterns. Some of the tests were specifically testing for whether the change events were invoked and they are now much more straightforward as well by manually invoking the `processFileChange` methods.

(Relanding a fixed version of D4161662)

Reviewed By: kentaromiura

Differential Revision: D4194378

fbshipit-source-id: 8c008247a911573f6b5f6b0b374d50d38f62a4f5
2016-11-16 20:13:26 -08:00
Martin Konicek 14ac051c19 Revert D4161662: [RNP] New file watching implementation
Differential Revision: D4161662

fbshipit-source-id: 00604387b4f4b808f95275458f1c653981f91b86
2016-11-16 10:28:31 -08:00
Christoph Pojer e8a623a2ab New file watching implementation
Reviewed By: davidaurelio

Differential Revision: D4161662

fbshipit-source-id: 9a2a399304c83b411a8b0b74ea015c18b599fbaf
2016-11-16 01:13:40 -08:00
Alexander Blom 2cc57d05a4 Support loading source maps
Reviewed By: davidaurelio

Differential Revision: D4121492

fbshipit-source-id: e2f9c42de3e28cd231580d8b7d3230d47e300d2e
2016-11-15 08:59:02 -08:00
Alexander Blom f571d28e68 Allow launching inspector from dev menu
Reviewed By: davidaurelio

Differential Revision: D4095356

fbshipit-source-id: 46e43578cdcd663316efb82dffde27b77294c5c0
2016-11-15 08:59:02 -08:00
Alexander Blom 655fe2796a Add packager inspector proxy
Summary:
Implements a multi-device proxy for the Chrome debugging protocol. Each device connects
to the proxy over a single websocket connection that is able to multiplex messages to multiple
Javascript VMs. An inspector instance running in Chrome can connect to a specific VM via this
proxy.

Reviewed By: davidaurelio

Differential Revision: D4088492

fbshipit-source-id: 3ee934e98604b5a378da732e687ca05fe3d23ce0
2016-11-15 08:59:02 -08:00
Ovidiu Viorel Iepure 24d2bbfbab Fix lint in local-cli
Reviewed By: cpojer

Differential Revision: D4166993

fbshipit-source-id: 9a8249175d98b42d7557817846d8c09c9769485e
2016-11-14 11:13:42 -08:00
Sandro Machado 2a2d3c6e5a Add the configuration option to the run-android command
Summary:
Currently, to generate a `Release` build in `Android` it is required to get into the `android` directory and run the `react native bundle`with a lot of options and after that run the `gradle` to assemble or install the application with the build type `Release`.

This PR improves the process adding that feature to the `React Native CLI`.

To generate a release build is only required to use the parameter `--configuration` with the value `Release`.

**Examples**

To generate a release build:
```sh
react-native run-android --configuration release
```

To generate a release build for the product flavors staging:
```sh
react-native run-android --configuration release --flavor staging
```

To generate a debug build:
```sh
react-native run-android
```

To generate a debug build for the product flavors staging:
```sh
react-native run-android --flavor staging
```

This PR also removes the option `--install-debug` from the `react-native run-android` because that is always the default value,
Closes https://github.com/facebook/react-native/pull/10867

Differential Revision: D4167203

Pulled By: cpojer

fbshipit-source-id: c5ac07f81feeeea00ee0e8b059b46ef0d258a1a6
2016-11-13 18:58:29 -08:00
Dustin Ingram 07dc35e4ad Add .gitattributes file, treat .pbxproj as binary
Summary:
By default, the `.pbxproj` file generated by React Native should be treated as binary data to prevent Git from possibly automatically converting or fixing CRLF issues with this file, which would break it.

See https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes#identifying-binary-files-znTLIVhvhG (where it specifically mentions `.pbxproj` files) for more information.
Closes https://github.com/facebook/react-native/pull/10864

Differential Revision: D4162492

fbshipit-source-id: 2c8f2f0ab2bb41c23b1460ef6cba672ef38f6310
2016-11-10 17:58:41 -08:00
Sandro Machado ca7cbdee85 Add the scheme configuration option to the run-ios command
Summary:
With the current `run-ios` script it is not possible to create/run iOS release builds or any other kind of scheme configuration from the terminal (we need to use `Xcode`). The reason for this is that the `run-ios` script does not expose the scheme configuration option for the `xcodebuild` command. This PR exposes that property and allows the developers to directly create/run release builds from the terminal.

This PR also closes [this](https://productpains.com/post/react-native/create-ios-release-builds-from-terminal) request at `productpains`.

And answers to [this](http://stackoverflow.com/questions/40303229/run-a-react-native-ios-release-build-from-terminal) question at the `stackoverflow`.

**Test plan (required)**

To generate a release build just run:

``` sh
react-native run-ios --configuration Release
```

The output

``` sh
Found Xcode project App.xcodeproj
Launching iPhone 6 (iOS 9.3)...
Building using "xcodebuild -project App.xcodeproj -scheme App -destination id=B0738993-CE4A-4D
Closes https://github.com/facebook/react-native/pull/10637

Differential Revision: D4151793

Pulled By: cpojer

fbshipit-source-id: 5a0fcdd59589977f3e251ec9bb3ba85e8919cffc
2016-11-10 09:58:42 -08:00
Sreejith R 8965f11769 Included NativeAnimation module on iOS in the starter project
Summary:
Fixes #10638.

Added NativeAnimation library to the starter project iOS generator. Passing `useNativeDriver: true` to `Animated` config will enable the app to tap into the native code for animations.

**Test plan**

Init a RN project and animate an element. Enable native driver as follows:

```
Animated.timing(
      this.state.value,
      {
        toValue: 300,  // some value
        useNativeDriver: true
      }
    ).start();
```
Earlier, this used to crash.
Closes https://github.com/facebook/react-native/pull/10783

Differential Revision: D4159386

Pulled By: mkonicek

fbshipit-source-id: 993481a31b4446eab24ef4ee35ae1941d7a7aae9
2016-11-10 00:58:33 -08:00
Ovidiu Viorel Iepure 33fb428a07 Use npm for e2e tests
Summary:
Force npm for e2e tests.
Bonus: tracked down and removed a non-standard `.done()` call that was breaking e2e tests.

Reviewed By: bestander

Differential Revision: D4153514

fbshipit-source-id: 079939874ea75c7ea6e3e5376d37873c95fc74c1
2016-11-09 09:31:12 -08:00
Yariv Kenan f0a58af37b Change matching pattern on settings.gradle
Summary:
Link doesn't work on f8app,
as it is, android projects don't have to contain the matching string and then the linking would not work, I've switched it to the much simpler new-line.
If you can find a better common minimum string for settings.gradle please do.

Commit Msg:
Current string, `include ':app'\n`, is not a minimum common string.
Instead a simple `\n` will do.
Closes https://github.com/facebook/react-native/pull/10172

Differential Revision: D4150313

fbshipit-source-id: 34470e1fb67194e41354b6085fb3eb90ddaa7ff8
2016-11-08 16:28:43 -08:00
Ovidiu Viorel Iepure b12db7645e Use native Promises
Summary: Use native Promises in React Native Packager. Remove all the non-standard `Promise.done()` calls throughout the codebase & replace `Promise.denodeify` with the stand-alone `denodeify` module.

Reviewed By: davidaurelio

Differential Revision: D4146965

fbshipit-source-id: 1730531c914863ac3c52626801d9f91c28eed717
2016-11-08 12:28:47 -08:00
Andres Suarez ba8bbcbe2f Remove prepack bundle functionality
Reviewed By: davidaurelio

Differential Revision: D4138495

fbshipit-source-id: 52793fc1a8ef8b2fc461156607c360f34c4cb362
2016-11-07 03:43:37 -08:00
Matthew Dapena-Tretter a643784144 Allow arguments in the editor env var
Reviewed By: frantic

Differential Revision: D4129207

fbshipit-source-id: a92fbbbe917db9c9afc0d970e3ac546e2a14bced
2016-11-04 12:59:17 -07:00
Martin Konicek c02c7f3024 CLI: Only use yarn if global CLI uses it
Summary:
Check that 'react-native init' itself used yarn to install React Native.
When using an old global react-native-cli@1.0.0 (or older), we don't want to install React Native with npm, and React + Jest with yarn. Let's be safe and not mix yarn and npm in a single project.

**Test plan**

Publish the code in this PR to Sinopia, use that when creating a new project.

Using old CLI:

    npm install -g react-native-cli@1.0.0
    react-native init AwesomeApp

The generated project doesn't contain `yarn.lock` (everything was installed with the npm client).

 ---

Using new CLI:

    npm install -g react-native-cli@1.2.0
    react-native init AwesomeApp

The generated project contains `yarn.lock`, output shows that yarn is used to install React Native, React, Jest.

 ---

In both cases the project runs and Reload JS works:

![screenshot 2016-11-04 17 20 50](https://cloud.githubusercontent.com/assets/346214/20015719/719effb0-a2b4-11e6-84a0-43474314009b.png)
Closes https://github.com/facebook/react-native/pull/10752

Differential Revision: D4131812

Pulled By: bestander

fbshipit-source-id: efaaf97a27005e2c2d10cae5d07afe108d5c0dee
2016-11-04 11:28:40 -07:00
Felix Oghina 0907ef6689 Call SoLoader.init in MainApplication#onCreate
Summary:
Fixes #10352.
Closes https://github.com/facebook/react-native/pull/10724

Differential Revision: D4126371

fbshipit-source-id: e1765e2d2a3ff80a962f1db6bdc9e90d797d3ab6
2016-11-03 13:29:09 -07:00
Ben Bodenmiller dc0a5ec75d ignore all keystore files
Summary:
Ignore all keystore files as we do not want users to accidentally check in their keystore file.
Closes https://github.com/facebook/react-native/pull/10214

Differential Revision: D4118169

Pulled By: bestander

fbshipit-source-id: a81fc99afd1715d52dfdce8c47dfc10808470008
2016-11-02 11:15:10 -07:00
Martin Konicek 94711bfb06 Use yarn when available
Summary:
**Motivation**

`react-native init` takes minutes even on a fast network. Yarn makes it much quicker.

When yarn is not installed on the system:

<img width="440" alt="screenshot 2016-10-31 22 21 19" src="https://cloud.githubusercontent.com/assets/346214/19873897/7bad5662-9fb9-11e6-85fb-ad4879949dad.png">

When yarn is installed:

<img width="441" alt="screenshot 2016-10-31 22 02 20" src="https://cloud.githubusercontent.com/assets/346214/19873898/7baf4c56-9fb9-11e6-96b3-007f93d2438a.png">

Also added the option `react-native init AwesomeApp --npm` as a fallback in case yarn is not stable enough for some people (I saw some Github issues that yarn hangs for example; for me it works great though).

**Test plan**
1. Publish to Sinopia: https://github.com/facebook/react-native/tree/master/react-native-cli
2. `react-native init AwesomeApp`

***Tested the following setups***

- New CLI - uses yarn, new react-native - uses yarn
- Old CLI (1.0.0) - doesn't use yarn, new react-native - uses yarn
-
Closes https://github.com/facebook/react-native/pull/10626

Differential Revision: D4110883

Pulled By: bestander

fbshipit-source-id: 8a3427e2bc9158cf5fadd8ddf5b31e4b50ce6453
2016-11-01 09:28:52 -07:00
Cristian Carlesso 6d3e074dd4 Adding Jest preset so that people can configure Jest using react-native as preset
Reviewed By: cpojer

Differential Revision: D4081817

fbshipit-source-id: 43cf2ec467ea69651705162b6a58e0b3f1ad1dbf
2016-10-31 12:58:35 -07:00
Tim Yung 8b653cde56 RN: Show Warning for Background Remote Debuggers
Summary:
Some recent change to Chrome causes the remote debugger to be throttled unexpectedly if it is in a background tab. Although this does not fix the problem, it raises the issue and suggests a workaround.

I also cleaned up some littering of the global namespace in the debugger web worker.

Reviewed By: jingc

Differential Revision: D4104515

fbshipit-source-id: 56e46c0e759bec4c42d3baedd4d2d46cdea2e4a0
2016-10-31 11:29:57 -07:00
Tim Yung 448e66b3fa RN: Cleanup Debugger HTML
Summary: Minor cleanup to `debugger.html`.

Reviewed By: fkgozali

Differential Revision: D4104499

fbshipit-source-id: f484711b4a855a1fd703d3a457b96ad45e0250e2
2016-10-31 11:29:57 -07:00
Mehdi AHRAOUI a16d72842d debuggerWorker.js contains code incompatible with node 5
Summary:
Hi,

This is a small fix for issue #10564.
Closes https://github.com/facebook/react-native/pull/10571

Differential Revision: D4086542

fbshipit-source-id: a50b4b3afdefe4abfe64869768ce51c6c628708a
2016-10-26 19:28:38 -07:00
Charles Dick 6ddf8a8795 refactor aggrow to make adding new sources of data easier
Reviewed By: michalgr

Differential Revision: D3961648

fbshipit-source-id: 3c77d3c1352fd89e12163eee393ffcebe09ea8e3
2016-10-25 07:13:51 -07:00
aleclarson 178a19f3da Fix 'mapHeaderSearchPaths'
Summary:
👍
Closes https://github.com/facebook/react-native/pull/9976

Differential Revision: D4070412

fbshipit-source-id: fc0a1d10606faa117d46eeab62669c62923ce935
2016-10-24 15:13:30 -07:00
Kevin Lacker c4aa29c753 Update Android support URL
Summary:
> Explain the **motivation** for making this change. What existing problem does the pull request solve?

There's no longer a seaprate page for Android setup instructions, it just redirects to the getting started page, where you have to navigate futher.

**Test plan (required)**

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

Differential Revision: D4069696

Pulled By: lacker

fbshipit-source-id: 67f6450f550cbbf446476ea824a6915125e823ba
2016-10-24 13:43:36 -07:00
Rob Clouth 157a03dd8d Fixes react-native link for apps with extra xcode projects in the root folder
Summary:
Adds a ```sort``` to ```findProject(folder)``` to boost ones in IOS_BASE to the top. Otherwise, if for example there is a git submodule project in the root app folder, the method will pick that one instead and linking will fail.
Fixes issue #10494
Closes https://github.com/facebook/react-native/pull/10495

Differential Revision: D4069439

Pulled By: lacker

fbshipit-source-id: 4328ac55389ed51cb42759fcf8360e56d5058136
2016-10-24 13:13:46 -07:00
David Aurelio d7aa297762 Break out defaults, add flow for Config
Summary: In order to make `Config` and defaults available to our new code, I’ve added flow types and put default values into one shared modile

Reviewed By: cpojer

Differential Revision: D4044600

fbshipit-source-id: 875ed3ade69c5b22bb3c1b177e7bad732834d476
2016-10-22 06:13:42 -07:00
Christoph Pojer fb4f34bc9b Remove fastpath
Summary: I originally added fastpath to node-haste to speed up `path` operations by an order of magnitude. Now we are exclusively using Node 6 at FB so we don't need to ship this thing any more.

Reviewed By: bestander

Differential Revision: D4029092

fbshipit-source-id: 064cf67f4f79ce4f2774fb4e430d22eef4a95434
2016-10-20 00:14:03 -07:00
Yoshiya Hinosawa 71676809d6 Fix indent of .gradle files
Summary:
In most .gradle files, lines are indented with 4 spaces, but in some places they are indented with 2 spaces. This PR fixes them and enforce it by adding .editorconfig settings.
Closes https://github.com/facebook/react-native/pull/10267

Differential Revision: D4048335

Pulled By: lacker

fbshipit-source-id: df2f2556380f56672cf85690eb1c80e640a6aedf
2016-10-19 16:58:36 -07:00
Stephen Poter 8b55e50d1d Fix error in react-native run-ios when Product Name and Scheme are inequal
Summary:
In xcode, you can modify the Product Name per build configuration.  During the build, the app file name is made using that value.  For example, I name my app "MyApp Dev", it will build into "MyApp Dev.app".

react-native run-ios doesn't extract the proper app name.  Instead it uses the scheme name + ".app".  So if in the example above I use the default Scheme "MyApp", which references the build configuration whose name is "MyApp Dev".  The build will succeed, but when runIOS.js goes to run the app, it fails because the file name doesn't exist.

My fix parses the build output and extracts the app name from the line "export FULL_PRODUCT_NAME=$(appfilename)" and uses that instead of the scheme.  If there is any issue parsing, the scheme name is used like it currently is.

**Test plan (required)**

1) Change the Product Name in xcode project manager to be something different than the scheme name.
2) Run react-native run-ios and ensure it works.
Closes https://github.com/facebook/react-native/pull/10178

Differential Revision: D4022116

Pulled By: javache

fbshipit-source-id: c1bd8e7a1f6364d681c505557a96955a293bc05c
2016-10-14 14:43:52 -07:00
David Aurelio d26af5811d Monkey-patch `fs` with graceful-fs before anything else runs
Reviewed By: matryoshcow, kentaromiura

Differential Revision: D4020645

fbshipit-source-id: a7985109476b78b588c3e2a75ae6f25ea8f09237
2016-10-14 11:13:54 -07:00
Ben Hughes 41f4f1eaaf CLI errors if no package.json is found
Summary:
If you don't have a `package.json` in your project you can't do anything with the cli as it errors. This fixes that by wrapping the reading of the `package.json` file and returns `my-react-native-app` if an error is caught.
Closes https://github.com/facebook/react-native/pull/10207

Differential Revision: D4022113

Pulled By: javache

fbshipit-source-id: ffe940160f9d0b58e630adfab5e0dc9d34b859e5
2016-10-14 10:58:43 -07:00
MIYOKAWA, Nobuyoshi 5c0dec16ba replace old ATS key name to new one.
Summary:
On iOS project, ATS is disabled for 'localhost'.  But the key for this setting is old and just for early iOS9 beta.  iOS9 release and later uses new one, so I updated it.
Closes https://github.com/facebook/react-native/pull/10314

Differential Revision: D3993780

fbshipit-source-id: b749edd571c34f07989dde6af0e4ff95f5355c29
2016-10-09 12:13:37 -07:00
Charles Dick 217a4449d4 remove dependency between aggrow and stackRegistry
Reviewed By: bnham

Differential Revision: D3876267

fbshipit-source-id: 2ad7e70445f3f4641cde554e94de000403368233
2016-10-06 07:58:36 -07:00
Jani Eväkallio 467b637656 Add a debugger favicon
Summary:
I frequently spend multiple seconds scanning my open Chrome tabs for the React Native debugger tab. It would be a lot quicker to find the correct tab if the debugger UI tab had a favicon.

This commit adds favicon (blue react logo in a white circle). It's a super minor change, but would help a lot with day-to-day DX.

I chose this icon to differentiate sufficiently from other tabs developer might have open: React docs (blue logo in black square) and React Native docs (white logo in black square). If the idea of having a favicon is agreeable but you want a different asset, I'm more than happy to change it to something else.

Original asset before base-64 encoding:
![favicon-32x32](https://cloud.githubusercontent.com/assets/1203949/19117546/44b36fd2-8b11-11e6-8a94-c8956fe7533c.png)

In the wild:
<img width="335" alt="screen shot 2016-10-05 at 15 40 58" src="https://cloud.githubusercontent.com/assets/1203949/19117811/43cad316-8b12-11e6-8406-4c9b74efdaf2.png">
Closes https://github.com/facebook/react-native/pull/10252

Differential Revision: D3974983

Pulled By: hramos

fbshipit-source-id: 6b07d446dd972c4c171062134b45bc3850886349
2016-10-05 10:43:43 -07:00
Charles Dick 286b56fbd0 Add configuration tab to aggrow
Reviewed By: bnham

Differential Revision: D3759273

fbshipit-source-id: fd09465e19fbd1b377bf8b384f9b0b241bf43288
2016-10-04 03:29:55 -07:00
Konstantin Raev 0eea9c61ee added new property to mock in chalk.js
Summary:
Tests started [failing](https://travis-ci.org/facebook/react-native/jobs/163517412) with release of new  babel that uses chalk.white.bgRed in code.
Jest does not like chalk and needs it mocked.
Removed code duplication and patched the mock.
Closes https://github.com/facebook/react-native/pull/10169

Differential Revision: D3943493

Pulled By: davidaurelio

fbshipit-source-id: 11f57f60ed909a394f15de7b9cc511400aeff510
2016-09-29 04:13:33 -07:00
David Aurelio ba8066d7f3 Disable `extra-arrow-initializer` rule in node directories
Reviewed By: bestander

Differential Revision: D3929929

fbshipit-source-id: a78e22104a5ac593d7f396907cb0252d1629870c
2016-09-27 13:43:37 -07:00
Ovidiu Viorel Iepure 23d84c8df8 Remove platform blacklists
Summary: File platform identifiers (`fileName.<platform>.js`) are no longer part of the blacklist regular expression. This allows the upcoming `jest-haste-map` to include all files for all platforms, therefore enabling Packager to build bundles for different platforms using the same `HasteMap`(jest-haste-map) instance.

Reviewed By: davidaurelio

Differential Revision: D3907508

fbshipit-source-id: d7d7f3bd93287a634a1ef0590a736d021be2aaa5
2016-09-23 08:13:46 -07:00
Cristian Carlesso 7b2080e118 Removing automatically reset modules between test run
Reviewed By: bestander

Differential Revision: D3886125

fbshipit-source-id: c8f47c3466add1e2c89649a1c6f47b01f0d7a89e
2016-09-19 12:43:55 -07:00
David Aurelio b62ed2f291 Add support for module groups to iOS Random Access Bundle format
Summary:
Adds the possibility to specify an array of files (group roots) that are used to bundle modules outside of the “startup section” into bigger groups by colocating their code.
A require call for any grouped module will load all modules in that group.
Files contained by multiple groups are deoptimized (i.e. bundled as individual script)

Reviewed By: martinbigio

Differential Revision: D3841780

fbshipit-source-id: 8d37782792efd66b5f557c7567489f68c9b229d8
2016-09-16 10:13:49 -07:00