[Logs] Name fs step

Summary:
There are two fs steps and it wasn't clear why. This now puts the right label:

```
[9:38:25 PM] <START> Building in-memory fs for JavaScript
[9:38:27 PM] <END>   Building in-memory fs for JavaScript (2030ms)
[9:38:27 PM] <START> Building in-memory fs for Assets
[9:38:27 PM] <END>   Building in-memory fs for Assets (615ms)
```
This commit is contained in:
Christopher Chedeau 2015-08-21 13:09:49 -07:00
parent 37774b463d
commit c675840fd9
3 changed files with 14 additions and 6 deletions

View File

@ -89,10 +89,15 @@ class DependencyGraph {
}); });
this._crawling.then((files) => Activity.endEvent(crawlActivity)); this._crawling.then((files) => Activity.endEvent(crawlActivity));
this._fastfs = new Fastfs(this._opts.roots, this._opts.fileWatcher, { this._fastfs = new Fastfs(
'JavaScript',
this._opts.roots,
this._opts.fileWatcher,
{
ignore: this._opts.ignoreFilePath, ignore: this._opts.ignoreFilePath,
crawling: this._crawling, crawling: this._crawling,
}); }
);
this._fastfs.on('change', this._processFileChange.bind(this)); this._fastfs.on('change', this._processFileChange.bind(this));
@ -544,6 +549,7 @@ class DependencyGraph {
this._assetMap_DEPRECATED = Object.create(null); this._assetMap_DEPRECATED = Object.create(null);
const fastfs = new Fastfs( const fastfs = new Fastfs(
'Assets',
this._opts.assetRoots_DEPRECATED, this._opts.assetRoots_DEPRECATED,
this._opts.fileWatcher, this._opts.fileWatcher,
{ ignore: this._opts.ignoreFilePath, crawling: this._crawling } { ignore: this._opts.ignoreFilePath, crawling: this._crawling }

View File

@ -40,6 +40,7 @@ describe('Module', () => {
describe('Async Dependencies', () => { describe('Async Dependencies', () => {
function expectAsyncDependenciesToEqual(expected) { function expectAsyncDependenciesToEqual(expected) {
var fastfs = new Fastfs( var fastfs = new Fastfs(
'test',
['/root'], ['/root'],
fileWatcher, fileWatcher,
{crawling: Promise.resolve(['/root/index.js']), ignore: []}, {crawling: Promise.resolve(['/root/index.js']), ignore: []},

View File

@ -14,8 +14,9 @@ const stat = Promise.denodeify(fs.stat);
const hasOwn = Object.prototype.hasOwnProperty; const hasOwn = Object.prototype.hasOwnProperty;
class Fastfs extends EventEmitter { class Fastfs extends EventEmitter {
constructor(roots, fileWatcher, {ignore, crawling}) { constructor(name, roots, fileWatcher, {ignore, crawling}) {
super(); super();
this._name = name;
this._fileWatcher = fileWatcher; this._fileWatcher = fileWatcher;
this._ignore = ignore; this._ignore = ignore;
this._roots = roots.map(root => new File(root, { isDir: true })); this._roots = roots.map(root => new File(root, { isDir: true }));
@ -29,7 +30,7 @@ class Fastfs extends EventEmitter {
); );
return this._crawling.then(files => { return this._crawling.then(files => {
const fastfsActivity = Activity.startEvent('Building in-memory fs'); const fastfsActivity = Activity.startEvent('Building in-memory fs for ' + this._name);
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 });