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

Embed scorecalc within performance-scoring doc #10726

Closed
paulirish opened this issue May 7, 2020 · 7 comments
Closed

Embed scorecalc within performance-scoring doc #10726

paulirish opened this issue May 7, 2020 · 7 comments

Comments

@paulirish
Copy link
Member

paulirish commented May 7, 2020

https://web.dev/performance-scoring/ has our canonical scoring docs

the scorecalc supports receiving metric values through the URL! Thanks @connorjclark !

https://paulirish.github.io/lh-scorecalc/#first-contentful-paint=2390&first-meaningful-paint=4000&speed-index=8070&interactive=11260&first-cpu-idle=6500&total-blocking-time=320&largest-contentful-paint=2140&cumulative-layout-shift=0.13

this means we can now link to it from the report! 🥳

Also, the report currently links to the scoring docs 3 times!


My thought was we'd link [perf score is calculated] to the perf-scoring doc, and then we'd have an embed of the scorecalc and all your numbers are prefilled.

Talked it out with @robdodson and the thought was..

  • the [perf score is calculated] link has the long hash: /performance-scoring#metricvalue=3200&...
  • within the web.dev page is a lil custom element (<scorecalc-embed>) that adds an iframe for the scorecalc.
    • it also reads the hash from the page's URL and sets it on the iframe src.
    • and maybe it scrolls the doc page down to where the scorecalc lives.
    • and this small custom element can have tests in src/site/test/lib

Kinda relevant: GoogleChrome/web.dev#2296 arbitrary script can currently run in web.dev but probably not for long. The custom element route seems better.

@connorjclark
Copy link
Collaborator

I think we should deploy it to lighthouse' github pages. The repo can remain separate.

@robdodson
Copy link
Contributor

I think we should deploy it to lighthouse' github pages.

Which thing are you referring to?

@connorjclark
Copy link
Collaborator

connorjclark commented May 7, 2020

@addyosmani
Copy link
Member

https://paulirish.github.io/lh-scorecalc/ -> https://googlechrome.github.io/lighthouse/calc/

👍

This would be a nice to have for 6.0 final imo.

@robdodson
Copy link
Contributor

ah yep that sounds good to me.

@paulirish
Copy link
Member Author

paulirish commented May 12, 2020

todo:

@paulirish
Copy link
Member Author

There's no big interest in this anymore.

If we do pick it up, probably a lot easier to iframe than to deal with custom elements

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants