Skip to content

core(page-dependency-graph): compute using URL artifact #13772

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

Merged
merged 22 commits into from
Mar 30, 2022

Conversation

adamraine
Copy link
Member

@adamraine adamraine commented Mar 22, 2022

Removes to "first document request" path from NetworkAnalyzer.findMainDocument. The document url is now a required parameter to find the main document. This improves our handling of JS redirects.

I don't think anything here would be a breaking change, and it's only tangentially related to #13706

Related
#8984
#13706

@adamraine adamraine requested a review from a team as a code owner March 22, 2022 22:06
@adamraine adamraine requested review from connorjclark and removed request for a team March 22, 2022 22:06
const sampleTrace = require('../fixtures/traces/progressive-app-m60.json');
const sampleDevtoolsLog = require('../fixtures/traces/progressive-app-m60.devtools.log.json');
const sampleTrace = require('../fixtures/traces/iframe-m79.trace.json');
const sampleDevtoolsLog = require('../fixtures/traces/iframe-m79.devtoolslog.json');
Copy link
Member Author

Choose a reason for hiding this comment

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

The M60 trace has the old TracingStartedInPage which uses uses a memory address as the frame ID instead of the same ID in the DT log.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder if we should refresh many of these old traces. m60 is from 2017-07

Copy link
Member Author

Choose a reason for hiding this comment

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

Not a bad idea, but wouldn't help this PR anymore.

After piping artifacts.URL everywhere, this change isn't really necessary.

@@ -463,6 +448,34 @@ class PageDependencyGraph {
});
}

/**
* Should provide the same urls found on `artifacts.URL`.
* TODO: make `artifacts.URL` a dependency for this computed artifact.
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 was hoping this would make it so we wouldn't need to refactor a bunch of test cases, but it seems like that's unavoidable since networkRecordsToDevtoolsLog doesn't currently add any Page.frameNavigated events.

@adamraine
Copy link
Member Author

adamraine commented Mar 23, 2022

Piping artifacts.URL everywhere will be annoying but I think it makes the most sense if a large refactor is inevitable. I don't think it's a breaking change and it's not required for #13706, so we don't necessarily need to land in 10.0.

See below

* @param {LH.DevtoolsLog} devtoolsLog
* @return {LH.Artifacts['URL']}
*/
function getURLFromDevtoolsLog(devtoolsLog) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: getURLArtifactFromDevtoolsLog ?

Copy link
Collaborator

@connorjclark connorjclark left a comment

Choose a reason for hiding this comment

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

that looked like it was an annoying PR to author. nice work 👍

@adamraine
Copy link
Member Author

I don't think it's a breaking change and it's not required for #13706, so we don't necessarily need to land in 10.0.

So pubads requires a backport that makes URL an "optional" dependency so it would be preferable to land this in 10.0

@adamraine adamraine changed the title core(network-analyzer): require a url to find the main document core(page-dependency-graph): compute using URL artifact Mar 30, 2022
@adamraine adamraine merged commit d5327b0 into master Mar 30, 2022
@adamraine adamraine deleted the find-main-doc-url branch March 30, 2022 21:45
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.

3 participants