Expose getDependencies when using RAM bundles

Reviewed By: rafeca

Differential Revision: D6965192

fbshipit-source-id: 8f4178aa4c38c03beab6da8bcaf4dc193c02b044
This commit is contained in:
Christoph Nakazawa 2018-02-12 09:43:47 -08:00 committed by Facebook Github Bot
parent 918e1a384c
commit 892b4ac9de
3 changed files with 10 additions and 3 deletions

View File

@ -37,6 +37,7 @@ export type Options = BundleOptions & {
export type RamModule = ModuleTransportLike;
export type RamBundleInfo = {
getDependencies: string => Set<string>,
startupModules: $ReadOnlyArray<RamModule>,
lazyModules: $ReadOnlyArray<RamModule>,
groups: Map<number, Set<number>>,
@ -218,9 +219,10 @@ async function getRamBundleInfo(
);
return {
startupModules,
lazyModules,
getDependencies,
groups,
lazyModules,
startupModules,
};
}

View File

@ -117,6 +117,7 @@ Array [
exports[`Serializers should return the RAM bundle info 1`] = `
Object {
"getDependencies": [Function],
"groups": Map {},
"lazyModules": Array [
Object {
@ -191,6 +192,7 @@ Object {
exports[`Serializers should return the RAM bundle info 2`] = `
Object {
"getDependencies": [Function],
"groups": Map {},
"lazyModules": Array [
Object {
@ -403,6 +405,7 @@ Object {
exports[`Serializers should use the preloadedModules and ramGroup configs to build a RAM bundle 1`] = `
Object {
"getDependencies": [Function],
"groups": Map {
5 => Set {
6,

View File

@ -338,8 +338,9 @@ exports.runBuild = async ({
try {
metroBundle = await output.build(metroServer, requestOptions);
} finally {
} catch (error) {
await metroServer.end();
throw error;
}
if (onComplete) {
@ -358,6 +359,7 @@ exports.runBuild = async ({
};
await output.save(metroBundle, outputOptions, console.log);
await metroServer.end();
return {metroServer, metroBundle};
};