Rocky_Mountain_Vending/.pnpm-store/v10/files/08/a8cd75b988b34ca60f28d01c67b77434a905ee64a738612186c5823b6dfd421c0715737fd94fa4f08d1f3817320fcbea48daaeeacfc6c964e989417347a5dc
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
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>
2026-02-12 16:22:15 -07:00

48 lines
No EOL
1.7 KiB
Text

// Combined load times for loading client components
let clientComponentLoadStart = 0;
let clientComponentLoadTimes = 0;
let clientComponentLoadCount = 0;
export function wrapClientComponentLoader(ComponentMod) {
if (!('performance' in globalThis)) {
return ComponentMod.__next_app__;
}
return {
require: (...args)=>{
const startTime = performance.now();
if (clientComponentLoadStart === 0) {
clientComponentLoadStart = startTime;
}
try {
clientComponentLoadCount += 1;
return ComponentMod.__next_app__.require(...args);
} finally{
clientComponentLoadTimes += performance.now() - startTime;
}
},
loadChunk: (...args)=>{
const startTime = performance.now();
const result = ComponentMod.__next_app__.loadChunk(...args);
// Avoid wrapping `loadChunk`'s result in an extra promise in case something like React depends on its identity.
// We only need to know when it's settled.
result.finally(()=>{
clientComponentLoadTimes += performance.now() - startTime;
});
return result;
}
};
}
export function getClientComponentLoaderMetrics(options = {}) {
const metrics = clientComponentLoadStart === 0 ? undefined : {
clientComponentLoadStart,
clientComponentLoadTimes,
clientComponentLoadCount
};
if (options.reset) {
clientComponentLoadStart = 0;
clientComponentLoadTimes = 0;
clientComponentLoadCount = 0;
}
return metrics;
}
//# sourceMappingURL=client-component-renderer-logger.js.map