-
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
WIP: audit responsive images #1021
Conversation
enables more device emulation adds use-responsive-images audit to dobetterweb addresses GoogleChrome#978
@ebidel needs a bit more cleanup but wanted to grab first impression before doing so |
@@ -2,6 +2,7 @@ | |||
"passes": [{ | |||
"recordNetwork": true, | |||
"recordTrace": true, | |||
"emulation": "iphone4", |
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.
I added extra empty passes at first, but for some sites this adds a really long time. Not sure if these emulation changes will break anything
yeah, I think we're going to have to work through some of the implications here. We've talked about having flags be settable both on the command line but also in the config file, which I think will be a good thing, but we'll have to keep them in sync, e.g. what does it mean when you have We also need to dedupe some of the emulation terminology as we did for the CLI flags but didn't do internally since That's all stuff we need to figure out/do anyways, so that's great, but specific to this PR, I'm not entirely sure of the reason for the audit vs #876 (and maybe #718). Why not just check if the images are way too big for the page and suggest alternatives? |
I still see these as two distinct abilities atm, in the config you can specify which device you wish to be emulating, and through the CLI you can disable emulation entirely which will effectively ignore those devices (whether or not that's a good thing is another question ;) )
Yeah I see this as stage 1, where stage 2 has the emulate device bit control corresponding network and CPU throttling as well
Yeah the descriptions all seemed to overlap a lot to me, but I currently see this as v1 to actually analyzing the images for size maybe compression/quality etc as v2. And client hints/save data is just a "do you support it" check |
My real question was why compare two image loads vs just "is this image appropriate for this device, size on screen, etc". The only benefit seems to be we could warn that that desktop could be loading bigger images |
(also worth noting that when running lighthouse on a real device, no emulation obviously still means running on a mobile device) |
Short answer: because that seemed more complicated to intermingle with a PR focused on the emulation angle and would come later There seemed to be many different underlying concerns amidst those 3 issues and this represents one angle of attack (which I'm fine scraping if it seems useless)
Fair I'll switch to back to an emulation profile |
ah, I missed that the real point of this PR is the increased emulation flexibility and not (necessarily) the responsive image audit :) |
buuut, that said, I'm thinking we actually shouldn't move forward with this level of granularity in emulation switching unless we have a really compelling reason for it. It will be difficult to write gatherers that are indifferent to the emulation state they're in. A good example would be the DBW gatherers that run in the fourth pass in this audit. Since the callsite gatherers don't do static analysis, only reporting when problematic functions were actually executed, the specific code paths that end up running become really important. If the fourth pass were to run with no mobile emulation, for example, the report may end up confusing on performance problems since the perf metrics would be reported for the mobile version of the site but things like So my initial thoughts, at least, are that the assumption should be that all passes run at the same level of emulation, and then we could maybe (somehow) make it easy for a gatherer to make requests or take actions with different emulation properties solely within that gatherer's methods, restoring everything before leaving it. |
alright |
enables more device emulation
adds use-responsive-images audit to dobetterweb
addresses #978