Summary: Now that the minifier is integrated inside the transformer, we can expose the param in the `buildGraph` method
Reviewed By: davidaurelio
Differential Revision: D7707542
fbshipit-source-id: 0125172b2ac90c7ceb477d5c55e9aea3c3867e02
Summary:
When moving the minification to the worker, I forgot to also minify JSON files (they have an early return).
This diff fixes this :)
Reviewed By: davidaurelio
Differential Revision: D7707317
fbshipit-source-id: 1114017b811861a6f2caebe79e1d79e6ad9a7b1e
Summary:
Since Babel is still in beta and breaking changes may happen between beta versions we need to lock this down and carefully consider upgrades.
For example, between .40 and .44 there seem to be at least two new mandatory options and who knows what else.
Once Babel 7 leaves beta we can go back to the caret (^).
Reviewed By: rafeca
Differential Revision: D7685783
fbshipit-source-id: ff6e19f5716b4c7fdfb8778c650309bb92966ff7
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
Summary:
BREAKING CHANGE
This change upgrades the React Native build pipeline from Babel 6 to Babel 7
If you use a `.babelrc` then you'll need to update it to Babel 7 (note that some plugins are no longer relevant, some plugins are automatically upgraded, and some will need some manual love).
Note that you may also need to upgrade your dev env, tests etc, to make sure they work with Babel 7.
Reviewed By: mjesun
Differential Revision: D7591303
fbshipit-source-id: 29cef21f6466633a9c366d1f3c0d3cf874c714db
Summary:
Here, we move `index.js` files in directories one level up, and rename them to `<dirname>.js`.
This makes for a more pleasant development experience, as files are easier to identify even when only seeing the file name.
It also eliminates quite some `../` segments in imports.
Reviewed By: mjesun
Differential Revision: D7587186
fbshipit-source-id: cf7e6b417085435d731c5b6830309068035bcd19
Summary: Fixes a typo with a property name that flow did not catch.
Reviewed By: mjesun
Differential Revision: D7582300
fbshipit-source-id: 039550dffb0f22ed8d2820e7fdcbe35c1d012c68
Summary:
BREAKING CHANGE
This change upgrades the React Native build pipeline from Babel 6 to Babel 7
If you use a `.babelrc` then you'll need to update it to Babel 7 (note that some plugins are no longer relevant, some plugins are automatically upgraded, and some will need some manual love).
Note that you may also need to upgrade your dev env, tests etc, to make sure they work with Babel 7.
Reviewed By: cpojer
Differential Revision: D7097279
fbshipit-source-id: 9fb204cae733174a1c155669b7c17ddb70f7aecc