Commit Graph

952 Commits

Author SHA1 Message Date
Peter van der Zee 9b90096a2a Depend on local version of babel-plugin-react-transform
Reviewed By: arcanis

Differential Revision: D7337432

fbshipit-source-id: 3729359da0ccfd3161546ab3ea9331ad30fb6e8d
2018-03-21 09:30:47 -07:00
Peter van der Zee ad2d99512b Create a local package of babel-plugin-transform-react
Reviewed By: arcanis

Differential Revision: D7337425

fbshipit-source-id: c70c27921faacb4f39674d0fbc14a2052fe9eac3
2018-03-21 09:30:47 -07:00
Rafael Oleza 012bb6a512 Bump metro@0.31.0
Reviewed By: mjesun

Differential Revision: D7336904

fbshipit-source-id: 2132c77d07e52a91f09b6f905bee4806aaf7d23e
2018-03-20 19:46:18 -07:00
Rafael Oleza 6aed6433b0 Add getRunModuleStatement config param to configure the require() statements
Reviewed By: cpojer

Differential Revision: D7334078

fbshipit-source-id: c19340567c634e3173ee707e92389eaaa4e724e9
2018-03-20 07:12:53 -07:00
Rafael Oleza a396616e4b Make crawling Options type strict
Reviewed By: cpojer

Differential Revision: D7334076

fbshipit-source-id: 5aaf65d594b23a51287f97ce9f14aab09010f871
2018-03-20 07:12:53 -07:00
Rafael Oleza 69755c9a0d More cleanup of unneeded option params
Reviewed By: cpojer

Differential Revision: D7334077

fbshipit-source-id: ca3359e0e866a84cb57a298ae09c6dd6005d3242
2018-03-20 07:12:53 -07:00
Rafael Oleza 93c2f102b5 Small cleanup on Server
Reviewed By: cpojer

Differential Revision: D7320668

fbshipit-source-id: ff7c338ed079574ec86e86e7af87f9f9c6b3eda0
2018-03-20 07:12:53 -07:00
Rafael Oleza feaf638688 Remove DeltaTransformer + DeltaPatcher
Reviewed By: cpojer

Differential Revision: D7320669

fbshipit-source-id: 9e4e44e64c77e1d77a403517c154f64acd1e66ae
2018-03-20 07:12:53 -07:00
Rafael Oleza 5c6bdd35f0 Deprecate postProcessModules config param
Reviewed By: mjesun

Differential Revision: D7320671

fbshipit-source-id: 979108f0931f9ee0dd820025782137d4c726d19f
2018-03-20 07:12:53 -07:00
Rafael Oleza 2d77ecc6c0 Expose the buildGraph method as a public metro api
Reviewed By: mjesun

Differential Revision: D7320672

fbshipit-source-id: 251874edc28483d5ac6f810dcda77e04e4729049
2018-03-20 07:12:53 -07:00
Rafael Oleza add2826ebe Support concurrent bundle requests on the Server
Reviewed By: mjesun

Differential Revision: D7320670

fbshipit-source-id: 02090f85bf1b5376e9af879d17898bf31c31ce3a
2018-03-20 07:12:53 -07:00
Rafael Oleza 9bae90b2b8 Use the new Graph object for generating HMR bundles
Reviewed By: jeanlauliac

Differential Revision: D7275598

fbshipit-source-id: 912a60ebce7ccc291d138c6f1ef8b0fea2d5712b
2018-03-20 07:12:53 -07:00
Rafael Oleza 395e0494a6 Use the new Graph object for generating delta bundles
Reviewed By: mjesun

Differential Revision: D7275600

fbshipit-source-id: 29579594b88ea19ff81c6e4c1936611f8ecc42f7
2018-03-20 07:12:53 -07:00
Rafael Oleza 2a107aaafc Use the new Graph object for returning the RAM bundle info
Reviewed By: mjesun

Differential Revision: D7275597

fbshipit-source-id: 5a30c83f9ce756f457796a08d10034d03cbc3b75
2018-03-20 07:12:53 -07:00
Rafael Oleza 1b3d2e126d Use the new Graph object for symbolicating errors
Reviewed By: jeanlauliac

Differential Revision: D7275603

fbshipit-source-id: 94a127647f22f7deaaffe649bba6a7ec9353fc03
2018-03-20 07:12:53 -07:00
Rafael Oleza b9b541542b Use the new Graph object for generating dev bundle/sourcemaps
Reviewed By: mjesun

