Skip to content

Commit

Permalink
remove report v1 and dependencies (#2596)
Browse files Browse the repository at this point in the history
removes removes report as well as formatters, handlebars, handlebar build files, etc
  • Loading branch information
brendankenny committed Jun 28, 2017
1 parent 56eaa50 commit fadaef9
Show file tree
Hide file tree
Showing 96 changed files with 265 additions and 6,047 deletions.
4 changes: 0 additions & 4 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,5 @@ lighthouse-cli/types/*.js
!chrome-launcher/compiled-check.js
chrome-launcher/*.js

# Handlebar-templates
lighthouse-core/report/templates/report-templates.js
lighthouse-core/report/partials/templates/report-partials.js

# Generated files
plots/out*
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,4 @@ lighthouse-cli/types/*.map
/chrome-win32/
/chrome.zip

lighthouse-core/report/partials/templates/
lighthouse-core/report/templates/*.js

plots/out**
2 changes: 0 additions & 2 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
.vscode/
assets/
coverage/
gulp/

lighthouse-core/scripts/
lighthouse-core/test/
Expand Down Expand Up @@ -50,4 +49,3 @@ results.html
.eslintignore
.eslintrc.js
.travis.yml
gulpfile.js
18 changes: 0 additions & 18 deletions docs/hacking-tips.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,24 +46,6 @@ const html = new ReportGeneratorV2().generateReportHtml(results);
console.log(html);
```

## Iterating on the v1 report

```sh
node generate_report.js > temp.report.html; open temp.report.html
```

```js
// generate_report.js
'use strict';

const ReportGenerator = require('./lighthouse-core/report/report-generator');
const results = require('./lighthouse-core/test/results/sample.json');
const reportGenerator = new ReportGenerator();
const html = reportGenerator.generateHTML(results, 'devtools');

console.log(html);
```

## Debugging Travis via docker image

You can do a local docker image install of Travis to better inspect a travis build:
Expand Down
38 changes: 0 additions & 38 deletions gulp/compile.js

This file was deleted.

14 changes: 0 additions & 14 deletions gulp/config.js

This file was deleted.

27 changes: 0 additions & 27 deletions gulpfile.js

This file was deleted.

1 change: 0 additions & 1 deletion jsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"**/dist/*",
"**/app/scripts/*",

"lighthouse-core/report/templates/*.js",
"lighthouse-core/closure"
]
}
3 changes: 1 addition & 2 deletions lighthouse-cli/compiled-check.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ const path = require('path');

module.exports = function(filename) {
if (!fs.existsSync(path.join(__dirname, filename))) {
console.log('Oops! Looks like the CLI or templates needs to be compiled. Please run:');
console.log('Oops! Looks like the CLI needs to be compiled. Please run:');
console.log(' yarn install-cli; yarn build-cli;');
console.log(' gulp;');
console.log('More at: https://github.com/GoogleChrome/lighthouse#develop');
process.exit(1);
}
Expand Down
1 change: 0 additions & 1 deletion lighthouse-cli/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@
require('./compiled-check.js')('bin.js');
require('./compiled-check.js')('printer.js');
require('./compiled-check.js')('shim-modules.js');
require('./compiled-check.js')('../lighthouse-core/report/templates/report-templates.js');

require('./bin.js').run();
13 changes: 7 additions & 6 deletions lighthouse-cli/performance-experiment/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const parse = require('url').parse;
const log = require('lighthouse-logger');
const lighthouse = require('../../lighthouse-core');
const ExperimentDatabase = require('./experiment-database/database');
const PerfXReportGenerator = require('./report/perf-x-report-generator');
// const PerfXReportGenerator = require('./report/perf-x-report-generator');
const opn = require('../shim-modules').opn;

let database;
Expand Down Expand Up @@ -89,7 +89,7 @@ function requestHandler(request, response) {

function reportRequestHandler(request, response) {
try {
const id = request.parsedUrl.query.id || fallbackReportId;
// const id = request.parsedUrl.query.id || fallbackReportId;

const reportsMetadata = Object.keys(database.timeStamps).map(key => {
const generatedTime = database.timeStamps[key];
Expand All @@ -98,13 +98,14 @@ function reportRequestHandler(request, response) {
reportsMetadata.sort((metadata1, metadata2) => {
return new Date(metadata1.generatedTime) - new Date(metadata2.generatedTime);
});
const reportsCatalog = {reportsMetadata, selectedReportHref: `/?id=${id}`};
// const reportsCatalog = {reportsMetadata, selectedReportHref: `/?id=${id}`};

const results = database.getResults(id);
const perfXReportGenerator = new PerfXReportGenerator();
// const results = database.getResults(id);
// const perfXReportGenerator = new PerfXReportGenerator();

response.writeHead(200, {'Content-Type': 'text/html'});
response.end(perfXReportGenerator.generateHTML(results, 'perf-x', reportsCatalog));
// response.end(perfXReportGenerator.generateHTML(results, 'perf-x', reportsCatalog));
response.end('Report not generated.');
} catch (err) {
throw new HTTPError(404);
}
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-cli/printer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* An enumeration of acceptable output modes:
* 'json': JSON formatted results
* 'html': An HTML report
* 'domhtml': An HTML report rendered client-side with DOM elements
* 'domhtml': Alias for 'html' report
*/
enum OutputMode {
json,
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-cli/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export function saveResults(results: Results, artifacts: Object, flags: Flags) {
promise = promise.then(_ => assetSaver.saveAssets(artifacts, results.audits, resolvedPath));
}

const typeToExtension = (type: string) => type === 'domhtml' ? 'dom.html' : type;
const typeToExtension = (type: string) => type === 'domhtml' ? 'html' : type;
return promise.then(_ => {
if (Array.isArray(flags.output)) {
return flags.output.reduce((innerPromise, outputType) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ const assert = require('assert');
const fs = require('fs');

const PerfXDatabase = require('../../../performance-experiment/experiment-database/database');
const sampleResults = require('../../../../lighthouse-core/test/results/sample');
const sampleResults = require('../../../../lighthouse-core/test/results/sample_v2');

describe('Perf-X Database', function() {
// TODO: Update/retire PerfX
describe.skip('Perf-X Database', function() {
let perfXDatabase;
beforeEach(() => perfXDatabase = new PerfXDatabase());
afterEach(() => perfXDatabase.clear());
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-cli/test/cli/printer-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require('../../compiled-check.js')('printer.js');
const Printer = require('../../printer.js');
const assert = require('assert');
const fs = require('fs');
const sampleResults = require('../../../lighthouse-core/test/results/sample.json');
const sampleResults = require('../../../lighthouse-core/test/results/sample_v2.json');

describe('Printer', () => {
it('accepts valid output paths', () => {
Expand Down
2 changes: 1 addition & 1 deletion lighthouse-cli/test/fixtures/dobetterweb/dbw_tester.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<!-- Note: these will only fail when using the static-server.js, which supports the ?delay=true param.
If you're using your own server, the resource will load instantly and the
stylesheets will be ignored for being below the threshold. -->
<!-- we use a relative protocol url to test that `new URL(resource)` in the critical-request-chains.js formatter can handle it -->
<!-- we use a relative protocol url to test that `new URL(resource)` in the critical-request-chains.js audit can handle it -->
<link rel="stylesheet" href="//localhost:10200/dobetterweb/dbw_tester.css?delay=100"> <!-- FAIL, when run under smokehouse -->
<link rel="stylesheet" href="./unknown404.css?delay=200"> <!-- FAIL -->
<link rel="stylesheet" href="./dbw_tester.css?delay=2200"> <!-- FAIL -->
Expand Down
63 changes: 63 additions & 0 deletions lighthouse-cli/test/smokehouse/dobetterweb/dbw-expectations.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ module.exports = [
length: 14
}
}
},
details: {
items: {
length: 14
}
}
},
'external-anchors-use-rel-noopener': {
Expand All @@ -39,6 +44,11 @@ module.exports = [
value: {
length: 3
}
},
details: {
items: {
length: 3
}
}
},
'appcache-manifest': {
Expand All @@ -56,6 +66,11 @@ module.exports = [
length: 4
}
}
},
details: {
items: {
length: 4
}
}
},
'no-document-write': {
Expand All @@ -64,6 +79,11 @@ module.exports = [
value: {
length: 3
}
},
details: {
items: {
length: 3
}
}
},
'no-mutation-events': {
Expand All @@ -74,6 +94,11 @@ module.exports = [
length: 6
}
}
},
details: {
items: {
length: 6
}
}
},
// 'no-old-flexbox': {
Expand Down Expand Up @@ -102,6 +127,11 @@ module.exports = [
length: 1
}
}
},
details: {
items: {
length: 1
}
}
},
'uses-passive-event-listeners': {
Expand All @@ -120,6 +150,11 @@ module.exports = [
value: {
length: 4
}
},
details: {
items: {
length: 4
}
}
},
'password-inputs-can-be-pasted-into': {
Expand All @@ -143,6 +178,13 @@ module.exports = [
1: {value: '7'},
2: {value: '1,303'}
}
},
details: {
items: {
0: {value: '1,324'},
1: {value: '7'},
2: {value: '1,303'}
}
}
}
}
Expand All @@ -158,6 +200,13 @@ module.exports = [
1: {value: '9'},
2: {value: '6,003'}
}
},
details: {
items: {
0: {value: '6,025'},
1: {value: '9'},
2: {value: '6,003'}
}
}
}
}
Expand All @@ -173,6 +222,13 @@ module.exports = [
1: {value: '9'},
2: {value: '9'}
}
},
details: {
items: {
0: {value: '25'},
1: {value: '9'},
2: {value: '9'}
}
}
}
}
Expand All @@ -188,6 +244,13 @@ module.exports = [
1: {value: '7'},
2: {value: '9'}
}
},
details: {
items: {
0: {value: '24'},
1: {value: '7'},
2: {value: '9'}
}
}
}
}
Expand Down
Loading

0 comments on commit fadaef9

Please sign in to comment.