mirror of https://github.com/status-im/metro.git
[react-packager] Add more granular Activity logging
This commit is contained in:
parent
49fde903b8
commit
8c521f9749
|
@ -101,7 +101,7 @@ class DependencyGraph {
|
||||||
this._loading = Promise.all([
|
this._loading = Promise.all([
|
||||||
this._fastfs.build()
|
this._fastfs.build()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
const hasteActivity = Activity.startEvent('haste map');
|
const hasteActivity = Activity.startEvent('Building Haste Map');
|
||||||
this._buildHasteMap().then(() => Activity.endEvent(hasteActivity));
|
this._buildHasteMap().then(() => Activity.endEvent(hasteActivity));
|
||||||
}),
|
}),
|
||||||
this._buildAssetMap_DEPRECATED(),
|
this._buildAssetMap_DEPRECATED(),
|
||||||
|
@ -518,9 +518,18 @@ class DependencyGraph {
|
||||||
fastfs.on('change', this._processAssetChange_DEPRECATED.bind(this));
|
fastfs.on('change', this._processAssetChange_DEPRECATED.bind(this));
|
||||||
|
|
||||||
return fastfs.build().then(
|
return fastfs.build().then(
|
||||||
() => fastfs.findFilesByExts(this._opts.assetExts).map(
|
() => {
|
||||||
file => this._processAsset_DEPRECATED(file)
|
const processAsset_DEPRECATEDActivity = Activity.startEvent(
|
||||||
)
|
'Building (deprecated) Asset Map',
|
||||||
|
);
|
||||||
|
|
||||||
|
const assets = fastfs.findFilesByExts(this._opts.assetExts).map(
|
||||||
|
file => this._processAsset_DEPRECATED(file)
|
||||||
|
);
|
||||||
|
|
||||||
|
Activity.endEvent(processAsset_DEPRECATEDActivity);
|
||||||
|
return assets;
|
||||||
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
const Activity = require('../Activity');
|
||||||
const Promise = require('promise');
|
const Promise = require('promise');
|
||||||
const {EventEmitter} = require('events');
|
const {EventEmitter} = require('events');
|
||||||
|
|
||||||
|
@ -28,6 +29,7 @@ class Fastfs extends EventEmitter {
|
||||||
);
|
);
|
||||||
|
|
||||||
return this._crawling.then(files => {
|
return this._crawling.then(files => {
|
||||||
|
const fastfsActivity = Activity.startEvent('Building in-memory fs');
|
||||||
files.forEach(filePath => {
|
files.forEach(filePath => {
|
||||||
if (filePath.match(rootsPattern)) {
|
if (filePath.match(rootsPattern)) {
|
||||||
const newFile = new File(filePath, { isDir: false });
|
const newFile = new File(filePath, { isDir: false });
|
||||||
|
@ -44,6 +46,7 @@ class Fastfs extends EventEmitter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Activity.endEvent(fastfsActivity);
|
||||||
this._fileWatcher.on('all', this._processFileChange.bind(this));
|
this._fileWatcher.on('all', this._processFileChange.bind(this));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue