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>
40 lines
1.3 KiB
Text
40 lines
1.3 KiB
Text
/**
|
|
* @license
|
|
* Copyright 2018 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
import {makeComputedArtifact} from '../computed-artifact.js';
|
|
import {NavigationMetric} from './navigation-metric.js';
|
|
import {LanternFirstContentfulPaint} from './lantern-first-contentful-paint.js';
|
|
|
|
class FirstContentfulPaint extends NavigationMetric {
|
|
/**
|
|
* @param {LH.Artifacts.NavigationMetricComputationData} data
|
|
* @param {LH.Artifacts.ComputedContext} context
|
|
* @return {Promise<LH.Artifacts.LanternMetric>}
|
|
*/
|
|
static computeSimulatedMetric(data, context) {
|
|
const metricData = NavigationMetric.getMetricComputationInput(data);
|
|
return LanternFirstContentfulPaint.request(metricData, context);
|
|
}
|
|
|
|
/**
|
|
* @param {LH.Artifacts.NavigationMetricComputationData} data
|
|
* @return {Promise<LH.Artifacts.Metric>}
|
|
*/
|
|
static async computeObservedMetric(data) {
|
|
const {processedNavigation} = data;
|
|
|
|
return {
|
|
timing: processedNavigation.timings.firstContentfulPaint,
|
|
timestamp: processedNavigation.timestamps.firstContentfulPaint,
|
|
};
|
|
}
|
|
}
|
|
|
|
const FirstContentfulPaintComputed = makeComputedArtifact(
|
|
FirstContentfulPaint,
|
|
['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL', 'SourceMaps']
|
|
);
|
|
export {FirstContentfulPaintComputed as FirstContentfulPaint};
|