Differential Revision: D7275599

fbshipit-source-id: 4889d259005b3df19977925a6729805b9df68113
2018-03-20 07:12:52 -07:00
Rafael Oleza 12fe345e1b Use the new Graph object for returning bundle dependencies
Reviewed By: mjesun

Differential Revision: D7275602

fbshipit-source-id: 9c07d85b085c297ed5efe958e3b7efe001f3542f
2018-03-20 07:12:52 -07:00
Rafael Oleza 0520fb254b Use the new Graph object for generating assets
Reviewed By: mjesun

Differential Revision: D7275601

fbshipit-source-id: b7c03ec35ea1994e2441da2889a44466e9e2aa0f
2018-03-20 07:12:52 -07:00
Naor Matania ce2ee5a19c Revert D7319514: Create a local package of babel-plugin-transform-react
Differential Revision:
D7319514

Original commit changeset: bcad3dded2b2

fbshipit-source-id: 3aae57ba660846508ea06fe5a540f4adf5b0088e
2018-03-20 06:35:11 -07:00
Naor Matania 13a7535d31 Revert D7319513: Depend on local version of babel-plugin-react-transform
Differential Revision:
D7319513

Original commit changeset: 4945ec753087

fbshipit-source-id: 98de6a0fda19732c02ad780953497f9d9b451dea
2018-03-20 06:35:11 -07:00
Naor Matania 045cf843d1 Revert D7305051: Work around babel7 issue with duplicate declarations
Differential Revision:
D7305051

Original commit changeset: ac9a0130dc61

fbshipit-source-id: 6489a2385477be5c37e63387bf6367dd3ae97be1
2018-03-20 06:35:11 -07:00
Naor Matania 94c03a6cd3 Revert D7264205: Add babel-helper-module-imports to prepare react transform
Differential Revision:
D7264205

Original commit changeset: 515fc85739c6

fbshipit-source-id: f6c8cc8c36e939228dcdcbc4babd76b74a54df7f
2018-03-20 06:35:11 -07:00
Naor Matania 1864a83e6e Revert D7257551: Fix the react transform to work in babel 7
Differential Revision:
D7257551

Original commit changeset: 408104df411e

fbshipit-source-id: 5128bc475ae4d4cc02f6b6825a697bbb3ed1e6a3
2018-03-20 06:35:11 -07:00
Peter van der Zee 226e59a7e2 Fix the react transform to work in babel 7
Reviewed By: jeanlauliac

Differential Revision: D7257551

fbshipit-source-id: 408104df411e6f7011c148d0f5146341d7e90125
2018-03-20 05:19:38 -07:00
Peter van der Zee df5b71ec39 Add babel-helper-module-imports to prepare react transform
Reviewed By: rafeca

Differential Revision: D7264205

fbshipit-source-id: 515fc85739c6131bb8f61612e37af5042c7e3c06
2018-03-20 05:19:38 -07:00
Peter van der Zee 9f1bf87c22 Work around babel7 issue with duplicate declarations
Reviewed By: rafeca

Differential Revision: D7305051

fbshipit-source-id: ac9a0130dc616a87dcc0cdd02dd829e995cfc92f
2018-03-20 05:19:38 -07:00
Peter van der Zee 84f2e6f3a3 Depend on local version of babel-plugin-react-transform
Reviewed By: jeanlauliac

Differential Revision: D7319513

fbshipit-source-id: 4945ec753087206cd01eca4ba9464672d5fb05ba
2018-03-20 05:19:38 -07:00
Peter van der Zee b5f1b4ae25 Create a local package of babel-plugin-transform-react
Reviewed By: rafeca

Differential Revision: D7319514

fbshipit-source-id: bcad3dded2b2141f8a1c12b6a526335da6d6e8a1
2018-03-20 05:19:38 -07:00
Sam Goldman 8dd921a5d6 Upgrade to Flow v0.68.0
Reviewed By: gabelevi

Differential Revision: D7310349

fbshipit-source-id: 70d29815dd7912704aec8a015c970be3fafeeba3
2018-03-19 18:42:30 -07:00
Rafael Oleza d8eed45c37 Use Graph traversal logic for building polyfills
Reviewed By: mjesun

Differential Revision: D7240946

