Commit Graph

20 Commits

Author SHA1 Message Date
Jean Lauliac b96d886982 metro-bundler: upgrade jest-haste-map
Reviewed By: cpojer

Differential Revision: D5346860

fbshipit-source-id: 16e9eeeb28804af81428745fda4ffc05a461845c
2017-06-29 08:36:14 -07:00
David Aurelio 429c1e8032 Use `jest-docblock`
Summary:
Remove our internal docbloc module and use `jest-docblock` instead.

The development server is using `jest-haste-map` exclusively, which in turn relies on `jest-docblock`, which differs slightly from our own docblock module.

Depending on only one version greatly reduces the number of edge cases

Reviewed By: cpojer

Differential Revision: D5328472

fbshipit-source-id: 4a31d8159519e01a83fda04b76e8f14f0beb16af
2017-06-27 03:51:37 -07:00
David Aurelio b62669e2da Publish v0.9.0
Reviewed By: bestander

Differential Revision: D5310936

fbshipit-source-id: a4d1b5f273c3fd6ba631834175d7e37e8589ef16
2017-06-23 13:07:43 -07:00
David Aurelio 08699062d5 npm package has `src/` rather than `build/`
Summary:
We use custom npm scripts (`prepare-release`, `cleanup-release`) to

- move `src` to `src.orig`, and `build` to `src` before creating the tarball
- move everything back afterwards

We run these scripts with lerna before and after publishing. Custom hooks avoid problems with `prepublishOnly` and `postpublish` not being run at opportune times, `prepack` and `postpack` not being supported by npm v4 and yarn, and using `lerna run prepublishOnly` resulting in duplicated execution of the command.

This ensures that development is closer to what is pulled in from npm.

Reviewed By: jeanlauliac

Differential Revision: D5310133

fbshipit-source-id: 6b9885c88b936ef3fe5f1858738ad63d581a8731
2017-06-23 09:06:33 -07:00
David Aurelio 1e6b34f415 Backed out changeset db8638eebe2d
Reviewed By: alexeylang

Differential Revision: D5246311

fbshipit-source-id: cb12964c27a6d1e6fa719a979a8f0ebcc8efae8a
2017-06-14 09:53:06 -07:00
Christoph Pojer 9127fce33c Add --maxWorkers flag and allow transformers to run in-band.
Summary:
This diff cleans up some cruft and adds some features:

* It removes the usage of an env variable to control workers.
* It removes the lazy and handwavy calculation on how many workers to use for jest-haste-map. Jest itself uses the maximum amount of workers available and it has never been reported as an issue – especially since it is a one-time startup cost of about 3 seconds on a cold cache only.
* It adds a `--max-workers` flag to replace the env variable. This one is able to control both the number of workers for `jest-haste-map` as well as the transformers.
* It makes the transformers run in the parent process if 1 or fewer workers are are specified. This should help with debugging.

Once you approve this diff, I will publish a new version of metro to npm and update the version used in RN and remove the use of the env variable altogether: https://our.intern.facebook.com/intern/biggrep/?corpus=xplat&filename=&case=false&view=default&extre=&s=REACT_NATIVE_MAX_WORKERS&engine=apr_strmatch&context=false&filter[uninteresting]=false&filter[intern]=false&filter[test]=false&grep_regex=

Note: the process of adding a CLI option is really broken. Commander also has a weird API. We should consider building a better public API for Metro and then consider how to build a new CLI on top of it and simplify our internal integration. I really don't like how Metro is integrated across pieces of the RN cli in ways that is hard to manage. But that is a larger task for another time :)

Reviewed By: jeanlauliac

Differential Revision: D5217726

fbshipit-source-id: 74efddbb87755a9e744c816fbc62efa21f6a79bf
2017-06-13 09:21:40 -07:00
David Aurelio 573d9edfd0 Upgrade uglify to v3 + es support
Summary: Upgrades uglify to version 3 with (experimental) ES6 support turned on.

Reviewed By: cpojer

Differential Revision: D5227245

