Commit Graph

615 Commits

Author SHA1 Message Date
Gabe Levi 92f900c79d Upgrade to v0.44.0
Reviewed By: zertosh

Differential Revision: D4893660

fbshipit-source-id: ed85f5d4c585164d464a7e009888a28e5af339cd
2017-04-17 09:33:20 -07:00
Brian Vaughn 6564edce5e Ran PropTypes -> prop-types codemod against Libraries/FBReactKit/js/react-native-github
Reviewed By: acdlite

Differential Revision: D4876709

fbshipit-source-id: 3a5e92bfc74287b7a9054546c438580bed0147af
2017-04-12 16:15:15 -07:00
Christoph Pojer deebf15a56 Move formatBanner into packager folder
Reviewed By: davidaurelio

Differential Revision: D4868954

fbshipit-source-id: 7a28019c781262bcf4aab0ad2e67868d35ebf9fb
2017-04-12 02:44:51 -07:00
Karan Thakkar 840dc0cc82 Allow configuring the app source folder for android
Summary:
I have been working on integrating React Native into an existing app and realised that the source folder for android code is currently hardcoded as `app`. Being a legacy codebase we can't really change that. So I wanted to be able to customise this folder name so that I can integrate RN seamlessly and start it from the CLI without having to run it from Android Studio.

- Create a barebones RN app
- `react-native run-android` works successfully
- Refactor the name of the app folder inside the android directory to `TestFolderName` using Android Studio
- `react-native run-android` now fails
- Changing this command to `react-native run-android --appFolder=TestFolderName` works successfully
Closes https://github.com/facebook/react-native/pull/13273

Differential Revision: D4833396

Pulled By: ericvicenti

fbshipit-source-id: 4c62cee6aaa2cc78eede5c7756459430022fffde
2017-04-11 12:25:39 -07:00
Andres Suarez e67b8fe761 Use flow 0.43.1
Reviewed By: nmote

Differential Revision: D4851923

fbshipit-source-id: 018f61c3a45e32c899287848d36129e3601145a4
2017-04-08 14:05:11 -07:00
Adam Perry 403f356082 Stop yarn error message appearing for Windows users of local-cli
Summary:
On windows, recent versions of local-cli will display a yarn error to stderr when starting the packager (see https://github.com/expo/xde/issues/91, https://github.com/react-community/create-react-native-app/issues/101, https://github.com/react-community/create-react-native-app/issues/113#issuecomment-289185491 for examples of users hitting this in the wild), even though no package management action is being taken.

From what I can tell this is what happens:

* [`local-cli/util/yarn.js` does not ignore stderr on Windows](6fa87134fc/local-cli/util/yarn.js (L25))
* [`local-cli/util/PackageManager.js` calls the above function when it's require'd](6fa87134fc/local-cli/util/PackageManager.js (L20))

For Windows users who don't have yarn installed, this means that the 'yarn is not recognized as an internal or external command..." error displays wh
Closes https://github.com/facebook/react-native/pull/13355

Differential Revision: D4848084

Pulled By: hramos

fbshipit-source-id: f32176354e0bd7ff6d7009ea30dca64ff23ae3d5
2017-04-07 11:17:00 -07:00
Max Sherman 6fa87134fc Use the absolute path to the sourcemap in the CS bundle
Reviewed By: davidaurelio

Differential Revision: D4831377

fbshipit-source-id: b7da81264a65bea1827237cdd34567b29579acd4
2017-04-06 09:30:31 -07:00
Gabe Levi 4f243f1ecd Deploy v0.43.0
Reviewed By: zertosh

Differential Revision: D4835081

fbshipit-source-id: a9ab33648320fb19b8cc7ab212e68fada7810b90
2017-04-05 18:31:06 -07:00
Vojtech Novak cd4545f812 configurable devEnabled in React.gradle
Summary:
This PR adds support for configurable devEnabled option when building an android app. This is currently hardcoded.

The reason for making this configurable is this: I have an app that uses code-push and 3 buildConfigs. I want to have a debugging version which has `devEnabled = true`, then a staging version which has `devEnabled = false` (this version of the app is used internally for testing and should behave just like a release version of the app, and when the tests succeed the changes are promoted into the release version to the users out there, using code-push). The last version is a standard release version with `devEnabled = false`.

Currently, `devEnabled` is hardwired like this: `!targetName.toLowerCase().contains("release")` so by default my `staging` buildConfig will have `devEnabled = true` but I'd like it to be false.

With this PR it'd be possible to configure this as follows, while not breaking the current behavior.
`'devDisabledIn${productFlavor}${buildType}'`
`'devDisabledIn${buildType
Closes https://github.com/facebook/react-native/pull/11438

Differential Revision: D4630513

Pulled By: hramos

fbshipit-source-id: b6817cf4c144fc948f76785e9cb5f93a13a6a6a2
2017-04-05 12:50:31 -07:00
Fred Blau d8f23f79c7 Allow specifying an appIdSuffix to run-android
Summary:
Motivation

Currently react-native run-android instals and starts your app, but if you have more than one variant, it doesn't know which one to start.  This allows developers to pass in the suffix specified in build.gradle, so that the correct app is started.

Test Plan

verify that `react-native run-android` runs properly
verify that `react-native run-android --appIdSuffix validSuffix` runs properly
Closes https://github.com/facebook/react-native/pull/13169

Differential Revision: D4823391

Pulled By: ericvicenti

fbshipit-source-id: 31ed35fd79403804b4781e81eb49f1c4627d7f8e
2017-04-04 16:45:27 -07:00
Sai Grandhi 0fe0fc038b Make copy button work on android emulator in Linux using xsel
Summary:
Resolves issue [#13165](https://github.com/facebook/react-native/issues/13165). The copy button in the redbox for RN android is not currently supported for Linux. This pull request provides the copy button functionality to Linux RN users.

I have tested the updated code locally.
Firstly, I edited `index.android.js` that caused the following error.
![pasted image at 2017_03_27 10_21 am](https://cloud.githubusercontent.com/assets/22376429/24426834/f567c5dc-13d6-11e7-8e3b-a650e2f6237c.png)
After I clicked the copy button and pasted from the clipboard into the chrome address bar, the message appeared.
![pasted_image_at_2017_03_27_10_21_am](https://cloud.githubusercontent.com/assets/22376429/24426896/2c0d4d64-13d7-11e7-8650-da19c44b177d.png)
Closes https://github.com/facebook/react-native/pull/13188

Differential Revision: D4819796

Pulled By: ericvicenti

fbshipit-source-id: 9adc6e93330f89240a505a403e4913dc10e5a31f
2017-04-04 10:20:19 -07:00
Jean Lauliac 8755338728 packager: get rid of type `any` in ResolutionRequest
Summary:
One of my changeset broke the "ModuleGraph" code without warning earlier because we are using `any`, that equivalent to having no typing at all. This changeset fixes the types so that `ResolutionRequest` is exactly what it actually is: a class usable for any `Module`-looking class, including the normal one, and the "ModuleGraph" one used for Buck builds. That way, the ModuleGraph's `Module` is typechecked against `Moduleish`.

Concretely this change mostly migrates the `Module` to its generic parameter counterpart `TModule` inside `ResolutionRequest`.

Reviewed By: kentaromiura

Differential Revision: D4826256

fbshipit-source-id: fcd7ca08ac6c35e4e9ca983e2aab260e352bcb4e
2017-04-04 07:15:23 -07:00
Jhen d38644eee5 Add Atom Beta to launchEditor
Summary:
Support [the pre-release of Atom](https://github.com/atom/atom/releases/tag/v1.16.0-beta0) for launchEditor in RN packager.

Open the pre-release of Atom and use the following code: (use the built-in [openFileInEditor](292cc82d0e/Libraries/Core/Devtools/openFileInEditor.js) module)

```js
import openFileInEditor from 'openFileInEditor'

openFileInEditor(file, lineNumber)
```
Closes https://github.com/facebook/react-native/pull/13255

Differential Revision: D4819130

Pulled By: ericvicenti

fbshipit-source-id: eb542295ee9489dad0fe9084e51c4141d33f1fbf
2017-04-03 09:15:29 -07:00
Shruti Malugu edbb48c67a Replacing all instances of [UIApplication sharedApplication] wi…
Summary:
…th RCTSharedApplication()

Thanks for submitting a PR! Please read these instructions carefully:

- [ ] Explain the **motivation** for making this change.
          Using React Native latest version with Cocoapods 1.2.0 causes the following error inside iOS app extensions

> /react-native/React/Modules/RCTAccessibilityManager.m:67:70: ‘sharedApplication’ is unavailable: not available on iOS (App Extension) — Use view controller based solutions where appropriate instead.

Moving the use of [UIApplication sharedApplication] to RCTSharedApplication() which is safe on app extension

- [ ] Provide a **test plan** demonstrating that the code is solid.
        I am not sure how to test such that all the features which touch the modified code are tested.

- [ ] Match the **code formatting** of the rest of the codebase.
- [ ] Target the `master` branch, NOT a "stable" branch.

What existing problem does the pull request solve?
    Using React Native latest v
Closes https://github.com/facebook/react-native/pull/13227

Differential Revision: D4816338

Pulled By: javache

fbshipit-source-id: e3e3c77882990ad1817b0b633521cff52571ecd0
2017-04-01 03:34:41 -07:00
Koen Punt 8daf985fc3 match plist indentation with xcode format
Summary:
xcode has its own way of indentation of the plist.

fixes #11668
Closes https://github.com/facebook/react-native/pull/11670

Differential Revision: D4410865

fbshipit-source-id: 8c65e7719d228b07f58b1ccb86b369e319067f02
2017-03-31 03:03:10 -07:00
Brent Vatne b80e2c8799 Move packager initialization events to reporter
Summary:
This PR depends on #13172

Packager events are mostly logged through the TerminalReporter by default (#13172 makes this configurable). But there are a few things that aren't passed through TerminalReporter.

- We [log a banner with some information about the port and what's going on](8c7b32d5f1/local-cli/server/server.js (L22-L32))
- Also [a message about looking for JS files](8c7b32d5f1/local-cli/server/server.js (L34-L38)) (not sure what that is for / if it is useful beyond telling the user what directory root they started the packager in, but that's another thing).
- If the packager fails to start, then [we log an error message](8c7b32d5f1/local-cli/server/server.js (L41-L61)).

This pull request changes those log messages to be handled by TerminalReporter. I tri
Closes https://github.com/facebook/react-native/pull/13209

Differential Revision: D4809759

Pulled By: davidaurelio

fbshipit-source-id: 2c427ec0c1accaf54bf6b2d1da882cd6bfaa7829
2017-03-31 02:17:22 -07:00
Brent Vatne 5f5da4e122 Add support for custom log reporter cli option for local server
Summary:
In Expo tools such as XDE, exp we listen listen to stdout from the packager process and print it in our own buffer. In the case of XDE, an electron app, our log pane is DOM-based, and before printing each log chunk we need to remove special tty characters and sometimes parse it to get information that we need (eg: progress bar). By using a custom reporter, we can take the raw events and pass them along in a format that is easy to consume by XDE and exp. This same motivation applies to create-react-native-app, where we currently don't show a progress bar in the terminal, but we can with this change.

Create `LogReporter.js` in the root of a project with the CLI changes included in this PR.

```
class LogReporter {
  update(event) {
    console.log(JSON.stringify(event));
  }
}

module.exports = LogReporter;
```

Now, run `react-native start --customLogReporterPath=LogReporter.js` -- all of the raw events will be output as JSON (while the logs
Closes https://github.com/facebook/react-native/pull/13172

Differential Revision: D4795760

Pulled By: hramos

fbshipit-source-id: 80164b2f30e33a3f9965f4865a8404f8640a52c1
2017-03-30 18:15:49 -07:00
Sam Corcos c31a65669e Add comma to prevent build error when react.gradle is uncommented
Summary:
Thanks for submitting a PR! Please read these instructions carefully:

- [ ] Explain the **motivation** for making this change.
- [ ] Provide a **test plan** demonstrating that the code is solid.
- [ ] Match the **code formatting** of the rest of the codebase.
- [ ] Target the `master` branch, NOT a "stable" branch.

At the moment, if you uncomment the react specific code in `build.gradle` you'll get a compilation error. Adding a comma prevents this error.

No tests are necessary. This is a simple fix.

Sign the [CLA][2], if you haven't already.

Small pull requests are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it.

Make sure all **tests pass** on both [Travis][3] and [Circle CI][4]. PRs that break tests are unlikely to be merged.

For more info, see the ["Pull Requests"][5] section of our "Contributing" guidelines.

[1]: https://medium.com/martink
Closes https://github.com/facebook/react-native/pull/13212

Differential Revision: D4802065

Pulled By: javache

fbshipit-source-id: 0ddfe16241381d7e4ac0e48be1bada21d9df2068
2017-03-30 10:20:56 -07:00
Build Service 12de9729bd @allow-large-files [i18n] remove unused generated strings.xml files on master
fbshipit-source-id: c3151e7f8c346b1ece67ea37b88110b16e1a9107
2017-03-29 21:02:38 -07:00
Build Service 7f35abb26a @allow-large-files @ignore-conflict-markers[i18n] translation auto-update for i18n/instagram.config.json on master
fbshipit-source-id: 680e36c342abcc80279979ca461eb08449d535bb
2017-03-29 21:02:38 -07:00
Build Service c21760af4f @allow-large-files @ignore-conflict-markers[i18n] translation auto-update for i18n/fb4a.config.json on master
fbshipit-source-id: e973b0d453b88fc9f6cf54e1fd97ef7780cafe87
2017-03-29 21:02:38 -07:00
Build Service b6f1a3b6d7 @allow-large-files @ignore-conflict-markers[i18n] translation auto-update for i18n/adsmanager.config.json on master
fbshipit-source-id: f52efb222ea7385f8d291395b2edef5f28dea713
2017-03-29 21:02:38 -07:00
Build Service 944adb76d1 @allow-large-files [i18n] remove unused generated strings.xml files on master
fbshipit-source-id: 8efabef352fa71b3c18c1a8e318d66850fdd5e56
2017-03-29 17:13:58 -07:00
Build Service 9a596018f8 @allow-large-files @ignore-conflict-markers[i18n] translation auto-update for i18n/instagram.config.json on master
fbshipit-source-id: 951f549645f4010bd01ab6486a2b3b617a901b04
2017-03-29 17:13:58 -07:00
Build Service 5012f8938e @allow-large-files @ignore-conflict-markers[i18n] translation auto-update for i18n/fb4a.config.json on master
fbshipit-source-id: 2d84aa83e9efaaa89838da7c8d9595692b6bccdd
2017-03-29 17:13:58 -07:00
Build Service 7f346973d1 @allow-large-files @ignore-conflict-markers[i18n] translation auto-update for i18n/adsmanager.config.json on master
fbshipit-source-id: 156680756e04fc7ef69017c49324ff0b7acd030f
2017-03-29 17:13:57 -07:00
Benjamin Eckel 140c5f657c Make run-ios --device example copy-pastable
Summary:
This changes the single quotes to double quotes so this command can be copy-pasted.

If a user copy pastes the run-on-device example in bash they will be presented with a confusing prompt because bash expects another terminating single quote.

```
~ben (master *) ~/code/transit: react-native run-ios --device 'Max's iPhone'
>
>
```

It seems minor but this could be just confusing enough to frustrate a beginner or someone not familiar with bash.

This can be tested by running:

```
react-native run-ios --help
```

and verifying that the "run on device" example is changed:

```diff
- react-native run-ios --device 'Max's iPhone'
+ react-native run-ios --device "Max's iPhone"
```
Closes https://github.com/facebook/react-native/pull/13145

Differential Revision: D4776305

Pulled By: hramos

fbshipit-source-id: 9500551bfc106cd1687468f7ecc4c91089e1f703
2017-03-29 11:45:56 -07:00
Tim Yung 5643bbc11d RN: Add "Maintain Priority" Checkbox
Summary:
Adds a new checkbox to the Chrome Debugger page that prevents the tab from being deprioritized by Google Chrome.

This is accomplished by embedding an inaudible sound byte (in 10Hz range) that loops on a low volume.

Reviewed By: kassens

Differential Revision: D4786288

fbshipit-source-id: 949d96ed3c0eac92ad56cdd119418df9ec6d0846
2017-03-28 18:50:56 -07:00
Tim Yung 696b49e3b8 RN: Refactor Chrome Debugger JS
Summary:
Refactors JavaScript in the `debugger.html` used to operate the Chrome Debugger.

- Pull out all view-related logic into a global `Page` object.
- Persist the dark theme across debug sessions using `localStorage`.

Reviewed By: kassens

Differential Revision: D4786235

fbshipit-source-id: ab959d1c95465a10b4538b14d9c87a51ae3b7078
2017-03-28 18:50:56 -07:00
jrodiger f891985bd8 Update runAndroid.js to fix startServerInNewWindow() (Windows)
Summary:
**Motivation**
Resolves issue: #12367. The issue is that the packager does not launch automatically on Windows when running `react-native run-android` like it does on OSX. The proposed change fixes this issue, and causes the packager to be launched automatically on Windows 10. Also note the updated code uses the syntax described in the [Node.js documentation](https://nodejs.org/api/all.html#child_process_spawning_bat_and_cmd_files_on_windows) on spawning .bat files on Windows.

**Test plan**
Manually tested on Windows 10.

Running just `react-native run-android` now results in the packager launching, without needing to run `react-native start` in a new command prompt window.

**Screenshot:**
![packager](https://cloud.githubusercontent.com/assets/17132071/23641540/8d82bb7c-02c2-11e7-9c47-d1c9b582bd65.png)
Closes https://github.com/facebook/react-native/pull/12755

Differential Revision: D4767321

fbshipit-source-id: a14f369ba99939aa44d0ee3403e1d262e2657e6e
2017-03-23 18:20:10 -07:00
Gabe Levi d868e86df0 Deploy v0.42.0
Reviewed By: zertosh

Differential Revision: D4732064

fbshipit-source-id: 12fb8f9aff983ff5d1cb01f413bab761259829f9
2017-03-23 16:46:23 -07:00
Yann Pringault 8a8f34ae10 Improve dark mode for debugger
Summary:
* Added a label so we can click on the text to toggle the dark mode
* Added `height: 100%` in the CSS to make the dark background fill the entire view
* Improving JS code with `classList.toggle()` instead of redundant `if else` and fragile `document.styleSheets` access
* Adjusted the link color in dark mode to be less flashy

![image](https://cloud.githubusercontent.com/assets/5436545/24155304/bb80bb9a-0e53-11e7-9298-ce2c1ec6672c.png)

![image](https://cloud.githubusercontent.com/assets/5436545/24155311/c27e85f8-0e53-11e7-87ae-0245f54870c5.png)
Closes https://github.com/facebook/react-native/pull/13052

Differential Revision: D4748893

fbshipit-source-id: a81266c52b24f8e5dcedf0b9f37134688342d8d2
2017-03-23 04:38:57 -07:00
Dan Abramov c451dd6cce Update message with instructions
Summary:
The middleware for automatically converting Systrace traces to HTML and popping the browser hasn't worked properly for a while, since the version on Homebrew generates some code that uses `Object.observe`, which was deleted from Chrome ages ago. People have complained about it, but fixing it properly has proven to be harder than expected, so I suggest we simply update the message with instructions for people to load it on Chrome, which is what all of us have been doing anyway (AFAIK).
Closes https://github.com/facebook/react-native/pull/12445

Reviewed By: javache

Differential Revision: D4700153

Pulled By: gaearon

fbshipit-source-id: 0c33099babed93b3c70d36ae9dfc7d82460c8269
2017-03-20 10:49:43 -07:00
Nick cbd46aaa7c more accurate product-name regex
Summary:
Some projects define multiple targets, including app extensions, which are built with a “.appex” extension.   This fix prevents the buildProject method from selecting any app extension (e.g. a Today.appex today-widget extension) as the product name.

Thanks for submitting a PR! Please read these instructions carefully:

- [X] Explain the **motivation** for making this change.
- [X] Provide a **test plan** demonstrating that the code is solid.
- [X] Match the **code formatting** of the rest of the codebase.
- [X] Target the `master` branch, NOT a "stable" branch.

When building our workspace, ReactNative was failing to install the app to the simulator because it calculated an incorrect path to the app itself.   It was attempting to install "Today.app" when it should have been installing "Remitly.app".   I discovered that ReactNative parses the build output to identify the generated app name, and that this was broken when the build also generated an app extension.  The f
Closes https://github.com/facebook/react-native/pull/13001

Differential Revision: D4735360

fbshipit-source-id: afeeb2073ccd65c95916b153fcde574b5343af8c
2017-03-18 13:16:08 -07:00
Lukas Piatkowski 60142adc72 Extract PackagerConnectionSettings to ensure easier reusability of PackagerConnection module
Reviewed By: cwdick

Differential Revision: D4689535

fbshipit-source-id: f698837f407a03bf91521cc5e921c66f5755e6e0
2017-03-17 10:02:34 -07:00
Andrew Jack 35046984db Add TextLayoutBuilder proguard rule
Summary:
To enable users to use run proguard in their Android applications.

Fixes: #11891

[TextLayoutBuilder](https://github.com/facebookincubator/TextLayoutBuilder) is built as a Jar rather than an AAR so the proguard rules cannot be provided with the binary.

This PR adds the rules that are included in TextLayoutBuilder https://github.com/facebookincubator/TextLayoutBuilder/blob/master/proguard-android.txt

- Created an `react-native init ProguardTest` project with proguard turned on for v0.41.0
- Make sure tests pass on both Travis and Circle CI.
Closes https://github.com/facebook/react-native/pull/12511

Differential Revision: D4718029

Pulled By: mkonicek

fbshipit-source-id: 9e3f11c8b9b54eb8e52aa6f44cacd00857a882a5
2017-03-15 17:46:15 -07:00
Charles Dick af590b0c74 remove the old heap profiler visualization code
Differential Revision: D4650983

fbshipit-source-id: 1f791acdd3e2d96e7881ea037045fafa2c6d781a
2017-03-15 06:47:34 -07:00
Jean Lauliac 7098c450d8 packager: attachHMRServer.js: Flow
Summary:
The breakage fixed by changeset [1] could have been identified earlier if we had typing on `attachHMRServer`, so I spent some time on that. This has revealed in turn a few functions across the codebase that were incorrectly typed, and that are now fixed.

[1] packager: attachHMRServer.js: fix callsite of Server#getModuleForPath()

Reviewed By: davidaurelio

Differential Revision: D4706241

fbshipit-source-id: fc4285245921ae45d5781a47d626fc0559dba998
2017-03-15 06:20:48 -07:00
Jean Lauliac 4ac585b34b packager: attachHMRServer.js: fix callsite of Server#getModuleForPath()
Summary: In a previous changeset, Server#getModuleForPath() started returning `Promise<Module>` instead of `Module`, but the callsites in HMR haven't been updated, causing it to break. This would have been caught if `attachHMRServer.js` was using flow, that I'm considering doing in a following up diff. This would also have been caught if we had better integration testing of HMR. Good news however,it was caught by the OSS e2e test, that covers Hot Reloading.

Reviewed By: davidaurelio

Differential Revision: D4705937

fbshipit-source-id: fe787bc6ae50024759c7f7aeed747394fdce9aa1
2017-03-14 11:32:54 -07:00
Jean Lauliac 4203c9c837 packager: fix buildBundle() options
Summary: The problem with `bundleOpts` is that it discards Flow typing, so it prevents reinforcing the integration of `Bundler` into `Server`. This changeset removes the `bundleOpts` to solve that issues. Instead, it makes the options explicit so that there is less uncertaintly. I love making options explicit, because they force callsites to take a consicious decision about what is really needed, making them more robust. They also expose oddities that probably needs refatoring, for example having a `resolutionRequest` in the bundle options does not seem correct, it should be an implementation details. Likewise, `onProgress` should probably be exposed differently, as it does not affect the content of the bundle itself.

Reviewed By: davidaurelio

Differential Revision: D4697729

fbshipit-source-id: d543870ba024e7588c10b101fa51429c77cc5ddc
2017-03-14 11:04:51 -07:00
Yann Pringault 68695bdb26 Fix indent for .babelrc in HelloWorld template
Summary:
Minor code formatting.
Each time I run `react-native init` I must reindent this file.
Closes https://github.com/facebook/react-native/pull/12850

Differential Revision: D4691374

fbshipit-source-id: dc02b021e2f320f1046e4e6d024ba675a4213de8
2017-03-10 13:45:58 -08:00
Richard Evans 4471c32b08 CLI: Assign project root concat back to project roots.
Summary:
With the latest version of React Native I noted my setup with React Native Storybook stopped working because it stopped searching all the right project roots. I found that it had to do with the change here bce6ece5f6

**Test plan (required)**

Run the CLI with a project root other then the root directory and ensure that it displays both the specified project root and the actual root directory.
Closes https://github.com/facebook/react-native/pull/12659

Differential Revision: D4658137

Pulled By: ericvicenti

fbshipit-source-id: 97d3784348f92394df111f189c6b00dd0165b75e
2017-03-06 00:19:20 -08:00
Alexey Kureev c97c1e5516 Fix symlink resolving for examples in the repo
Summary:
Motivation:
Few days ago gaearon [filed an issue](https://github.com/facebook/react-native/issues/12406) that examples in the react-native repo doesn't work after the [recent changes in local-cli](bce6ece5f6). This PR fixes reported bug.

**Test plan (required)**
- No UI changes
- [x] Run UIExplorer from XCode (no package.json in the folder) and check if packager/application runs correctly

cc davidaurelio satya164 grabbou
Closes https://github.com/facebook/react-native/pull/12435

Differential Revision: D4657370

Pulled By: ericvicenti

fbshipit-source-id: 72ee4b96cae37c7ed2794ed4490ce7b4fbbd66c3
2017-03-05 17:34:41 -08:00
Jeff Morrison 59257d6976 fbobjc
Reviewed By: gabelevi

Differential Revision: D4652687

fbshipit-source-id: 6069c8bc24f0b88da3537ada877cdb7d1d4eccfd
2017-03-04 19:30:34 -08:00
Ke Mao 8bfab2c733 Improve command-line experience for capturing mobile JS heap
Reviewed By: cwdick

Differential Revision: D4612319

fbshipit-source-id: 607a09286abdd83368996ffc553b3ce984b62f34
2017-03-01 19:26:28 -08:00
Eli Perkins 1b0d8ac43b Use appropriate capitalization of Xcode
Summary:
[Xcode](https://developer.apple.com/xcode/) is spelled with a lowercase `c`. 😄

**Test plan (required)**

ctrl-f project for `XCode`, case sensitive, find-and-replace with `Xcode`.

Make sure tests pass on both Travis and Circle CI.
Closes https://github.com/facebook/react-native/pull/12572

Differential Revision: D4622075

Pulled By: hramos

fbshipit-source-id: d64f0b10254cd624a71844ebaefa6fc29bc1ea57
2017-02-27 22:47:14 -08:00
Bhuwan Khattar 234f4f538d Introduce HasteImpl
Summary:
Similar to https://github.com/facebook/jest/pull/2877, this introduces an optional config `HasteImpl` of type `{getHasteName(filePath: string): (string|void)}` that returns the haste name for a module at filePath if it is a haste module or undefined otherwise.

This allows us to inject a custom implementation of haste's module id resolution rather than only relying on `providesModule` annotations

Reviewed By: davidaurelio

Differential Revision: D4589372

fbshipit-source-id: 4d1983dfbf09c9d67faf725e86ae86ab42433b7d
2017-02-27 14:04:58 -08:00
Martin Konicek 17c175a149 CLI: Add support for templates fetched from npm
Summary:
This PR allows anyone to publish templates for React Native.

It's possible for people to publish modules for React Native, we should also support custom templates. A suggestion from a Cordova mantainer where they did the same thing suggests this is useful:
https://github.com/mkonicek/AppTemplateFeedback/issues/1

I published a sample template [react-native-template-demo](https://www.npmjs.com/package/react-native-template-demo).

(GitHub: https://github.com/mkonicek/react-native-template-demo)

With this PR anyone can then use that template:

`react-native init MyApp --template demo`

The convention is: if someone publishes an npm package called `react-native-template-foo`, people can use it by running `react-native init MyApp --template foo`.

Use a template called `react-native-template-demo` from npm:

`react-native init MyApp --template demo`

Use a local template:

`react-native init MyApp --template file:///path_to/react-native-template-dem
Closes https://github.com/facebook/react-native/pull/12548

Differential Revision: D4620567

Pulled By: mkonicek

fbshipit-source-id: bb40d457a7fec28edb577f08137e73241072de3a
2017-02-27 14:04:57 -08:00
Michael Bolin 48cb932c6e Apply auto-formatter for BUCK files in fbandroid.
fbshipit-source-id: 278ce6f67f5df830b2218e3aca69be103d3c56a6
2017-02-27 14:04:56 -08:00
Gabe Levi 4a60be62bc Deploy v0.40.0
Reviewed By: yungsters

Differential Revision: D4612331

fbshipit-source-id: 3eaa2f99d3181227166064cbee29b9245401a775
2017-02-24 12:45:56 -08:00
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