Commit Graph

1203 Commits

Author SHA1 Message Date
cpojer c27751d4c3 Update package.json 2017-02-23 16:38:25 +00:00
cpojer 294850f364 Add spread transform. 2017-02-23 16:16:00 +00:00
Jean Lauliac a8570b6b98 packager: node-haste: do not expose HasteMap
Reviewed By: davidaurelio

Differential Revision: D4598085

fbshipit-source-id: d993be8e3bdcfda018a898b4adb32b53c1f0a948
2017-02-23 03:36:28 -08:00
David Aurelio 6fa8dedfb5 Discard protocol, host, and port of URLs in bundle options
Summary:
HTTP request URLs don’t include protocol, host and port. Stack frames URLs, on the other hand, contain full URLs. These full URLs are used to get the correct bundle to build the source map from.

The method that creates option objects from URLs therefore now discards leading protocol, host and port to ensure that cached bundles can be reused for symbolication rather than triggering rebuilds.

Reviewed By: jeanlauliac, cpojer

Differential Revision: D4598077

fbshipit-source-id: 262df187bcdf7099011371e8b55ae692c6e1a942
2017-02-23 02:37:25 -08:00
Christoph Pojer 7e8ab0d237 Add dependencies to package.json
Summary:
I extracted all the dependencies (using jest-haste-map) and copied them from the package.json in react-native to RNP. There is some duplication here for now but we can later go back and remove the duplicated dependencies from react-native that aren't needed there.

I also removed a mock file that hasn't been in use for a long time.

Reviewed By: jeanlauliac

Differential Revision: D4598155

fbshipit-source-id: 850b6dfa6fc2eec138ebdd7208cd34bee21f7927
2017-02-23 01:07:28 -08:00
cpojer 2a65cc1963 Revert package.json for now. 2017-02-23 08:59:36 +00:00
Jean Lauliac b1e07180c6 packager: cleanup node-haste/index.js opts
Reviewed By: cpojer

Differential Revision: D4591599

fbshipit-source-id: d1906b0b9a80f173f2a07174304dabe30985a5bc
2017-02-22 04:05:47 -08:00
Jean Lauliac ec51314fc8 GlobalTransformCache: increase timeout
Reviewed By: davidaurelio

Differential Revision: D4589052

fbshipit-source-id: 7eaec58a196db7f89b3039afbda4620889c9bcef
2017-02-20 10:55:49 -08:00
Jean Lauliac 243d0694ff packager: BatchProcessor: use Promise for processBatch()
Reviewed By: cpojer

Differential Revision: D4572495

fbshipit-source-id: 4a18b6ae16ea588104c337f2085707be07609005
2017-02-20 08:37:40 -08:00
Jean Lauliac 46d5c2f517 packager: BatchProcessor: use Promise for queue()
Reviewed By: cpojer

Differential Revision: D4572181

fbshipit-source-id: 34c3824f05efd93847df9ba5931b0735c6711c28
2017-02-20 08:37:40 -08:00
Jean Lauliac 306bf14d4a packager: introducing async/await, return of the yarn
Summary:
The first time I tried to commit this changeset, it was causing many new packages to be installed, because the dependency would depend on newer versions that what we have installed. So, I had made a diff so upgrade all the babel packages. Unfortunately this caused some problem as the newer versions of Babel are more strict on some syntaxes. Of course, these have to be addressed, but I don't want this changeset to be coupled with Babel upgrades and the issues that arise from it.

So instead, I decided to install the slightly older version of the async-to-generator module. At first I tried with just doing:

    yarn add babel-plugin-transform-async-to-generator@6.16.0

But, `yarn` is stubborn: because this module depends on a caret version of `babel-helper-remap-async-to-generator`, it installs the very last version of it, that itself needs more recent versions of other Babel modules. So, instead, I add to install a slightly older version of the dependency manually, then then the plugin:

    yarn add babel-helper-remap-async-to-generator@6.16.0
    yarn add babel-plugin-transform-async-to-generator@6.16.0

This allows us to have a `yarn.lock` with only a minimal amount of changes, and uncouple this change from any Babel upgrades. Because we only have a few new modules, the `node_modules` folder also stays the same, 133M, and it gives us confidence this will not cause significant startup time regressions.

Reviewed By: cpojer

Differential Revision: D4578733

