Commit Graph

291 Commits

Author SHA1 Message Date
Tadeu Zagallo ccd90e25c1 Convert remaining uses of alloc] init] to new]
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
2015-11-02 08:03:17 -08:00
Aaron Chiu c4d780d904 fix packager compilation error
Differential Revision: D2604171

fb-gh-sync-id: 11decf6c8b689b903bd9c4fd9aca2ea626cc1d43
2015-10-31 06:14:26 -07:00
Tadeu Zagallo 010380cca6 Fix CPU profiler upload
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
2015-10-30 14:46:00 -07:00
Adrov Igor 95972cfd08 fix error handling in packager
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
2015-10-29 08:59:02 -07:00
Martín Bigio 89f1e6732e Fix comments on .bat file 2015-10-28 21:36:07 -04:00
Martín Bigio 15006cf0b4 Add option to indicate bundle encoding
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
2015-10-28 13:20:28 -07:00
Martín Bigio 44af0d3dec Infer platform from extension
Summary: public
Aparently this used to work on 0.11, lets fix it :)

Reviewed By: foghina

Differential Revision: D2557719

fb-gh-sync-id: dcbca077431c1356c89dfc55b71eecff64c7ad3d
2015-10-27 17:47:28 -07:00
Martin Konicek 4e5a2bc079 Introduce react-native link
Reviewed By: martinbigio

Differential Revision: D2575858

fb-gh-sync-id: 13be5a0411db5cd753ebbac3799a7a0139c0f952
2015-10-27 11:22:28 -07:00
Martin Konicek 3c730b1ce2 Revert "Add folders to attempt to unblock sync"
We don't need these files anymore, the sync from the internal
fb repo to github is working now.

This reverts commit 746ebc6a79.
2015-10-26 22:48:10 +00:00
Martín Bigio bcf762af60 Move files from `packager/` to `local-cli`
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
2015-10-26 15:38:14 -07:00
Martín Bigio 2856be9a07 Bring back global cli module check
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
2015-10-26 15:36:29 -07:00
Martín Bigio 849aa4dae6 Move `private-cli` commands to `local-cli`
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
2015-10-26 15:36:04 -07:00
Martin Konicek 746ebc6a79 Add folders to attempt to unblock sync 2015-10-26 17:22:39 +00:00
Martin Bigio 47926abca9 Use default asset roots on `default.config.js`
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
2015-10-23 18:49:25 -07:00
Felix Oghină 7e53ee1095 add upgrade cli command
Reviewed By: mkonicek

Differential Revision: D2559885

fb-gh-sync-id: 785bd6ad855da30c00b170e737a7dd0f3e756430
2015-10-23 03:37:28 -07:00
Martín Bigio 32aeeea313 Fix cli entry points
Reviewed By: frantic

Differential Revision: D2565954

fb-gh-sync-id: 6fde9e1dbefd71944e8f857e9a40619bf599ef75
2015-10-22 10:13:13 -07:00
Alex Kotliarskyi be70e32de2 Generate bundle and assets when building via Xcode
Summary: This integrates React Native into Xcode's build process, which lets us automatically handle bundling and packaging image assets.

Tested the script via https://github.com/frantic/ReactNativeAssetsExample

Loaded from packager:
<img width="432" alt="screen shot 2015-10-19 at 3 11 12 pm" src="https://cloud.githubusercontent.com/assets/192222/10593447/be5bc7e8-7678-11e5-8c70-ecc2a1ee24fc.png">

Loaded from offline bundle:
<img width="432" alt="screen shot 2015-10-19 at 3 10 58 pm" src="https://cloud.githubusercontent.com/assets/192222/10593448/be5d5194-7678-11e5-8b02-d492a26cfb81.png">

Android:
<img width="639" alt="screen shot 2015-10-19 at 3 11 20 pm" src="https://cloud.githubusercontent.com/assets/192222/10593449/be5de2d0-7678-11e5-8d3c-0378fc447f15.png">
Closes https://github.com/facebook/react-native/pull/3523

Reviewed By: mkonicek

Differential Revision: D2557923

Pulled By: frantic

