-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
core(starturl): re-use already fetched manifest #6882
Conversation
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.
it's crazy but i'm into it. 👍
@@ -458,6 +469,16 @@ class GatherRunner { | |||
passConfig, | |||
// *pass() functions and gatherers can push to this warnings array. | |||
LighthouseRunWarnings: baseArtifacts.LighthouseRunWarnings, | |||
/** @param {keyof LH.GathererArtifacts} name */ | |||
async dangerouslyUsePreviousArtifact(name) { |
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.
feels like this fn should be defined outside of this for loop.
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.
what would be your preferred flavor?
dangerouslyUsePreviousArtifact: GatherRunner.dangerouslyUsePreviousArtifact.bind(gathererResults)
dangerouslyUsePreviousArtifact: GatherRunner.createPreviousArtifactFn(gathererResults)
dangerouslyUsePreviousArtifact(name) { return GatherRunner.dangerouslyUsePreviousArtifact(gathererResults, name); }
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.
dangerouslyUsePreviousArtifact: GatherRunner.dangerouslyUsePreviousArtifact.bind(gathererResults)
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.
ha, probably to no one's surprise, I'm not super into this :) but I think it's definitely worth thinking about.
We've had use cases before but never a super necessary one (they always end up "or we could do it this somewhat less convenient way"), but maybe this is it.
I do think #6881 presents the super necessary use case :D |
ha, sorry, I meant to say super necessary to share artifacts between gatherers instead of finding another solution. We definitely definitely should fix #6881 :) :) |
DZL, do a barrel roll! |
DZL is done! Go check it out http://lh-dzl-6882.surge.sh |
@brendankenny what concretely does
mean :) Is it any of the following....?
|
My hesitation is that we already have a lot of implicit interactions in the gathering stage (online/offline, affects perf while a trace is being collected, etc), but at least the A couple of other options:
I recognize the underlying issue that it's still vaguely reasonable to want to access artifacts between gatherers, but I think I favor the third option, since it lets us avoid that complexity and it matches how Chrome treats manifests as part of the meta information available for a site. I think we also have some help here, as I recently read that Chrome always fetches the manifest on first visit if a site has one, so we actually don't even need the |
I can get behind this 👍 |
btw @brendankenny I skipped the first two because I'll update the issue with a comment. |
oh, haha, whoops. I had no idea :) |
@brendankenny scratch that last thing I said, the author fixed the service worker and I attributed that to a 1-day Canary bug instead 😆 they will be sharing source code though so we can also get to bottom of it |
closing in favor of #6957 |
Summary
We've talked about being able to reuse prior artifacts in other future gatherers but were always afraid of the precedence it sets for some horrifying graph of dependencies. This really is great use case though, so I wanted to play with it and see how it feels.
Therefore, I named the method
dangerouslyUsePreviousArtifact
in the hopes it assuages some concerns about this starting to be used everywhere 😆Waiting to update start-url test depending on what kind of reaction this gets :)
Related Issues/PRs
fixes #6881