fbshipit-source-id: db8638eebe2daf40b60570cac34905e9a7288705
2017-06-12 10:11:20 -07:00
Christoph Pojer ef7965df63 Update package.json
Reviewed By: jeanlauliac

Differential Revision: D5183469

fbshipit-source-id: 89c17c80398afb7755d8e7dec5116e62fbbc520e
2017-06-06 12:37:37 -07:00
Christoph Pojer 921005d44d Move remaining Metro Bundler files around.
Reviewed By: jeanlauliac

Differential Revision: D5154653

fbshipit-source-id: 482bf9829263d5d8f3d0b951ee58e2020236cc2c
2017-05-31 11:08:01 -07:00
Jean Lauliac f0ee61c438 packager: upgrade jest-haste-map version
Summary: This allows us to get the new fix for recovery on duplicate modules.

Reviewed By: cpojer

Differential Revision: D5128975

fbshipit-source-id: 5a2b60430bbca1806a97798c482af8522366e071
2017-05-25 05:07:05 -07:00
Jean Lauliac 20d7a7cdc8 packager: add missing dep
Reviewed By: davidaurelio

Differential Revision: D5111613

fbshipit-source-id: bf3b574e6166601d52127540e7970839d7019b6c
2017-05-23 09:26:05 -07:00
Christoph Pojer 8e8daabf3f Update package.json
Reviewed By: jeanlauliac

Differential Revision: D5103378

fbshipit-source-id: 64acdc767372a166460859ffba729710d5bf4b80
2017-05-22 07:52:44 -07:00
David Aurelio b5b443f2a5 Pass local paths to transformers
Summary:
Pass `localPath` to transformers to allow usage of plugins like `transform-react-jsx-source` that don’t conflict with x-machine caches, e.g. Buck or our own global cache.
These caches don’t work properly if paths local to a specific machine are part of cached outputs.

Reviewed By: jeanlauliac

Differential Revision: D5044147

fbshipit-source-id: 1177afb48d6dd9351738fcd4da8f9f6357e25e81
2017-05-11 16:51:38 -07:00
David Aurelio 797a07ccc2 BREAKING: Pass parameters to `transformer.transform` as object
Reviewed By: jeanlauliac

Differential Revision: D5037155

fbshipit-source-id: fbd18bd62254d7e1522f659ea62055e66748a951
2017-05-11 08:38:05 -07:00
Brent Vatne e3daf33ed8 Lock version to 2.7.5 to avoid breakage like #12772
Summary:
As per uglify-js maintainer kzc's comment in https://github.com/mishoo/UglifyJS2/issues/1573#issuecomment-284940371 we should be locking our version to prevent issues like #12772 from happening again.

No test plan needed, people are already using this version of uglify-js (it's the latest).
Closes https://github.com/facebook/react-native/pull/12802

Differential Revision: D4749853

Pulled By: javache

fbshipit-source-id: 866a19cb2c1add31b55e14d0f4dadb7f68fda64c
2017-03-22 05:53:50 -07:00
David Aurelio f19e5215cf Allow flow-declared variables when inlining
Summary: The logic of the `inline` babel transform regarded identifiers as global if no binding exists for them. We extend that logic to also accept flow-declared variables.

Reviewed By: arcanis

Differential Revision: D4737620

fbshipit-source-id: e71cfdf77c7b7751265cfa4412430b4f29e9e853
2017-03-20 08:09:09 -07:00
David Aurelio d7dbcfc478 Symbolicate stack traces off the main process
Summary:
Moves stack trace symbolication to a worker process.

The worker process is spawned laziliy, and is treated as an exclusive resource (requests are queued).

This helps keeping the server process responsive when symbolicating.

Reviewed By: cpojer

Differential Revision: D4602722

fbshipit-source-id: 5da97e53afd9a1ab981c5ba4b02a7d1d869dee71
2017-02-27 10:52:57 -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
cpojer f8eda9b735 Initial repository structure. 2017-01-26 12:56:40 +00:00