-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ae78390
commit 8f474ba
Showing
24 changed files
with
808 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
build/test/page-functions-test-case-computeBenchmarkIndex-out.js.map
Large diffs are not rendered by default.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
build/test/page-functions-test-case-computeBenchmarkIndex-out.min.js.map
Large diffs are not rendered by default.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
build/test/page-functions-test-case-getElementsInDocument-out.js.map
Large diffs are not rendered by default.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
build/test/page-functions-test-case-getElementsInDocument-out.min.js.map
Large diffs are not rendered by default.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
build/test/page-functions-test-case-getNodeDetails-out.js.map
Large diffs are not rendered by default.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
build/test/page-functions-test-case-getNodeDetails-out.min.js.map
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Insight audits | ||
|
||
When adding new insight audits, you can start off by just running `yarn generate-insight-audits` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/** | ||
* @license | ||
* Copyright 2025 Google LLC | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import {UIStrings} from '@paulirish/trace_engine/models/trace/insights/CLSCulprits.js'; | ||
|
||
import {Audit} from '../audit.js'; | ||
import * as i18n from '../../lib/i18n/i18n.js'; | ||
import {adaptInsightToAuditProduct, makeNodeItemForNodeId} from './insight-audit.js'; | ||
|
||
// eslint-disable-next-line max-len | ||
const str_ = i18n.createIcuMessageFn('node_modules/@paulirish/trace_engine/models/trace/insights/CLSCulprits.js', UIStrings); | ||
|
||
class CLSCulpritsInsight extends Audit { | ||
/** | ||
* @return {LH.Audit.Meta} | ||
*/ | ||
static get meta() { | ||
return { | ||
id: 'cls-culprits-insight', | ||
title: str_(UIStrings.title), | ||
description: str_(UIStrings.description), | ||
guidanceLevel: 3, // TODO: confirm/change. | ||
requiredArtifacts: ['traces', 'TraceElements'], | ||
scoreDisplayMode: Audit.SCORING_MODES.METRIC_SAVINGS, // TODO: confirm/change. | ||
}; | ||
} | ||
|
||
/** | ||
* @param {LH.Artifacts} artifacts | ||
* @param {LH.Audit.Context} context | ||
* @return {Promise<LH.Audit.Product>} | ||
*/ | ||
static async audit(artifacts, context) { | ||
// TODO: implement. | ||
return adaptInsightToAuditProduct(artifacts, context, 'CLSCulprits', (insight) => { | ||
/** @type {LH.Audit.Details.Table['headings']} */ | ||
const headings = [ | ||
]; | ||
/** @type {LH.Audit.Details.Table['items']} */ | ||
const items = [ | ||
]; | ||
return Audit.makeTableDetails(headings, items); | ||
}); | ||
} | ||
} | ||
|
||
export default CLSCulpritsInsight; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/** | ||
* @license | ||
* Copyright 2025 Google LLC | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import {UIStrings} from '@paulirish/trace_engine/models/trace/insights/DocumentLatency.js'; | ||
|
||
import {Audit} from '../audit.js'; | ||
import * as i18n from '../../lib/i18n/i18n.js'; | ||
import {adaptInsightToAuditProduct, makeNodeItemForNodeId} from './insight-audit.js'; | ||
|
||
// eslint-disable-next-line max-len | ||
const str_ = i18n.createIcuMessageFn('node_modules/@paulirish/trace_engine/models/trace/insights/DocumentLatency.js', UIStrings); | ||
|
||
class DocumentLatencyInsight extends Audit { | ||
/** | ||
* @return {LH.Audit.Meta} | ||
*/ | ||
static get meta() { | ||
return { | ||
id: 'document-latency-insight', | ||
title: str_(UIStrings.title), | ||
description: str_(UIStrings.description), | ||
guidanceLevel: 3, // TODO: confirm/change. | ||
requiredArtifacts: ['traces', 'TraceElements'], | ||
scoreDisplayMode: Audit.SCORING_MODES.METRIC_SAVINGS, // TODO: confirm/change. | ||
}; | ||
} | ||
|
||
/** | ||
* @param {LH.Artifacts} artifacts | ||
* @param {LH.Audit.Context} context | ||
* @return {Promise<LH.Audit.Product>} | ||
*/ | ||
static async audit(artifacts, context) { | ||
// TODO: implement. | ||
return adaptInsightToAuditProduct(artifacts, context, 'DocumentLatency', (insight) => { | ||
/** @type {LH.Audit.Details.Table['headings']} */ | ||
const headings = [ | ||
]; | ||
/** @type {LH.Audit.Details.Table['items']} */ | ||
const items = [ | ||
]; | ||
return Audit.makeTableDetails(headings, items); | ||
}); | ||
} | ||
} | ||
|
||
export default DocumentLatencyInsight; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/** | ||
* @license | ||
* Copyright 2025 Google LLC | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import {UIStrings} from '@paulirish/trace_engine/models/trace/insights/FontDisplay.js'; | ||
|
||
import {Audit} from '../audit.js'; | ||
import * as i18n from '../../lib/i18n/i18n.js'; | ||
import {adaptInsightToAuditProduct, makeNodeItemForNodeId} from './insight-audit.js'; | ||
|
||
// eslint-disable-next-line max-len | ||
const str_ = i18n.createIcuMessageFn('node_modules/@paulirish/trace_engine/models/trace/insights/FontDisplay.js', UIStrings); | ||
|
||
class FontDisplayInsight extends Audit { | ||
/** | ||
* @return {LH.Audit.Meta} | ||
*/ | ||
static get meta() { | ||
return { | ||
id: 'font-display-insight', | ||
title: str_(UIStrings.title), | ||
description: str_(UIStrings.description), | ||
guidanceLevel: 3, // TODO: confirm/change. | ||
requiredArtifacts: ['traces', 'TraceElements'], | ||
scoreDisplayMode: Audit.SCORING_MODES.METRIC_SAVINGS, // TODO: confirm/change. | ||
}; | ||
} | ||
|
||
/** | ||
* @param {LH.Artifacts} artifacts | ||
* @param {LH.Audit.Context} context | ||
* @return {Promise<LH.Audit.Product>} | ||
*/ | ||
static async audit(artifacts, context) { | ||
// TODO: implement. | ||
return adaptInsightToAuditProduct(artifacts, context, 'FontDisplay', (insight) => { | ||
/** @type {LH.Audit.Details.Table['headings']} */ | ||
const headings = [ | ||
]; | ||
/** @type {LH.Audit.Details.Table['items']} */ | ||
const items = [ | ||
]; | ||
return Audit.makeTableDetails(headings, items); | ||
}); | ||
} | ||
} | ||
|
||
export default FontDisplayInsight; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/** | ||
* @license | ||
* Copyright 2025 Google LLC | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import {UIStrings} from '@paulirish/trace_engine/models/trace/insights/ForcedReflow.js'; | ||
|
||
import {Audit} from '../audit.js'; | ||
import * as i18n from '../../lib/i18n/i18n.js'; | ||
import {adaptInsightToAuditProduct, makeNodeItemForNodeId} from './insight-audit.js'; | ||
|
||
// eslint-disable-next-line max-len | ||
const str_ = i18n.createIcuMessageFn('node_modules/@paulirish/trace_engine/models/trace/insights/ForcedReflow.js', UIStrings); | ||
|
||
class ForcedReflowInsight extends Audit { | ||
/** | ||
* @return {LH.Audit.Meta} | ||
*/ | ||
static get meta() { | ||
return { | ||
id: 'forced-reflow-insight', | ||
title: str_(UIStrings.title), | ||
description: str_(UIStrings.description), | ||
guidanceLevel: 3, // TODO: confirm/change. | ||
requiredArtifacts: ['traces', 'TraceElements'], | ||
scoreDisplayMode: Audit.SCORING_MODES.METRIC_SAVINGS, // TODO: confirm/change. | ||
}; | ||
} | ||
|
||
/** | ||
* @param {LH.Artifacts} artifacts | ||
* @param {LH.Audit.Context} context | ||
* @return {Promise<LH.Audit.Product>} | ||
*/ | ||
static async audit(artifacts, context) { | ||
// TODO: implement. | ||
return adaptInsightToAuditProduct(artifacts, context, 'ForcedReflow', (insight) => { | ||
/** @type {LH.Audit.Details.Table['headings']} */ | ||
const headings = [ | ||
]; | ||
/** @type {LH.Audit.Details.Table['items']} */ | ||
const items = [ | ||
]; | ||
return Audit.makeTableDetails(headings, items); | ||
}); | ||
} | ||
} | ||
|
||
export default ForcedReflowInsight; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/** | ||
* @license | ||
* Copyright 2025 Google LLC | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import {UIStrings} from '@paulirish/trace_engine/models/trace/insights/ImageDelivery.js'; | ||
|
||
import {Audit} from '../audit.js'; | ||
import * as i18n from '../../lib/i18n/i18n.js'; | ||
import {adaptInsightToAuditProduct, makeNodeItemForNodeId} from './insight-audit.js'; | ||
|
||
// eslint-disable-next-line max-len | ||
const str_ = i18n.createIcuMessageFn('node_modules/@paulirish/trace_engine/models/trace/insights/ImageDelivery.js', UIStrings); | ||
|
||
class ImageDeliveryInsight extends Audit { | ||
/** | ||
* @return {LH.Audit.Meta} | ||
*/ | ||
static get meta() { | ||
return { | ||
id: 'image-delivery-insight', | ||
title: str_(UIStrings.title), | ||
description: str_(UIStrings.description), | ||
guidanceLevel: 3, // TODO: confirm/change. | ||
requiredArtifacts: ['traces', 'TraceElements'], | ||
scoreDisplayMode: Audit.SCORING_MODES.METRIC_SAVINGS, // TODO: confirm/change. | ||
}; | ||
} | ||
|
||
/** | ||
* @param {LH.Artifacts} artifacts | ||
* @param {LH.Audit.Context} context | ||
* @return {Promise<LH.Audit.Product>} | ||
*/ | ||
static async audit(artifacts, context) { | ||
// TODO: implement. | ||
return adaptInsightToAuditProduct(artifacts, context, 'ImageDelivery', (insight) => { | ||
/** @type {LH.Audit.Details.Table['headings']} */ | ||
const headings = [ | ||
]; | ||
/** @type {LH.Audit.Details.Table['items']} */ | ||
const items = [ | ||
]; | ||
return Audit.makeTableDetails(headings, items); | ||
}); | ||
} | ||
} | ||
|
||
export default ImageDeliveryInsight; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/** | ||
* @license | ||
* Copyright 2025 Google LLC | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import {UIStrings} from '@paulirish/trace_engine/models/trace/insights/InteractionToNextPaint.js'; | ||
|
||
import {Audit} from '../audit.js'; | ||
import * as i18n from '../../lib/i18n/i18n.js'; | ||
import {adaptInsightToAuditProduct, makeNodeItemForNodeId} from './insight-audit.js'; | ||
|
||
// eslint-disable-next-line max-len | ||
const str_ = i18n.createIcuMessageFn('node_modules/@paulirish/trace_engine/models/trace/insights/InteractionToNextPaint.js', UIStrings); | ||
|
||
class InteractionToNextPaintInsight extends Audit { | ||
/** | ||
* @return {LH.Audit.Meta} | ||
*/ | ||
static get meta() { | ||
return { | ||
id: 'interaction-to-next-paint-insight', | ||
title: str_(UIStrings.title), | ||
description: str_(UIStrings.description), | ||
guidanceLevel: 3, // TODO: confirm/change. | ||
requiredArtifacts: ['traces', 'TraceElements'], | ||
scoreDisplayMode: Audit.SCORING_MODES.METRIC_SAVINGS, // TODO: confirm/change. | ||
}; | ||
} | ||
|
||
/** | ||
* @param {LH.Artifacts} artifacts | ||
* @param {LH.Audit.Context} context | ||
* @return {Promise<LH.Audit.Product>} | ||
*/ | ||
static async audit(artifacts, context) { | ||
// TODO: implement. | ||
return adaptInsightToAuditProduct(artifacts, context, 'InteractionToNextPaint', (insight) => { | ||
/** @type {LH.Audit.Details.Table['headings']} */ | ||
const headings = [ | ||
]; | ||
/** @type {LH.Audit.Details.Table['items']} */ | ||
const items = [ | ||
]; | ||
return Audit.makeTableDetails(headings, items); | ||
}); | ||
} | ||
} | ||
|
||
export default InteractionToNextPaintInsight; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/** | ||
* @license | ||
* Copyright 2025 Google LLC | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import {UIStrings} from '@paulirish/trace_engine/models/trace/insights/LCPDiscovery.js'; | ||
|
||
import {Audit} from '../audit.js'; | ||
import * as i18n from '../../lib/i18n/i18n.js'; | ||
import {adaptInsightToAuditProduct, makeNodeItemForNodeId} from './insight-audit.js'; | ||
|
||
// eslint-disable-next-line max-len | ||
const str_ = i18n.createIcuMessageFn('node_modules/@paulirish/trace_engine/models/trace/insights/LCPDiscovery.js', UIStrings); | ||
|
||
class LCPDiscoveryInsight extends Audit { | ||
/** | ||
* @return {LH.Audit.Meta} | ||
*/ | ||
static get meta() { | ||
return { | ||
id: 'lcp-discovery-insight', | ||
title: str_(UIStrings.title), | ||
description: str_(UIStrings.description), | ||
guidanceLevel: 3, // TODO: confirm/change. | ||
requiredArtifacts: ['traces', 'TraceElements'], | ||
scoreDisplayMode: Audit.SCORING_MODES.METRIC_SAVINGS, // TODO: confirm/change. | ||
}; | ||
} | ||
|
||
/** | ||
* @param {LH.Artifacts} artifacts | ||
* @param {LH.Audit.Context} context | ||
* @return {Promise<LH.Audit.Product>} | ||
*/ | ||
static async audit(artifacts, context) { | ||
// TODO: implement. | ||
return adaptInsightToAuditProduct(artifacts, context, 'LCPDiscovery', (insight) => { | ||
/** @type {LH.Audit.Details.Table['headings']} */ | ||
const headings = [ | ||
]; | ||
/** @type {LH.Audit.Details.Table['items']} */ | ||
const items = [ | ||
]; | ||
return Audit.makeTableDetails(headings, items); | ||
}); | ||
} | ||
} | ||
|
||
export default LCPDiscoveryInsight; |
Oops, something went wrong.