mirror of https://github.com/status-im/metro.git
packager: node-haste: do not expose HasteMap
Reviewed By: davidaurelio Differential Revision: D4598085 fbshipit-source-id: d993be8e3bdcfda018a898b4adb32b53c1f0a948
This commit is contained in:
parent
6fa8dedfb5
commit
a8570b6b98
|
@ -81,7 +81,7 @@ class DependencyGraph {
|
||||||
_helpers: DependencyGraphHelpers;
|
_helpers: DependencyGraphHelpers;
|
||||||
_moduleCache: ModuleCache;
|
_moduleCache: ModuleCache;
|
||||||
|
|
||||||
_loading: Promise<mixed>;
|
_loading: Promise<void>;
|
||||||
|
|
||||||
constructor(opts: Options) {
|
constructor(opts: Options) {
|
||||||
this._opts = {...opts};
|
this._opts = {...opts};
|
||||||
|
@ -89,7 +89,7 @@ class DependencyGraph {
|
||||||
this.load();
|
this.load();
|
||||||
}
|
}
|
||||||
|
|
||||||
load() {
|
load(): Promise<void> {
|
||||||
if (this._loading) {
|
if (this._loading) {
|
||||||
return this._loading;
|
return this._loading;
|
||||||
}
|
}
|
||||||
|
@ -164,7 +164,6 @@ class DependencyGraph {
|
||||||
log(createActionEndEntry(buildingHasteMapLogEntry));
|
log(createActionEndEntry(buildingHasteMapLogEntry));
|
||||||
log(createActionEndEntry(initializingPackagerLogEntry));
|
log(createActionEndEntry(initializingPackagerLogEntry));
|
||||||
this._opts.reporter.update({type: 'dep_graph_loaded'});
|
this._opts.reporter.update({type: 'dep_graph_loaded'});
|
||||||
return map;
|
|
||||||
},
|
},
|
||||||
err => {
|
err => {
|
||||||
const error = new Error(
|
const error = new Error(
|
||||||
|
@ -300,7 +299,7 @@ class DependencyGraph {
|
||||||
this._hasteMapError = null;
|
this._hasteMapError = null;
|
||||||
|
|
||||||
// Rebuild the entire map if last change resulted in an error.
|
// Rebuild the entire map if last change resulted in an error.
|
||||||
this._loading = this._hasteMap.build();
|
this._loading = this._hasteMap.build().then(() => {});
|
||||||
} else {
|
} else {
|
||||||
this._loading = this._hasteMap.processFileChange(type, filePath);
|
this._loading = this._hasteMap.processFileChange(type, filePath);
|
||||||
this._loading.catch(error => {
|
this._loading.catch(error => {
|
||||||
|
|
Loading…
Reference in New Issue