Commit Graph

1892 Commits

Author SHA1 Message Date
Rafael Oleza b456f7b61a Remove old extract-dependencies logic
Reviewed By: davidaurelio

Differential Revision: D6447749

fbshipit-source-id: 39c4960da65a9d8ab1e2615d48f5c2868a17f82b
2017-12-04 08:14:55 -08:00
Jean Lauliac 03e735d232 metro: fix collect-dependencies for the async/BundleSegments case
Reviewed By: cpojer

Differential Revision: D6462925

fbshipit-source-id: ca83176a7c7f47346daf16703cefb86172dc35b5
2017-12-02 04:58:52 -08:00
Rafael Oleza de7f1d90f2 Support null transformer AST output
Summary: This fixes https://github.com/facebook/metro/issues/99, which causes issues when metro tries to build files that are ignored by babel (if babel transformer ignores a file, it returns a null AST, which makes the collectDependencies logic break).

Reviewed By: mjesun

Differential Revision: D6466878

fbshipit-source-id: b5030e03775b982958a0b9204f4efccc8940ae4d
2017-12-02 00:28:42 -08:00
Rafael Oleza 5d76d340e5 Check for inverseDependencies existance before calling HMR
Differential Revision: D6449768

fbshipit-source-id: d9fe8b54fec0754ffb8ce2db1e87f180862a57a3
2017-12-01 08:59:20 -08:00
Rafael Oleza 8cf97e332f Use async/await in AssetServer methods
Reviewed By: davidaurelio

Differential Revision: D6435849

fbshipit-source-id: c665dfd6737e636f06c7056a89609730a5041a53
2017-11-30 04:03:29 -08:00
Rafael Oleza e19f82d408 Remove unused param from AssetServer
Reviewed By: jeanlauliac

Differential Revision: D6435881

fbshipit-source-id: 1d6d354e63a67f566e69d894bc22999e32b9a76f
2017-11-30 04:03:29 -08:00
Eli White 42b7e6fcdf Remove $FixMe flow suppression
Reviewed By: sahrens, kassens

Differential Revision: D6426829

fbshipit-source-id: b10e33117cf4adf6bb39fc95a9ffa1e268e7c835
2017-11-30 04:03:29 -08:00
Rafael Oleza 750e62bcdf Remove transformAndExtractDependencies() method in worker
Reviewed By: mjesun, davidaurelio

Differential Revision: D6433590

fbshipit-source-id: ef3c31d73a831fabe2a6f1be6051b0cb5c7e6c55
2017-11-30 04:03:29 -08:00
Jean Lauliac 86aba17329 metro: clean up Module option, remove some from state
Reviewed By: davidaurelio

Differential Revision: D6435957

fbshipit-source-id: eaed8f5c1d4d18d6ff0bde34892f059a01fe1a65
2017-11-30 04:03:29 -08:00
Christoph Nakazawa 575142d0c2 Add script to automatically deploy the website
Reviewed By: rafeca

Differential Revision: D6435717

fbshipit-source-id: dbbf4fed745ac460becc03ca2c4f4ae3a0249314
2017-11-30 04:03:29 -08:00
Jean Lauliac ec4a0ce527 packager-worker-for-buck: resolve at bundling time using js_library resolution information
Reviewed By: davidaurelio

Differential Revision: D6414372

fbshipit-source-id: 7bb0404e51a6130dfc89adb9476ad829020e76f0
2017-11-30 04:03:29 -08:00
Christoph Nakazawa 66b381a5c7 Export Config/defaults on Metro's main module
Reviewed By: arcanis

Differential Revision: D6435529

fbshipit-source-id: a9549dc5900025fcc798ccb92b49e96c982c2e1e
2017-11-30 04:03:29 -08:00
cpojer 0f7ad193c7 Rename metro-bundler to metro
Reviewed By: davidaurelio

Differential Revision: D6413420

