perf: Remove ssrInit completely (#20439)

* remove ssrInit completely

* remove instances of dehydratedState

* fix

* refactor

* fix type checks

* fix linting

* Refactor

* Refactor

* remove log
This commit is contained in:
Benny Joo authored and GitHub committed 2025-04-01 19:14:46 -04:00
1 parent b5b4134b75
commit 75c79f76c8
30 files changed
+70 -209

No files matched your search

@@ -9,13 +9,11 @@ import { getSafeRedirectUrl } from "@calcom/lib/getSafeRedirectUrl";
import prisma from "@calcom/prisma";
import { IS_GOOGLE_LOGIN_ENABLED } from "@server/lib/constants";
import { ssrInit } from "@server/lib/ssr";
export async function getServerSideProps(context: GetServerSidePropsContext) {
const { req, query } = context;
const session = await getServerSession({ req });
const ssr = await ssrInit(context);
const verifyJwt = (jwt: string) => {
const secret = new TextEncoder().encode(process.env.CALENDSO_ENCRYPTION_KEY);
@@ -91,7 +89,6 @@ export async function getServerSideProps(context: GetServerSidePropsContext) {
return {
props: {
csrfToken: await getCsrfToken(context),
trpcState: ssr.dehydrate(),
isGoogleLoginEnabled: IS_GOOGLE_LOGIN_ENABLED,
isSAMLLoginEnabled,
samlTenantID,
@@ -12,8 +12,6 @@ import prisma from "@calcom/prisma";
import { asStringOrNull } from "@lib/asStringOrNull";
import { ssrInit } from "@server/lib/ssr";
export const getServerSideProps = async (context: GetServerSidePropsContext) => {
// get query params and typecast them to string
// (would be even better to assert them instead of typecasting)
@@ -28,7 +26,7 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) =>
const { req } = context;
const session = await getServerSession({ req });
const ssr = await ssrInit(context);
const { currentOrgDomain } = orgDomainConfig(context.req);
if (session) {
@@ -93,7 +91,6 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) =>
return {
props: {
trpcState: ssr.dehydrate(),
provider: providerParam,
isSAMLLoginEnabled,
hostedCal,