Skip to content
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(psi): retire prepareLabData, reuse standard report rendering #13229

Merged
merged 7 commits into from
Oct 19, 2021

Conversation

paulirish
Copy link
Member

@paulirish paulirish commented Oct 18, 2021

with v8.6.0 shipped we can now land our breaking report changes.

(legacy) PSI frontend may get updated to 8.6.0 but nothing further.

This PR removes the hacks-upon-hacks that is prepareLabData(). Yay for deleting some serious debt. 🎉
Now, the faux-psi sample report will adopt the standard report rendering approach currently used by psi-next. But otherwise it has tabs.

With this done, there are a few 'broken' items in faux-psi that I'll be addressing in followups.

@paulirish paulirish requested a review from a team as a code owner October 18, 2021 21:20
@paulirish paulirish requested review from connorjclark and removed request for a team October 18, 2021 21:20
@google-cla google-cla bot added the cla: yes label Oct 18, 2021
Copy link
Member

@brendankenny brendankenny left a comment

Choose a reason for hiding this comment

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

lovely PR

(not sure when @connorjclark will be back but feel free to disregard the LGTM if you'd rather wait for his check)

/**
* @param {Document} doc
*/
function getRenderer(doc) {
Copy link
Member

Choose a reason for hiding this comment

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

any reason for this to be a function? just going for a regular

const dom = new lighthouseRenderer.DOM(reportContainer.ownerDocument);
const renderer = new lighthouseRenderer.ReportRenderer(dom);

seems more straightforward

Copy link
Member Author

Choose a reason for hiding this comment

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

i am mirroring some internal impl structure used elsewhere. ;)

thats why this indirection is added. :)

// Check that the report exists and has some content.
expect(reportContainer instanceof document.defaultView.Element).toBeTruthy();
expect(reportContainer.outerHTML.length).toBeGreaterThan(50000);
// fs.writeFileSync('./supp.html', reportContainer.outerHTML, 'utf-8');
Copy link
Member

Choose a reason for hiding this comment

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

yah nah?

report/test-assets/faux-psi.js Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants