Commit Graph

1956 Commits

Author SHA1 Message Date
Peter van der Zee 9ca07d83c5 Fix some babel types that did not exist
Reviewed By: davidaurelio

Differential Revision: D7288340

fbshipit-source-id: 477b95e8dc543e643b823a55e9d7157e2a5bf18a
2018-03-15 09:40:54 -07:00
Peter van der Zee 9185eeb04b Refactoring resolvePlugin out
Reviewed By: BYK

Differential Revision: D7257553

fbshipit-source-id: 1abffa3606f1d342a571d7b22ee34272a995bf9f
2018-03-15 07:00:02 -07:00
Peter van der Zee df9e523900 babylon7 -> metro-babylon7 and drop the alias
Reviewed By: arcanis

Differential Revision: D7194524

fbshipit-source-id: 85b11b7319c6e0985b166ba9ce990a2581ff1dd2
2018-03-15 05:51:56 -07:00
Burak Yigit Kaya 7c4b7da523 Fix flaky Transformer test
Reviewed By: rafeca

Differential Revision: D7279027

fbshipit-source-id: 2e2be997259eae3fcb2b6a3a74ad22e1daa218d9
2018-03-15 05:51:56 -07:00
Jean Lauliac 43ab7ab811 metro-memory-fs: clean up createWriteStream()
Reviewed By: rafeca

Differential Revision: D7257022

fbshipit-source-id: 30598f2dd24a66bf07d75133ca10fb6b9082010a
2018-03-14 09:29:45 -07:00
Rafael Oleza 167117fe36 Bump metro@0.30.1
Reviewed By: BYK

Differential Revision: D7259632

fbshipit-source-id: ef713d35a953cd829d6a8684d2fa9cfa30e69ac4
2018-03-14 09:08:31 -07:00
Rafael Oleza 233b00e836 Handle correctly multiple requires to the same file with different forms
Summary:
The traverse dependencies logic was using the absolute path of the resolved dependency to group the module dependencies, so for example if there's a module like:

```
const a = require('./a');
const a1 = require('./a.js');
```

The traversal dependencies logic was just outputting a single dependency for that module.

Since we're transforming each `require()` call to replace the relative path by a dependencyMap, the code from above was transformed to:

```
const a = require(_dependencyMap[0]);
const a1 = require(_dependencyMap[1]);
```

But since the traverse dependencies logic could only find a single dependency, `_dependencyMap[1]` was undefined, causing a runtime error.

This fixes https://github.com/facebook/metro/issues/152 (more info in the task)

Reviewed By: jeanlauliac

Differential Revision: D7258093

fbshipit-source-id: 65c42b87e589430ecc96b906230dd7c4c55c2146
2018-03-14 09:08:27 -07:00
Rafael Oleza 6a587db117 Allow to configure the name of the require in the traverseDependency tests
Reviewed By: jeanlauliac

Differential Revision: D7258095

fbshipit-source-id: 3cf11148ed58ba0b8802513db0731787a4d83773
2018-03-14 09:08:22 -07:00
Miguel Jimenez Esun cf5a431388 Use a single file delimited with null characters
Reviewed By: rafeca

Differential Revision: D7232425

fbshipit-source-id: c51387b94cd990ed3ba9be5c82b14c2a7773c7e7
2018-03-13 07:09:17 -07:00
Miguel Jimenez Esun 601f718dd6 Make a common hash of all the bundler information
Reviewed By: davidaurelio

Differential Revision: D7196792

fbshipit-source-id: dc1e0b399d1d5ff9c0956facd69be4279cc4f5c3
2018-03-12 03:53:41 -07:00
Rafael Oleza b8d20a089c Fix the npm publishing workflow from circleCI
Reviewed By: mjesun

Differential Revision: D7229135

fbshipit-source-id: 7065d70c66c0cc1f4e8c18e93f5439e477c0d680
2018-03-12 03:53:40 -07:00
Jean Lauliac f518bf9fd1 ignore build artifacts
Summary:
When running `yarn` it compiles all the packages files into `build` folders. We should probably ignore this to avoid them ending up checked-in on the repo.
Closes https://github.com/facebook/metro/pull/149

Reviewed By: rafeca

Differential Revision: D7229013

Pulled By: jeanlauliac

fbshipit-source-id: fbbc478fa1cda78231620e2ff0fa8e02539f30ed
2018-03-12 03:53:38 -07:00
wtgtybhertgeghgtwtg e985b6e6ec Remove `request`.
Summary:
<!-- Thanks for submitting a pull request! Please provide enough information so that others can review your pull request. The two fields below are mandatory. -->

**Summary**
Remove `request` from `metro`.  It doesn't seem to be used.
<!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? -->

**Test plan**
Everything works as it did before.
<!-- Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI. -->
Closes https://github.com/facebook/metro/pull/151

Differential Revision: D7226502

Pulled By: rafeca

fbshipit-source-id: fc353292ba55ea9f98eba67f05f8f8f82794dd82
2018-03-10 13:14:03 -08:00
Nat Mote ded999bc75 Upgrade to Flow v0.67
Reviewed By: gabelevi

Differential Revision: D7208080

fbshipit-source-id: 81380aca39b7a74646a4a44af1e5571bc5629b77
2018-03-09 20:38:38 -08:00
Rafael Oleza ee497c61b6 Bump metro@0.30.0
Reviewed By: BYK

Differential Revision: D7214924

fbshipit-source-id: 4f50ec27e2dceb18e9ef82e741675df295235d74
2018-03-09 16:53:58 -08:00
Rafael Oleza 13f9ea7d3a Completely clean the bundler once a client gets disconnected
Reviewed By: BYK

Differential Revision: D7211827

fbshipit-source-id: 4490d2f520b24595a1d5833b69ecca3e408ba3c5
2018-03-09 16:53:58 -08:00
Rafael Oleza c26a68e5c7 Pass the added modules to the client before the modified ones through HMR
Reviewed By: davidaurelio

Differential Revision: D7206085

fbshipit-source-id: 055dc4f90950c46845b49249106cda64c4bd4f6e
2018-03-09 16:53:58 -08:00
Jean Lauliac d9e3d21922 metro-memory-fs: fix createWriteStream autoClose behavior
Summary:
In Node v6 there is no `final` function: https://nodejs.org/docs/v6.13.1/api/stream.html#stream_simplified_construction.

It's not a problem however because we can preferentially use the `finish` event, that makes it more consistent with how `createReadStream` is implemented. I also added closing the fs on `error` events, as specified in the docs.

**Test plan**

    yarn jest
Closes https://github.com/facebook/metro/pull/150

Reviewed By: rafeca

Differential Revision: D7215708

Pulled By: jeanlauliac

fbshipit-source-id: 80921a245c8c87085a2ba83b84b1156a60aa1fb3
2018-03-09 13:37:44 -08:00
Jean Lauliac de35a73798 metro: collapse name verification into getHasteName()
Reviewed By: rafeca, mjesun

Differential Revision: D7196246

fbshipit-source-id: 425573f61148ac3a4e85bbcf4fb1033f3e560dab
2018-03-09 10:45:20 -08:00
Peter van der Zee 091815ea81 Minor refactor moving a line
Reviewed By: rafeca

Differential Revision: D7180929

fbshipit-source-id: 94dd062ffd05f22e67c7d913f6d6e04c24a4c8ec
2018-03-08 05:01:29 -08:00
Miguel Jimenez Esun a4c417a1c5 Fine-tune adjustments to experimental caches
Reviewed By: jeanlauliac

Differential Revision: D7185544

fbshipit-source-id: b4b6c363910a80f906260afe49a72d476609ae14
2018-03-08 04:35:11 -08:00
Rafael Oleza 8fd56bf2e5 Bump metro@0.29.0
Reviewed By: BYK

Differential Revision: D7181876

fbshipit-source-id: a1b567303b8024b832bf43dd6be56ccebffaf39c
2018-03-07 15:00:27 -08:00
Miguel Jimenez Esun aaedb99ac4 Get rid of unused methods
Reviewed By: davidaurelio

Differential Revision: D7169707

