metro/packages
Rafael Oleza 2446fe2211 Decouple the dependency traversal logic from Bundler/Dependencygraph/Module
Summary:
This commit refactors the metro bundling logic to make the traversal of dependencies much more generic, to not depend on any assumption regarding dependency resolution, haste, or even about the transformer/caching system.

So, the actual API of the `DeltaBundler` module (which will be extracted as a separate package in the near future) ends up being like this:

```
const graph = await deltaBundler.buildGraph(
  ['/root/entryPoint1.js', '/root/entryPoint2.js', /* ... */],
  {
    dependencyResolver: (from, to) => require('resolve').sync(to, {from}), // Use the standard nodejs resolver
    transformFn: filePath => await transformFileUsingWhateverIPrefer(filePath),
  },
);
```

The only part that is still coupled with the `DependencyGraph` is the file listener (which is tied to JestHasteMap via `DependencyGraph`), which is going to be decoupled soon.

From here, and once we have the new caching system fully rolled out and the old cache logic removed, we'll incorporate `jest-worker` and the caching system directly into the build graph logic, to end up extracting the whole `DeltaBundler` logic into its own package.

From there we can potentially reuse it to create simpler/more focused bundlers for web/etc.

Reviewed By: davidaurelio

Differential Revision: D7617143

fbshipit-source-id: b7e1a71cd95043f6232b07f2e8c45dcd49f089f2
2018-04-18 12:25:02 -07:00
..
metro Decouple the dependency traversal logic from Bundler/Dependencygraph/Module 2018-04-18 12:25:02 -07:00
metro-babel7-plugin-react-transform BREAKING CHANGE: UPGRADE REACT NATIVE TO BABEL 7! 2018-04-11 17:14:14 -07:00
metro-babylon7 Bump metro@0.32.0 2018-04-11 10:53:54 -07:00
metro-cache Implement "clear" method in "metro-cache" stores 2018-04-16 12:59:57 -07:00
metro-core Move `.../<name>/index.js` to `.../<name>.js` 2018-04-11 13:46:37 -07:00
metro-memory-fs metro-memory-fs: add support for win32 2018-04-11 18:14:34 -07:00
metro-minify-uglify Bump metro@0.32.0 2018-04-11 10:53:54 -07:00
metro-resolver Bump metro@0.32.0 2018-04-11 10:53:54 -07:00
metro-source-map Bump metro@0.32.0 2018-04-11 10:53:54 -07:00