GoogleChrome/lighthouse

Possible Viewer 2.0 Improvements

Open

#2591 opened on Jun 23, 2017

View on GitHub
 (0 comments) (0 reactions) (0 assignees)JavaScript (27,768 stars) (9,278 forks)batch import
P3featuregood first issuehelp wantedviewer

Description

  • Reduce asset sizes:

    • Minify or dedupe report renderer js, css, and templates (included twice, for report rendering but also in a browserified bundle of ReportGenerator for html saving). Minifying just the JS before inlining would save about 75KB in viewer and lighthouse-background.

      This could either use the assets already in the page (but we'd need a non-awkward/maintainable way to do so) so they only appear once, or we could replace brfs with a transform that minifies the JS/CSS/HTML before inlining it as a string (this approach would also fix #2014)

    • Resize lh_logo_bg.png closer to the size it appears on screen (formerly #1569)

    • Minify in-page CSS (formerly #1552)

  • Experiment with versioned viewer/report scripts so old JSON results can still be loaded in viewer. May be less of a priority since we want to maintain some level of backwards compatibility so that DevTools can load old JSON reports.

    Could do this with a script that checks the version and redirects to a specific URL per LH version (easy), or could split viewer and report into separate bundles and load the right report bundle based on json version (harder).

  • PWAify Viewer

  • Switch Viewer to use event-based ga and logging, like report does.

  • Explore CSP options (for extension and HTML report, as well)

  • Verify that report is actually isolated to its container so that when the container is cleared the report is actually cleared. It's likely that event listeners, references, etc remain every time a new report is loaded.

  • Viewer could easily be added to the report compile step since they're designed to be loaded in the page at the same time. Would need to write idbKeyval and firebase externs.

Contributor guide