Techdebt/bundle size experiments (#7894)

* Checking package size effects when we remove zod from middleware

* Remove 'crypto' from client code

* Revert "Checking package size effects when we remove zod from middleware"

This reverts commit ecc2038411c73fc562d57712d5c83d66925e7e13.

* Adding lodash to dynamicImports + consistent imports

* Remove the locales from the global Dayjs object
This commit is contained in:
Alex van Andel authored and GitHub committed 2023-03-23 11:49:28 -07:00
1 parent e4893c2218
commit 46f0b55a45
17 files changed
+51 -52

No files matched your search

+6 -6
View File
@@ -1,5 +1,5 @@
import type { SelectedCalendar } from "@prisma/client";
import _ from "lodash";
import { sortBy } from "lodash";
import * as process from "process";
import { getCalendar } from "@calcom/app-store/_utils/getCalendar";
@@ -54,8 +54,8 @@ export const getConnectedCalendars = async (
};
}
const cals = await calendar.listCalendars();
const calendars = _(cals)
.map((cal) => {
const calendars = sortBy(
cals.map((cal) => {
if (cal.externalId === destinationCalendarExternalId) destinationCalendar = cal;
return {
...cal,
@@ -64,9 +64,9 @@ export const getConnectedCalendars = async (
isSelected: selectedCalendars.some((selected) => selected.externalId === cal.externalId),
credentialId,
};
})
.sortBy(["primary"])
.value();
}),
["primary"]
);
const primary = calendars.find((item) => item.primary) ?? calendars.find((cal) => cal !== undefined);
if (!primary) {
return {
+1 -2
View File
@@ -1,6 +1,5 @@
import type { DestinationCalendar, Booking } from "@prisma/client";
import { cloneDeep } from "lodash";
import merge from "lodash/merge";
import { cloneDeep, merge } from "lodash";
import { v5 as uuidv5 } from "uuid";
import type { z } from "zod";