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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Summary:
As mkonicek suggested in [#9568](https://github.com/facebook/react-native/pull/9568#issuecomment-267600043) I did some cleanup
**Test plan (required)**
Only one functional change:
> Run `react-native run-android --deviceId`
Before it was beginning to build the app and then failing because of the missing device "true" :-)
Now it's showing a message and stopping the build:
```
❯ react-native run-android --deviceId
Starting JS server...
Parameter missing (device id)
```
Closes https://github.com/facebook/react-native/pull/11703
Differential Revision: D4376615
Pulled By: ericvicenti
fbshipit-source-id: 3c6e0f12220ab22539c7bc3d390367e02c96728a
Summary:
**Motivation**
New iOS project generation with react-native-cli should allow developers to build for Apple TV as well as iPhone/iPad.
**Test plan**
Added to `scripts/run-ci-e2e-tests.js` and `.travis.yml` to have the new tvOS target automatically built and tested in Travis CI.
Closes https://github.com/facebook/react-native/pull/11591
Differential Revision: D4375593
Pulled By: mkonicek
fbshipit-source-id: 4e241caa400a88e6b2f91416fa26b48ae01cb7b6
Summary:
Fixes#11605
HelloWorld refers to CSSLayout even thought master has moved on and the library is now called Yoga.
Closes https://github.com/facebook/react-native/pull/11606
Differential Revision: D4365469
fbshipit-source-id: e0eaac400449f0ba767bf98f3bd8e8185fb6fd12
Summary:
Running `master` (at 260d68bf8b) I noticed `react-native link` fails when there is no windows project due to a bug in the code that fetches windows project configs (introduced 445182c707).
There's a guard to return early if `csSolution` (the relative path of the windows solution) is null but it needs to be a line earlier, because `path.join` errors when passed a non-string.
Tested locally on a non-windows project, `react-native link` errored previously and now succeeds.
Closes https://github.com/facebook/react-native/pull/11590
Differential Revision: D4362419
fbshipit-source-id: b3b9f6784d8b1d1a7c53abe0ee421b1dc6048571
Summary:
Due to react-native-cli use yarn if yarn is available, we need to add yarn-error.log to .gitignore.
Closes https://github.com/facebook/react-native/pull/11583
Differential Revision: D4359507
fbshipit-source-id: 0c7582215a31e0d03dced138c8275225910713ee
Summary:
At the moment the run-android command from the react-native cli does run all available devices at once. However it would be extreme useful to have the option to choose only one specific device/simulator.
Therefore i've created a new flag for the command 'run-android': --deviceIdFromList 'deviceIdFromList' in order
to install and launch apps on a specific device/simulator from the command line.
'deviceIdFromList' is the id listed on the output of the command 'adb devices'.
I've tested my code with the following commands:
react-native run-android --deviceIdFromList "Not existing id"
react-native run-android --deviceIdFromList
react-native run-android --deviceIdFromList "id of a simulator"
react-native run-android --deviceIdFromList "id of a device"
Output:
![not-existing-device](https://cloud.githubusercontent.com/assets/9102810/17931086/d843abc8-6a09-11e6-995d-8c737dd5ed5c.png)
![empty-flag](https://cloud.githubusercontent.com/assets/9102810/17931087/d8443930-6a09-11e6-94f3-d
Closes https://github.com/facebook/react-native/pull/9568
Differential Revision: D4335133
Pulled By: mkonicek
fbshipit-source-id: a827628316be1b5751225851323b1131f451574c
Summary: This was buggy and didn't print the folder we need to cd into.
Reviewed By: mkonicek
Differential Revision:
D4313396
Ninja: OSS only
fbshipit-source-id: 0e15baf818065b63e939def60a1366e2251aac7d
Summary:
Seeing as [Windows is a supported platform](72157cf991/packager/defaults.js (L22)) until platforms can better manager their own CLI and packager needs.
Linking 3rd party libraries should be supported first, because then I'd like to do a follow up PR with grabbou to identify how we can effectively move RNPM functionality out of react-native core and eventually housed in each external platform's repo. The goal would be working with cpojer and hopefully andrewimm to help keep external platform needs in their respective repos, for rnpm/packager _et al._ Seeing as this is a major discussion point, I've made this PR first. Making small steps towards this goal, seems to be the approved methodology from all.
Additionally, I have a merged PR that makes an excellent place for documenting the CLI when it advances, as preparatio
Closes https://github.com/facebook/react-native/pull/11282
Differential Revision: D4311391
fbshipit-source-id: be9a836344be4aed6c4732b0ce4947c2a16b6dad
Summary:
This is a simple one line change. When a red box is launching the editor, if `launchEditor.js` is aware of your editor it can also add a line number to open the file at. So if the stacktrace shows an error on like 56 in `ako.js` then it'll try`wstorm /Users/somelady/src/project/ako.js:56` instead of `wstorm /Users/somelady/src/project/ako.js`.
This adds PyCharm's command line launcher, which is named `charm`. There is existing logic to handle other JetBrains editors, so I just did a simple one line addition.
**Test plan (required)**
* Install PyCharm (if needed)
* Set environment variable `REACT_EDITOR` to `charm`
* Open PyCharm
* Add/replace the current `charm` command via `Tools -> Create Command-line launcher...` in PyCharm.
* Run a React Native project with an error in the source code.
* In the generated red box, click on one of the entries in the stack trace
* File should open in PyCharm at the correct line number.
Closes https://github.com/facebook/react-native/pull/11275
Differential Revision: D4295724
Pulled By: javache
fbshipit-source-id: 29dec525f76c2f0a3ee203cac67408eecc8ac6b6
Summary:
Xcode really sucks, per some discussion on e1577df1fd and https://developer.apple.com/library/content/technotes/tn2215/_index.html, if you use the headers phase, and mark headers in your static library as public, they will actually end up in the final package that's built and you can't submit to the app store! This changes our xcode setup to use a copy files phase instead.
I've also changed the header include path to be $(BUILT_PRODUCTS_DIR)/include, which is added to the include path by Xcode by default, so 3rd party libraries should not be impacted by these changes anymore.
Reviewed By: mkonicek
Differential Revision: D4291607
fbshipit-source-id: 969b9ebcbeb8161f85427f8c429e198d9d0fae30
Summary:
I missed this while doing the Yeoman wipeout.
Currently we just print:
Installing React...
Installing Jest...
This diff makes it print the output of those commands.
**Test Plan**
Published react-native to Sinopia, ran `react-native init MyApp`, saw the output:
Installing Jest...
⸨░░░░░░░░░░░░░░░⸩ ⠸ normalizeTree: ...
Reviewed By: bestander
Differential Revision: D4286640
fbshipit-source-id: e554f03a4729c2de85eba527f10f4b727de722e4
Summary:
This module is not actually used inside of React Native. Projects that use this,
can now depend on https://www.npmjs.com/package/signedsource
Reviewed By: yungsters
Differential Revision: D4272511
fbshipit-source-id: 93eb74aa4ccfa8ef8743de2cfa92b5403de91e0a
Summary:
**Motivation**
This morning I was trying to test on iPhone 7 with iOS 10 so I booted that device and ran "react-native run-ios" expecting it to notice I had a simulator running and install my app to it. Instead it switched my device to the iPhone 6s iOS 9.2. After digging it was found that run-ios did not handle multiple versions of iOS being installed very well when it came to checking for the booted device. This PR resolves that.
**Test plan (required)**
Tests were added for the situation of multiple iOS versions being installed and a slight change to the code was completed to make the new tests pass and continue to keep the old tests passing.
Closes https://github.com/facebook/react-native/pull/10558
Differential Revision: D4163616
Pulled By: hramos
fbshipit-source-id: 26b44fb73ef402ce252e7a754036279e15359170
Summary:
I was running RN 0.31 on ArchLinux (kernel 4.7), and "react-native start"
was refusing to run on the default (and sometimes required, as I have
noticed) port. I tried executing the suggested lsof command, but that did not
work. Somewhere I found the lsof command I include in this commit, and that
worked (it was a node.js process). So I'm including it, since I found it
helpful.
Closes https://github.com/facebook/react-native/pull/9402
Reviewed By: lacker
Differential Revision: D4144400
Pulled By: hramos
fbshipit-source-id: 6203549455555efc59b7bab0a3ec23957d80b956
Summary:
This kills fastfs in favor of Jest's hasteFS. It gets rid of a ton of code, including the mocking code in ResolutionRequest which we don't need any more. Next step after this is to rewrite HasteMap, ModuleCache, Module/Package. We are getting closer to a nicer and faster world! :)
Here is what I did:
* Use Jest's HasteFS instead of fastfs. A fresh instance is received every time something changes on the FS.
* HasteFS is not shared with everything any more. Only one reference is kept in DependencyGraph and there are a few smaller functions that are passed around (getClosestPackage and dirExists). Note: `dirExists` now does fs access instead of an offline check. This sucks but stat calls aren't slow and aren't going to be a bottleneck in ResolutionRequest, I promise! When it is time to tackle a ResolutionRequest rewrite with jest-resolve, this will go away. "It gets worse before it gets better" :) The ModuleGraph equivalent does *not* do fs access and retains the previous way of doing things because we shouldn't do online fs access there.
* Add flow annotations to ResolutionRequest. This required a few tiny hacks for now because of ModuleGraph's duck typing. I'll get rid of this soon.
* Updated ModuleGraph to work with the new code, also created a mock HasteFS instance there.
* I fixed a few tiny mock issues for `fs` to make the tests work; I had to add one tiny little internal update to `dgraph._hasteFS._files` because the file watching in the tests isn't real. It is instrumented through some function calls, therefore the hasteFS instance doesn't get automatically updated. One way to solve this is to add `JestHasteMap.emit('change', …)` for testing but I didn't want to cut a Jest release just for that. #movefast
(Note: I will likely land this in 1.5 weeks from now after my vacation and I have yet to fully test all the product flows. Please give me feedback so I can make sure this is solid!)
Reviewed By: davidaurelio
Differential Revision: D4204082
fbshipit-source-id: d6dc9fcb77ac224df4554a59f0fce241c01b0512
Summary: Flow was updated in bf901d926e, need to update the config file for the template too.
Reviewed By: mkonicek
Differential Revision:
D4240152
Ninja: OSS tests only
fbshipit-source-id: c20704c43a5d603105125a0316b7926cdc7cd7fd
Summary:
The upgrading process based on Yeoman is a pain. For each file, Yeoman (or the brand new copyAndReplace solution a477aec) compares the newly generated content with the existing one and prompts the user if it differs, with very basic options: overwrite or skip.
I have digged into this problem and came with [rn-diff](https://github.com/ncuillery/rn-diff) (you may have read [this article](https://medium.com/ncuillery/easier-react-native-upgrades-with-rn-diff-5020b5c3de2d#.llvy2dym5)). This repository helps people to upgrade RN on their projects. An alternative upgrading process using `git apply` instead of Yeoman is described [here](https://github.com/ncuillery/rn-diff/blob/master/USAGE.md).
This PR is the integration of this process into the core. I got rid of the drawbacks mentioned in the link below in order to make it a clean, elegant, one-step operation.
This process is based on some Shell operations that:
- Generate the blank sources of both old and new versions
Closes https://github.com/facebook/react-native/pull/11110
Differential Revision: D4237107
Pulled By: mkonicek
fbshipit-source-id: 15e82e030b762415c925ccb2a62ddb354a6e18b9
Summary:
Instead of exposing a `getTransformOptionsModulePath` function in configurations, we can simply expose a `getTransformOptions` *function*. The necessity of exposing a path comes from the olden days, where we had a server listening on a socket, and a client, talking to that server.
Since that architectural gem no longer exists, we can use functions directly, rather than passing paths to modules around.
Reviewed By: cpojer
Differential Revision: D4233551
fbshipit-source-id: ec1acef8e6495a2f1fd0911a5613c144e8ffd7c3
Summary:
Thanks for submitting a pull request! Please provide enough information so that others can review your pull request:
> **Unless you are a React Native release maintainer and cherry-picking an *existing* commit into a current release, ensure your pull request is targeting the `master` React Native branch.**
Explain the **motivation** for making this change. What existing problem does the pull request solve?
Warning about new Buffer when init
Prefer **small pull requests**. These are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it.
**Test plan (required)**
Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI.
Make sure tests pass on both Travis and Circle CI.
**Code formatting**
Look around. Match the style of the rest of the codebase. See also the simple [style guide](https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md#s
Closes https://github.com/facebook/react-native/pull/11153
Differential Revision: D4234591
fbshipit-source-id: a9373f3151de8a50c18342f45fb9684a5c7416a6
Summary:
This removes support for `require('image!…')`, which has been deprecated for a long time.
It is still possible to use images that are already bundled by the native app using the `nativeImageSource` module.
Check http://facebook.github.io/react-native/docs/images.html for detailed documentation.
Reviewed By: matryoshcow
Differential Revision: D4231208
fbshipit-source-id: 05ec4c1ca0fabdc3fbb652f8ad1acdf240a67955
Summary:
To make React Native play nicely with our internal build infrastructure we need to properly namespace all of our header includes.
Where previously you could do `#import "RCTBridge.h"`, you must now write this as `#import <React/RCTBridge.h>`. If your xcode project still has a custom header include path, both variants will likely continue to work, but for new projects, we're defaulting the header include path to `$(BUILT_PRODUCTS_DIR)/usr/local/include`, where the React and CSSLayout targets will copy a subset of headers too. To make Xcode copy headers phase work properly, you may need to add React as an explicit dependency to your app's scheme and disable "parallelize build".
Reviewed By: mmmulani
Differential Revision: D4213120
fbshipit-source-id: 84a32a4b250c27699e6795f43584f13d594a9a82
Summary:
Follow up to #8190
Tested with custom parameter as well as w/o (using default value). All worked well.
Differential Revision: D4220565
Pulled By: mkonicek
fbshipit-source-id: e8a98542d3ff96d60ff6045b328f5b464f78ee74
Summary:
Follow on in https://github.com/facebook/react-native/pull/10864.
**Motivation**
ncuillery Is has a lot of experience with upgrading RN projects (see his [talk](http://www.slideshare.net/ncuillery/introducing-the-new-reactnative-upgrade)) and is rewriting 'react-native upgrade' to use git.
He tells me that we actually want git to merge changes in the .pbxproj file. In his words: "Making the project.pbxproj invisible for "git diff" means that react-native-git-upgrade will never be able to upgrade the project.pbxproj."
Note the git docs explicitly recommend not to use git to merge .pbxproj files: https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes#Binary-Files
ncuillery do we have an alternative? Some ideas:
1. Use a 3rd-party tool in 'react-native upgrade' to merge the .pbxproj file?
2. We could always re-generate and overwrite the .pbxproj file (never merge) and then run 'react-native link' to update native 3rd-party dependencies in the Xcode project?
3. Last resort: stay away
Closes https://github.com/facebook/react-native/pull/11047
Differential Revision: D4220521
fbshipit-source-id: 823c735856b519be114aa4349ca1392910f00445
Summary:
Just fixes a typo in an error message when running a simulator that XCode doesn't recognise.
Closes https://github.com/facebook/react-native/pull/11060
Differential Revision: D4220364
Pulled By: mkonicek
fbshipit-source-id: da7b9a529ad8cd77c6e144f4bbf3ea594a9efee4
Summary: Adds flow types for output functionality for easier maintenance and interop with new code
Reviewed By: matryoshcow
Differential Revision: D4211863
fbshipit-source-id: 591407d3a6d49536054ae94ba31125c18a1e1fa1
Summary:
Followup for CLI rewrite (a477aec10d). See the comment in the code for details.
**Test plan (required)**
- Published to Sinopia locally ([docs](https://github.com/facebook/react-native/tree/master/react-native-cli))
- Ran 'react-native init MyApp', the correct files were created (no more .npmignore, but have .gitignore):
$ cd MyApp
$ ls -a
. .flowconfig __tests__ ios
.. .gitattributes android node_modules
.babelrc .gitignore index.android.js package.json
.buckconfig .watchmanconfig index.ios.js yarn.lock
- Changed .flowconfig, ran 'react-native upgrade'. Saw a prompt "Do you want to overwrite .flowconfig", tried answering first 'n' and then 'y'. When answering 'y' the file was overwritten by the version from the template as expected.
Closes https://github.com/facebook/react-native/pull/11051
Differential Revision: D4214831
Pulled By: ericvicenti
fbshipit-source-id: 7c6aae4f97c7d45e7241bf017ed2f6527d5d29fe
Summary: Switch to native promises in the local cli
Reviewed By: davidaurelio
Differential Revision: D4213142
fbshipit-source-id: aff99f8bb3dc237cecc852cdb09dee9b49b05753
Summary: Correct header import paths, update podspec so we point at the copy in ReactCommon (and can eventually remove the copy under React)
Reviewed By: astreet
Differential Revision: D4204501
fbshipit-source-id: e979a010092f025b2cdc289e1e5f22fc7b65a8d1
Summary:
I had to re-do my CLI pull request internally using hg because shipit couldn't import binary files even after debugging with the OSS team. While using hg I messed up. This should fix it:
- Remove files added by mistake when using 'hg addremove'
- Add Xcode project that was ignored by hg (probably at fb we don't want people to check in Xcode projects since we use Buck)
**Test Plan**
Travis tests on this pull request.
Closes https://github.com/facebook/react-native/pull/11043
Differential Revision: D4212755
Pulled By: bestander
fbshipit-source-id: c762472ed31b9845425c1766510dce7761a35ae0
Summary: Uses `Logger` for the HMR Server output so that we get timestamps for free and the packager server output does not look as crappy.
Reviewed By: cpojer
Differential Revision: D4210827
fbshipit-source-id: e1ae64c359150b98c33e7b074f1111d37a2bc39b
Summary:
This is the manually imported version of https://github.com/facebook/react-native/pull/10786
This was mostly straigthforward by replacing the local-cli folder with the version I had in my local git checkout,
plus a few other files I listed with git diff --name-only.
Reviewed By: hramos
Differential Revision: D4201118
fbshipit-source-id: 4d0fb54b0edda9de1abba427958e420fd2ac105c
Summary: This adds a new flag to the `unbundle` command: `--indexed-unbundle` allows to output the indexed file format even when building for android.
Reviewed By: cpojer
Differential Revision: D4189485
fbshipit-source-id: e56192456de764eb38c25b574ceaaf52eb8a6fca
Summary:
This is the next incremental step to rewrite node-haste. I apologize for the size of this diff but there is really no smaller way to do this. The current architecture passes a single file watcher instance into many classes that each subscribe to file changes. It's really hard to keep track of this. The new implementation reduces the listeners to two (will eventually be just one!) - one in DependencyGraph and one in it's parent's parent's parent (ugh! This doesn't make any sense). This should make it much more straightforward to understand what happens when a file changes.
I was able to remove a bunch of tests because jest's watcher takes care of things like ignore patterns. Some of the tests were specifically testing for whether the change events were invoked and they are now much more straightforward as well by manually invoking the `processFileChange` methods.
(Relanding a fixed version of D4161662)
Reviewed By: kentaromiura
Differential Revision: D4194378
fbshipit-source-id: 8c008247a911573f6b5f6b0b374d50d38f62a4f5
Summary:
Implements a multi-device proxy for the Chrome debugging protocol. Each device connects
to the proxy over a single websocket connection that is able to multiplex messages to multiple
Javascript VMs. An inspector instance running in Chrome can connect to a specific VM via this
proxy.
Reviewed By: davidaurelio
Differential Revision: D4088492
fbshipit-source-id: 3ee934e98604b5a378da732e687ca05fe3d23ce0
Summary:
Currently, to generate a `Release` build in `Android` it is required to get into the `android` directory and run the `react native bundle`with a lot of options and after that run the `gradle` to assemble or install the application with the build type `Release`.
This PR improves the process adding that feature to the `React Native CLI`.
To generate a release build is only required to use the parameter `--configuration` with the value `Release`.
**Examples**
To generate a release build:
```sh
react-native run-android --configuration release
```
To generate a release build for the product flavors staging:
```sh
react-native run-android --configuration release --flavor staging
```
To generate a debug build:
```sh
react-native run-android
```
To generate a debug build for the product flavors staging:
```sh
react-native run-android --flavor staging
```
This PR also removes the option `--install-debug` from the `react-native run-android` because that is always the default value,
Closes https://github.com/facebook/react-native/pull/10867
Differential Revision: D4167203
Pulled By: cpojer
fbshipit-source-id: c5ac07f81feeeea00ee0e8b059b46ef0d258a1a6
Summary:
With the current `run-ios` script it is not possible to create/run iOS release builds or any other kind of scheme configuration from the terminal (we need to use `Xcode`). The reason for this is that the `run-ios` script does not expose the scheme configuration option for the `xcodebuild` command. This PR exposes that property and allows the developers to directly create/run release builds from the terminal.
This PR also closes [this](https://productpains.com/post/react-native/create-ios-release-builds-from-terminal) request at `productpains`.
And answers to [this](http://stackoverflow.com/questions/40303229/run-a-react-native-ios-release-build-from-terminal) question at the `stackoverflow`.
**Test plan (required)**
To generate a release build just run:
``` sh
react-native run-ios --configuration Release
```
The output
``` sh
Found Xcode project App.xcodeproj
Launching iPhone 6 (iOS 9.3)...
Building using "xcodebuild -project App.xcodeproj -scheme App -destination id=B0738993-CE4A-4D
Closes https://github.com/facebook/react-native/pull/10637
Differential Revision: D4151793
Pulled By: cpojer
fbshipit-source-id: 5a0fcdd59589977f3e251ec9bb3ba85e8919cffc
Summary:
Fixes#10638.
Added NativeAnimation library to the starter project iOS generator. Passing `useNativeDriver: true` to `Animated` config will enable the app to tap into the native code for animations.
**Test plan**
Init a RN project and animate an element. Enable native driver as follows:
```
Animated.timing(
this.state.value,
{
toValue: 300, // some value
useNativeDriver: true
}
).start();
```
Earlier, this used to crash.
Closes https://github.com/facebook/react-native/pull/10783
Differential Revision: D4159386
Pulled By: mkonicek
fbshipit-source-id: 993481a31b4446eab24ef4ee35ae1941d7a7aae9
Summary:
Force npm for e2e tests.
Bonus: tracked down and removed a non-standard `.done()` call that was breaking e2e tests.
Reviewed By: bestander
Differential Revision: D4153514
fbshipit-source-id: 079939874ea75c7ea6e3e5376d37873c95fc74c1
Summary:
Link doesn't work on f8app,
as it is, android projects don't have to contain the matching string and then the linking would not work, I've switched it to the much simpler new-line.
If you can find a better common minimum string for settings.gradle please do.
Commit Msg:
Current string, `include ':app'\n`, is not a minimum common string.
Instead a simple `\n` will do.
Closes https://github.com/facebook/react-native/pull/10172
Differential Revision: D4150313
fbshipit-source-id: 34470e1fb67194e41354b6085fb3eb90ddaa7ff8
Summary: Use native Promises in React Native Packager. Remove all the non-standard `Promise.done()` calls throughout the codebase & replace `Promise.denodeify` with the stand-alone `denodeify` module.
Reviewed By: davidaurelio
Differential Revision: D4146965
fbshipit-source-id: 1730531c914863ac3c52626801d9f91c28eed717
Summary:
Check that 'react-native init' itself used yarn to install React Native.
When using an old global react-native-cli@1.0.0 (or older), we don't want to install React Native with npm, and React + Jest with yarn. Let's be safe and not mix yarn and npm in a single project.
**Test plan**
Publish the code in this PR to Sinopia, use that when creating a new project.
Using old CLI:
npm install -g react-native-cli@1.0.0
react-native init AwesomeApp
The generated project doesn't contain `yarn.lock` (everything was installed with the npm client).
---
Using new CLI:
npm install -g react-native-cli@1.2.0
react-native init AwesomeApp
The generated project contains `yarn.lock`, output shows that yarn is used to install React Native, React, Jest.
---
In both cases the project runs and Reload JS works:
![screenshot 2016-11-04 17 20 50](https://cloud.githubusercontent.com/assets/346214/20015719/719effb0-a2b4-11e6-84a0-43474314009b.png)
Closes https://github.com/facebook/react-native/pull/10752
Differential Revision: D4131812
Pulled By: bestander
fbshipit-source-id: efaaf97a27005e2c2d10cae5d07afe108d5c0dee
Summary:
Ignore all keystore files as we do not want users to accidentally check in their keystore file.
Closes https://github.com/facebook/react-native/pull/10214
Differential Revision: D4118169
Pulled By: bestander
fbshipit-source-id: a81fc99afd1715d52dfdce8c47dfc10808470008
Summary:
Some recent change to Chrome causes the remote debugger to be throttled unexpectedly if it is in a background tab. Although this does not fix the problem, it raises the issue and suggests a workaround.
I also cleaned up some littering of the global namespace in the debugger web worker.
Reviewed By: jingc
Differential Revision: D4104515
fbshipit-source-id: 56e46c0e759bec4c42d3baedd4d2d46cdea2e4a0
Summary:
> Explain the **motivation** for making this change. What existing problem does the pull request solve?
There's no longer a seaprate page for Android setup instructions, it just redirects to the getting started page, where you have to navigate futher.
**Test plan (required)**
None.
Closes https://github.com/facebook/react-native/pull/10524
Differential Revision: D4069696
Pulled By: lacker
fbshipit-source-id: 67f6450f550cbbf446476ea824a6915125e823ba
Summary:
Adds a ```sort``` to ```findProject(folder)``` to boost ones in IOS_BASE to the top. Otherwise, if for example there is a git submodule project in the root app folder, the method will pick that one instead and linking will fail.
Fixes issue #10494
Closes https://github.com/facebook/react-native/pull/10495
Differential Revision: D4069439
Pulled By: lacker
fbshipit-source-id: 4328ac55389ed51cb42759fcf8360e56d5058136
Summary: In order to make `Config` and defaults available to our new code, I’ve added flow types and put default values into one shared modile
Reviewed By: cpojer
Differential Revision: D4044600
fbshipit-source-id: 875ed3ade69c5b22bb3c1b177e7bad732834d476
Summary: I originally added fastpath to node-haste to speed up `path` operations by an order of magnitude. Now we are exclusively using Node 6 at FB so we don't need to ship this thing any more.
Reviewed By: bestander
Differential Revision: D4029092
fbshipit-source-id: 064cf67f4f79ce4f2774fb4e430d22eef4a95434
Summary:
In most .gradle files, lines are indented with 4 spaces, but in some places they are indented with 2 spaces. This PR fixes them and enforce it by adding .editorconfig settings.
Closes https://github.com/facebook/react-native/pull/10267
Differential Revision: D4048335
Pulled By: lacker
fbshipit-source-id: df2f2556380f56672cf85690eb1c80e640a6aedf
Summary:
In xcode, you can modify the Product Name per build configuration. During the build, the app file name is made using that value. For example, I name my app "MyApp Dev", it will build into "MyApp Dev.app".
react-native run-ios doesn't extract the proper app name. Instead it uses the scheme name + ".app". So if in the example above I use the default Scheme "MyApp", which references the build configuration whose name is "MyApp Dev". The build will succeed, but when runIOS.js goes to run the app, it fails because the file name doesn't exist.
My fix parses the build output and extracts the app name from the line "export FULL_PRODUCT_NAME=$(appfilename)" and uses that instead of the scheme. If there is any issue parsing, the scheme name is used like it currently is.
**Test plan (required)**
1) Change the Product Name in xcode project manager to be something different than the scheme name.
2) Run react-native run-ios and ensure it works.
Closes https://github.com/facebook/react-native/pull/10178
Differential Revision: D4022116
Pulled By: javache
fbshipit-source-id: c1bd8e7a1f6364d681c505557a96955a293bc05c
Summary:
If you don't have a `package.json` in your project you can't do anything with the cli as it errors. This fixes that by wrapping the reading of the `package.json` file and returns `my-react-native-app` if an error is caught.
Closes https://github.com/facebook/react-native/pull/10207
Differential Revision: D4022113
Pulled By: javache
fbshipit-source-id: ffe940160f9d0b58e630adfab5e0dc9d34b859e5
Summary:
On iOS project, ATS is disabled for 'localhost'. But the key for this setting is old and just for early iOS9 beta. iOS9 release and later uses new one, so I updated it.
Closes https://github.com/facebook/react-native/pull/10314
Differential Revision: D3993780
fbshipit-source-id: b749edd571c34f07989dde6af0e4ff95f5355c29
Summary:
I frequently spend multiple seconds scanning my open Chrome tabs for the React Native debugger tab. It would be a lot quicker to find the correct tab if the debugger UI tab had a favicon.
This commit adds favicon (blue react logo in a white circle). It's a super minor change, but would help a lot with day-to-day DX.
I chose this icon to differentiate sufficiently from other tabs developer might have open: React docs (blue logo in black square) and React Native docs (white logo in black square). If the idea of having a favicon is agreeable but you want a different asset, I'm more than happy to change it to something else.
Original asset before base-64 encoding:
![favicon-32x32](https://cloud.githubusercontent.com/assets/1203949/19117546/44b36fd2-8b11-11e6-8a94-c8956fe7533c.png)
In the wild:
<img width="335" alt="screen shot 2016-10-05 at 15 40 58" src="https://cloud.githubusercontent.com/assets/1203949/19117811/43cad316-8b12-11e6-8406-4c9b74efdaf2.png">
Closes https://github.com/facebook/react-native/pull/10252
Differential Revision: D3974983
Pulled By: hramos
fbshipit-source-id: 6b07d446dd972c4c171062134b45bc3850886349
Summary: File platform identifiers (`fileName.<platform>.js`) are no longer part of the blacklist regular expression. This allows the upcoming `jest-haste-map` to include all files for all platforms, therefore enabling Packager to build bundles for different platforms using the same `HasteMap`(jest-haste-map) instance.
Reviewed By: davidaurelio
Differential Revision: D3907508
fbshipit-source-id: d7d7f3bd93287a634a1ef0590a736d021be2aaa5
Summary:
Adds the possibility to specify an array of files (group roots) that are used to bundle modules outside of the “startup section” into bigger groups by colocating their code.
A require call for any grouped module will load all modules in that group.
Files contained by multiple groups are deoptimized (i.e. bundled as individual script)
Reviewed By: martinbigio
Differential Revision: D3841780
fbshipit-source-id: 8d37782792efd66b5f557c7567489f68c9b229d8
Summary:
Very simple PR to add the shorcuts for windows/linux to the web debuger interface so it's less mac-centric.
**Test plan**: Open the debugger and see the shorcuts for windows/linux/mac
Closes https://github.com/facebook/react-native/pull/9812
Differential Revision: D3862570
fbshipit-source-id: 54605af66b674d176b3cbbb9efcfa93f84fcd552
Summary:
If the packager is already watching `/path/to/MyProject`, and it finds symlinks inside `/path/to/MyProject/node_modules` that point to `/path/to/MyProject/path/to/somewhere/else`, there's no need to add the latter to the project roots.
**Test Plan:** replicate an aforementioned project set-up, and verify that only `/path/to/MyProject` is a project root for the packager, while files in `/path/to/MyProject/path/to/somewhere/else` can still be imported so long as they're part of an npm-style package (e.g. `/path/to/MyProject/path/to/somewhere/else/package.json` exists).
Closes https://github.com/facebook/react-native/pull/9819
Differential Revision: D3852591
Pulled By: mkonicek
fbshipit-source-id: 558ab3f835ee3d2bf6174c31595e242992f75601
Summary:
Adding jest and its presets to the react-native init command
**Test plan (required)**
run react-native init foo (using `npm link` to use the local `react-native` version)
inside foo there are now a .babelrc file and the package.json is set up as described by
https://facebook.github.io/jest/docs/tutorial-react-native.html#setup
Closes https://github.com/facebook/react-native/pull/9719
Differential Revision: D3843037
Pulled By: bestander
fbshipit-source-id: 004e27ebd3f257a202ed43f378d6fe6cc23ced52
Summary:
Current Xcode project does not include settings to enable auto-incrementing build numbers using ```agvtool``` as described [here](https://developer.apple.com/library/ios/qa/qa1827/_index.html). Tools like Fastlane, for example, rely on this for commands like ```increment_build_number```. Having these settings enabled by default ensures that people will have one less thing to worry about setting up CI for RN based projects.
Closes https://github.com/facebook/react-native/pull/9511
Differential Revision: D3841281
Pulled By: javache
fbshipit-source-id: 9b9640edf608efd0835371dbe90a2f51786748af
Summary:
I removed `$` and `_` (only from the starting substring) as they
cannot be used in creating Android package name according to official
android documentation. Also removed a duplicate function (there is the
same one in `react-native-cli/index.js`). This fixes#7115.
Closes https://github.com/facebook/react-native/pull/7127
Differential Revision: D3841253
Pulled By: mkonicek
fbshipit-source-id: 677c7e4277c783180b04dee57d3ccd509e2b99d3
Summary:
At the moment the run-ios command from the react-native cli does only work for simulators.
The pull request adds a new option to the existing command: **"--device 'device-name'" which installs and launches an iOS application on a connected device.**
This makes it easier to build a test environment using react-native for connected devices.
I've tested my code with the following commands:
react-native run-ios --device "Not existing device"
react-native run-ios --device
react-native run-ios --device "name-of-a-simulator"
react-native run-ios --device "name-of-connected-device"
Output of the first three commands:
![example_error_output](https://cloud.githubusercontent.com/assets/9102810/17669443/f53d5948-630d-11e6-9a80-7df2f352c6a3.png)
Additional to the manual command tests i've added a test file 'parseIOSDevicesList-test.js'.
I used **ios-deploy** In order to launch and install the .app-bundle on a connected device.
ios-deploy on github:
Closes https://github.com/facebook/react-native/pull/9414
Differential Revision: D3821638
Pulled By: javache
fbshipit-source-id: c07b7bf25283a966e45613a22ed3184bb1aac714
Summary:
An attempt to address https://github.com/facebook/react-native/issues/9156.
cc grabbou Kureev
**Test plan (required)**
1. Added the following to the `package.json` of a `react-native-plugin`
```
"rnpm": {
"commands": {
"preunlink": "node node_modules/react-native-plugin/scripts/preunlink"
"postunlink": "node node_modules/react-native-plugin/scripts/postunlink"
}
}
```
2. Added files, `scripts/preunlink.js` and `scripts/postunlink.js` to the plugin. Each of them simply logs a string to the console.
3. Ran `react-native unlink react-native-plugin` to verify that those logs get printed.
Closes https://github.com/facebook/react-native/pull/9157
Differential Revision: D3749434
fbshipit-source-id: 40b94c9026db4f11e8f5be4a417a0670e8069be6
Summary:
Fixes#9312
(Sorry for inconvenience, could've been removed by mistake!)
Bonus: projectName can be configured rather than always defaulting to package.json name, not sure if helpful, but just added it since we have a `default` function that makes sense in this case.
Closes https://github.com/facebook/react-native/pull/9525
Differential Revision: D3753610
Pulled By: bestander
fbshipit-source-id: 641872855b9865502f4055910262686edc4b504e
Summary:
This commit removes `rnpm` folder that we left during initial merge to keep the diff cleaner. The `core`, `link` and `install` have now the same directory structure as any other command to make development more natural for all of us.
From most notable differences:
1) the `src` folder is now gone. The new structure should make it easier for people to work with the stuff and also move us closer to 100% rnpm integration,
2) There's also no `package.json` present in any of the `rnpm` packages, since they are no longer standalone modules,
3) There's no `bugs.url` in link.js since main package.json of React doesn't specify it. Decided to hardcode it to facebook/react-native since it's really unlikely to change. If one would prefer to use pkg.bugs.url as before, a separate PR modifying package.json should be sent.
Closes https://github.com/facebook/react-native/pull/9509
Differential Revision: D3751115
fbshipit-source-id: 74ae8330f7634df0887ad676808f47eee4b8de85
Summary:
`this` is a `ReactNativeHost` post RN 0.29, so the current patch doesn't compile. Simply `getResources()` will work for all versions - Post RN 0.29, it will be the method in the outer `MainApplication`, Pre RN 0.29, it will be the method on the `MainActivity`.
grabbou Kureev
Closes https://github.com/facebook/react-native/pull/9381
Differential Revision: D3744162
fbshipit-source-id: 1fa270bb3268b7b40c6160da948d99ff993c83b1
Summary:
Currently we just try to resolve a rn-cli.config.js file by walking up the tree from node_modules/react-native. In non-standard uses of RN, when your copy of RN may not live within node_modules, it's impossible to use rn-cli.config.js. This PR adds a "config" flag to the cli that let's you pass in a path to rn-cli.config.js.
cc ide
Closes https://github.com/facebook/react-native/pull/7883
Differential Revision: D3382823
Pulled By: bestander
fbshipit-source-id: b946f3bb355050fc2fe99273d0e99e441dbed111
Summary: This shortens the source map URL to its basename for bundles built via the command line API. This makes builds reproducible across different file system locations.
Reviewed By: michalgr
Differential Revision: D3684263
fbshipit-source-id: 2d5fdb5c5d0aa229f5a85465b2d1919f54e33d55
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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