-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
report(flow): report api #13374
report(flow): report api #13374
Conversation
function __initLighthouseFlowReport__() { | ||
// TODO(adamraine): add lh-vars, etc classes programmatically instead of in the HTML template |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drive-by resolving this TODO
* @return {DocumentFragment} | ||
*/ | ||
function renderCategoryScore(category, options) { | ||
const dom = new DOM(document, document.documentElement); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@paulirish we discussed making these globals, but that lead to some jest issues where the globals are persistent across tests. I didn't think it would be a big deal to create new instances on each call.
Another option would be to use globals and expose a _resetGlobals
function for testing or something.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah i like what you did here. this seems like a great solution for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a few thoughts. otherwise this lg
* @return {DocumentFragment} | ||
*/ | ||
function renderCategoryScore(category, options) { | ||
const dom = new DOM(document, document.documentElement); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah i like what you did here. this seems like a great solution for now.
Use new report api in the flow report and removes
ReportRendererContext
. We still do some flow-specific stuff (e.g. removing labels from gauges), but it's handled by options on the report API now.Individual LH reports in the flow will now be initialized with
ReportUIFeatures
, adding support for the treemap button and 3P filter in flows. Topbar, dark mode, and fireworks are disabled via report api options.