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>
39 lines
1.5 KiB
Text
39 lines
1.5 KiB
Text
/**
|
|
* @license
|
|
* Copyright 2018 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
import * as Lantern from '../../lib/lantern/lantern.js';
|
|
import {makeComputedArtifact} from '../computed-artifact.js';
|
|
import {getComputationDataParams, lanternErrorAdapter} from './lantern-metric.js';
|
|
import {LanternFirstContentfulPaint} from './lantern-first-contentful-paint.js';
|
|
|
|
class LanternMaxPotentialFID extends Lantern.Metrics.MaxPotentialFID {
|
|
/**
|
|
* @param {LH.Artifacts.MetricComputationDataInput} data
|
|
* @param {LH.Artifacts.ComputedContext} context
|
|
* @param {Omit<Lantern.Metrics.Extras, 'optimistic'>=} extras
|
|
* @return {Promise<LH.Artifacts.LanternMetric>}
|
|
*/
|
|
static async computeMetricWithGraphs(data, context, extras) {
|
|
const params = await getComputationDataParams(data, context);
|
|
return Promise.resolve(this.compute(params, extras)).catch(lanternErrorAdapter);
|
|
}
|
|
|
|
/**
|
|
* @param {LH.Artifacts.MetricComputationDataInput} data
|
|
* @param {LH.Artifacts.ComputedContext} context
|
|
* @return {Promise<LH.Artifacts.LanternMetric>}
|
|
*/
|
|
static async compute_(data, context) {
|
|
const fcpResult = await LanternFirstContentfulPaint.request(data, context);
|
|
return this.computeMetricWithGraphs(data, context, {fcpResult});
|
|
}
|
|
}
|
|
|
|
const LanternMaxPotentialFIDComputed = makeComputedArtifact(
|
|
LanternMaxPotentialFID,
|
|
['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL', 'SourceMaps']
|
|
);
|
|
export {LanternMaxPotentialFIDComputed as LanternMaxPotentialFID};
|