fb-gh-sync-id: 19957e255993696e793b0162662772efd89f5c1a
2015-10-21 18:44:27 -07:00
Martín Bigio c6c97cbd9d Introduce default config
Reviewed By: frantic

Differential Revision: D2561344

fb-gh-sync-id: 651b8a199069f78e1ace2897ba4c0352aab7e3ea
2015-10-21 03:04:04 -07:00
Martín Bigio 8e7cfcd053 Kill unused files
Reviewed By: frantic

Differential Revision: D2561113

fb-gh-sync-id: a81fece0a948485e12bff7ec146e39d890664887
2015-10-21 03:04:01 -07:00
Martín Bigio 088c193a22 Start packager through cli
Reviewed By: frantic

Differential Revision: D2561066

fb-gh-sync-id: 1743153a84947da5d0e54aca7e1919cf5df3a965
2015-10-21 03:03:59 -07:00
Martín Bigio 5c4bb894bf Clean up cli.js
Reviewed By: frantic

Differential Revision: D2546201

fb-gh-sync-id: 214a12213674749e1b7270ccbe90fd3330c9cb1e
2015-10-21 03:03:57 -07:00
Felix Oghină 71adc24974 Revert "Update rn-cli.config.js"
This reverts commit 8d592650c9.
2015-10-21 11:02:08 +01:00
Martín Bigio 02e39719c2 Move `run-android` to `private-cli`
Reviewed By: mkonicek

Differential Revision: D2544567

fb-gh-sync-id: 3c62f6c30b5be7f480d8f44a48fb551fc30d477e
2015-10-20 11:48:29 -07:00
Martin Konicek 4ac3c4a853 Make 'npm start' an alias for 'packager.sh', don't silently no-op on Windows
Reviewed By: martinbigio

Differential Revision: D2559772

fb-gh-sync-id: d1cd2874c32459d6e1f0af7d084c3559ebc145aa
2015-10-20 10:15:22 -07:00
Martin Konicek e612690413 Add license headers to local-cli
Reviewed By: martinbigio

Differential Revision: D2559969

fb-gh-sync-id: d8cd52435213729ff73a1f039eb0378b28f8d10e
2015-10-20 09:55:21 -07:00
Martín Bigio 8d592650c9 Update rn-cli.config.js 2015-10-19 19:07:34 -04:00
Felix Oghină 9dc036d2b9 add gradle tasks for bundling js and assets in template
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
2015-10-19 06:33:22 -07:00
Martín Bigio 8bff2d30ab Use `private-cli`'s server instead of `packager.js`
Reviewed By: vjeux

Differential Revision: D2542027

fb-gh-sync-id: e59f3be17590c1e256a903e04f2f0359c835c8b5
2015-10-16 15:01:23 -07:00
Martín Bigio 5977f494fc Allow user to configure transformer through cl argument
Reviewed By: frantic

Differential Revision: D2547435

fb-gh-sync-id: 77016ee5beba854a4cb58e9ac04b91a7dd76cf3e
2015-10-16 13:26:22 -07:00
Martin Bigio c0b5e6ed67 [react-native-cli] Move `new-library` command to `private-cli` 2015-10-16 11:20:29 -04:00
Pieter De Baets 74002b784b Fixes broken link to running on device
Summary: Closes https://github.com/facebook/react-native/pull/2420

@​public

Reviewed By: @majak

Differential Revision: D2549685

