Commit Graph

43 Commits

Author SHA1 Message Date
Krzysztof Magiera
27a67c2434 [ReactNative] Respect --assets-dest in "download from server" mode 2015-08-25 07:22:05 -08:00
Amjad Masad
ec82ffa52b [react-packger] Add a timeout on transform jobs
Summary:
There's been a case where Babel can hang indefinitely on a file parse/transform. Possibly related to https://github.com/babel/babel/issues/2211

This adds a timeout to transform jobs and throws an error informing the user of the offending file. The timeout interval defaults to 10 seconds, but can be changed via an option.
2015-08-19 17:42:28 -07:00
Amjad Masad
3388d8fe79 [reat-packager] Switch platform resolution based on query param
Summary:
Currently the platform selection is controlled by the blacklist. However, since we want to use the same server instance for cross-platform development, we need this to be controlled per request.

One outstanding issue, is that the DependencyGraph class wasn't designed that way and it doesn't have a per-request state. This means that with the current design race conditions is possible. If we got a request for a different platfrom while processing the previous request, we may change the outcome of the previous request.

To fix this a larger refactor is needed. I'll follow up a diff to do that.

Finally, so I don't break the universe like last time, I'll leave it up to the RN guys to update the call sites.
2015-08-15 13:28:18 -07:00
Martín Bigio
3be2b1d966 [react-packager] Modernize Server to ES6 2015-08-14 12:34:23 -08:00
Martín Bigio
76e37c4423 [react-packager] Modernize Server-test by using ES6 features 2015-08-14 12:23:02 -08:00
Amjad Masad
309326db2e [react-packager] Rename 'Package' to 'Bundle'
Summary:
The word Package is overloaded, it may mean npm package, or may mean a collection of bundles. Neither is what we mean. We mean `bundle`.

This renames it and modernize some of the Bundler code.
2015-08-12 12:09:01 -08:00
Martín Bigio
aefdf82cdc [JSAppServer] Don't keep track of not found packages 2015-08-06 11:34:56 -08:00
James Ide
53222f0dda [Packager] Include Content-Type headers with bundle and source maps
Summary:
The packager did not send back the Content-Type headers. Adding these.

Closes https://github.com/facebook/react-native/pull/2029
Github Author: James Ide <ide@jameside.com>
2015-07-24 18:46:17 -08:00
Forbes Lindesay
fccea2f365 Replace bluebird with promise 2015-06-22 08:44:03 -08:00
Bill Fisher
5aee4cec98 [ReactNative][easy] fix server 500 response typo
Summary:
@public
corrected small typo in the 500 response from the packager server

Test Plan: add throw to promise function prior to error handler, run packager, cache a bundle with bundle extension URI, open /debug/packages, see clean 500 error
2015-06-20 16:43:18 -08:00
Amjad Masad
0fec355076 [react-packager] Cache based on options, not url
Summary:
@public

We cached based on url, which wasn't unique becuase some options would be defaulted. This was obvious when starting the server via fbrnios which tries to warmup the bundle.
And then when the device woke up it will send a request (that is identical in reality) but would miss the cache.

This changes the cache key into a JSON stringification of the options.

Test Plan:
* ./runJestTests.sh
* ./fbrnios.sh run
2015-06-19 15:14:31 -08:00
Amjad Masad
82a082a794 [react-packager] Introduce buildPackage API 2015-05-22 17:28:27 -08:00
Amjad Masad
9a76f224af [react-packager] Add first class support to popular image formats
Summary:
@public
1. Default to first class support of popular image formats
2. Add tests to make sure we support other than png

