mirror of
https://github.com/status-im/metro.git
synced 2025-02-11 18:47:20 +00:00
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:
parent
a62f260680
commit
0680259ad4
4
react-packager/src/Bundler/index.js
vendored
4
react-packager/src/Bundler/index.js
vendored
@ -320,6 +320,10 @@ class Bundler {
|
|||||||
return this._resolver.getShallowDependencies(entryFile);
|
return this._resolver.getShallowDependencies(entryFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stat(filePath) {
|
||||||
|
return this._resolver.stat(filePath);
|
||||||
|
}
|
||||||
|
|
||||||
getModuleForPath(entryFile) {
|
getModuleForPath(entryFile) {
|
||||||
return this._resolver.getModuleForPath(entryFile);
|
return this._resolver.getModuleForPath(entryFile);
|
||||||
}
|
}
|
||||||
|
@ -145,6 +145,10 @@ class DependencyGraph {
|
|||||||
return this._moduleCache.getModule(entryPath).getDependencies();
|
return this._moduleCache.getModule(entryPath).getDependencies();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stat(filePath) {
|
||||||
|
return this._fastfs.stat(filePath);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the module object for the given path.
|
* Returns the module object for the given path.
|
||||||
*/
|
*/
|
||||||
|
4
react-packager/src/Resolver/index.js
vendored
4
react-packager/src/Resolver/index.js
vendored
@ -105,6 +105,10 @@ class Resolver {
|
|||||||
return this._depGraph.getShallowDependencies(entryFile);
|
return this._depGraph.getShallowDependencies(entryFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stat(filePath) {
|
||||||
|
return this._depGraph.stat(filePath);
|
||||||
|
}
|
||||||
|
|
||||||
getModuleForPath(entryFile) {
|
getModuleForPath(entryFile) {
|
||||||
return this._depGraph.getModuleForPath(entryFile);
|
return this._depGraph.getModuleForPath(entryFile);
|
||||||
}
|
}
|
||||||
|
2
react-packager/src/Server/index.js
vendored
2
react-packager/src/Server/index.js
vendored
@ -184,7 +184,7 @@ class Server {
|
|||||||
// updates. Instead, send the HMR updates right away and once that
|
// updates. Instead, send the HMR updates right away and once that
|
||||||
// finishes, invoke any other file change listener.
|
// finishes, invoke any other file change listener.
|
||||||
if (this._hmrFileChangeListener) {
|
if (this._hmrFileChangeListener) {
|
||||||
this._hmrFileChangeListener(filePath);
|
this._hmrFileChangeListener(filePath, this._bundler.stat(filePath));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user