fb-gh-sync-id: 8ce3c9aa242cd65e8efc2bdd0065f9e20de8240d
2015-10-16 03:41:21 -07:00
Martín Bigio 36697ae6a1 Move android generator to private-cli
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
2015-10-16 03:40:48 -07:00
Martín Bigio a21e226b68 Remove `install` command
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
2015-10-13 12:08:22 -07:00
Martín Bigio a102e6f587 Breaking change: Move `bundle` to `private-cli`
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
2015-10-13 11:48:30 -07:00
Martín Bigio 144f8598c2 Introduce configuration template
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
2015-10-13 06:44:14 -07:00
Felix Oghină aa63636512 [cli] suppress yeoman create output in init 2015-10-12 16:10:18 +01:00
Martin Konicek a7b23df510 [Android] Add default Proguard config 2015-10-09 17:13:46 +01:00
Martin Konicek c740edaf03 Add a comment to CLI's init 2015-10-08 17:49:05 +01:00
Nick Simmons 8d3bbdf8e6 [cli] make init backwards-compatible for real 2015-10-07 17:39:22 -04:00
Ben Vinegar a16d0e46d8 Add --write-sourcemap option to 'bundle' cli command (fixes GH-3202) 2015-10-02 16:01:18 -07:00
Felix Oghină 046d8d2dee [cli] make init backwards-compatible 2015-10-02 14:44:20 +01:00
Atticus White 56abd6ab41 add android .gradle and build directories to sample app gitignore 2015-10-01 15:09:44 -04:00
Martin Konicek 31a0c95f69 [cli] Formatting 2015-10-01 15:33:45 +01:00
Martin Konicek a5463c4c10 [cli] Fix 'react-native start' on Windows
Based on https://github.com/facebook/react-native/pull/2989
Thanks @BerndWessels!
2015-10-01 15:28:05 +01:00
Felix Oghină 7f9cf97767 Merge pull request #2713 from jmhdez/fix-appName-on-init
[cli] pass arguments from cli instead of using process.argv in init
2015-10-01 12:06:24 +01:00
jmhdez 575e9b7b9a Respect projectName on template creation 2015-10-01 12:39:35 +02:00
Felix Oghină 3e7af6e1a4 [SampleApp] adding unsynced changes from PR #3025 2015-09-30 15:15:30 +01:00
Felix Oghina f6ec854e23 [cli] spawn xterm on linux to run the packager
Also use ANDROID_HOME env var when running adb.
2015-09-28 20:14:07 +01:00
Felix Oghină 5cd64a658d [cli] merge yeoman tests into one file to avoid concurrenct issues with jest 2015-09-24 17:02:43 +01:00
Felix Oghină 2dcb06949a [cli] use different names in generator tests 2015-09-24 13:54:01 +01:00
Jan Kassens c6a9d0e69f Update cacheVersion in bundle.js
As requested by @vjeux, this moves the change to this file to a separate PR.

For more info see #2905.
2015-09-23 15:24:54 -07:00
Aaron Chiu 2566ed8089 merge the root .flowconfig and local-cli/generator/templates/_flowconfig
Test Plan: flow check && scripts/e2e-tests.sh
2015-09-23 21:47:43 +01:00
Pieter De Baets 64eb8741ee Bump flow version 2015-09-18 19:28:38 -07:00
DengYun 9e60d5788c Merge branch 'master' of github.com:facebook/react-native into master-pr-6 2015-09-18 01:02:56 +08:00
DengYun 302c89f912 let 'react-native bundle' support platform option.
react-native bundle --platform android --minify
2015-09-18 00:58:50 +08:00
Kyle Corbitt 88add08c2e handle back button press in JS 2015-09-17 12:09:19 +01:00
Christopher Chedeau 36a8358ae7 Fix more tests
Summary: beeper node modules has a `return` statement outside of a function which doesn't parse. To fix it, we mock it. Also, setupEnvPolyfills is no longer being used.
Closes https://github.com/facebook/react-native/pull/2770

Reviewed By: @​svcscm

Differential Revision: D2448882

Pulled By: @vjeux
2015-09-16 13:05:30 -07:00
Felix Oghină f775bb0e05 [cli] update appcompat and gradle tools versions in the template 2015-09-16 16:30:31 +01:00
Christopher Chedeau 3f86d42b81 Merge pull request #2725 from javache/fix-flow-config
Update generator's flow config
2015-09-15 21:08:55 -07:00
Pieter De Baets 81c81501d5 Update generator's flow config 2015-09-15 11:20:24 -07:00
Pieter De Baets e7d833f2d9 Disable code stripping for DEBUG builds 2015-09-15 09:44:15 -07:00
Martin Konicek 42eb5464fd Release React Native for Android
This is an early release and there are several things that are known
not to work if you're porting your iOS app to Android.

See the Known Issues guide on the website.