fbshipit-source-id: 5af729878cdf31831b15867c296cf89025ab6f58
2018-03-19 10:29:52 -07:00
Rafael Oleza 6be6b0805d Refactor production serializers to use directly the graph information
Reviewed By: mjesun

Differential Revision: D7158632

fbshipit-source-id: 91fad2e3ca617ea5f3b283e335c0d70edbb6ff3b
2018-03-19 10:29:52 -07:00
Rafael Oleza 3ac0bb47d9 Add new plainJSSerializer that uses directly the Graph object
Reviewed By: mjesun

Differential Revision: D7211546

fbshipit-source-id: 7e6a0a0123f46a9037ecae845d29daea43e1ebed
2018-03-19 10:29:52 -07:00
Rafael Oleza a4afdcb2e8 Move serializers test to the correct folder
Reviewed By: mjesun

Differential Revision: D7210700

fbshipit-source-id: 4d1cc709ffabb46f244ab66d96467f4cb1c90eaf
2018-03-19 10:29:52 -07:00
Rafael Oleza 40cce3b120 Convert entryPoint paths to absolute in the Server
Reviewed By: davidaurelio

Differential Revision: D7196392

fbshipit-source-id: a1927d66fd67e35382a5ac418896dc5a902a5a5c
2018-03-19 10:29:52 -07:00
Rafael Oleza ab25e7c475 Simplify the parameters needed to call the delta calculator
Reviewed By: BYK

Differential Revision: D7185274

fbshipit-source-id: 0bb4040556dfa96f288c9d4aef2314ded44bcd0d
2018-03-19 10:29:52 -07:00
Rafael Oleza 45123d822b Add multiple entrypoint support to the dependency traversal logic
Reviewed By: davidaurelio

Differential Revision: D7180692

fbshipit-source-id: 65b1992abbf10e753b6895623824ff90d7cadc24
2018-03-19 10:29:52 -07:00
Rafael Oleza 5e9cf9ec4b Start using the Graph object in the traverse dependencies logic
Reviewed By: davidaurelio

Differential Revision: D7180698

fbshipit-source-id: a7c39b73a7673f450e3a147e7feff4cfcc3061bf
2018-03-19 10:29:52 -07:00
Rafael Oleza 935b6b5e32 Expose Graph object from the delta bundler
Reviewed By: davidaurelio

Differential Revision: D7158629

fbshipit-source-id: bb10ad8449cc8f1566f02568adaaecbc54c76d2e
2018-03-19 10:29:52 -07:00
Miguel Jimenez Esun 21ccd2b269 Remove things that contain absolute paths
Reviewed By: rafeca

Differential Revision: D7306933

fbshipit-source-id: 497b0f6f71243180870a297d6ea8b09164112649
2018-03-19 05:13:00 -07:00
Miguel Jimenez Esun b581a3e2bb Add logging into cache class
Reviewed By: rafeca

Differential Revision: D7307863

fbshipit-source-id: 0365c5598cd8e56580ebab953dfdcf2d27a59276
2018-03-18 07:12:49 -07:00
Jean Lauliac 23bd78220b metro-memory-fs: add lstat() and fstat()
Reviewed By: mjesun

Differential Revision: D7257967

fbshipit-source-id: 56c59ca088bfd71fc111efdfda2f5393d6abbd9b
2018-03-16 09:00:22 -07:00
Rafael Oleza bfecccd180 Avoid parsing JSON files with babel
Summary:
Metro does not need to use babel to parse JSON files, it only needs to wrap the stringified JSON directly into the `define` function.

This makes the transformation of JSON files much faster, plus prevent out of memory exceptions when having huge JSON files.

This diff fixes https://github.com/facebook/metro/issues/146

Reviewed By: mjesun

Differential Revision: D7227095

fbshipit-source-id: 5d1a9cb2d1c7162a403c00dc43e46f781fbd1514
2018-03-16 01:44:09 -07:00
Rafael Oleza f2b6232c5d Bump metro@0.30.2
Reviewed By: BYK

Differential Revision: D7292431

fbshipit-source-id: 2d81e502e060ecd278977b838e0ef2db7e13b0e3
2018-03-15 18:41:36 -07:00
Rafael Oleza f231396260 Fix HMR connection issues when the client gets reconnects
Reviewed By: BYK

Differential Revision: D7288613

fbshipit-source-id: ac8b5800af0bfaf1c2a25108b564092e3a47273c
2018-03-15 15:37:41 -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
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