Commit Graph

367 Commits

Author SHA1 Message Date
Geoffrey Goh 1168d0db45 Should be R.string, not R.strings
Summary:
Fix regression of https://github.com/rnpm/rnpm-plugin-link/pull/88.
Closes https://github.com/facebook/react-native/pull/9252

Differential Revision: D3680785

fbshipit-source-id: a6ea63295ae8f61b17c0a1b2ca5e6a5f5da7437a
2016-08-06 07:28:28 -07:00
Lukas Piatkowski 4e3b484631 Put "file:line" when we can't resolve function name
Reviewed By: michalgr

Differential Revision: D3670558

fbshipit-source-id: 2a60babf16ac6e6be77ebb6e76f5179b024a77c6
2016-08-05 06:13:41 -07:00
Mike Grabowski 504b516947 Fix corrupted `options()` call for link and other commands
Summary:
The issue here is that sometimes `this.options()` is not `[options]` but contains different stuff, esp. if your command accepts arguments.

This commit reverts its original behaviour and passes custom `examples` property that we use instead.

Tested, can be shipped right away.

Differential Revision: D3662179

fbshipit-source-id: 4b2af3487464d46e2007388230e675ce3575f797
2016-08-03 08:32:18 -07:00
Kureev Alexey 59a1311c86 Feature/watch symlinks
Summary:
see #9009

cc bestander
Closes https://github.com/facebook/react-native/pull/9176

Differential Revision: D3662018

Pulled By: bestander

fbshipit-source-id: a4c03e69e5215377b1edac940f0254a0fd429258
2016-08-03 03:44:57 -07:00
Mike Grabowski 4fce8ea4f4 Fixes #9168
Summary:
Imports missing commit from the rnpm master.
Closes https://github.com/facebook/react-native/pull/9179

Differential Revision: D3661909

fbshipit-source-id: 23ebd3b96f236ab140f91eb4ed9f456d7c925027
2016-08-03 01:58:38 -07:00
Eric Rozell 4ce431b9cf Fixes command validity check for local-cli.
Summary:
Prior to the RNPM integration, command names would match the second argument passed to the react-native-cli. Now the command names contain some usage information (such as non-flag CLI arguments). This commit splits the name of the commands and checks that against the second command line argument.
Closes https://github.com/facebook/react-native/pull/9171

Differential Revision: D3661799

