From 7229316a73d881c05e241f12b40b3c77ed1607e5 Mon Sep 17 00:00:00 2001 From: Yiming Date: Wed, 13 Mar 2024 19:43:02 -0700 Subject: [PATCH] refactor(server): remove deprecated useSuperJSON flag (#1137) --- packages/server/src/express/middleware.ts | 5 ----- packages/server/src/fastify/plugin.ts | 5 ----- packages/server/src/next/app-route-handler.ts | 5 ----- packages/server/src/next/pages-route-handler.ts | 5 ----- packages/server/src/sveltekit/handler.ts | 5 ----- packages/server/src/types.ts | 7 ------- 6 files changed, 32 deletions(-) diff --git a/packages/server/src/express/middleware.ts b/packages/server/src/express/middleware.ts index cdf5a3c6e..200c57bd6 100644 --- a/packages/server/src/express/middleware.ts +++ b/packages/server/src/express/middleware.ts @@ -33,11 +33,6 @@ const factory = (options: MiddlewareOptions): Handler => { const { modelMeta, zodSchemas } = loadAssets(options); const requestHandler = options.handler || RPCAPIHandler(); - if (options.useSuperJson !== undefined) { - console.warn( - 'The option "useSuperJson" is deprecated. The server APIs automatically use superjson for serialization.' - ); - } return async (request, response, next) => { const prisma = (await options.getPrisma(request, response)) as DbClientContract; diff --git a/packages/server/src/fastify/plugin.ts b/packages/server/src/fastify/plugin.ts index 480c4ba8d..8651e0bb0 100644 --- a/packages/server/src/fastify/plugin.ts +++ b/packages/server/src/fastify/plugin.ts @@ -32,11 +32,6 @@ const pluginHandler: FastifyPluginCallback = (fastify, options, d const { modelMeta, zodSchemas } = loadAssets(options); const requestHandler = options.handler ?? RPCApiHandler(); - if (options.useSuperJson !== undefined) { - console.warn( - 'The option "useSuperJson" is deprecated. The server APIs automatically use superjson for serialization.' - ); - } fastify.all(`${prefix}/*`, async (request, reply) => { const prisma = (await options.getPrisma(request, reply)) as DbClientContract; diff --git a/packages/server/src/next/app-route-handler.ts b/packages/server/src/next/app-route-handler.ts index 538f4ceb5..71121d151 100644 --- a/packages/server/src/next/app-route-handler.ts +++ b/packages/server/src/next/app-route-handler.ts @@ -20,11 +20,6 @@ export default function factory( const { modelMeta, zodSchemas } = loadAssets(options); const requestHandler = options.handler || RPCAPIHandler(); - if (options.useSuperJson !== undefined) { - console.warn( - 'The option "useSuperJson" is deprecated. The server APIs automatically use superjson for serialization.' - ); - } return async (req: NextRequest, context: Context) => { const prisma = (await options.getPrisma(req)) as DbClientContract; diff --git a/packages/server/src/next/pages-route-handler.ts b/packages/server/src/next/pages-route-handler.ts index bd2fbf643..0752775da 100644 --- a/packages/server/src/next/pages-route-handler.ts +++ b/packages/server/src/next/pages-route-handler.ts @@ -18,11 +18,6 @@ export default function factory( const { modelMeta, zodSchemas } = loadAssets(options); const requestHandler = options.handler || RPCAPIHandler(); - if (options.useSuperJson !== undefined) { - console.warn( - 'The option "useSuperJson" is deprecated. The server APIs automatically use superjson for serialization.' - ); - } return async (req: NextApiRequest, res: NextApiResponse) => { const prisma = (await options.getPrisma(req, res)) as DbClientContract; diff --git a/packages/server/src/sveltekit/handler.ts b/packages/server/src/sveltekit/handler.ts index be1d831d8..3d346f762 100644 --- a/packages/server/src/sveltekit/handler.ts +++ b/packages/server/src/sveltekit/handler.ts @@ -29,11 +29,6 @@ export default function createHandler(options: HandlerOptions): Handle { const { modelMeta, zodSchemas } = loadAssets(options); const requestHandler = options.handler ?? RPCApiHandler(); - if (options.useSuperJson !== undefined) { - console.warn( - 'The option "useSuperJson" is deprecated. The server APIs automatically use superjson for serialization.' - ); - } return async ({ event, resolve }) => { if (event.url.pathname.startsWith(options.prefix)) { diff --git a/packages/server/src/types.ts b/packages/server/src/types.ts index dc72fea25..81e2f5fd7 100644 --- a/packages/server/src/types.ts +++ b/packages/server/src/types.ts @@ -58,11 +58,4 @@ export interface AdapterBaseOptions { * Defaults to RPC-style API handler created with `/api/rpc`. */ handler?: HandleRequestFn; - - /** - * Whether to use superjson for serialization/deserialization. Defaults to `false`. - * - * @deprecated Not needed anymore and will be removed in a future release. - */ - useSuperJson?: boolean; }