Skip to content

Commit

Permalink
refactor(server): remove deprecated useSuperJSON flag (#1137)
Browse files Browse the repository at this point in the history
  • Loading branch information
ymc9 authored Mar 14, 2024
1 parent 0d6674d commit 7229316
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 32 deletions.
5 changes: 0 additions & 5 deletions packages/server/src/express/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 0 additions & 5 deletions packages/server/src/fastify/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ const pluginHandler: FastifyPluginCallback<PluginOptions> = (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;
Expand Down
5 changes: 0 additions & 5 deletions packages/server/src/next/app-route-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 0 additions & 5 deletions packages/server/src/next/pages-route-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 0 additions & 5 deletions packages/server/src/sveltekit/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
7 changes: 0 additions & 7 deletions packages/server/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 7229316

Please sign in to comment.