Next.js website for Rocky Mountain Vending company featuring: - Product catalog with Stripe integration - Service areas and parts pages - Admin dashboard with Clerk authentication - SEO optimized pages with JSON-LD structured data Co-authored-by: Cursor <cursoragent@cursor.com>
55 lines
1.7 KiB
Text
55 lines
1.7 KiB
Text
/**
|
|
* @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} 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),
|
|
failureTitle: str_(UIStrings.title),
|
|
description: str_(UIStrings.description),
|
|
guidanceLevel: 3,
|
|
requiredArtifacts: ['Trace', 'TraceElements', 'SourceMaps'],
|
|
replacesAudits: ['redirects', 'server-response-time', 'uses-text-compression'],
|
|
};
|
|
}
|
|
|
|
/**
|
|
* @param {LH.Artifacts} artifacts
|
|
* @param {LH.Audit.Context} context
|
|
* @return {Promise<LH.Audit.Product>}
|
|
*/
|
|
static async audit(artifacts, context) {
|
|
return adaptInsightToAuditProduct(artifacts, context, 'DocumentLatency', (insight) => {
|
|
if (!insight.data) {
|
|
return;
|
|
}
|
|
|
|
const details = Audit.makeChecklistDetails(insight.data.checklist);
|
|
details.debugData = {
|
|
type: 'debugdata',
|
|
redirectDuration: insight.data.redirectDuration,
|
|
serverResponseTime: insight.data.serverResponseTime,
|
|
uncompressedResponseBytes: insight.data.uncompressedResponseBytes,
|
|
};
|
|
return details;
|
|
});
|
|
}
|
|
}
|
|
|
|
export default DocumentLatencyInsight;
|