mirror of https://github.com/status-im/metro.git
Lazily access source all the way up
Reviewed By: jeanlauliac Differential Revision: D7602299 fbshipit-source-id: e3787d164a691350cb37183b4738947902cc85cf
This commit is contained in:
parent
55e7e50232
commit
b278e42155
|
@ -232,7 +232,15 @@ async function processEdge(
|
||||||
// Update the edge information.
|
// Update the edge information.
|
||||||
edge.output.code = result.code;
|
edge.output.code = result.code;
|
||||||
edge.output.map = result.map;
|
edge.output.map = result.map;
|
||||||
edge.output.source = result.source;
|
// TODO(T28259615): Remove as soon as possible to avoid leaking.
|
||||||
|
// Lazily access source code; if not needed, don't read the file.
|
||||||
|
// eslint-disable-next-line lint/flow-no-fixme
|
||||||
|
// $FlowFixMe: "defineProperty" with a getter is buggy in flow.
|
||||||
|
Object.defineProperty(edge.output, 'source', {
|
||||||
|
configurable: true,
|
||||||
|
enumerable: true,
|
||||||
|
get: () => result.source,
|
||||||
|
});
|
||||||
edge.dependencies = new Map();
|
edge.dependencies = new Map();
|
||||||
|
|
||||||
currentDependencies.forEach((absolutePath, relativePath) => {
|
currentDependencies.forEach((absolutePath, relativePath) => {
|
||||||
|
|
Loading…
Reference in New Issue