diff --git a/react-packager/src/DependencyResolver/DependencyGraph/index.js b/react-packager/src/DependencyResolver/DependencyGraph/index.js index 2daab227..f2b77f4d 100644 --- a/react-packager/src/DependencyResolver/DependencyGraph/index.js +++ b/react-packager/src/DependencyResolver/DependencyGraph/index.js @@ -89,10 +89,15 @@ class DependencyGraph { }); this._crawling.then((files) => Activity.endEvent(crawlActivity)); - this._fastfs = new Fastfs(this._opts.roots, this._opts.fileWatcher, { - ignore: this._opts.ignoreFilePath, - crawling: this._crawling, - }); + this._fastfs = new Fastfs( + 'JavaScript', + this._opts.roots, + this._opts.fileWatcher, + { + ignore: this._opts.ignoreFilePath, + crawling: this._crawling, + } + ); this._fastfs.on('change', this._processFileChange.bind(this)); @@ -544,6 +549,7 @@ class DependencyGraph { this._assetMap_DEPRECATED = Object.create(null); const fastfs = new Fastfs( + 'Assets', this._opts.assetRoots_DEPRECATED, this._opts.fileWatcher, { ignore: this._opts.ignoreFilePath, crawling: this._crawling } diff --git a/react-packager/src/DependencyResolver/__tests__/Module-test.js b/react-packager/src/DependencyResolver/__tests__/Module-test.js index 171e8230..640157d9 100644 --- a/react-packager/src/DependencyResolver/__tests__/Module-test.js +++ b/react-packager/src/DependencyResolver/__tests__/Module-test.js @@ -40,6 +40,7 @@ describe('Module', () => { describe('Async Dependencies', () => { function expectAsyncDependenciesToEqual(expected) { var fastfs = new Fastfs( + 'test', ['/root'], fileWatcher, {crawling: Promise.resolve(['/root/index.js']), ignore: []}, diff --git a/react-packager/src/DependencyResolver/fastfs.js b/react-packager/src/DependencyResolver/fastfs.js index 944d411a..a4c04232 100644 --- a/react-packager/src/DependencyResolver/fastfs.js +++ b/react-packager/src/DependencyResolver/fastfs.js @@ -14,8 +14,9 @@ const stat = Promise.denodeify(fs.stat); const hasOwn = Object.prototype.hasOwnProperty; class Fastfs extends EventEmitter { - constructor(roots, fileWatcher, {ignore, crawling}) { + constructor(name, roots, fileWatcher, {ignore, crawling}) { super(); + this._name = name; this._fileWatcher = fileWatcher; this._ignore = ignore; this._roots = roots.map(root => new File(root, { isDir: true })); @@ -29,7 +30,7 @@ class Fastfs extends EventEmitter { ); 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 => { if (filePath.match(rootsPattern)) { const newFile = new File(filePath, { isDir: false });