Summary: A lot of people try to use a device as the very first thing when trying
out React Native. I've observed this at the developer workshop in Prague
and on Twitter.
However, developing on pre-API 21 devices is quite involved:
https://facebook.github.io/react-native/docs/running-on-device-android.html
I'm thinking we could recommend installing Android together with Android
studio. Android studio installs HAXM for you (hardware acceleration, without
this Google emulators are useless) and also creates and starts emulators.
So it would be quite a smooth experience similar to pressing 'Run' in Xcode.
We'd just need to integrate with Gradle so that installing the app also starts
the packager. I think that's something we should do in any case.
Probably an even better option is to build a React Native-specific tool that
lets you do everything you need: opens the Android SDK Manager, creates and
starts emulators, detects whether you have Genymotion and opens it, upgrades
node and npm etc.
public
Reviewed By: vjeux
Differential Revision: D2604774
fb-gh-sync-id: c7ffb701b4e5209815faf652926937c22943be95
Summary: Inspired by: https://twitter.com/geirmanc/status/660275638637477889
There are many reasons why the Gradle build could fail and the best
thing to do is to read the error message.
We can provide some hints in the most common cases though.
public
Reviewed By: vjeux
Differential Revision: D2604747
fb-gh-sync-id: 1aa83abb9ec823c03814dcc31d630a8f1914cf5c
Summary: public
We moved to using `new` instead of `alloc] init` but there was still some calls
left.
Reviewed By: javache
Differential Revision: D2604679
fb-gh-sync-id: ff7300ecbedb55dd5e93873592598810c9b87808
Summary: public
Changes were made on the packager that broke the CPU profile upload route,
fix it.
Reviewed By: martinbigio
Differential Revision: D2585184
fb-gh-sync-id: 206744f92d403d6851a69891dfac0c4c11bf1b7e
Summary: Currently on error I have following output:
```
ERROR Packager can't listen on port 8081
Most likely another process is already using this port
Run the following command to find out which process:
lsof -n -i4TCP:8081
You can either shut down the other process:
kill -9 <PID>
or run packager on different port.
See http://facebook.github.io/react-native/docs/troubleshooting.html
for common problems and solutions.
/Users/nucleartux/Work/projects/react-native/local-cli/server/server.js:90
if (error.code === 'EADDRINUSE') {
^
TypeError: Cannot read property 'code' of undefined
at process.<anonymous> (/Users/nucleartux/Work/projects/react-native/local-cli/server/server.js:104:14)
at emitOne (events.js:77:13)
at process.emit (events.js:169:7)
at process._fatalException (node.js:211:26)
```
Closes https://github.com/facebook/react-native/pull/3765
Reviewed By: svcscm
Differential Revision: D2595537
Pulled By: martinbigio
fb-gh-sync-id: e11ec2e6e8794bf5fe7570e27cd327777d8b300c
Summary: public
To improve cold start performance we want to be able to avoid decoding the bundle at all. To make that happen we need to be able to generate a bundle encoded on `ucs2`. This diff adds support for indicating the encoding the Packager should use for bundling.
Reviewed By: davidaurelio
Differential Revision: D2582365
fb-gh-sync-id: 905384272a668910c57a1a2ca6d1b723c39233f8
Summary: public
Aparently this used to work on 0.11, lets fix it :)
Reviewed By: foghina
Differential Revision: D2557719
fb-gh-sync-id: dcbca077431c1356c89dfc55b71eecff64c7ad3d
Summary: public
This is not only to put the files on a place where it makes more sense but also to allow to use ES6 features on them as `/packager` is not whitelisted on `babel`.
Reviewed By: mkonicek
Differential Revision: D2577267
fb-gh-sync-id: b69a17c0aad349a3eda987e33d1778d97a8e1549
Summary: public
This was introduced by vjeux on 0a5967d and removed on 0686b01. I guess it was removed accidentally as this this is a nice warning to have that should prevent n00bs from commiting a common mistake
Reviewed By: frantic
Differential Revision: D2563885
fb-gh-sync-id: 9fae145bbec587514f118d1d28d076b1d82f0630
Summary: public
We cannot remove `local-cli` because is referenced by the global cli explicitly. If we do so, people would have to upgrate this global thin cli which will cause some pain. So, lets move `private-cli` commands into `local-cli` instead.
Reviewed By: frantic
Differential Revision: D2571983
fb-gh-sync-id: 712c29430203660fb6f0d5f23813cb2a7156ee48
Summary: We need to cherry pick this one as well.
cc ide
Closes https://github.com/facebook/react-native/pull/3640
Reviewed By: svcscm
Differential Revision: D2577961
Pulled By: mkonicek
fb-gh-sync-id: 3368fc02a931e0f259f3baa6706bd7d8586b0fbf
Summary: This adds gradle tasks that call `react-native bundle` with the correct args to bundle dev/release JS and assets. The dev task is disabled by default, as in dev mode people only use reload JS in most cases.
Submitting this as a pull request to have community visibility, although we have this code internally as well now and this will require an import.
* generate a project with `react-native init`, add some assets, run `./gradlew assembleRelease`, sign & zipalign generated APK, run it -> works
* enable dev bundling task, run `./gradlew installDebug` (not `react-native run-android` so as to not start the packager) -> works
Reviewed By: svcscm
Differential Revision: D2555071
Pulled By: foghina
fb-gh-sync-id: c3d9fcd4c77862e6a4db4e4d8d8cc39ee9dff3ab
Summary: @public
Lets also make this more generic to allow to generate the template for any platform code.
Reviewed By: @vjeux
Differential Revision: D2536821
fb-gh-sync-id: 6fb99c6dc546b8e1f9839c96a473dc08b0f5285c
Summary: @public
The implementation wasn't working. Lets remove this for now and revisit if we trully want to support this.
Reviewed By: @frantic
Differential Revision: D2536442
fb-gh-sync-id: 4aca2d1d2584cd15ac855d69e6e9a5a08abf778e
Summary: @public
We need to start using the `private-cli` for the new asset system. Note this is a breaking change! People will have to upgrade their workflows/scripts to start using the new cli. Otherwise we'd need to build a thin adapter that is aware of both APIs which is something we;d like to avoid. The major API changes are:
- API is now `entry-file` based instead of `url` based.
- /s/--out/--bundle-output
- /s/--out/--sourcemap-output
Also these parameters have no longer default values, you need to specify them. For instance, if you want to generate the sourcemaps you need to pass in the `--sourcemap-output` option
Lastly, additional project roots or asset roots need to be specified on the `rn-cli.config.js`.
Reviewed By: @frantic
Differential Revision: D2533877
fb-gh-sync-id: a45f9095fdf9442a9106ea7bb6a6b7f651d25273
Summary: @public
We're rolling out a replacement for `local-cli`. As part of the process we moved many hardcoded values into a JS based configuration file.
Reviewed By: @vjeux
Differential Revision: D2533111
fb-gh-sync-id: 7250bddee9989b089ded409104e098ef15d79498