fbshipit-source-id: deb0f720b895b7196aaf432adec3e56f18663940
2017-02-20 08:37:40 -08:00
Jean Lauliac 7b02a9ae7d Revert D4559167: packager: introducing async/await
Differential Revision: D4559167

fbshipit-source-id: de887a737ad1d02ef07a431ee0713d0bad65eb85
2017-02-16 11:07:25 -08:00
Jean Lauliac 0ea19a62d7 packager: introducing async/await
Summary:
allow-large-files

By using async/await the code is (1) less nested, (2) more compact and (3) more robust (no exceptions running away, and much less risks of forgetting to call the callback/resolve, or mistakenly calling it twice). I now tend to think we could switch to it for all the callsites that are not in a perf-critical path.

I switched from 'request' to 'node-fetch' because 'request' has an annoying callback with 2 arguments. So it's simpler to use an interface that's (1) already returning a Promise and (2) that is becoming standard.

This changeset was a way for me to start experiment with introducing async/await in packager codebase, and it looks pretty good so far.

Reviewed By: cpojer

Differential Revision: D4559167

fbshipit-source-id: 89a328c5766c2ba890e9d0e67a81a38dac6cfc73
2017-02-15 13:51:41 -08:00
Jean Lauliac 96a7d25bdf packager: JSONReporter: expose errors correctly
Reviewed By: cpojer

Differential Revision: D4536721

fbshipit-source-id: d8969a42e844da809bd167cbc1bae2cb11f1db57
2017-02-10 09:37:03 -08:00
Jean Lauliac 7b301aa3a4 packager: cleanup build status reporting
Reviewed By: cpojer

Differential Revision: D4521560

fbshipit-source-id: 8943e179192522da5145e4f14f0b648d3548cc36
2017-02-09 04:26:15 -08:00
Christoph Pojer 78ae767123 Change `transformCacheKey` to `getTransformCacheKey`
Reviewed By: jeanlauliac

Differential Revision: D4506459

fbshipit-source-id: cd42cb4f09c0130d08c27e3a097710b91c5dc6ba
2017-02-09 04:06:08 -08:00
Christoph Pojer 2517d18535 Remove baseTransformer
Reviewed By: jeanlauliac

Differential Revision: D4506124

fbshipit-source-id: 642f06dffe4ea710113e8e8426915bf1b40d4611
2017-02-09 04:06:08 -08:00
Jhen 5f99af011a Fix resolveNodeDependency for Windows
Summary:
Related to https://github.com/zalmoxisus/remote-redux-devtools/issues/62, we got the wrong resolved path on Windows, should use `path.sep` instead of `'/'`.
Closes https://github.com/facebook/react-native/pull/12206

Differential Revision: D4513338

