[react-packager] Rewrite dependency graph (support node_modules, speed, fix bugs etc)
Summary:
@public
Fixes #773, #1055
The resolver was getting a bit unwieldy because a lot has changed since the initial writing (porting node-haste).
This also splits up a large complex file into the following:
* Makes use of classes: Module, AssetModule, Package, and AssetModule_DEPRECATED (`image!` modules)
* DependencyGraph is lazy for everything that isn't haste modules and packages (need to read ahead of time)
* Lazy makes it fast, easier to reason about, and easier to add new loaders
* Has a centralized filesystem wrapper: fast-fs (ffs)
* ffs is async and lazy for any read operation and sync for directory/file lookup which makes it fast
* we can easily drop in different adapters for ffs to be able to build up the tree: watchman, git ls-files, etc
* use es6 for classes and easier to read promise-based code
Follow up diffs will include:
* Using new types (Module, AssetModule etc) in the rest of the codebase (currently we convert to plain object which is a bit of a hack)
* using watchman to build up the fs
* some caching at the object creation level (we are recreating Modules and Packages many times, we can cache them)
* A plugin system for loaders (e.g. @tadeuzagallo wants to add a native module loader)
Test Plan:
* ./runJestTests.sh react-packager
* ./runJestTests.sh PackagerIntegration
* Export open source and run the e2e test
* reset cache
* ./fbrnios.sh run and click around
2015-06-20 01:01:21 +00:00
|
|
|
{
|
|
|
|
"retainLines": true,
|
|
|
|
"compact": true,
|
|
|
|
"comments": false,
|
2015-11-10 18:51:39 +00:00
|
|
|
"plugins": [
|
|
|
|
"syntax-async-functions",
|
|
|
|
"syntax-class-properties",
|
|
|
|
"syntax-trailing-function-commas",
|
2015-11-14 11:23:46 +00:00
|
|
|
"transform-class-properties",
|
2015-11-10 18:51:39 +00:00
|
|
|
"transform-es2015-arrow-functions",
|
|
|
|
"transform-es2015-block-scoping",
|
|
|
|
"transform-es2015-classes",
|
|
|
|
"transform-es2015-computed-properties",
|
|
|
|
"transform-es2015-constants",
|
|
|
|
"transform-es2015-destructuring",
|
|
|
|
["transform-es2015-modules-commonjs", {"strict": false, "allowTopLevelThis": true}],
|
|
|
|
"transform-es2015-parameters",
|
|
|
|
"transform-es2015-shorthand-properties",
|
|
|
|
"transform-es2015-spread",
|
|
|
|
"transform-es2015-template-literals",
|
|
|
|
"transform-flow-strip-types",
|
|
|
|
"transform-object-assign",
|
|
|
|
"transform-object-rest-spread",
|
|
|
|
"transform-react-display-name",
|
|
|
|
"transform-react-jsx",
|
2015-12-02 11:10:42 +00:00
|
|
|
"transform-regenerator",
|
|
|
|
"transform-es2015-for-of"
|
[react-packager] Rewrite dependency graph (support node_modules, speed, fix bugs etc)
Summary:
@public
Fixes #773, #1055
The resolver was getting a bit unwieldy because a lot has changed since the initial writing (porting node-haste).
This also splits up a large complex file into the following:
* Makes use of classes: Module, AssetModule, Package, and AssetModule_DEPRECATED (`image!` modules)
* DependencyGraph is lazy for everything that isn't haste modules and packages (need to read ahead of time)
* Lazy makes it fast, easier to reason about, and easier to add new loaders
* Has a centralized filesystem wrapper: fast-fs (ffs)
* ffs is async and lazy for any read operation and sync for directory/file lookup which makes it fast
* we can easily drop in different adapters for ffs to be able to build up the tree: watchman, git ls-files, etc
* use es6 for classes and easier to read promise-based code
Follow up diffs will include:
* Using new types (Module, AssetModule etc) in the rest of the codebase (currently we convert to plain object which is a bit of a hack)
* using watchman to build up the fs
* some caching at the object creation level (we are recreating Modules and Packages many times, we can cache them)
* A plugin system for loaders (e.g. @tadeuzagallo wants to add a native module loader)
Test Plan:
* ./runJestTests.sh react-packager
* ./runJestTests.sh PackagerIntegration
* Export open source and run the e2e test
* reset cache
* ./fbrnios.sh run and click around
2015-06-20 01:01:21 +00:00
|
|
|
],
|
|
|
|
"sourceMaps": false
|
|
|
|
}
|