Cleanup packager dead debug endpoint

Summary:
When trying to access the debug dependency graph through the `/debug/graph` endpoint of the packager server (documented in the packager README and listed as well when hitting the root `/debug` endpoint), all I am getting back is a nasty HTTP 500 error :'(

What triggers this HTTP 500 is a `TypeError` being thrown while trying to access a function that doesn't exists (anymore). Here is the error log of the packager when trying to access this endpoint :

```
TypeError: this._depGraph.getDebugInfo is not a function
    at Resolver.getDebugInfo (index.js:270:27)
    at Bundler.getGraphDebugInfo (index.js:575:27)
    at Server._processDebugRequest (index.js:369:28)
    at Server.processRequest (index.js:423:12)
    at next (/Users/blemair/Code/DependencyGraphTest/node_modules/connect/lib/proto.js:174:15)
    at Object.module.exports [as handle] (cpuProfilerMiddleware.js:17:5)
    at next (/Users/blemair/Code/DependencyGraphTest/node_modules/connect/lib/proto.js:174:15)
    at Object.module.exports [as
Closes https://github.com/facebook/react-native/pull/8117

Differential Revision: D3445582

fbshipit-source-id: cf5af8bbba293f39773f32814a3b388b7ff67bf7
This commit is contained in:
Benoit Lemaire 2016-06-16 14:16:22 -07:00 committed by Facebook Github Bot 7
parent 3f058100cd
commit 50d5275fc0
4 changed files with 1 additions and 16 deletions

View File

@ -72,12 +72,10 @@ Here are the current options the packager accepts:
### /debug
This is a page used for debugging, it has links to two pages:
This is a page used for debugging, it offers a link to a single page :
* Cached Packages: which shows you the packages that's been already
generated and cached
* Dependency Graph: is the in-memory graph of all the modules and
their dependencies
## Programmatic API

View File

@ -566,10 +566,6 @@ class Bundler {
});
}
getGraphDebugInfo() {
return this._resolver.getDebugInfo();
}
_generateAssetModule_DEPRECATED(bundle, module, getModuleId) {
return Promise.all([
sizeOf(module.path),

View File

@ -265,10 +265,6 @@ class Resolver {
minifyModule({path, code, map}) {
return this._minifyCode(path, code, map);
}
getDebugInfo() {
return this._depGraph.getDebugInfo();
}
}
function defineModuleCode(moduleName, code, verboseName = '', dev = true) {

View File

@ -348,7 +348,6 @@ class Server {
const parts = pathname.split('/').filter(Boolean);
if (parts.length === 1) {
ret += '<div><a href="/debug/bundles">Cached Bundles</a></div>';
ret += '<div><a href="/debug/graph">Dependency Graph</a></div>';
res.end(ret);
} else if (parts[1] === 'bundles') {
ret += '<h1> Cached Bundles </h1>';
@ -365,10 +364,6 @@ class Server {
console.log(e.stack); // eslint-disable-line no-console-disallow
}
);
} else if (parts[1] === 'graph'){
ret += '<h1> Dependency Graph </h2>';
ret += this._bundler.getGraphDebugInfo();
res.end(ret);
} else {
res.writeHead('404');
res.end('Invalid debug request');