Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions clients/devtools-report-assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
const cachedResources = Runtime.cachedResources;

module.exports = {
REPORT_CSS: cachedResources['audits2/lighthouse/report.css'],
REPORT_JAVASCRIPT: cachedResources['audits2/lighthouse/report.js'],
REPORT_TEMPLATE: cachedResources['audits2/lighthouse/template.html'],
REPORT_TEMPLATES: cachedResources['audits2/lighthouse/templates.html'],
REPORT_CSS: cachedResources['audits/lighthouse/report.css'],
REPORT_JAVASCRIPT: cachedResources['audits/lighthouse/report.js'],
REPORT_TEMPLATE: cachedResources['audits/lighthouse/template.html'],
REPORT_TEMPLATES: cachedResources['audits/lighthouse/templates.html'],
};
2 changes: 1 addition & 1 deletion lighthouse-core/report/html/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ The renderer was designed to be portable across various environments.

1. _LH Chrome Extension_: It [creates the HTML as the runner finishes up](https://github.com/GoogleChrome/lighthouse/blob/440155cdda377c458c0efce006bc3a69ce2a351c/lighthouse-core/runner.js#L137-L138) and transforms it [into a blob url in the background page](https://github.com/GoogleChrome/lighthouse/blob/440155cdda377c458c0efce006bc3a69ce2a351c/lighthouse-extension/app/src/lighthouse-ext-background.js#L129-L143).
1. _LH CLI_: It [creates the HTML as the runner finishes up](https://github.com/GoogleChrome/lighthouse/blob/440155cdda377c458c0efce006bc3a69ce2a351c/lighthouse-core/runner.js#L137-L138) and [saves it to disk](https://github.com/GoogleChrome/lighthouse/blob/440155cdda377c458c0efce006bc3a69ce2a351c/lighthouse-cli/printer.js#L71-L92).
1. _Chrome DevTools Audits Panel_: The `renderer` files are rolled into the Chromium repo, and they execute within the DevTools context. The audits panel [receives the LHR object from a WebWorker](https://github.com/ChromeDevTools/devtools-frontend/blob/master/front_end/audits2/Audits2ProtocolService.js#L27-L35), through a `postMessage` and then runs [the renderer within DevTools UI](https://github.com/ChromeDevTools/devtools-frontend/blob/fee00605cada877c1f8e3aae758a0f8d05b64476/front_end/audits2/Audits2Panel.js#L519-L542), making a few upgrades ([one](https://github.com/ChromeDevTools/devtools-frontend/blob/fee00605cada877c1f8e3aae758a0f8d05b64476/front_end/audits2/Audits2Panel.js#L570-L583), [two](https://github.com/ChromeDevTools/devtools-frontend/blob/fee00605cada877c1f8e3aae758a0f8d05b64476/front_end/audits2/Audits2Panel.js#L596-L637)) and [simplifications](https://github.com/ChromeDevTools/devtools-frontend/blob/fee00605cada877c1f8e3aae758a0f8d05b64476/front_end/audits2/Audits2Panel.js#L275-L304).
1. _Chrome DevTools Audits Panel_: The `renderer` files are rolled into the Chromium repo, and they execute within the DevTools context. The audits panel [receives the LHR object from a WebWorker](https://github.com/ChromeDevTools/devtools-frontend/blob/aa1532c2f8bdc37c9886255644ed90ad01c61c77/front_end/audits/AuditsProtocolService.js#L27-L35), through a `postMessage` and then runs [the renderer within DevTools UI](https://github.com/ChromeDevTools/devtools-frontend/blob/aa1532c2f8bdc37c9886255644ed90ad01c61c77/front_end/audits/AuditsPanel.js#L123-L157), making a few [simplifications](https://github.com/ChromeDevTools/devtools-frontend/blob/master/front_end/audits/AuditsReportRenderer.js).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should the last link be hashed based too?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah it could. The other links are anchored to specific lines of code, but the last one is just the file. so i thought it could be unversioned.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't care either way. Although, I'm not sure if this documentation is even useful to anyone.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Meh, I don't feel strongly I agree it probably won't matter in the end. Fine by me to land :)

1. _Hosted [Lighthouse Viewer](https://googlechrome.github.io/lighthouse/viewer/)_: It's a webapp that has the renderer (along with some [additional features](https://github.com/GoogleChrome/lighthouse/blob/master/lighthouse-core/report/html/renderer/report-ui-features.js)) all compiled into a [`viewer.js`](https://googlechrome.github.io/lighthouse/viewer/src/viewer.js) file. Same [basic approach](https://github.com/GoogleChrome/lighthouse/blob/440155cdda377c458c0efce006bc3a69ce2a351c/lighthouse-viewer/app/src/lighthouse-report-viewer.js#L116-L117) there.

### Polyfills
Expand Down
10 changes: 5 additions & 5 deletions lighthouse-core/scripts/compile-against-devtools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
set -x

# This the text here will override the renderer/ files in in the scripts[] array:
# https://github.com/ChromeDevTools/devtools-frontend/blob/master/front_end/audits2/module.json#L20
# https://github.com/ChromeDevTools/devtools-frontend/blob/master/front_end/audits/module.json#L20

# (Currently this doesnt include logger or report-features)
files_to_include="\"lighthouse\/renderer\/util.js\", \"lighthouse\/renderer\/dom.js\", \"lighthouse\/renderer\/category-renderer.js\", \"lighthouse\/renderer\/performance-category-renderer.js\", \"lighthouse\/renderer\/crc-details-renderer.js\", \"lighthouse\/renderer\/details-renderer.js\", \"lighthouse\/renderer\/report-renderer.js\","
Expand Down Expand Up @@ -54,13 +54,13 @@ cd "$lhroot_path" || exit 1
yarn devtools "$frontend_path/front_end/"

#
# monkeypatch the audits2 module.json to include any new files we're added that aren't present
# monkeypatch the audits module.json to include any new files we're added that aren't present
#
audit2_modulejson_path="$frontend_path/front_end/audits2/module.json"
audit_modulejson_path="$frontend_path/front_end/audits/module.json"
# remove existing renderer file mentions
sed -i='' 's/.*\/renderer\/.*//' $audit2_modulejson_path
sed -i='' 's/.*\/renderer\/.*//' $audit_modulejson_path
# add in our hardcoded renderer file mentions
sed -i='' "s/\"Audits2Panel\.js\"/ $files_to_include \"Audits2Panel.js\"/" $audit2_modulejson_path
sed -i='' "s/\"AuditsPanel\.js\"/ $files_to_include \"AuditsPanel.js\"/" $audit_modulejson_path

# compile, finally
python "$frontend_path/scripts/compile_frontend.py" --protocol-externs-file "$protocol_path/externs/protocol_externs.js"
Expand Down
4 changes: 2 additions & 2 deletions lighthouse-core/scripts/roll-to-devtools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ else
fi

report_dir="lighthouse-core/report/html"
fe_lh_dir="$frontend_dir/audits2/lighthouse"
fe_lh_dir="$frontend_dir/audits/lighthouse"

lh_bg_js="dist/lighthouse-dt-bundle.js"
lh_worker_dir="$frontend_dir/audits2_worker/lighthouse"
lh_worker_dir="$frontend_dir/audits_worker/lighthouse"

# copy lighthouse-dt-bundle (potentially stale)
cp -pPR "$lh_bg_js" "$lh_worker_dir/lighthouse-dt-bundle.js"
Expand Down