fbshipit-source-id: 17814920986d091a6c6deae648f951f7be1cb688
2017-02-07 12:36:14 -08:00
Alexey Kureev a317b9da6c Add default option for Platform.select
Summary:
satya164 asked me to take over fixes for [this PR](https://github.com/facebook/react-native/pull/11608), so here we go!
Closes https://github.com/facebook/react-native/pull/12218

Differential Revision: D4515285

Pulled By: davidaurelio

fbshipit-source-id: 8987c518401fc67093dfe93bbbb63b934c20f6f9
2017-02-07 04:38:53 -08:00
Jean Lauliac 23d2a66cb1 packager: fix uncaught rejection
Summary: I figured out that the uncaught rejection that happens on transform error originated from a "fork" along the chain, where we both "then" on a promise, and return that promise. In that case Node.js, legitimately I think, identifies this as an uncaught rejection case. One solution, in this changeset, is to do the side-effects as part of the promise chain instead of "forking". Another option would be to add an explicit error handler to the additional "then", but it seems we don't have to handle that case here.

Reviewed By: davidaurelio

Differential Revision: D4515592

fbshipit-source-id: 17d813cfdbc76685b6273b8d94e97d948fd68674
2017-02-06 11:07:00 -08:00
Bhuwan Khattar 3f202920e2 refactor Module.js
Reviewed By: davidaurelio

Differential Revision: D4507868

fbshipit-source-id: 8b845bf8a484f494af1900eaf36454a8f3f78a9f
2017-02-06 08:19:07 -08:00
Bhuwan Khattar 2939e942fa Random @providesModule related fixes
Reviewed By: jeanlauliac

Differential Revision: D4507885

fbshipit-source-id: 34d1a7be26febf7d93b65ba8fff635ab44e6459d
2017-02-06 08:04:36 -08:00
Jean Lauliac e04b3bf52e packager: reestablish changes reverted by d63f9c
Reviewed By: cpojer

Differential Revision: D4514889

fbshipit-source-id: de5d1350cbcea7a26395e532fefd78a816167b4a
2017-02-06 07:04:10 -08:00
Bhuwan Khattar 310c5d4163 Replace @provides with @providesModule
Reviewed By: davidaurelio

Differential Revision: D4494624

fbshipit-source-id: 192cc77126a99b3a3baeb806ed605c2194c4713a
2017-02-02 09:04:07 -08:00
Christoph Pojer 09797f281b Remove `react-packager` indirection.
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
2017-02-02 05:34:12 -08:00
Jean Lauliac e1a131eb08 packager: JSTransform cleanup: remove options object
Summary: We can simplify as there's only one option, and it seems to me we can also make it required, as otherwise the `JSTransformer` is essentially doing nothing. I don't believe we still have use cases where no transform happens at all, even in OSS?

Reviewed By: davidaurelio

Differential Revision: D4481723

fbshipit-source-id: b2e3830b206d56242d298ff3a7b5f4587ecfd29a
2017-01-31 05:27:06 -08:00
Jean Lauliac 16fd44b3c0 packager: JSTransform cleanup: remove opts.methods
Summary: It's not used from any callsite as far as I can see.

Reviewed By: davidaurelio

Differential Revision: D4481708

fbshipit-source-id: 2c503fb7ef20f9370a950c315832f3ace4709739
2017-01-31 04:49:44 -08:00
Jean Lauliac 485dcb1e79 packager: JSTransform cleanup: remove opts.worker
Summary: it's not used from any callsite as far as I can see.

Reviewed By: davidaurelio

Differential Revision: D4481699

fbshipit-source-id: 4cf63ef7953d6cfc58e7ef4f22ecb99bf51e76a0
2017-01-31 04:49:43 -08:00
Jean Lauliac fd5933b63d packager: JSTransform cleanup: remove transformTimeoutInterval
Summary: It's not used in any callsite.

Reviewed By: cpojer

Differential Revision: D4481683

fbshipit-source-id: 3fa55693f5f56b4fb6c455ad77d7780f69be81a9
2017-01-31 04:49:43 -08:00
Jean Lauliac 0ebea9b5b5 packager: json reporter
Summary: The idea is to make it easier to interact with tools consuming the packager's output. For example, Nuclide. Do you think that'd work well?

Reviewed By: davidaurelio

Differential Revision: D4482041

fbshipit-source-id: 6c64d7963195a4d786ed8902640f9e9f279f5f83
2017-01-31 04:49:43 -08:00
Jean Lauliac 9577837f99 packager: simplify ScribeLogger-test
Reviewed By: cpojer

Differential Revision: D4481570

fbshipit-source-id: 27beae850806d8d7f526a3196b2962a18e514007
2017-01-31 04:49:43 -08:00
Jean Lauliac 00940db5d5 packager: add utilities to log errors internally
Reviewed By: davidaurelio

Differential Revision: D4468471

fbshipit-source-id: 10deb5014d06e4d3bb9d3122eef362c09f74d044
2017-01-31 04:49:43 -08:00
Jean Lauliac 94f1c6b34a packager: backticks for module names
Reviewed By: cpojer

Differential Revision: D4468850

fbshipit-source-id: 281064a81ff1262094711f4e800effcd17fb7e4d
2017-01-26 11:30:18 -08:00
Jean Lauliac 7883debebc packager: remove rogue terminal.log()
Reviewed By: cpojer

Differential Revision: D4468825

fbshipit-source-id: 29320f50cabc6002401e470a9ac278e9cb6673d3
2017-01-26 11:30:18 -08:00
Jean Lauliac ec5cd2a59a packager: add BatchProcessor-test
Reviewed By: davidaurelio

Differential Revision: D4468735

fbshipit-source-id: 8d20b44ef20aa24e72cd53182dbc34139a10df41
2017-01-26 11:30:18 -08:00
cpojer a35016bd49 Merge branch 'master' of ../react-native 2017-01-26 13:33:56 +00:00
cpojer 3f0b26916e Move 2017-01-26 13:31:04 +00:00
cpojer f8eda9b735 Initial repository structure. 2017-01-26 12:56:40 +00:00
Jean Lauliac c227d162ef packager: server/runServer.js: @flow
Reviewed By: davidaurelio

Differential Revision: D4462611

fbshipit-source-id: 22f4cc299e2a30fe260dbe8d4c67323ceb8178e8
2017-01-26 03:43:33 -08:00
Jean Lauliac 735e50efc4 packager: server/server.js: @flow
Reviewed By: davidaurelio

Differential Revision: D4462520

fbshipit-source-id: dc08aef691a78acb571a4da8038343184019d09f
2017-01-26 03:43:33 -08:00
Jean Lauliac 30f915e818 Backed out changeset 35b573bece59
Reviewed By: davidaurelio

Differential Revision: D4461681

fbshipit-source-id: f5c45f713f2fe68443986a2822aa325b01dd5075
2017-01-26 03:43:33 -08:00
Liu Zhanhong 795c1d5148 Sync with Resolver/polyfills/require.js
Summary:
I don't know which version is better, but it should sync with `Resolver/polyfills/require.js: 168`
```js
    // keep args in sync with with defineModuleCode in
    // packager/react-packager/src/Resolver/index.js
    // and packager/react-packager/src/ModuleGraph/worker.js
    factory(global, require, moduleObject, exports, dependencyMap);
```
Closes https://github.com/facebook/react-native/pull/12033

Differential Revision: D4461635

Pulled By: davidaurelio

fbshipit-source-id: 1a17e6cbac5525dc09609b658bef82a23574b00c
2017-01-25 03:58:30 -08:00
Jing Chen cbc808dc86 Revert stacked revisions on packager that causes packager to instacrash
Reviewed By: fkgozali, bestander

Differential Revision: D4456911

fbshipit-source-id: 35b573bece59c59c0700ef2d8ab26c0b7150d3cf
2017-01-24 11:43:36 -08:00
David Aurelio f6e068bcf0 Add tests for source map generator
Summary: This adds test for our high-perf source map generator.

Reviewed By: cpojer

Differential Revision: D4455547

fbshipit-source-id: 293bfe09c9c020259ae3daa4fa52f829248cca3c
2017-01-24 08:58:42 -08:00
Jean Lauliac 7eef41bc00 packager: extract BatchProcessor module
Reviewed By: davidaurelio

Differential Revision: D4449820

fbshipit-source-id: f54e6dd53ba4d211694e0bdc955af846d25778b8
2017-01-24 03:43:36 -08:00
Jean Lauliac 83ed3acc58 packager: move error handling from Module to GlobalTransformCache
Reviewed By: davidaurelio

Differential Revision: D4449685

fbshipit-source-id: 4f57cfe132036f476e36933bd2ffcb9f23c42ccc
2017-01-24 03:43:36 -08:00
Jean Lauliac 3a98e93069 packager: GlobalTransformCache: remove global variable
Reviewed By: davidaurelio

Differential Revision: D4449333

fbshipit-source-id: b9546b90d2fd5ddca9c1ee2719c6c454b60bdfa4
2017-01-24 03:43:36 -08:00
David Aurelio d728fa4ec1 add tests
Summary: Tests for things introduced over the last 10 weeks

Reviewed By: cpojer

Differential Revision: D4442404

fbshipit-source-id: cf7a14f237360fde083b7e2ffcd9d70aafd0ced6
2017-01-23 03:58:24 -08:00
Radek Czemerys 673b1713f3 Fix typo in ResolutionRequest.js
Summary:
Small fix:
Fix typo in error message - should be `npm start --reset-cache`
Closes https://github.com/facebook/react-native/pull/11983

Reviewed By: AsyncDBConnMarkedDownDBException

Differential Revision: D4443749

Pulled By: hramos

fbshipit-source-id: eeaa531180c58a85df482fe3162b2a0b2169c891
2017-01-20 17:43:27 -08:00
David Aurelio a9a2ac3d17 amend babel definitions to allow inline plugins without configuration
Summary: Updates babel flow defs to allow for inline plugins without configuration arguments.

Reviewed By: jeanlauliac

Differential Revision: D4442217

fbshipit-source-id: 1b4392bf13977d97984c72cff65b28e62f602300
2017-01-20 10:43:29 -08:00