fbshipit-source-id: 8b29791e15631a3ee4674a6cb5046e675c2c3727
2018-03-07 07:03:44 -08:00
Peter van der Zee 243fe983b7 Improve Flow typing for @babel/template
Summary:
The current typing is incorrectly marking the second parameter as required. The options object is optional.

Also added the special defaults for clarity.

Reviewed By: davidaurelio

Differential Revision: D7168409

fbshipit-source-id: e01b651f92b33175b750d188f9e6db99bdc4ab64
2018-03-07 04:36:33 -08:00
Miguel Jimenez Esun 0e9e2505dd Type transformCode
Reviewed By: davidaurelio

Differential Revision: D7169708

fbshipit-source-id: b886ea7b3e694ada4d930df9fa6aec1cdc188d98
2018-03-06 18:07:27 -08:00
Miguel Jimenez Esun 8a10127b58 Enforce object strictness at runtime
Reviewed By: jeanlauliac

Differential Revision: D7153674

fbshipit-source-id: a7f68d26430d04dc36360199ffcb243f8e2e09cf
2018-03-06 04:51:38 -08:00
Jean Lauliac 08283058ec metro: switch Assets-test to the new memory-fs
Reviewed By: mjesun

Differential Revision: D7135767

fbshipit-source-id: dd7998b8aca87391ec2081770645ba73d11cf859
2018-03-05 07:53:53 -08:00
Jean Lauliac e565f10a30 metro-memory-fs: implement createReadStream()
Reviewed By: mjesun

Differential Revision: D7124071

fbshipit-source-id: a267e35bb32d540cec915ac38f5ab11e2096f33e
2018-03-05 07:53:53 -08:00
Miguel Jimenez Esun b7e3e046cd Tweaks to experimental caches
Reviewed By: jeanlauliac

Differential Revision: D7123128

fbshipit-source-id: 2f838d66c51ef5faef261a6ad474cefd9ac7e8ad
2018-03-05 04:05:48 -08:00
Miguel Jimenez Esun 3bd7ef1d74 Remove "projectRoot" as an option
Reviewed By: jeanlauliac

Differential Revision: D7123052

fbshipit-source-id: be57635187c7e9c4bed2a62eca23bfe8346bc4f3
2018-03-05 04:05:48 -08:00
Jean Lauliac a4d1bf21b3 metro: switch Bundler-test to the new memory-fs
Reviewed By: rafeca

Differential Revision: D7111251

fbshipit-source-id: dfba2c3e7d17cc90c329785736b7c5a30816305b
2018-03-02 12:05:49 -08:00
Rafael Oleza cc392c699a Make the chrome debugger handle dynamic delta ids
Differential Revision: D7112419

fbshipit-source-id: 1d80c0c13144dd19bbcd5535383befc6567cacf7
2018-03-02 03:18:52 -08:00
Burak Yigit Kaya edacc36cb4 Implement `dispose` for HMR
Reviewed By: rafeca

Differential Revision: D7111433

fbshipit-source-id: 3ae8b6abc08328ea178965bfa60ec6af91dcc2cf
2018-03-01 09:36:44 -08:00
Miguel Jimenez Esun df399aa8c5 Make caches not to update beyond the hit
Reviewed By: davidaurelio

Differential Revision: D7098171

fbshipit-source-id: 2e934054fd265c40887a9ff5458bf294b2a61132
2018-03-01 07:10:41 -08:00
Rafael Oleza cd13bb80eb Reduce memory in the traverse dependencies logic by reusing objects
Reviewed By: BYK

Differential Revision: D7110823

fbshipit-source-id: 575da43e99bc2ba82b6e7bdcf61e933e95535710
2018-03-01 06:07:40 -08:00
Christoph Nakazawa 5bec7748e4 Tweaks to error reporting
Reviewed By: mjesun

Differential Revision: D7110894

fbshipit-source-id: cd4b10bb423c14519acb930192cfc3d9932fa091
2018-03-01 06:07:40 -08:00
Christoph Nakazawa 240711313c Enable colors to syntax highlight code in errors
Reviewed By: mjesun

Differential Revision: D7110895

fbshipit-source-id: 1ec1a2147258de44fe65453e1df25afb72c2c6a4
2018-03-01 06:07:40 -08:00
Rafael Oleza 59cfe85cca Make eslint rules more strict
Reviewed By: cpojer

