Skip to content

Commit

Permalink
Add support for efficiently reusing transform results across variants
Browse files Browse the repository at this point in the history
Reviewed By: cpojer

Differential Revision: D22036656

fbshipit-source-id: 31873a00c982eacf03802491bd0a3e6d172a06be
  • Loading branch information
motiz88 authored and facebook-github-bot committed Jun 29, 2020
1 parent e8e4fc7 commit 920ba69
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions packages/metro/src/ModuleGraph/types.flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ export type PackageData = {|

export type ResolveFn = (id: string, source: ?string) => string;

export type TransformResult = {|
export type TransformResult = ConcreteTransformResult | LinkedTransformResult;

export type ConcreteTransformResult = {
code: string,
dependencies: $ReadOnlyArray<TransformResultDependency>,
dependencyMapName?: string,
Expand All @@ -138,9 +140,14 @@ export type TransformResult = {|
...
},
isESModule?: true,
|};
};

export type TransformResults = {[string]: TransformResult, ...};
export type LinkedTransformResult = $ReadOnly<{sourceVariantName: string}>;

export type TransformResults = {
+[string]: TransformResult,
...,
};

export type TransformVariants = {+[name: string]: {...}, ...};

Expand Down

0 comments on commit 920ba69

Please sign in to comment.