From 870f70fc38701a10a85cd8fa16cb56b655a9dc01 Mon Sep 17 00:00:00 2001 From: Alex van Andel Date: Fri, 12 Aug 2022 19:18:13 +0100 Subject: [PATCH] Imports performance explicitly for Node v14 (#3823) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Imports performance explicitly for Node v14 * Update packages/trpc/server/routers/viewer/slots.tsx * Adds missing performance imports * Update turbo.json Co-authored-by: Omar López --- packages/core/CalendarManager.ts | 1 + packages/core/getBusyTimes.ts | 7 ++++--- packages/core/getUserAvailability.ts | 1 + packages/trpc/server/routers/viewer/slots.tsx | 1 + turbo.json | 1 + 5 files changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/core/CalendarManager.ts b/packages/core/CalendarManager.ts index b8739d4a0b..683ed6bd5c 100644 --- a/packages/core/CalendarManager.ts +++ b/packages/core/CalendarManager.ts @@ -9,6 +9,7 @@ import { sendBrokenIntegrationEmail } from "@calcom/emails"; import { getUid } from "@calcom/lib/CalEventParser"; import { getErrorFromUnknown } from "@calcom/lib/errors"; import logger from "@calcom/lib/logger"; +import { performance } from "@calcom/lib/server/perfObserver"; import type { CalendarEvent, EventBusyDate, NewCalendarEventType } from "@calcom/types/Calendar"; import type { EventResult } from "@calcom/types/EventManager"; diff --git a/packages/core/getBusyTimes.ts b/packages/core/getBusyTimes.ts index e6131e2175..6d34efb066 100644 --- a/packages/core/getBusyTimes.ts +++ b/packages/core/getBusyTimes.ts @@ -2,8 +2,7 @@ import { BookingStatus, Credential, SelectedCalendar } from "@prisma/client"; import { getBusyCalendarTimes } from "@calcom/core/CalendarManager"; import logger from "@calcom/lib/logger"; -// import { getBusyVideoTimes } from "@calcom/core/videoClient"; -// import notEmpty from "@calcom/lib/notEmpty"; +import { performance } from "@calcom/lib/server/perfObserver"; import prisma from "@calcom/prisma"; import type { EventBusyDetails } from "@calcom/types/Calendar"; @@ -42,7 +41,9 @@ export async function getBusyTimes(params: { title: true, }, }) - .then((bookings) => bookings.map(({ startTime, endTime, title }) => ({ end: endTime, start: startTime, title }))); + .then((bookings) => + bookings.map(({ startTime, endTime, title }) => ({ end: endTime, start: startTime, title })) + ); logger.silly(`Busy Time from Cal Bookings ${JSON.stringify(busyTimes)}`); const endPrismaBookingGet = performance.now(); logger.debug(`prisma booking get took ${endPrismaBookingGet - startPrismaBookingGet}ms`); diff --git a/packages/core/getUserAvailability.ts b/packages/core/getUserAvailability.ts index a398f6c8cd..cf07c9de2d 100644 --- a/packages/core/getUserAvailability.ts +++ b/packages/core/getUserAvailability.ts @@ -5,6 +5,7 @@ import dayjs, { Dayjs } from "@calcom/dayjs"; import { getWorkingHours } from "@calcom/lib/availability"; import { HttpError } from "@calcom/lib/http-error"; import logger from "@calcom/lib/logger"; +import { performance } from "@calcom/lib/server/perfObserver"; import prisma, { availabilityUserSelect } from "@calcom/prisma"; import { stringToDayjs } from "@calcom/prisma/zod-utils"; diff --git a/packages/trpc/server/routers/viewer/slots.tsx b/packages/trpc/server/routers/viewer/slots.tsx index ddbbe6bc26..e460740a19 100644 --- a/packages/trpc/server/routers/viewer/slots.tsx +++ b/packages/trpc/server/routers/viewer/slots.tsx @@ -6,6 +6,7 @@ import { getUserAvailability } from "@calcom/core/getUserAvailability"; import dayjs, { Dayjs } from "@calcom/dayjs"; import isOutOfBounds from "@calcom/lib/isOutOfBounds"; import logger from "@calcom/lib/logger"; +import { performance } from "@calcom/lib/server/perfObserver"; import getSlots from "@calcom/lib/slots"; import prisma, { availabilityUserSelect } from "@calcom/prisma"; import { TimeRange } from "@calcom/types/schedule"; diff --git a/turbo.json b/turbo.json index a7d56d68bc..f6a77f73d7 100644 --- a/turbo.json +++ b/turbo.json @@ -205,6 +205,7 @@ "$HEROKU_APP_NAME", "$HOSTED_CAL_FEATURES", "$HUBSPOT_CLIENT_ID", + "$INTEGRATION_TEST_MODE", "$NEXT_PUBLIC_CONSOLE_URL", "$NEXT_PUBLIC_DEBUG", "$NEXT_PUBLIC_EMBED_LIB_URL",