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

misc: mark dependencies of entity classification computed artifact #14732

Merged
merged 2 commits into from
Jan 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion core/computed/entity-classification.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,5 +98,6 @@ class EntityClassification {
}
}

const EntityClassificationComputed = makeComputedArtifact(EntityClassification, null);
const EntityClassificationComputed = makeComputedArtifact(EntityClassification,
Copy link
Collaborator

Choose a reason for hiding this comment

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

can you update all calls to this computed artifact to only pass in these two values? Otherwise, the caching doesn't work.

Copy link
Member Author

Choose a reason for hiding this comment

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

Can you explain? May be I'm reading this wrong, but it seems to pick only those dependencies picked via keys supplied during makeComputedArtifact. I've updated the one remaining call that had more than the required two parameters passed, but it didn't seem to create any difference in sample.json.

Copy link
Collaborator

@connorjclark connorjclark Jan 28, 2023

Choose a reason for hiding this comment

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

Ah, I forgot we did that part recently. All good. For some reason I though the dep thing was just a type hint ... But nah we do runtime stuff to ensure the caching works well

['URL', 'devtoolsLog']);
export {EntityClassificationComputed as EntityClassification};
3 changes: 2 additions & 1 deletion core/computed/resource-summary.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ class ResourceSummary {
*/
static async compute_(data, context) {
const networkRecords = await NetworkRecords.request(data.devtoolsLog, context);
const classifiedEntities = await EntityClassification.request(data, context);
const classifiedEntities = await EntityClassification.request(
{URL: data.URL, devtoolsLog: data.devtoolsLog}, context);
return ResourceSummary.summarize(networkRecords, data.URL, data.budgets, classifiedEntities);
}
}
Expand Down
Loading