fbshipit-source-id: f13184b8157de2c3aeaa7f2647becc175f62cdbb
2017-11-30 11:56:25 +00:00
Maël Nison 9249ebcea7 Adds a (deprecated) --reset-cache option
Reviewed By: BYK

Differential Revision: D6424553

fbshipit-source-id: f84064f86a985ab19794ea3d94410dceac77a95b
2017-11-29 00:45:23 -08:00
Burak Yigit Kaya cf9ef1b30f Make `assetTransforms` option available to the new metro CLI
Reviewed By: arcanis

Differential Revision: D6424404

fbshipit-source-id: 30c56128b914d86491fce6276775d75e7b497146
2017-11-29 00:45:23 -08:00
Peter van der Zee 37995e2196 Add a bundle type to logger output and type
Reviewed By: rafeca

Differential Revision: D6405599

fbshipit-source-id: 2f3da971d55fae28fbd94ed9f60d3bc2be176d6a
2017-11-28 04:55:00 -08:00
Rafael Oleza b0de96c74a Small refactor in module resolution
Reviewed By: jeanlauliac

Differential Revision: D6417509

fbshipit-source-id: 9c6abb8ceebb7048c775c9c9d21cd881f7e56c1f
2017-11-28 04:35:55 -08:00
Maël Nison 5cc0939454 Automatically watches the metro configuration file
Reviewed By: BYK

Differential Revision: D6408358

fbshipit-source-id: d167534c9c51c3c079148d982ef4ab44c8be0d75
2017-11-28 04:35:55 -08:00
Miguel Jimenez Esun b282031517 Make tests compatible with the latest Jest version
Reviewed By: cpojer

Differential Revision: D6419868

fbshipit-source-id: f01a3f4d54ca1aa3539d92363a51f70247642463
2017-11-28 03:34:45 -08:00
Rafael Oleza ac2aa718c0 Bump metro-bundler@0.22.1
Reviewed By: mjesun

Differential Revision: D6415105

fbshipit-source-id: 51687fd20fc5958a3b18d704ffa100400d208057
2017-11-27 11:29:54 -08:00
Rafael Oleza d46e4ecb6a Keep the dependencyMaps consistent between runs
Reviewed By: mjesun

Differential Revision: D6413998

fbshipit-source-id: fd0ff9a82dcca23603977456b51213216c370f8d
2017-11-27 08:52:03 -08:00
Maël Nison 167bda72b0 Fixes various issues on the Metro CLI
Reviewed By: rafeca

Differential Revision: D6407718

fbshipit-source-id: 871dd77fad4fcf8f6b0fa628bacc0dfb6cb51484
2017-11-27 04:36:12 -08:00
Burak Yigit Kaya 319220d870 Do not return a promise from transformers unless we have to
Reviewed By: mjesun

Differential Revision: D6405568

fbshipit-source-id: 09463442aecdb844e18498c3b3ce169d2915fe77
2017-11-27 02:32:39 -08:00
Rafael Oleza 091f8560f2 Make inlineRequires boolean when passed to the transformer
Reviewed By: mjesun

Differential Revision: D6408081

fbshipit-source-id: 812c8e3983677f4133ef3080525859a4a70418b7
2017-11-26 11:20:57 -08:00
Rafael Oleza 2d03a34bbc Remove isJSON() method from Module
Reviewed By: cpojer

Differential Revision: D6408739

fbshipit-source-id: 3f1b76ca54937fbc433d4e7a804a9703a3a2ccb7
2017-11-24 13:06:22 -08:00
Rafael Oleza 75047399d8 Simplify transform options + pass minify to the transformer
Reviewed By: mjesun

Differential Revision: D6406614

fbshipit-source-id: 722e8e209c7b7c922139f0777b9b3bd2a77bf735
2017-11-24 13:06:22 -08:00
Christoph Nakazawa 06466e4f6e Remove some of the whitespace from the progess output
Reviewed By: rafeca

Differential Revision: D6408458

fbshipit-source-id: 2e6c50baedbd53ce4271edc337fada3b628d9c63
2017-11-24 11:56:57 -08:00
Alexey 95c1eda902 Straightforward deploy approach
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**

