Skip file removal on HMR interface

Summary:
public

We're not planning to accept file removals in the short term on the HMR interface so lets bail when a file is removed (before this this we were throwing when trying to get the shallow dependencies).

Reviewed By: yungsters

Differential Revision: D2810534

fb-gh-sync-id: f2733382f4a2619e22bdf1163aa4180694fff9f8
This commit is contained in:
Martín Bigio 2016-01-07 08:48:39 -08:00 committed by facebook-github-bot-3
parent a62f260680
commit 0680259ad4
4 changed files with 13 additions and 1 deletions

View File

@ -320,6 +320,10 @@ class Bundler {
return this._resolver.getShallowDependencies(entryFile);
}
stat(filePath) {
return this._resolver.stat(filePath);
}
getModuleForPath(entryFile) {
return this._resolver.getModuleForPath(entryFile);
}

View File

@ -145,6 +145,10 @@ class DependencyGraph {
return this._moduleCache.getModule(entryPath).getDependencies();
}
stat(filePath) {
return this._fastfs.stat(filePath);
}
/**
* Returns the module object for the given path.
*/

View File

@ -105,6 +105,10 @@ class Resolver {
return this._depGraph.getShallowDependencies(entryFile);
}
stat(filePath) {
return this._depGraph.stat(filePath);
}
getModuleForPath(entryFile) {
return this._depGraph.getModuleForPath(entryFile);
}

View File

@ -184,7 +184,7 @@ class Server {
// updates. Instead, send the HMR updates right away and once that
// finishes, invoke any other file change listener.
if (this._hmrFileChangeListener) {
this._hmrFileChangeListener(filePath);
this._hmrFileChangeListener(filePath, this._bundler.stat(filePath));
return;
}