fbshipit-source-id: dc2aa9cd9e69dde3c5b877aeb77a17c4f6427075
2016-08-03 00:58:34 -07:00
Eric Rozell de517a84e8 Flattens RNPM user commands from plugin modules
Summary:
RNPM plugins may have ship multiple commands as extensions (e.g., https://github.com/rnpm/rnpm-plugin-link/blob/master/index.js#L1)

The consumer of the user commands (https://github.com/facebook/react-native/blob/master/local-cli/commands.js#L67) expects a flat list of commands, which used to be flattened here https://github.com/rnpm/rnpm/blob/master/bin/cli#L35 in RNPM.

This commit simply flattens the (possible) set of commands coming out of a user plugin.
Closes https://github.com/facebook/react-native/pull/9170

Differential Revision: D3661809

fbshipit-source-id: 72107745e53bf63b47a297eae546ed4a69c57008
2016-08-03 00:58:33 -07:00
Konstantin Raev ed89d5ba0d fixed trunk: wrong way to require a module
Summary:
This should fix https://travis-ci.org/facebook/react-native/jobs/149264391
Closes https://github.com/facebook/react-native/pull/9169

Differential Revision: D3657544

Pulled By: javache

fbshipit-source-id: d49ed0355cc5da72d1d8f40dfa03e669f2291db1
2016-08-02 13:13:26 -07:00
Lukas Piatkowski 350b5a2c48 Use packager's source map to resolve function name and clean up dead code in SP
Reviewed By: bnham

Differential Revision: D3649501

fbshipit-source-id: 62e13633436c645d9b43eb75c39b4ddcf0458eb3
2016-08-02 11:14:06 -07:00
Lukas Piatkowski 066de9d820 #18 Using the bundle url resolve origin source in jsc profiler middleware
Reviewed By: bestander

Differential Revision: D3620292

fbshipit-source-id: e3c54fb30bc65ff1ddd650340a2905a9f0e16231
2016-08-02 11:14:06 -07:00
Lukas Piatkowski 2231b21ed0 #15.1 Extend packager server to receive signals from Sampling Profiler
Reviewed By: bestander

Differential Revision: D3606098

fbshipit-source-id: ec55030dd1b3a27f0595650da1ce01fe1ac9116c
2016-08-02 11:14:06 -07:00
androidtrunkagent 1ab4b2a792 Add support for passing in additional assetExts to packager
fbshipit-source-id: 42e508e37d960fbeb905a2ea8cb4741dba5c67fc
2016-08-02 10:27:25 -07:00
Konstantin Raev 55300382c6 disable symink finder to fix tests
Summary:
cc Kureev

Disabling symlink resolver temporarily because it breaks launchPackager.command.
Waiting for a PR with a fix to enable both
Closes https://github.com/facebook/react-native/pull/9166

Differential Revision: D3655846

Pulled By: matryoshcow

fbshipit-source-id: da0bfc64f5fd9d747db2b97d669fcb98250faf39
2016-08-02 09:43:33 -07:00
Charles Dick aba87550cc upload JSC heap capture to bundle server
Reviewed By: bestander

Differential Revision: D3642116

fbshipit-source-id: 9626078bb0f087f55d8270c8e0b082c74bd2df9d
2016-08-02 08:13:57 -07:00
Konstantin Raev 7cf4e3665a Fixed typo in packager middleware
Summary:
**Test plan (required)**

Run packager
Closes https://github.com/facebook/react-native/pull/9135

Differential Revision: D3649113

Pulled By: kentaromiura

fbshipit-source-id: db1b1b590f2b1ff50c1e519d4dce10b7c1eec133
2016-08-01 08:13:33 -07:00
Kureev Alexey 5cf7f040a5 Symlink support for packager
Summary:
I saw we have quite a few user requests for symlink support...

**Test plan (required)**

1. Create a symlink in `node_modules` (for instance use `npm link`)
2. Run `npm start`
3. Profit!

**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#style-guide).

For more info, see the ["Pull Requests" section of our "Contributing" guidelines](https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md#pull-requests).
Closes https://github.com/facebook/react-native/pull/9009

Differential Revision: D3648828

Pulled By: matryoshcow

fbshipit-source-id: 99cf313bfa70324ca904fa6919ef112180974e9e
2016-08-01 04:43:36 -07:00
Kureev Alexey 8ad748ac7d Fix scoped modules
Summary:
see https://github.com/facebook/react-native/issues/8623

**Background:**
Back in a days, one buggy patch sneaked into rnpm master. It was intended to fix `react-native-fbsdk` installation for version 0.1.0 (not required in version 0.3.0). Nowadays, we see that this patch break scoped modules `like/this`, so this PR fixes it (basically, reverting the patch).

**Test plan (required)**
- [x] Try to link unscoped react-native package
- [x] Try to link scoped react-native package
**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#style-guide).

For more info, see the ["Pull Requests" section of our "Contributing" guidelines](https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md#pull-requests).
Closes https://github.com/facebook/react-native/pull/9118

Differential Revision: D3648488

fbshipit-source-id: 1891086ac79a89c888631592c966a8b33fd9c9fd
2016-07-31 23:28:28 -07:00
Mike Grabowski e8b508144f Merge `rnpm cli` into react-native
Summary:
This is an initial step of rewriting the CLI interface to use `rnpm` one (commander, plugins etc.).

It's scope is to move all existing commands to use rnpm CLI interface, so that we get plugins, flags and our existing ecosystem working out of the box.

<s>This is still WIP and some of the commands are left commented out.</s>

For the `config` of `rnpm` (functions get info about project and dependency), <s>I am thinking we can merge them with</s> we decided to merge it with [`default.config.js`](e57683e420/local-cli/default.config.js (L33)), so they are available on the `new Config()` [instance](e57683e420/local-cli/cliEntry.js (L59)) (which means we don't have to change anything and current plugins, like runIOS and runAndroid can just start using it [w/o depending on any extra argument](https://github.com/grabbou/react-native/blob/e57683e420210749a5a6b802b4e
Closes https://github.com/facebook/react-native/pull/7899

Differential Revision: D3613193

Pulled By: bestander

fbshipit-source-id: 09a072f3b21e5239dfcd8da88a205bd28dc5d037
2016-07-30 09:13:46 -07:00
David Aurelio 667aaa4621 Bring back node-haste to fbsource
Summary:
Since jest stopped using node-haste a while ago, we are the only client left.
This brings back node-haste back to fbsource to allow us to iterate faster.

Reviewed By: bestander

Differential Revision: D3641341

fbshipit-source-id: a859f8834765723a3515e2cf265581b9dd83997c
2016-07-29 11:15:02 -07:00
Rob Hogan c3e8c825af Open to correct line on Webstorm, IntelliJ and AppCode
Summary:
A tiny PR to add support for launching IDEA editors with the cursor at the correct line. The argument syntax is the same as sublime.

The base names `wstorm`, `idea` and `appcode` are the default names when CLI launchers are created through 'Tools'->'Create Command-Line launcher' in the respective editor's gui.

Tested through a fork of RN on Webstorm, IntelliJ and AppCode for OSX and by manual invocation from CLI on IntelliJ for windows.
Closes https://github.com/facebook/react-native/pull/9042

Differential Revision: D3627680

fbshipit-source-id: dfb0db92f9ca8b464471c3dc9e92196d87d2e244
2016-07-27 04:43:47 -07:00
Chris Nager 481e1c77a0 Update keyboard input element from `span` to `kbd`
Summary:
Updated the keyboard input element on the browser debugger page that contains "⌘⌥J" from a `span` to the more semantic `kbd`.
Closes https://github.com/facebook/react-native/pull/8998

Differential Revision: D3620668

fbshipit-source-id: ab3081688202c85978f6f400a42eb1aa1abb77c6
2016-07-26 10:13:45 -07:00
Kureev Alexey 3c8a2eed92 Fix native modules linking in 0.29.1
Summary:
Attempt to fix https://github.com/facebook/react-native/pull/8612

We re-named `mainActivityPath` by `mainFilePath` in the `link` code, but we forgot to rename config parameters. Currently, link is broken.

- [x] `react-native link` should work for react-native 0.29+
Closes https://github.com/facebook/react-native/pull/8807

Differential Revision: D3576176

fbshipit-source-id: 60ecbd660563923696bbef1ed3b0900a7d58469f
2016-07-16 10:58:21 -07:00
Gant c3f4d79475 changes link file on Android to MainApplication.java for 0.29 update
Summary:
rnpm aka `react-native link` is broken with Android 0.29 - #8603

This gets it back to working again by checking for new MyApplication.java file, and curtailing the path when needed.
Closes https://github.com/facebook/react-native/pull/8612

Differential Revision: D3533960

fbshipit-source-id: 95d799eaebb26ba1d876c88107ccd2af72427f55
2016-07-08 01:45:58 -07:00
Tomasz Kurpios b046b2d51c Allow to specify simulator OS version from cli
Summary:
When multiple simulator runtimes are available, this change will make it possible to specify which one to run. So assuming you have e.g. iOS 9.0 and 9.3 runtimes, all following calls will now work:
```
react-native run-ios --simulator "iPhone 6s (9.0)"
react-native run-ios --simulator "iPhone 6s (9.3)"
react-native run-ios --simulator "iPhone 6s"
```
Closes https://github.com/facebook/react-native/pull/8559

Differential Revision: D3516811

Pulled By: frantic

fbshipit-source-id: c81658f77e482e712293367b13d27e783e538aad
2016-07-05 09:58:29 -07:00
Nathan Azaria a9a0ff267f Move setDefaults call to constructor.
Reviewed By: javache

Differential Revision: D3514703

fbshipit-source-id: 8195778b23868eae36a55edc2d5d4f148b36a12e
2016-07-04 10:58:25 -07:00
David Aurelio 970f9335a9 allow `rn.cli-config.js` w/o `getTransformModulePath`
Reviewed By: bestander

Differential Revision: D3509026

fbshipit-source-id: d7db3de13ecc92f6ddfdcec3029c78915e1e66c0
2016-07-01 06:58:37 -07:00
Siqi Liu dc3fce06ea Add Copy and Dismiss Button in RN Android Red Box
Summary:
Add "Copy" and "Dismiss" button when the RN Android redbox is shown, consistent with that in RN iOS.
  - "Copy" button copies all the messages shown in the redbox to the host system clipboard, the solution is posting redbox messages to packager and the the packager copies the messages onto the host clipboard.
  - "Dismiss" button always exits the redbox dialog.
  - Add shortcut as "Dismiss (ESC)" and "Reload (R, R).

Notice: Copy button is only supported on Mac OS by now (warning in packager on other platforms), because it's not easy for us to test on Windows or Linux. Will put the codes for other platforms on Github issues, hoping anyone could help test and add this feature, then send us a pull request.

Redbox Dialog in RN Android before:
{F61310489}
Redbox Dialog in RN Android now:
{F61659189}

Follow-up:
- We can adjust the button styles in redboxes.
- We can consider to add shortcut for "Copy" button.

Reviewed By: foghina

Differential Revision: D3392155

fbshipit-source-id: fc5dc2186718cac8706fb3c17d336160e61e3f4e
2016-06-30 08:13:22 -07:00
Nicolas Charpentier f8c486f03c Add missing character into BUCK android template
Summary: Closes https://github.com/facebook/react-native/pull/8362

Differential Revision: D3483454

fbshipit-source-id: e35bfa4002374993787cf8a8440efe1aa1c61e6f
2016-06-24 17:28:30 -07:00
Vitaly Gorodetsky 39f524d8e5 adds log-ios and log-android cli commands
Summary:
solves first part of #8186
Closes https://github.com/facebook/react-native/pull/8352

Differential Revision: D3475905

Pulled By: mkonicek

fbshipit-source-id: 99f6aa15b92ba3192fa0b812d369bd7020469573
2016-06-23 07:58:23 -07:00
Alon Burg 1cc7ef072e Fixes 8309: Automatically run `adb reverse tcp:8081 tcp:8081` when st…
Summary:
in `runAndroid.js` I renamed the `buildAndRun()` into `run()` and added a call to `runAdbReverse`
Closes https://github.com/facebook/react-native/pull/8345

Differential Revision: D3475782

Pulled By: mkonicek

fbshipit-source-id: 6f2c5a3e6d61cbeec914175686d2a7909d22a957
2016-06-23 06:58:33 -07:00
Martin Konicek a2c1170da5 Mention double tapping R to reload in the app template
Summary:
This is a pretty useful trick to know, let's promote it :)

The formatting is consistent with iOS: https://github.com/facebook/react-native/blob/master/local-cli/generator/templates/index.ios.js

<img width="443" alt="screen shot 2016-06-23 at 4 04 47 pm" src="https://cloud.githubusercontent.com/assets/346214/16304185/fc94f6d6-395c-11e6-9f2c-0167217d1514.png">
Closes https://github.com/facebook/react-native/pull/8354

Differential Revision: D3475790

Pulled By: mkonicek

fbshipit-source-id: 06a43cf73b31d91faac72280d680f8eb95f50145
2016-06-23 06:43:27 -07:00
Philipp von Weitershausen dd9b3e13a9 Allow rn-cli.config.js to specify the default transformer
Summary:
This will allow consumers to supply their own transformer to all `react-native` cli commands by simply implementing `rn-cli.config.js` and overriding `getTransformModulePath()`. That way they don't have to fork various parts of the iOS and Android build system that React Native already provides just to add a `--transformer` command line argument.

**Test plan:** Applied this patch to the React Native version in my app, implemented `getTransformModulePath()` in my `rn-cli.config.js`, and verified that my custom transformer is invoked.
Closes https://github.com/facebook/react-native/pull/7961

Differential Revision: D3404201

Pulled By: foghina

fbshipit-source-id: c7eaa85de84d485d06d23a2ffea899821b2cf71c
2016-06-22 08:13:26 -07:00
Nathan Azaria 9845f49581 Fixed setDefaults not being called in React Native apps, fixed typo
Reviewed By: javache

Differential Revision: D3469296

fbshipit-source-id: 032472fede4bfbd051b0f725f35368b22edcc130
2016-06-22 07:13:26 -07:00
Johannes Scharlach 523d39ad92 fix banner for old node version
Summary:
The file is used to notify users when they are using a node version < 4. Therefore we should not allow arrow functions. This was pointed out at the time when the arrow function was introduced but merged anyways: db3a00d58c (commitcomment-16590379)

Trying to run the code with Node version 0.10.32

Before:
```
…/node_modules/react-native/local-cli/server/formatBanner.js:48
    chalkFunction: (fn) => fn,
                         ^
SyntaxError: Unexpected token >
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (…/node_modules/react-native/local-cli/server/checkNodeVersion.js:12:20)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
Closes https://github.com/facebook/react-native/pull/8310

Differential Revision: D3469092

Pulled By: javache

fbshipit-source-id: 757e8b121f6cd6971dd7d73cda92fcb6fcbe5066
2016-06-22 03:43:33 -07:00
Mark Oswald 5276db492a fix runIOS: appPath is hardcoded, read from log
Summary:
The runIOS command currently assumes the path to the `xcodebuild` product - it's hardcoded

```
  const appPath = `build/Build/Products/Debug-iphonesimulator/${inferredSchemeName}.app`;
```
https://github.com/facebook/react-native/blob/master/local-cli/runIOS/runIOS.js#L87

This can be a problem, when you e.g. install a release version of the app to the simulator using the cli. We use a separate schema for that, which can be selected with `--scheme`.

This fix reads the output of the `xcodebuild` call and searches for the path and the name of the *.app file. If it's found, then it will be used to spawn in the simulator. If not, the default (as before) is used.
Closes https://github.com/facebook/react-native/pull/8250

Differential Revision: D3469074

Pulled By: javache

fbshipit-source-id: b10c7e6f48268b0c71dfcbfa661f8e5960c3aaa6
2016-06-22 03:43:33 -07:00
Patricio Beltran d1690a8f9e Support vscode as a React Editor
Summary:
When opening a text editor from react native there are a list of editors being supported. This PR adds `VSCode` to that.

As a difference with the current supported editors, `VSCode` has a notion of `workspace` (a directory that contains all of the project's files). The `workspace` can be passed to `VSCode` as a parameter so that if the workspace is already open we don't get new instances of `VSCode` every time a new file is open. The `workspace` is gotten by comparing the file location with the different `project roots`.

This code relies on `VSCode`'s `code` command, which it's documentation can be found at: https://code.visualstudio.com/Docs/editor/codebasics#_launching-from-the-command-line
Closes https://github.com/facebook/react-native/pull/7757

Differential Revision: D3463761

fbshipit-source-id: ee9ec999747ad6d16d95ec8317f551f3535286c9
2016-06-21 11:09:24 -07:00
Alex Kotliarskyi bc8954babb Use messageSocket to broadcast reload command on global shortcut
Reviewed By: yungsters

Differential Revision: D3433464

fbshipit-source-id: 74111f419d224310b546e7c80fa871417436e1ab
2016-06-20 10:58:32 -07:00
David Aurelio 62bb09d1f6 make module IDs deterministic when bundling
Summary:
This makes sure that `getModuleId` is called on modules in the order returned by `node-haste`, rather than waiting for a couple of promises to resolve before calling the function.

Related: #7758

Reviewed By: frantic

Differential Revision: D3450853

fbshipit-source-id: 7f26590b39b94ade32c73a8db9fd31d283d57549
2016-06-17 12:58:49 -07:00
David Aurelio ae6afcf3f6 move bundle signature to own file
Reviewed By: tadeuzagallo

Differential Revision: D3437491

fbshipit-source-id: c2e00932bacd799d547110c7214374c51ff0b830
2016-06-17 06:28:30 -07:00
Felix Oghina 49f20f4154 Add ReactInstanceHolder
Reviewed By: astreet

Differential Revision: D3328342

fbshipit-source-id: af4e825d0b7c2d3d4490094a939e97cc527dd242
2016-06-17 04:13:29 -07:00
Tony Xiao 93ff5799a5 Add $(inherited) to OTHER_LDFLAGS in xcodeproj template
Summary:
This is particularly important when using generated xcode project together with cocoapods (or anything that leverages a custom xcconfig)

If we do not set `$(inherited)`, then user will get cryptic "Symbol(s) not found for architecture ..." errors that will be really difficult to track down, especially for beginners. This happens because without setting `$(inherited)` we are essentially overriding settings provided on project level (rather than target level) as well as `.xcconfig` level.

**Test plan (required)**

```bash
react-native init MyProject
cd ios
pod init
```
Now go and add a pod to the `Podfile`, say
```ruby
pod 'HockeySDK'
```
And try to use it in `AppDelegate.m`
```objc
...
[[BITHockeyManager sharedHockeyManager] configureWithIdentifier:@"APP_IDENTIFIER"];
[[BITHockeyManager sharedHockeyManager] startManager];
```

Before this change, you'll get errors like this
![image](https://cloud.githubusercontent.com/assets/696842/15801450/feb3c036-2a4
Closes https://github.com/facebook/react-native/pull/7927

Differential Revision: D3430228

Pulled By: javache

fbshipit-source-id: ef453ad2e822726db0159d24ec93e301192e21de
2016-06-14 03:02:32 -07:00
Nathan Azaria 8c29a52c54 Implemented automatic IP detection for iOS
Summary:
Implemented automatic IP detection for iOS, based on #6345 and #6362.
As the previous pull requests did, this works by writing the IP address of the host to a file.
Closes https://github.com/facebook/react-native/pull/8091

Differential Revision: D3427657

Pulled By: javache

fbshipit-source-id: 3f534c9b32c4d6fb9615fc2e2c3c3aef421454c5
2016-06-13 15:58:36 -07:00
Valeri Karpov 402e7eaac2 Don't clobber user-defined environment variables
Summary:
Re: javache 's suggestions from https://github.com/facebook/react-native/pull/7878. Didn't want to deal with the merge conflict so I'm opening a separate PR. Here's the original justification:

If I want to set NODE_ENV to "baconator", I should be allowed to. Mutating global state that most devs assume to be immutable is just abysmal dev practice, especially since this mutation only happens when you're building for prod, not running on the simulator.

To test this, run env NODE_ENV=baconator ./gradlew assembleRelease with babel-plugin-transform-inline-environment-variables in your app/.babelrc. You'll see that the final app has NODE_ENV=production.

As a side note, running with babel-plugin-transform-inline-environment-variables in the top-level .babelrc crashes horribly with a compiler error.

For anybody who runs into this bug and doesn't feel like waiting for this to get merged, I wrote a quick babel plugin to remove assignments to process.env, which is sufficient to fix this issue.
Closes https://github.com/facebook/react-native/pull/8057

Differential Revision: D3419950

Pulled By: javache

fbshipit-source-id: dc541cad0a99906433e5c14bbc93ce66b4ed325e
2016-06-10 15:28:29 -07:00
Tim Yung b03a725447 RN: Clear Debug Console on Reload JS
Summary:
Clears the debug console whenever the React Native JS is reloaded.

NOTE: This respects "Preserve log" in Chrome by default.

Reviewed By: jingc

Differential Revision: D3409713

fbshipit-source-id: ce215e3125cf43ab3ea5811c707fab9dfa4bcbb3
2016-06-08 19:13:25 -07:00
Nicolas Charpentier 2a92b52ac8 Add Fresco to ProGuard
Summary:
Motivation #7760
Closes https://github.com/facebook/react-native/pull/7781

Differential Revision: D3397772

fbshipit-source-id: 02b6fd4a403da590fd1c55c554eca00e15899a03
2016-06-06 22:58:42 -07:00
Philipp von Weitershausen 588f01e998 Packager: accept relative --transformer paths everywhere.
Summary:
`react-native start` already ensures that the `--transformer` path is understood to be relative to CWD, not to the module that ends up importing that file. `react-native bundle` and `react-native dependencies` didn't up until this point.

**Test plan:** Ensured that `react-native bundle ... --transformer ./relative/path` works with this patch applied.
Closes https://github.com/facebook/react-native/pull/7857

Differential Revision: D3393777

fbshipit-source-id: 303a226fae9c8087c3dd3b2e8d004462ca66665e
2016-06-06 17:58:25 -07:00
Kasim Tan f49f28ce15 Fix typo (shoud -> should)
Summary: Closes https://github.com/facebook/react-native/pull/7928

Differential Revision: D3390537

fbshipit-source-id: 97ce2331d0942ffe21078b3aec27daed20cd8af5
2016-06-04 16:43:41 -07:00
Philipp von Weitershausen 58fb91e62b Android: allow app/build.gradle to specify how node gets invoked for the packager
Summary:
**Test plan:** With the given patch applied to `react.gradle`, I specified the following in my `android/app/build.gradle`:
```
project.ext.react = [
  nodeExecutableAndArgs: ["node", "--max_old_space_size=4096"]
]
```
and ensured in a `./gradlew installDebug --debug` run that the packager gets indeed invoked with these parameters.
Closes https://github.com/facebook/react-native/pull/7903

Differential Revision: D3390543

fbshipit-source-id: cf440b36633420b8f67070f47dfabf4c84cb28a7
2016-06-04 15:58:24 -07:00
Sean Kozer 0f35f7c6d5 Link React library to Tests target
Summary:
Fixes https://github.com/facebook/react-native/issues/2685
Closes https://github.com/facebook/react-native/pull/7918

Differential Revision: D3389814

fbshipit-source-id: d5054dae386d66e8055c883581f142ec24e60e18
2016-06-03 21:43:22 -07:00
Martin Konicek 7028929d8f react-native link calls into rnpm
Summary:
An initial integration of rnpm into 'react-native link'.

**Test plan (required)**

    react-native init MyApp
    cd MyApp
    # copied local-cli into MyApp's node_modules
    npm install --save react-native-vector-icons
    react-native link react-native-vector-icons

The link code ran, Android build files were modified.
Closes https://github.com/facebook/react-native/pull/7895

Reviewed By: bestander

Differential Revision: D3379197

Pulled By: mkonicek

fbshipit-source-id: 597158623ed072d7a7fc55a01624233a0f79de23
2016-06-03 09:13:20 -07:00
Konstantin Raev f22e9353a7 Made react installed via reac-native init strict to unbreak 15.1.0
Summary:
React@15.1.0 is incompatible with React-Native@0.26.
This PR was cherry-picked to 0.26-stable branch now.

What this change does:
- react-native-cli (major release bump) saves exact versions of react-native and react (only in npm2) dependencies into package.json
- local-cli saves exact version of react (only npm3) dependency into package.json
Closes https://github.com/facebook/react-native/pull/7879

Differential Revision: D3384705

Pulled By: davidaurelio

fbshipit-source-id: d4dff418f9659bd083ae8826433a4e7c0355d03b
2016-06-03 03:43:31 -07:00
Kasim Tan a7f1428d4a Fix comment typos
Summary: Closes https://github.com/facebook/react-native/pull/7901

Differential Revision: D3384624

Pulled By: javache

fbshipit-source-id: 741343dec5406af1855624069dd8dc426a93bdb3
2016-06-03 02:43:57 -07:00
Philipp von Weitershausen 1f2027a1fe Android: allow app/build.gradle to specify additional packager arguments
Summary:
If for instance you're using a custom transformer, having this hook will let you specify it without forking all of react.gradle

**Test plan:** Specified some additional packager args in my app's `android/app/build.gradle`:
```groovy
project.ext.react = [
  bundleInDebug: true,
  extraPackagerArgs: ["--transformer", "path/to/my/transformer.js"]
]
```
and ensured they show up when gradle invokes the bundler.
Closes https://github.com/facebook/react-native/pull/7858

Differential Revision: D3382996

Pulled By: mkonicek

fbshipit-source-id: 437b2e6c902931d45b9d2f7ec97c833ba0cd3217
2016-06-02 17:28:39 -07:00
Andrew Sardone 0f57702cd8 Enable ATS w/ localhost exception for generated iOS proj
Summary:
Building off of the work in https://github.com/facebook/react-native/pull/5290, this…

- Remove the total disabling of ATS from the react-native generated iOS project in favor of a localhost exception
Closes https://github.com/facebook/react-native/pull/5355

Differential Revision: D2837517

fbshipit-source-id: ba4b7bd2f6ba4359f5d45175944b990f9927db3b
2016-05-31 12:28:23 -07:00
Jeremy Wyld af149b3a11 Correctly reference cwd instead of __dirname
Summary:
This is for issue #7670.  I consider this a typo, but maybe you don't.

In order to see the problem, you need to have the packager search for the configuration in a place that doesn't have one and the default configuration can't be provided.  It's likely that no one is doing this and also why this probably wasn't seen.
Closes https://github.com/facebook/react-native/pull/7671

Differential Revision: D3350412

fbshipit-source-id: 5f9b520f7d5cbc749e2b898e7bbf2cd84d81ace0
2016-05-25 17:43:22 -07:00
Francois Dumas 84f82e5cdd use RN version from node_modules instead of jcenter
Summary:
the current `build.gradle` configuration make all third-party plugins to pull react native from jcenter instead of using version from `node_modules`.

For example, a newly generated project with RN 0.25 using https://github.com/ProjectSeptemberInc/gl-react-native leads to the following gradle output:

```
Download https://jcenter.bintray.com/com/facebook/stetho/stetho-okhttp/1.2.0/stetho-okhttp-1.2.0.pom
Download https://jcenter.bintray.com/com/facebook/stetho/stetho/1.2.0/stetho-1.2.0.pom
Download https://jcenter.bintray.com/com/facebook/stetho/stetho/1.2.0/stetho-1.2.0.jar
Download https://jcenter.bintray.com/com/facebook/stetho/stetho-okhttp/1.2.0/stetho-okhttp-1.2.0.jar
Download https://jcenter.bintray.com/com/facebook/react/react-native/0.20.1/react-native-0.20.1.aar
```
Closes https://github.com/facebook/react-native/pull/7470

Differential Revision: D3346526

Pulled By: mkonicek

fbshipit-source-id: 0f1d051f4340f35403931727982900a9fc7abad5
2016-05-25 07:58:23 -07:00
Alex Kotliarskyi 11449359e5 Add index page for packager
Summary:
When packager is running, visiting localhost:8081 produces ugly 404 "GET / not found"
This diff adds a simple index.html page that has a title and link to documentation.

It's a super tiny detail, but I hope it makes things a little nicer. Improvements are welcome.

Maybe we could include an offline copy of React Native's docs website?

Reviewed By: vjeux

Differential Revision: D3341242

fbshipit-source-id: c8cd4b647e69eb520ea8bc978bea070551225912
2016-05-24 11:58:23 -07:00
MIYOKAWA, Nobuyoshi 8f9a3aa0e2 Add .iml to ignore target.
Summary:
Sorry for trivial one, but I feel no need to share '.iml' in a project, so it should be ignored.
Closes https://github.com/facebook/react-native/pull/7689

Differential Revision: D3334367

fbshipit-source-id: 2a68aa93084a51d0b3d24427c71bc7c12e41ed78
2016-05-23 04:58:24 -07:00
Janic Duplessis 6961fd23ba Use a separate babel config for the local-cli and the packager
Summary:
This separates the babel config of the local-cli and the packager from the one used by the transforms of the packager since it doesn't run in the same environment and the local-cli/packager doesn't require react specific transforms and runs in node 4 so we can also avoid some es2015 transforms that node already supports.

I had to move the code in cli.js so it can still run in node 0.12 that doesn't support `const` since it is no longer transformed.

**Test plan**
Run the local-cli on node 0.12 and there should be a message saying that it requires at least node 4.
Run the local-cli on node 4 and 5 and everything should work the same as before.

I was also hoping for some perf gains but there was nothing noticeable. I did benchmark the babel-register call and it stayed pretty much the same. As for runtime performance it can help if there are optimisations for es2015 features in node.
Closes https://github.com/facebook/react-native/pull/6155

Reviewed By: bestander

Differential Revision: D3301008

Pulled By: davidaurelio

fbshipit-source-id: 504180d158a1e50bc03e28fb0d1e53d0731ce32f
2016-05-21 06:58:26 -07:00
Mike Grabowski 149d0b91c2 Merge rnpm into react-native
Summary:
This is initial (first step) in the merging process. For now, we are just going to move our code as is into `local-cli` folder (first commit). There were other tweaks made in separate commits to make it easier to go through the code as the diff is expected to be rather large. The purpose of this is to make it easier to start working in small batches and improving the CLI incrementally on a daily basis.

Current codebase will still leave in `rnpm` organisation on Github where we keep working on new features, bugs and ship releases to `npm` until we finish our integration and provide a nice interface for users to migrate (in case it changes at all)

Flow, Jest and npm will ignore this folder for now until we integrate it properly.

Tests are to be rewritten from mocha to jest in `rnpm/link`. We will hook them all up as soon as we start using them in local-cli.

For now, there's no point in having them running and possibly breaking the builds.

We will announce next steps with Kureev later this week
Closes https://github.com/facebook/react-native/pull/7550

Differential Revision: D3327772

Pulled By: mkonicek

fbshipit-source-id: 90faa4bd78476d93ed21b1253e0d95c755d28a30
2016-05-20 04:58:26 -07:00
Mike Grabowski e3bbd300f6 Update upgrade command with 0.26 breaking changes
Summary:
Generally it feels that at some point we will just integrate `rnpm upgrade` directly here, but this is a super temporary quick workaround for the people upgrading to 0.26. We might want to change it later to 0.27 and update this message in case we have any other stuff to upgrade.

![screen shot 2016-05-18 at 14 28 47](https://cloud.githubusercontent.com/assets/2464966/15358460/df3b1b66-1d04-11e6-825c-fa18fa96ee6e.png)

It is supposed to work for 0.26.0, 0.26.1 and all the others up to 0.27.
Closes https://github.com/facebook/react-native/pull/7614

Differential Revision: D3316420

fbshipit-source-id: 3861b4228ee878464e18ba3de1f3e0c12d5f30d1
2016-05-18 07:28:52 -07:00
Andrew Jack 6bbaff2944 Upgrade to OkHttp3
Summary:
Update to [OkHttp](https://github.com/square/okhttp) to [OkHttp3](https://publicobject.com/2015/12/12/com-squareup-okhttp3/)

We must also update:
- Fresco to 0.10.0
- okio to 1.8.0

**Motivation**
Reasons for upgrading:
* Issue #4021
* "We discovered that RN Android sometimes fails to connect to the latest stable version of NGINX when HTTP/2 is enabled. We aren't seeing errors with other HTTP clients so we think it's specific to RN and OkHttp. Square has fixed several HTTP/2 bugs over the past eight months." - ide
* OkHttp3 will be maintained & improved, but OkHttp2 will only receive [security fixes](https://publicobject.com/2016/02/11/okhttp-certificate-pinning-vulnerability/)
* Cleaner APIs - "Get and Set prefixes are avoided"
* Deprecated/Removed - HttpURLConnection & Apache HTTP
* React Native apps are currently being forced to bundle two versions of OkHttp (v2 & v3), if another library uses v3
* Improved WebSocket performance - [CHANGELOG.md](https://github.com/square/okhttp/blob/master
Closes https://github.com/facebook/react-native/pull/6113

Reviewed By: andreicoman11, lexs

Differential Revision: D3292375

Pulled By: bestander

fbshipit-source-id: 7c7043eaa2ea63f95854108b401c4066098d67f7
2016-05-17 12:43:39 -07:00
David Aurelio 9092198b1b Terminate startup code with a null byte, too (indexed file random access bundles)
Reviewed By: javache

Differential Revision: D3310269

fbshipit-source-id: d0fbf5afd6baecf50ec568e8694a15c96e6a9c85
2016-05-17 09:58:44 -07:00
David Aurelio 2f41c56f59 change to fixed size offset table + indexed lookup
Reviewed By: javache

Differential Revision: D3281989

fbshipit-source-id: 52db9f441dd46024eafac46ae8d32b26640cad71
2016-05-16 04:43:24 -07:00
Shane O'Sullivan fa5d1fefa1 Make the root view background color explicit
Summary:
The default white background for the root view causes an unattractive flash when loading any app with a non-white background.  Almost every developer has to search for how to fix it.

This change makes the background color explicit in the file, so it can be easily change to match the color of the splash screen and the main screen without having to search for it.

**Test plan (required)**
Launched my app and it still has a white flash for the background before loading the app.  I changed the background colors to other values and the flash was that color.
Closes https://github.com/facebook/react-native/pull/7570

Differential Revision: D3303451

Pulled By: vjeux

fbshipit-source-id: 61dbab768095c430bcb583bafb57575a7d767e6f
2016-05-14 22:43:20 -07:00
David Aurelio b4e970f6c3 Use continuous module IDs for random access bundles
Reviewed By: bestander

Differential Revision: D3292980

fbshipit-source-id: ab5791d31add42a26cf55a0309564330c383eaa2
2016-05-12 17:28:25 -07:00
Tomas Roos cd9271567f Add flow directive to index.android.js
Summary:
iOS template contains flow directive in top comment. Android should too for consistency.
Closes https://github.com/facebook/react-native/pull/7482

Differential Revision: D3281131

fbshipit-source-id: d9a77196faed5e41753d09768721e1da1e6cc60a
2016-05-10 03:11:21 -07:00
jsdevel d4cc5b53c7 Setting current working directory for dev server.
Summary:
* This allows `react-native` to work for users on fedora.
* `react-native run-android` was failing because the launch packager script was unable to find packager.sh (see `source` in `man bash`).
* This change sets cwd for the dev server when run with `run-android`.
Closes https://github.com/facebook/react-native/pull/7316

Differential Revision: D3255866

fb-gh-sync-id: 88f6b18f7c61636ce8fecef77f7f4e60b1d9a637
fbshipit-source-id: 88f6b18f7c61636ce8fecef77f7f4e60b1d9a637
2016-05-04 02:45:29 -07:00
Sawyer Hood 9425bcff8f Updated a warning string in upgrade.js
Summary:
I inserted an 'in' in the warning message that is displayed when the user's package.json file doesn't have a valid version number for react native.

Test plan
---------------
-run upgrade.js on a project with an invalid version number.
Closes https://github.com/facebook/react-native/pull/7314

Differential Revision: D3245839

fb-gh-sync-id: e38f3be0884d8c75f9610faced85d5c81c24a49e
fbshipit-source-id: e38f3be0884d8c75f9610faced85d5c81c24a49e
2016-04-30 18:21:17 -07:00
Janic Duplessis f8f9362c05 Reverted commit D3242754
Summary:
This separates the babel config of the local-cli and the packager from the one used by the transforms of the packager since it doesn't run in the same environment and the local-cli/packager doesn't require react specific transforms and runs in node 4 so we can also avoid some es2015 transforms that node already supports.

I had to move the code in cli.js so it can still run in node 0.12 that doesn't support `const` since it is no longer transformed.

**Test plan**
Run the local-cli on node 0.12 and there should be a message saying that it requires at least node 4.
Run the local-cli on node 4 and 5 and everything should work the same as before.

I was also hoping for some perf gains but there was nothing noticeable. I did benchmark the babel-register call and it stayed pretty much the same. As for runtime performance it can help if there are optimisations for es2015 features in node.
Closes https://github.com/facebook/react-native/pull/6155

Differential Revision: D3242754

Pulled By: eczarny

fb-gh-sync-id: 6cd349e284b7d92a1b2cc8b5c0e26adbfb0d9a2f
fbshipit-source-id: 6cd349e284b7d92a1b2cc8b5c0e26adbfb0d9a2f
2016-04-30 16:54:31 -07:00
Janic Duplessis 19429f79b2 Use a separate babel config for the local-cli and the packager
Summary:
This separates the babel config of the local-cli and the packager from the one used by the transforms of the packager since it doesn't run in the same environment and the local-cli/packager doesn't require react specific transforms and runs in node 4 so we can also avoid some es2015 transforms that node already supports.

I had to move the code in cli.js so it can still run in node 0.12 that doesn't support `const` since it is no longer transformed.

**Test plan**
Run the local-cli on node 0.12 and there should be a message saying that it requires at least node 4.
Run the local-cli on node 4 and 5 and everything should work the same as before.

I was also hoping for some perf gains but there was nothing noticeable. I did benchmark the babel-register call and it stayed pretty much the same. As for runtime performance it can help if there are optimisations for es2015 features in node.
Closes https://github.com/facebook/react-native/pull/6155

Differential Revision: D3242754

Pulled By: davidaurelio

fb-gh-sync-id: 02880c841c10562d5f107e1c975d668e55cc619f
fbshipit-source-id: 02880c841c10562d5f107e1c975d668e55cc619f
2016-04-30 16:25:24 -07:00
David Aurelio 34dd17cae5 Add encoding/hash signature to JS files
Reviewed By: tadeuzagallo

Differential Revision: D3241028

fb-gh-sync-id: 737ae64cf3a3f4f121076dbfe933d5fe71e07817
fbshipit-source-id: 737ae64cf3a3f4f121076dbfe933d5fe71e07817
2016-04-30 09:44:23 -07:00
Mark Oswald 90f9f48498 add reset-cache command to bundle
Summary:
Currently the `react-native bundle` has no option to reset the file cache. For example changing the .babelrc has no effect on the bundling process. `react-native start` has it already implemented, so this is just a small addition.

**Test plan (required)**

the issue:

- `react-native init` a new project
- run `react-native bundle` (should work as expected)
- create `.babelrc` with empty object ```{}```
- rerun `react-native bundle`
- should fail now with `Unexptected token` (no babel plugins configured)
 - if not failing, your cache already hit (clear $TMPDIR to get the error)
- delete .babelrc and rerun `bundle`
- still failing, but it should went back to normal
- delete your $TMPDIR contents
- works again

The option `--reset-cache` should fix that
Closes https://github.com/facebook/react-native/pull/7297

Differential Revision: D3241259

Pulled By: davidaurelio

fb-gh-sync-id: 0ed5b58aa1f021d72021f4c80fbc57d2e7e8181f
fbshipit-source-id: 0ed5b58aa1f021d72021f4c80fbc57d2e7e8181f
2016-04-29 10:38:29 -07:00
David Aurelio cccb8db175 Unify source map approach for RA bundles on iOS/Android
Reviewed By: javache

Differential Revision: D3229780

fb-gh-sync-id: a3148d7626b32a2e6803ae8c35ac75025a992a32
fbshipit-source-id: a3148d7626b32a2e6803ae8c35ac75025a992a32
2016-04-29 10:16:22 -07:00
Shawn Wilsher 856f9e9fed Add `--version` to `local-cli/cli.js`
Summary:
[Buck](https://buckbuild.com) has a concept of a versioned tool.  In order to
properly use RN with Buck, the `cli.js` script should return the proper version
when passed `--version`.

Reviewed By: astreet

Differential Revision: D3197207

fb-gh-sync-id: 12ea35587cf492eb89d7dd102e93bdd26bc813c0
fbshipit-source-id: 12ea35587cf492eb89d7dd102e93bdd26bc813c0
2016-04-29 09:25:32 -07:00
Martin Konicek 12caa363a1 Remove 'react-native link'
Summary:
`react-native link` was an early experiment, [rnpm](https://github.com/rnpm/rnpm) does this much better. After merging this PR we should merge rnpm so that `react-native link` works again :)

grabbou Kureev Just making some space here :)

This reverts 4e5a2bc079.

**Test Plan**

e2e tests on Travis and CircleCI
Closes https://github.com/facebook/react-native/pull/7290

Differential Revision: D3240702

Pulled By: mkonicek

fb-gh-sync-id: 6aac83fac599ba3db0dd0a7ac48653ebabd93491
fbshipit-source-id: 6aac83fac599ba3db0dd0a7ac48653ebabd93491
2016-04-29 05:27:28 -07:00
Jagdeep Nagpal 3d0d426d46 Renamed --flavor to --variant
Summary:
This small update to runAndroid.js which renames --flavor to --variant.
~~`react-native run-android --flavor=staging`~~

~~doesn't work as it needs build type as well~~

~~so at present it needs to be like this~~

~~`react-native run-android --flavor=stagingDebug`~~

~~it looks messy, instead if we want to use the original spec then Debug must be concatenated to the end all the time as run-android was speced to trigger only debug builds~~
Closes https://github.com/facebook/react-native/pull/7036

Differential Revision: D3240692

Pulled By: mkonicek

fb-gh-sync-id: ef4570797b53ac8f76d0b86a263916ac5bdb0581
fbshipit-source-id: ef4570797b53ac8f76d0b86a263916ac5bdb0581
2016-04-29 05:18:24 -07:00
Janic Duplessis 891b87e7fb Launch the packager with `react-native run-android` on Windows
Summary:
Adds support for launching the packager in a new window on Windows.

**Test plan (required)**

Tested that the packager is launched in a completely independent process. This means that exiting the `react-native run-android` command should not close the packager window and it should exit properly when completed even if the packager window is still opened. Pretty much made sure it behaves exactly like on mac.

Also tested that an error in the packager will not close the window immediately to show the error stack trace.
Closes https://github.com/facebook/react-native/pull/7129

Differential Revision: D3240628

Pulled By: mkonicek

fb-gh-sync-id: 007582250536481d2b2376f9a201f8f415fc1080
fbshipit-source-id: 007582250536481d2b2376f9a201f8f415fc1080
2016-04-29 04:14:22 -07:00
David Aurelio e3c18c3990 Upgrade to node-haste@2.10.0 and allow to specify extra node modules
Summary: This upgrades to node-haste@2.10.0 and allows to expose folders as additional node modules from rn-cli.config.js

Reviewed By: bestander

Differential Revision: D3232595

fb-gh-sync-id: dffca66fec55a79a2b3af1d6ec1b8799b2bbcf59
fbshipit-source-id: dffca66fec55a79a2b3af1d6ec1b8799b2bbcf59
2016-04-28 06:33:27 -07:00
Alex Kotliarskyi 8295d27a90 Fix usage of react-native cli inside package.json scripts
Summary:
IIRC we made `wrong-react-native` to warn people in case they installed `react-native` globally (instead of `react-native-cli` what the guide suggests). To do that we added `bin` entry to React Native's `package.json` that points to `local-cli/wrong-react-native.js`

However, this means that if we have a project that uses `react-native` package and has call to `react-native` CLI inside its package.json, npm will execute *local* override (which just prints a confusing in this context error message).

In fact, the template we generate with `react-native init` has `react-native start` as `start` script, which makes it useless. Let's fix it by making `wrong-react-native` script smarter – it can detect that it has been executed from local `node_modules` and run the actual CLI.

cc vjeux ide
Closes https://github.com/facebook/react-native/pull/7243

Differential Revision: D3226645

Pulled By: frantic

fb-gh-sync-id: be094eb0e70e491da4ebefc2abf11cff56c4c5b7
fbshipit-source-id: be094eb0e70e491da4ebefc2abf11cff56c4c5b7
2016-04-26 15:42:35 -07:00
James Ide 6fac6db4d4 Use xcodebuild and delete "Framework Search Paths" for Xcode 7.3 to un-stall the tests
Summary:The Obj-C tests were stalling when we updated TravisCI to use the OS X image with Xcode 7.3 and iOS 9.3.

On my own MBP with Xcode 7.3 the tests stall as well. Running `./scripts/objc-test.sh` prints out a warning near the end, which says `ld` couldn't find a Frameworks folder under the iPhoneSimulator9.3 SDK directory. Indeed, this directory doesn't exist on my computer. When creating a brand new project with unit tests and UI tests, both test targets don't specify "Framework Search Paths" so I don't think we need to specify it anymore.
Closes https://github.com/facebook/react-native/pull/7168

Differential Revision: D3216524

fb-gh-sync-id: 3097bda98d78289ecdba86801bcd461f3311ac47
fbshipit-source-id: 3097bda98d78289ecdba86801bcd461f3311ac47
2016-04-22 23:04:19 -07:00
Alexey Lang 8aa82d3b33 Add flag "-lc++" for all checked-in projects
Reviewed By: bestander

Differential Revision: D3214654

fb-gh-sync-id: cb07b439156ab5ff1f909f69c766c09da2a027c6
fbshipit-source-id: cb07b439156ab5ff1f909f69c766c09da2a027c6
2016-04-22 16:23:18 -07:00
Raul Ascencio 44d36f7c5f removing xterm from linux spawn
Summary:Simply removing the xterm spawn from android packager, since you can archive exactly the same results using the standard shell 😄
Closes https://github.com/facebook/react-native/pull/7077

Differential Revision: D3212548

Pulled By: mkonicek

fb-gh-sync-id: 8cc03d2708614f64e1394ca738e5de0ba631deb9
fbshipit-source-id: 8cc03d2708614f64e1394ca738e5de0ba631deb9
2016-04-22 09:01:22 -07:00
Mike Grabowski d9349a7b79 Update imports in generated projects
Summary:Fixes warnings when React API is used by requiring 'react-native'.
Closes https://github.com/facebook/react-native/pull/7060

Differential Revision: D3196109

Pulled By: mkonicek

fb-gh-sync-id: b47afc138cd7909ad53c0d67a65e3a124b87134b
fbshipit-source-id: b47afc138cd7909ad53c0d67a65e3a124b87134b
2016-04-19 05:11:27 -07:00
Leland Richardson e9398c7926 Whitelist the 'pdf' extension in the packager
Summary:The WebView component in iOS currently does not support displaying PDFs without providing a remote URI or manually including the assets in the xcodeproj itself. This is because the packager has not whitelisted the 'pdf' extension.

I've gone ahead and whitelisted the 'pdf extension according to the recommendation by nicklockwood

GH comment: https://github.com/facebook/react-native/issues/1846#issuecomment-199302488
Closes https://github.com/facebook/react-native/pull/7004

Differential Revision: D3196019

Pulled By: nicklockwood

fb-gh-sync-id: 10a86a9232095f98f277506141de0b8af5b21ab4
fbshipit-source-id: 10a86a9232095f98f277506141de0b8af5b21ab4
2016-04-19 03:52:27 -07:00
Konstantin Raev 59a11995b3 increased timeout for ios e2e test and fixed --js e2e after ios e2e
Summary:Packager usually builds within 250 seconds and sometimes misses test timeout.
Also added non-persistent option to make it build faster.
Should be fine because we don't test live reloading in ios
Closes https://github.com/facebook/react-native/pull/6974

Differential Revision: D3178884

fb-gh-sync-id: e9bf75456f1cf480ffea6aa2c769550b40eb3d32
fbshipit-source-id: e9bf75456f1cf480ffea6aa2c769550b40eb3d32
2016-04-14 04:30:00 -07:00
Konstantin Raev f9bd789206 E2e android
Summary:- converted shell script `scripts/e2e-test.sh` into JS script to have more programming flexibility
- using appium execute 2 tests after a fresh React Native app installation: check HMR and that debugging mode does not crash the app
- made sure tests can be stable on limited CI systems and added ways to debug any problems in the future

Using appium we can now interact with Android app and test its state.
As a follow up i am planning to write a blog post on how to use appium with android and ios for e2e testing.
Closes https://github.com/facebook/react-native/pull/6840

Differential Revision: D3173635

Pulled By: mkonicek

fb-gh-sync-id: 3cf044bc9f64d1a842ae4589dd1bcab76de3d66a
fbshipit-source-id: 3cf044bc9f64d1a842ae4589dd1bcab76de3d66a
2016-04-13 08:20:05 -07:00
Sam Swarr 6b61e5927c Transform packager src files in cli entry point
Reviewed By: bestander

Differential Revision: D3163457

fb-gh-sync-id: 15cafcf39b2a463d1200f3dddf025b1375b1e1d3
fbshipit-source-id: 15cafcf39b2a463d1200f3dddf025b1375b1e1d3
2016-04-11 12:43:25 -07:00
Sam Swarr a35ef6c745 Remove socket interface from dependencies command
Reviewed By: davidaurelio

Differential Revision: D3136438

fb-gh-sync-id: 51fce2caf60fdf32a8cba180c79b1996834cda6e
fbshipit-source-id: 51fce2caf60fdf32a8cba180c79b1996834cda6e
2016-04-11 09:23:29 -07:00
Sam Swarr bc81cc4073 Remove socket interface from buildBundle command
Reviewed By: davidaurelio

Differential Revision: D3137070

fb-gh-sync-id: 8f3bb4af597bf509d16e5ce26f31fe1646acbc57
fbshipit-source-id: 8f3bb4af597bf509d16e5ce26f31fe1646acbc57
2016-04-11 09:23:29 -07:00
Sam Swarr 66d5529ea4 Have parseCommandLine use a new instance of optimist for each run
Reviewed By: mjmahone

Differential Revision: D3156730

fb-gh-sync-id: 0a55d0c231a93a6c590bd8c4a6eb793eda66f32f
fbshipit-source-id: 0a55d0c231a93a6c590bd8c4a6eb793eda66f32f
2016-04-08 12:09:22 -07:00
digeff 4c8a9f0d00 Added support for JavaScript third-party debuggers
Summary:* Add ability to configure the app that should open when starting debugging

axemclion discussed this feature with tadeuzagallo and martinbigio on: https://github.com/facebook/react-native/issues/5051
Closes https://github.com/facebook/react-native/pull/5683

Reviewed By: martinbigio

Differential Revision: D2971497

Pulled By: mkonicek

fb-gh-sync-id: 91c3ce68feed989658124bb96cb61d03dd032599
fbshipit-source-id: 91c3ce68feed989658124bb96cb61d03dd032599
2016-04-07 13:15:58 -07:00
Martin Konicek e4865a5609 Clean up after removing the Stetho dependency from open source React Native
Summary:We've removed the Stetho dependency from open source React Native, removing stuff that's not needed anymore.
Closes https://github.com/facebook/react-native/pull/6864

Differential Revision: D3150758

Pulled By: mkonicek

fb-gh-sync-id: fad4408df16f52914357dc474eb1d8d965cfac60
fbshipit-source-id: fad4408df16f52914357dc474eb1d8d965cfac60
2016-04-07 10:18:22 -07:00
David Aurelio 817ec2d756 wait for bundle save, don't silence errors
Summary:The logic when saving a bundle was flawed: we didn?t wait for promises returned by the `save` operation.
That would silence all errors from `save`.

Reviewed By: andreicoman11

Differential Revision: D3150363

fb-gh-sync-id: cdabf6f0e171aece5bd1fcb59654fa7c147988ba
fbshipit-source-id: cdabf6f0e171aece5bd1fcb59654fa7c147988ba
2016-04-07 08:58:23 -07:00
David Aurelio b8da6a2963 Wait for the modules directory to be created before writing module files
Summary: Typo: the operation of writing module files to a common sub-directory didn?t wait until that directory was created, because `Promise.all` was invoked directly as argument to `.then()`, rather than putting it in a lambda function.

Reviewed By: andreicoman11

Differential Revision: D3150338

fb-gh-sync-id: c65270b1757a248993048b039f5ebadb281b2eea
fbshipit-source-id: c65270b1757a248993048b039f5ebadb281b2eea
2016-04-07 08:26:26 -07:00
Chris Liu a1e105eea5 react app root path can be override by env var 'react_native_app_root'
Summary:This PR is to solve app build issue when node_modules is a symlink by providing an environmental variable to override the current *smart* guessing of app root path.
I met this issue when I tried to setup a shared incremental node_modules directory to speed our react-native app build speed in CI. But the build crashed in step 'bundleReleaseJsAndAssets' with error messages like:
> :app:bundleReleaseJsAndAssets
> bundle: Created ReactPackager
> uncaught error Error: NotFoundError: Cannot find entry file index.android.js in any of the roots:["/home/jenkins/shared_data"]

The build is fixed by applying this patch and adding 'export react_native_app_root=${WORKSPACE}' before './gradlew assembleRelease' in build script.

**Test plan**
1. react-native init demo # init a demo app from scratch
2. cd demo/android && ./gradlew assembleRelease # build works fine
3. mkdir ~/shared_data && mv ../node_modules ~/shared_data && cd .. && ln -s ~/shared_data/node_modules . # create symlink for node_modules in shared d
Closes https://github.com/facebook/react-native/pull/6859

Differential Revision: D3150341

fb-gh-sync-id: efbe19b7f6b3053f18d8e568deb75d24861c27ff
fbshipit-source-id: efbe19b7f6b3053f18d8e568deb75d24861c27ff
2016-04-07 07:39:22 -07:00
James Ide c30d125050 Honor the version of "react" under peerDeps when setting up a new project
Summary:We need this since React 15.0.0 is coming and will break `react-native init`, which currently installs the latest version of React. We'll need some changes to React Native to support 15 that Sebastian is actively working on, but till that lands we want `react-native init` to continue working.
Closes https://github.com/facebook/react-native/pull/6846

Differential Revision: D3148182

Pulled By: sebmarkbage

fb-gh-sync-id: 3df5bc184c0b82d2c9c320c620256c7c8568d90b
fbshipit-source-id: 3df5bc184c0b82d2c9c320c620256c7c8568d90b
2016-04-07 00:07:21 -07:00
Adam Miskiewicz 8200041694 Pass transformOptions to getShallowDependencies.
Summary:We weren't passing `transformOptions` to `getShallowDependencies`, and therefore, when this method was called on a module, it would bust the cache and cause a retransform of the file. This was resulting in a complete retransforming of all files when the HMR Client connected to the packager.
Closes https://github.com/facebook/react-native/pull/6843

Differential Revision: D3145306

Pulled By: martinbigio

fb-gh-sync-id: 3619c27801b2fc07b758fafed47fcc892bb8e6db
fbshipit-source-id: 3619c27801b2fc07b758fafed47fcc892bb8e6db
2016-04-06 11:38:27 -07:00
Nick 2a03182b1c CHORE - Remove Trailing Spaces
Summary:Remove Trailing Spaces.

Why:
Sometimes there are conflicts with trailing spaces
Saves space
Those whose tools automatically delete them will have their pr watered down with trailing space removal
Closes https://github.com/facebook/react-native/pull/6787

Differential Revision: D3144704

fb-gh-sync-id: d8a62f115a3f8a8a49d5b07f56c540a02af38cf8
fbshipit-source-id: d8a62f115a3f8a8a49d5b07f56c540a02af38cf8
2016-04-06 09:21:53 -07:00
Konstantin Raev ce1261a3dd Added BUCK to generated app with react-native-cli init
Summary:BUCK is faster than Gradle.
For example `gradle app:installDebug` vs `buck install app` is ~7 seconds vs ~2 seconds with warm caches.
This is just the beginning to allow people to become familiar with BUCK.
It is enough for running the app locally and testing on a device.

Gradle is still used for dependency resolution.
Closes https://github.com/facebook/react-native/pull/6733

Differential Revision: D3126328

Pulled By: bestander

fb-gh-sync-id: 56aad276036c029af7e0e23d60c46ba2f77b3d2c
fbshipit-source-id: 56aad276036c029af7e0e23d60c46ba2f77b3d2c
2016-04-01 08:54:19 -07:00