We will work with the community to reach platform parity with iOS.
2015-09-14 18:13:39 +01:00
Christopher Chedeau e2ffac28e4 A deep dependency of yeoman just spams the console.log with giant json. This diff silences console.log around the require to kill them 2015-09-10 09:48:15 -07:00
Pieter De Baets bc69787576 Use new packager URL in e2e test 2015-09-10 14:41:16 +01:00
Rishab U Hegde 326768a949 Changing Linked Libraries URI to point to the right page 2015-08-26 18:47:03 -07:00
Martin Konicek 19f922aa80 [cli] Fix iOS app template 2015-08-25 19:25:17 +01:00
Felix Oghină 3b7bffa2a1 [e2e] fix e2e tests
* use new _flowconfig in generator template
* increase sinopia max_body_size
* remove breaking `cd` command from e2e-test.sh
2015-08-18 11:51:03 +01:00
Felix Oghină f83675d191 [cli] convert project generation to use yeoman 2015-08-12 12:04:27 +01:00
Isken Huang 6357931b61 add cli bundle url params 2015-07-14 10:40:39 +08:00
Spencer Ahrens 233f80d6c2 Fix tests
e2e flowconfig needed update, plus tweaks
2015-07-09 14:12:56 +02:00
Christopher Chedeau a6b6f97ba1 Merge pull request #1428 from JohnyDays/master
[CLI][Bundle][Packager] Implement --root --assetRoot and --out for consistency with packager and more flexibility
2015-06-19 11:56:02 +01:00
John Days a877c6bc68 Fix syntax error (missing ')') 2015-06-12 14:03:28 +01:00
John Days fcc4e4f8de [Bundler] Support multiple asset roots, for consistency with the packager 2015-06-12 13:06:31 +01:00
Tadeu Zagallo 7c49d293f1 Merge pull request #727 from TomMcHugh/master
[CLI] Adds Testing to CLI
2015-06-11 22:23:47 +01:00
John Days 34546e3bc8 Spaces before and after if conditions 2015-06-02 23:32:49 +01:00
John Days 169af1fb58 Add similar options from packager.sh to bundle.js, so we can develop and package with the same functionality 2015-05-27 19:02:26 +01:00
Joe Stanton 857c30b502 Stylistic cleanup 2015-05-15 17:08:21 +01:00
Joe Stanton 396439bf86 Added react-native new-library command 2015-05-15 09:17:27 +01:00
Joe Stanton 04832e5aa4 Fixed stylistic issues 2015-05-14 20:19:29 +01:00
Joe Stanton 29325d7cb3 Move init into local-cli 2015-05-14 18:08:56 +01:00
Joe Stanton 9caee3248b Linked with new local-cli, refactored 2015-05-14 16:11:05 +01:00
Alex Kotliarskyi 4933034334 Warn if `init` is called from existing project 2015-05-04 12:19:48 -07:00
Arthur Lee c13646fce1 Added bundle command using ReactPackager
Added bundle script
Pipe http response straight to file
Used ReactPackager directly, minor fixes
Added error handling to fs.writeFile
Changed .then to .done
2015-04-20 20:01:03 -04:00
Christopher Chedeau 0a5967dbfe Warn when installing globally react-native instead of react-native-cli
This adds a react-native binary that just output some instructions.
2015-04-08 11:15:56 -07:00
Thomas Mchugh 800502f2a0 Updates tests to work with new install output 2015-04-08 07:12:12 -05:00
Vinnie Garcia 2740e08ef7 Fix packager script breakage when running `npm start` 2015-04-08 01:21:30 -07:00
Christopher Chedeau d91d28a2a6 Unbreak npm publish
See https://github.com/facebook/react-native/pull/706#issuecomment-90799052
2015-04-07 21:30:46 -07:00
Thomas Mchugh 2efce394f5 Merge remote-tracking branch 'upstream/master' 2015-04-07 15:18:07 -05:00
Thomas Mchugh 10ca07840c added tests to cli 2015-04-07 15:16:33 -05:00
Alex Kotliarskyi 1dba7e0a5a Allow running local cli from terminal 2015-04-07 12:33:41 -07:00
Thomas Mchugh 6bc78b1d66 created install command and moved cli to local-cli directory 2015-04-06 12:58:03 -05:00