Test Plan:
1. ./runJestTests.sh
2. Add test.png and test.jpg images in the Playground app dir
3. require both images and render then in the playground app
4. they render
2015-05-20 15:28:29 -08:00
Nick Lockwood
6b2c88feec decode pathName when extracting from url 2015-05-13 13:24:36 -07:00
Amjad Masad
b4c82a4089 [react-packager] Additional data to asset modules 2015-04-22 10:59:37 -08:00
Amjad Masad
77d908b975 [react-packager] Allow json files as modules 2015-04-21 10:51:15 -08:00
Amjad Masad
2975f26e80 [react-packager] Add asset extensions to file watch glob in the project root 2015-04-17 09:03:41 -08:00
Tadeu Zagallo
1883ba535c [ReactNative] Send batched calls from objc to js every frame + add bridge profiling 2015-04-17 04:01:02 -08:00
Amjad Masad
fb7036eaac [react-packager] implement /assets endpoint to serve assets 2015-04-16 13:00:48 -08:00
Spencer Ahrens
a1ec752019 [ReactNative] Do flow check when running packager 2015-04-07 21:40:05 -08:00
Pilwon Huh
87599bfcd1 [react-packager] Switch from Q to Bluebird as promises library
Summary:
This PR improves performance of `react-packager` by switching the promises library from the [Q](https://github.com/kriskowal/q) to [Bluebird](https://github.com/petkaantonov/bluebird).

[Here is the test result](https://github.com/facebook/react-native/issues/361#issuecomment-87829808) showing a noticeable difference. (2x speed improvement)

Please refer to [this issue](https://github.com/facebook/react-native/issues/361) for more details.
Closes https://github.com/facebook/react-native/pull/516
Github Author: Pilwon Huh <pilwon@gmail.com>

Test Plan:
./runJestTests
start app and click around
2015-03-31 21:24:13 -08:00
Amjad Masad
a925082d2e [react-packager] Watch asset roots for changes to update dependency graph 2015-03-27 09:18:00 -08:00
Amjad Masad
39fe5ec266 [react-packager] Fix node v0.11.14 query parse bug 2015-03-26 14:33:33 -08:00
Amjad Masad
031adabd18 [react-packager] better error when main file not found 2015-03-26 10:38:50 -08:00
Amjad Masad
909e393f26 [react-packager] kill non-standard RAW_SOURCE_MAP 2015-03-24 17:17:02 -08:00
Amjad Masad
bc921916ed [react-packager] Fix regression with transform errors 2015-03-23 18:55:36 -08:00
Christopher Chedeau
f67a36733f [ReactNative] Expanded license on js packager files 2015-03-23 11:28:51 -08:00
Amjad Masad
a6b154332b [react-packager] Pick up package changes while running 2015-03-23 11:15:52 -08:00
Amjad Masad
ce6354604c [react-packager] Allow entry point extensions like .ios.js 2015-03-20 17:24:51 -08:00
Amjad Masad
115ad71831 [react-packager] Fix OOM 2015-03-19 11:50:27 -08:00
Amjad Masad
9249545047 [react-packager] Implement image loading i.e. ix('img') -> require('image!img'); 2015-03-13 16:10:58 -08:00
Amjad Masad
c99284bfdf [react-packager] onchange endpoint that informs of changes 2015-03-06 15:28:32 -08:00
Amjad Masad
b9207a3095 [react-packager] dev option needs to default to true for backwards compat 2015-03-06 14:45:23 -08:00
Amjad Masad
ab2537816f [react-packager] Add minify option as query param 2015-03-05 12:12:42 -08:00
Amjad Masad
78d03b89b7 [react-packager] Make dev a query param option 2015-03-04 21:24:08 -08:00
Amjad Masad
4f2c336ac3 [react-packager] Start converting options to query params 2015-03-04 19:06:51 -08:00
Amjad Masad
ab43dd9813 [react-packager] check-in node_modules and update tests 2015-03-03 02:02:51 -08:00
James Ide
e5d86aeb5b [react-packager] Add dev option to CLI | James Ide
Summary:
Exposes the dev option that is already there to the CLI so that you can turn off invariant checks, etc. I also made it omit the inlined source map when dev=false which made it a lot faster to run on a phone, both due to smaller download size and fewer bytes to copy from Obj-C to JS and evaluate.
Closes https://github.com/facebook/react-native/pull/112
Github Author: James Ide <ide@jameside.com>

Test Plan:
* ./runJestTests.sh
* test bundle creation with `bundle.sh`
* test `load_dependencies.js` script
* start the server and click around shell app
2015-03-02 21:11:07 -08:00
Amjad Masad
a9c8b13e6e [React Native][react-packager] Fix test runner and fialing tests 2015-02-28 14:55:00 -08:00
Amjad Masad
68fcfc3050 [react-packager] transformModulePath option is not actually required 2015-02-27 10:51:07 -08:00
Amjad Masad
96312af117 [react-packager] Fix lint errors 2015-02-25 20:29:42 -08:00
Amjad Masad
f426ec8d7d [react-packager] Cleanup option passing and validation 2015-02-24 15:17:40 -08:00
Spencer Ahrens
efae175a8e [react-packager][streamline oss] Move open sourced JS source to react-native-github 2015-02-19 21:25:11 -08:00