Rocky_Mountain_Vending/.pnpm-store/v10/files/e4/d31bfdfa5243d6e6717805cf0052165f8c2c89480e412b5eccbf101c781ce2da3b4155580ac6f221f247c75027553f5cba37275903ae80aad5cd772aa74c12
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
2.2 KiB
Text

/**
* We extend `Date` during builds and revalidates to ensure that prerenders don't observe the clock as a source of IO
* When cacheComponents is enabled. The current time is a form of IO even though it resolves synchronously. When cacheComponents is
* enabled we need to ensure that clock time is excluded from prerenders unless it is cached.
*
* There is tension here because time is used for both output and introspection. While arbitrary we intend to reserve
* `Date` for output use cases and `performance` for introspection use cases. If you want to measure
* how long something takes use `performance.timeOrigin` and `performance.now()` rather than `Date.now()` for instance.
*
* The extensions here never error nor alter the underlying Date objects, strings, and numbers created and thus should be transparent to callers.
*/ import { io } from './utils';
function createNow(originalNow) {
return ({
now: function now() {
io('`Date.now()`', 'time');
return originalNow();
}
})['now'.slice()].bind(null);
}
function createDate(originalConstructor) {
const properties = Object.getOwnPropertyDescriptors(originalConstructor);
properties.now.value = createNow(originalConstructor.now);
const apply = Reflect.apply;
const construct = Reflect.construct;
const newConstructor = Object.defineProperties(// Ideally this should not minify the name.
function Date1() {
if (new.target === undefined) {
io('`Date()`', 'time');
return apply(originalConstructor, undefined, arguments);
}
if (arguments.length === 0) {
io('`new Date()`', 'time');
}
return construct(originalConstructor, arguments, new.target);
}, properties);
Object.defineProperty(originalConstructor.prototype, 'constructor', {
value: newConstructor
});
return newConstructor;
}
try {
// eslint-disable-next-line no-native-reassign
Date = createDate(Date);
} catch {
console.error('Failed to install `Date` class extension. When using `cacheComponents`, APIs that read the current time will not correctly trigger dynamic behavior.');
}
//# sourceMappingURL=date.js.map