Differential Revision: D7123137

fbshipit-source-id: 68f82124ed565f223c6bf546c22e55ca401f1996
2018-03-01 06:07:40 -08:00
Miguel Jimenez Esun cfb8516925 Only capture "ENOENT"s in "FileStore"
Reviewed By: jeanlauliac

Differential Revision: D7111352

fbshipit-source-id: 97525051e58482d7f0604cd9c3e50183db83d455
2018-03-01 06:07:40 -08:00
Miguel Jimenez Esun 123f1cfd42 Use "writeFileSync" instead of "writeFile"
Reviewed By: cpojer

Differential Revision: D7110494

fbshipit-source-id: 3024227431317a446ec23d2c78cde8a66c49d41f
2018-03-01 06:07:40 -08:00
Miguel Jimenez Esun da45d64c76 Use global cache getter with Metro's experimental caches
Reviewed By: davidaurelio

Differential Revision: D7084356

fbshipit-source-id: e5960c8981e7157efb58294d722067000d285497
2018-03-01 06:07:40 -08:00
Miguel Jimenez Esun f583f81254 Remove optional parameter from server and enforce empty list everywhere
Reviewed By: jeanlauliac

Differential Revision: D6999448

fbshipit-source-id: 39a6b9333e3c3ec05bae5423fcc84ad17e1fdc06
2018-03-01 06:07:40 -08:00
Peter van der Zee f8b0a77dd3 Don't import, yet
Reviewed By: mjesun

Differential Revision: D7110450

fbshipit-source-id: fa31566443e976df13313f05ed8775c31863d6e5
2018-03-01 02:22:22 -08:00
Peter van der Zee d08682472b Add @babel/register to Metro
Summary:
This adds the babel register package for babel 7 to Metro

All changes are caused by yarn

Reviewed By: davidaurelio

Differential Revision: D7102279

fbshipit-source-id: a8a6db5600207b868bb10217884eb659de9778f4
2018-03-01 02:22:22 -08:00
Peter van der Zee 4946945215 Bump Babel 7 beta versions
Summary: Turns out we need an updated version of the babel 7 stack because the runtime depends on something in the newest version. This commit bumps various main package versions to beta.40

Reviewed By: davidaurelio

Differential Revision: D7104132

fbshipit-source-id: ff7db16f6ad82ea2a728ead63fe19b1c9dbd708c
2018-02-28 16:53:22 -08:00
Jean Lauliac bc4c233a1e metro: fix dep over memory-fs in OSS
Reviewed By: rafeca

Differential Revision: D7111222

fbshipit-source-id: 1aca3836e1c55a60ec77c22c8f38aabf9ba5cbb2
2018-02-28 10:56:59 -08:00
Rafael Oleza d7165e5cbb Add extraneous dependencies eslint plugin to metro
Reviewed By: davidaurelio

Differential Revision: D7084893

fbshipit-source-id: f1726fc189174bde8fc6f32ed6b0125764fe5093
2018-02-28 04:34:15 -08:00
Rafael Oleza 2f98a6ee61 Remove nested package.json files
Reviewed By: cpojer

Differential Revision: D7097285

fbshipit-source-id: 66b107632e3b84edf4f2c099b03ca590a7c6bb7b
2018-02-28 04:34:15 -08:00
Rafael Oleza f5bb45ffdd Do not transform Platform.select() calls using dynamic properties
Reviewed By: davidaurelio

Differential Revision: D7085775

fbshipit-source-id: 348e43312ecb8298c14b202f209850b54d9b7b12
2018-02-28 04:34:15 -08:00
David Aurelio 36cee35684 Remove `getOptions()` from `DeltaBundler`
Summary: More cleanup of `DeltaBundler` in order to move from `Bundler` to `ModuleGraph`. I am trying to remove all unrelated functionality to make the transition easier.

Reviewed By: rafeca

Differential Revision: D7100153

fbshipit-source-id: 2e0c2d4957dece27bd28d3cf7e4ff2e178c60fb2
2018-02-28 04:04:33 -08:00