-
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
Total byte audit reports full URL #2312
Total byte audit reports full URL #2312
Conversation
As I do like the idea we changed it for a reason as we didn't want to show the full url as it is irrelevant in most cases. Maybe better to work with a toggle button or tooltip.. |
@johnboxall thx for the patch! appreciate it. We've intended to have the full URL there in a tooltip. But based on the patch, it looks like it's not there. :/ |
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 definitely would like to see this change happen. This is part of a broader undertaking to move all the getURLDisplayName
calls out of the audits and into the renderer where it's just used for the span text but can view the full URL in tooltip or inspect.
@johnboxall how do you feel about taking a stab at setting the title over in the _renderURL
method in lighthouse-core/report/v2/renderer/details-renderer.js
?
@patrickhulce sure 👍 |
LGTM! Just have to fix the linting errors where travis throws on. |
So about that 😛 1️⃣ It's not clear to me how I'd resolve this type warning and the related error:
Relaxing the type on 2️⃣ It's looks like I'll need to re-generate node lighthouse-cli/test/fixtures/static-server.js
npm run start -- --output=json --output-path=lighthouse-core/test/results/sample_v2.json http://localhost:8080/dobetterweb/dbw_tester.html The diff is large. Can you confirm this is expected? 🙏 |
@@ -72,8 +72,10 @@ class DetailsRenderer { | |||
* @return {!Element} | |||
*/ | |||
_renderURL(text) { | |||
const element = this._renderText(text); | |||
const parsedURL = Util.parseURL(text.text); |
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.
we're going to have to try to be backwards compatible here now that we've released
maybe we can make parseURL do this safely, accept {string|undefined}
and return null if the URL was not parsable for some reason? then in here we can check if we were able to parse and either set the tooltip with the full text or fallback to the original behavior
on the plus side this should address both the linting and the test failures :)
thanks for the effort @johnboxall. @patrickhulce wdyt? 😄 |
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.
nice! thanks for the work here @johnboxall!
Most good. Thanks @johnboxall ! |
Currently the
total-byte-weight
audit only reportsgetURLDisplayName
for URLs.This can make it challenging to understand what resource the audit is talking about, as sites we work with include 3rd party scripts with mystery names.
Without the complete URL, it is impossible to create detailed CI tests that fail if certain resources are bigger than a threshold. In our case, we often do not control the size of all assets on the page, so we don't want to fail on the overall threshold... just thing we have control on.
This change displays the full URL.
I used the test page https://lighthouse-url-example.surge.sh/ with a few examples of URLs that we may encounter in the wild.
With the longer URLs, the styling could probably use some love (I could also imagine terrible ideas like having the full URL available on hover) – happy to pursue that if this is a direction you'd like to head in. Assuming this is a direction you're looking at going in, also happy to update the relevant tests.
❤️