As rafeca mentioned on Discord channel, `deploy` script fails. This PR is composed with intention to fix this error.

**Test plan**

- Try to deploy a new version using CircleCI config from this PR
<!-- 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-bundler/pull/94

Reviewed By: mjesun

Differential Revision: D6405189

Pulled By: rafeca

fbshipit-source-id: 9adca768044515784474aa6f71ca6f733db5b07e
2017-11-24 07:35:55 -08:00
Christoph Nakazawa b6a4185158 Move README text to documentation
Reviewed By: mjesun

Differential Revision: D6407519

fbshipit-source-id: 0c497b7a294861b6b92ac4ebc3aa64c632a3436f
2017-11-24 03:08:08 -08:00
Rafael Oleza b08ce130fd Move wrapModule logic for scripts, modules and JSON files to the transformer
Reviewed By: davidaurelio

Differential Revision: D6389116

fbshipit-source-id: fa43bd54669849c22b6b9d155ab07676b2455ef7
2017-11-23 15:40:03 -08:00
Rafael Oleza b193fc3436 BREAKING: metro transformers should only output AST
Reviewed By: jeanlauliac

Differential Revision: D6396416

fbshipit-source-id: e4c6f0c0feb1ac638dc13dd3eb400f1bc72b5d44
2017-11-23 15:40:03 -08:00
Jean Lauliac f434d43f54 metro-bundler: RAM bundles cannot contain scripts masquerading as modules
Reviewed By: davidaurelio

Differential Revision: D6405614

fbshipit-source-id: 6c21fd30d6246f50c34e9f23a193452737a3b67b
2017-11-23 12:10:21 -08:00
Peter van der Zee ccd8eae0b0 Fix terminal string chunker to ignore non-printable color seqs
Reviewed By: rafeca

Differential Revision: D6405127

fbshipit-source-id: 94fd12a04db43a790af34fdee36be9d7f8ecf59d
2017-11-23 10:11:54 -08:00
Burak Yigit Kaya b7ba5c7ee1 Support async transformers
Reviewed By: rafeca, mjesun

Differential Revision: D6405491

fbshipit-source-id: 7110135e9f75ab43c03710abfa8e582577662ab3
2017-11-23 09:56:44 -08:00
Peter van der Zee a766a4a499 Update http progress output in cli; add platform, shorten rest
Reviewed By: rafeca, davidaurelio

Differential Revision: D6395717

fbshipit-source-id: 0fed7f29539bb59bc300d88b09a99be13bbb42ba
2017-11-23 08:27:13 -08:00
Rafael Oleza 6557272f8c Avoid losing deltas when unexpected errors happen on the DeltaTransformer
Reviewed By: jeanlauliac

Differential Revision: D6402261

fbshipit-source-id: 6a1a18c1bd7d4f7cecd5a5e9114f6eb493d40b4d
2017-11-23 08:27:13 -08:00
Rafael Oleza 70dadc63f9 Update Readme + change default transform
Reviewed By: cpojer

Differential Revision: D6401596

fbshipit-source-id: 8928abb825933edd84c508a4f04f50c748725722
2017-11-23 03:06:48 -08:00
Burak Yigit Kaya 7b5ae96479 Add option to bypass AssetRegistry and sending assets to transforms
Reviewed By: rafeca

Differential Revision: D6385816

fbshipit-source-id: b94fb125bee0576cfb25170aa86a253c10a3d862
2017-11-23 02:38:19 -08:00
Rafael Oleza 5f58ae0e84 Metro reads AST from transformers if available
Reviewed By: BYK

Differential Revision: D6396330

fbshipit-source-id: 10539a1cce81b090a781df7d75515d52ece9ef9c
2017-11-22 13:36:20 -08:00
Rafael Oleza c9e0589171 Allow HMR client accept wrapped modules from metro
Reviewed By: davidaurelio

Differential Revision: D6385273

fbshipit-source-id: 15109332aceb4c0523c668a54b1bf40d8e8fba80
2017-11-22 11:37:20 -08:00
Christoph Nakazawa ef9b4b0f0f Metro Website scaffold
Reviewed By: jeanlauliac

Differential Revision: D6396202

fbshipit-source-id: 9bfa3f88fdd747732566a95ded204f8f5206b350
2017-11-22 09:21:33 -08:00
Jean Lauliac 52a76cb5af packager-worker-for-buck: refactor and fix source map output
Reviewed By: davidaurelio

Differential Revision: D6385199

fbshipit-source-id: f104f7b000dde131b57b671d14d4ec4e0d30d7a2
2017-11-22 05:08:49 -08:00
Peter van der Zee efceeacd77 Move Option types from Server to shared/types.flow
Reviewed By: davidaurelio

Differential Revision: D6384292

fbshipit-source-id: 58cba889f549cbd7a8c82856d5283048f4f2a8c5
2017-11-22 03:57:33 -08:00
Flarnie Marchan 1017f8ab7e Add CODE_OF_CONDUCT.md
Summary:
**what is the change?:**
Adding a document linking to the Facebook Open Source Code of Conduct,
for visibility and to meet Github community standards.

**why make this change?:**
Facebook Open Source provides a Code of Conduct statement for all
projects to follow.

Metro already links to this Code of Conduct in the CONTRIBUTING, which is
great!

Exposing the COC via a separate markdown file is a standard being
promoted by Github via the Community Profile in order to meet their Open
Source Guide's recommended community standards.

As you can see, adding this file will complete [Metro's Community Profile](https://github.com/facebook/metro-bundler/community)
checklist and increase the visibility of our COC.

**test plan:**
Viewing it on my branch -
![screen shot 2017-11-20 at 5 10 01 pm](https://user-images.githubusercontent.com/1114467/33049599-c36b316e-ce15-11e7-9041-0fa228a74ce4.png)

**issue:**
internal task t23481323
Closes https://github.com/facebook/metro-bundler/pull/93

Reviewed By: cpojer

Differential Revision: D6395546

Pulled By: flarnie

fbshipit-source-id: dacc85abed53cec3e6200daa8fe139cd6c53b7a0
2017-11-22 02:58:16 -08:00
Rafael Oleza 4f3c4ca238 Remove @format and trailing commas from mapCoverage
Reviewed By: cpojer

Differential Revision: D6388338

fbshipit-source-id: ef33f530397e8ca3de8625b33333df2d57d228d3
2017-11-22 02:40:53 -08:00
Rafael Oleza d4b7cb5d08 Bump metro to v0.21.1
Reviewed By: mjesun

Differential Revision: D6385524

fbshipit-source-id: 189f03466f8e84a9ac3acfd1aa0faf4f39d394f2
2017-11-21 10:28:18 -08:00
Jean Lauliac 507fbd7d7e packager-worker-for-buck: store resolutions at library level
Reviewed By: davidaurelio

Differential Revision: D6359267

fbshipit-source-id: 795d451c6ff32c07842e9e067778136180a9988e
2017-11-21 07:08:28 -08:00
Rafael Oleza 6ec09775ef Upgrade uglify-es to 3.1.9
Reviewed By: davidaurelio

Differential Revision: D6309485

fbshipit-source-id: 17d8b66a2a676a9a556509e28a48ee703fc6da89
2017-11-21 06:44:11 -08:00
Rafael Oleza 085dd97fa0 Change getModuleId() signature to directly accept a path
Reviewed By: mjesun

Differential Revision: D6373180

fbshipit-source-id: d6b49431adf85e7587cf0fe858d9dc9b9afeee06
2017-11-21 05:45:44 -08:00
Rafael Oleza e58b7f1d73 Do not calculate inverseDependencies when processing a standard delta bundle
Reviewed By: mjesun

Differential Revision: D6373006

fbshipit-source-id: 86863595b1e5f0417e898f19f21ed83147b46db3
2017-11-21 05:45:44 -08:00