Merge pull request #857 from ahmadk953/ai_generated-performance-enhancements

Optimize performance and reduce bundle sizes
This commit is contained in:
Ahmad 2024-12-18 21:45:09 -05:00 committed by GitHub
commit f64ec56481
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 1201 additions and 2364 deletions

View file

@ -29,6 +29,13 @@ const handler = async (data: InputType): Promise<ReturnType> => {
}, },
}, },
}, },
select: {
id: true,
title: true,
description: true,
order: true,
listId: true,
},
}); });
if (!cardToCopy) return { error: 'Card not found' }; if (!cardToCopy) return { error: 'Card not found' };

View file

@ -28,8 +28,18 @@ const handler = async (data: InputType): Promise<ReturnType> => {
orgId, orgId,
}, },
}, },
include: { select: {
cards: true, id: true,
title: true,
order: true,
boardId: true,
cards: {
select: {
title: true,
description: true,
order: true,
},
},
}, },
}); });

View file

@ -27,6 +27,9 @@ const handler = async (data: InputType): Promise<ReturnType> => {
orgId, orgId,
}, },
}, },
select: {
id: true,
},
}); });
if (!list) return { error: 'List not found' }; if (!list) return { error: 'List not found' };

View file

@ -25,6 +25,9 @@ const handler = async (data: InputType): Promise<ReturnType> => {
id: boardId, id: boardId,
orgId, orgId,
}, },
select: {
id: true,
},
}); });
if (!board) return { error: 'Board not found' }; if (!board) return { error: 'Board not found' };

View file

@ -30,6 +30,10 @@ const handler = async (data: InputType): Promise<ReturnType> => {
id, id,
orgId, orgId,
}, },
select: {
id: true,
title: true,
},
}); });
if (!isPro) { if (!isPro) {

View file

@ -24,6 +24,9 @@ const handler = async (data: InputType): Promise<ReturnType> => {
try { try {
const orgSubscription = await db.orgSubscription.findUnique({ const orgSubscription = await db.orgSubscription.findUnique({
where: { orgId }, where: { orgId },
select: {
stripeCustomerId: true,
},
}); });
if (orgSubscription?.stripeCustomerId) { if (orgSubscription?.stripeCustomerId) {

View file

@ -1,6 +1,6 @@
import Stripe from 'stripe'; import Stripe from 'stripe';
export const stripe = new Stripe(process.env.STRIPE_API_KEY!, { export const stripe = new Stripe(process.env.STRIPE_API_KEY!, {
apiVersion: '2024-11-20.acacia', apiVersion: '2024-12-18.acacia',
typescript: true, typescript: true,
}); });

View file

@ -1,5 +1,6 @@
import { withSentryConfig } from '@sentry/nextjs'; import { withSentryConfig } from '@sentry/nextjs';
import type { NextConfig } from 'next'; import type { NextConfig } from 'next';
import compression from 'compression';
import { withContentCollections } from '@content-collections/next'; import { withContentCollections } from '@content-collections/next';
import createMDX from '@next/mdx'; import createMDX from '@next/mdx';
@ -23,6 +24,8 @@ const nextConfig: NextConfig = {
], ],
}, },
pageExtensions: ['ts', 'tsx', 'js', 'jsx', 'md', 'mdx'], pageExtensions: ['ts', 'tsx', 'js', 'jsx', 'md', 'mdx'],
compress: true,
serverMiddleware: [compression()],
}; };
const withMDX = createMDX({}); const withMDX = createMDX({});

View file

@ -6,7 +6,7 @@
"dev": "next dev --turbo", "dev": "next dev --turbo",
"build": "next build", "build": "next build",
"start": "next start", "start": "next start",
"lint": "next lint", "lint": "next lint && tsc --noemit",
"postinstall": "prisma generate --no-engine", "postinstall": "prisma generate --no-engine",
"format": "prettier --check --ignore-path .prettierignore .", "format": "prettier --check --ignore-path .prettierignore .",
"format:fix": "prettier --write --ignore-path .prettierignore ." "format:fix": "prettier --write --ignore-path .prettierignore ."
@ -40,6 +40,7 @@
"@vercel/speed-insights": "^1.1.0", "@vercel/speed-insights": "^1.1.0",
"class-variance-authority": "^0.7.1", "class-variance-authority": "^0.7.1",
"clsx": "^2.1.1", "clsx": "^2.1.1",
"compression": "^1.7.5",
"date-fns": "^4.1.0", "date-fns": "^4.1.0",
"dompurify": "^3.2.3", "dompurify": "^3.2.3",
"lodash": "^4.17.21", "lodash": "^4.17.21",
@ -67,6 +68,7 @@
"@microsoft/eslint-formatter-sarif": "^3.1.0", "@microsoft/eslint-formatter-sarif": "^3.1.0",
"@next/eslint-plugin-next": "15.1.1", "@next/eslint-plugin-next": "15.1.1",
"@tailwindcss/typography": "^0.5.15", "@tailwindcss/typography": "^0.5.15",
"@types/compression": "^1.7.5",
"@types/dompurify": "^3", "@types/dompurify": "^3",
"@types/lodash": "^4.17.13", "@types/lodash": "^4.17.13",
"@types/node": "^22.10.2", "@types/node": "^22.10.2",

3522
yarn.lock

File diff suppressed because it is too large Load diff