Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.
TypeScript i18nextnext-authnextjspostgresqlprismareact-emailt3-stacktailwindcsstrpcturborepotypescriptzod
♻️ Refinements (#2365)
Luke Vellab91a801e54fe
diff --git a/apps/landing/next.config.ts b/apps/landing/next.config.tsindex 022d092ae..5135b8411 100644--- a/apps/landing/next.config.ts+++ b/apps/landing/next.config.ts@@ -13,6 +13,7 @@ function createAppUrl(subpath: string) {}const nextConfig: NextConfig = {+ cacheComponents: true,allowedDevOrigins: ["landing.rallly.co"],productionBrowserSourceMaps: true,transpilePackages: [diff --git a/apps/landing/src/app/[locale]/(main)/blog/[slug]/page.tsx b/apps/landing/src/app/[locale]/(main)/blog/[slug]/page.tsxindex 6b2f716cb..797dcc416 100644--- a/apps/landing/src/app/[locale]/(main)/blog/[slug]/page.tsx+++ b/apps/landing/src/app/[locale]/(main)/blog/[slug]/page.tsx@@ -60,8 +60,6 @@ export default async function Page(props: {);}-export const dynamicParams = false;-export async function generateStaticParams() {const posts = getAllPosts(["slug"]);return posts.map((post) => ({diff --git a/apps/landing/src/lib/data.ts b/apps/landing/src/lib/data.tsindex dcfde5bfc..60df6c6c7 100644--- a/apps/landing/src/lib/data.ts+++ b/apps/landing/src/lib/data.ts@@ -1,19 +1,15 @@import "server-only";import { prisma } from "@rallly/database";-import { unstable_cache } from "next/cache";+import { cacheLife } from "next/cache";-export const getUserCount = unstable_cache(- async () => {- const userCount = await prisma.user.count({- where: {- isAnonymous: false,- },- });- return userCount;- },- ["user-count"],- {- revalidate: false,- },-);+export const getUserCount = async () => {+ "use cache";+ cacheLife("days");+ const userCount = await prisma.user.count({+ where: {+ isAnonymous: false,+ },+ });+ return userCount;+};diff --git a/apps/web/src/app/[locale]/(auth)/login/loading.tsx b/apps/web/src/app/[locale]/(auth)/loading.tsxsimilarity index 100%rename from apps/web/src/app/[locale]/(auth)/login/loading.tsxrename to apps/web/src/app/[locale]/(auth)/loading.tsxdiff --git a/apps/web/src/app/[locale]/(auth)/register/loading.tsx b/apps/web/src/app/[locale]/(auth)/register/loading.tsxdeleted file mode 100644index 79098356f..000000000--- a/apps/web/src/app/[locale]/(auth)/register/loading.tsx+++ /dev/null@@ -1,9 +0,0 @@-import { Spinner } from "@/components/spinner";--export default function Loading() {- return (- <div className="flex h-full items-center justify-center">- <Spinner className="text-muted-foreground" />- </div>- );-}diff --git a/apps/web/src/app/[locale]/(space)/settings/general/components/delete-space-button.tsx b/apps/web/src/app/[locale]/(space)/settings/general/components/delete-space-button.tsxindex ae19fba70..8cda8e568 100644--- a/apps/web/src/app/[locale]/(space)/settings/general/components/delete-space-button.tsx+++ b/apps/web/src/app/[locale]/(space)/settings/general/components/delete-space-button.tsx@@ -36,6 +36,9 @@ function DeleteSpaceDialog({},});+ const router = useRouter();+ const { t } = useTranslation();+const deleteSpace = trpc.spaces.delete.useMutation({onSuccess: () => {toast.success(@@ -43,13 +46,10 @@ function DeleteSpaceDialog({defaultValue: "Space has been permanently deleted",}),);- router.refresh();+ router.push("/");},});- const router = useRouter();- const { t } = useTranslation();-return (<Form {...form}><Dialog {...rest}>diff --git a/apps/web/src/features/space/client.tsx b/apps/web/src/features/space/client.tsxindex 674a2779a..30f0167c0 100644--- a/apps/web/src/features/space/client.tsx+++ b/apps/web/src/features/space/client.tsx@@ -66,20 +66,20 @@ export function SpaceProvider({ children }: { children: React.ReactNode }) {: null;return (- <>+ <div data-space-branding style={{ display: "contents" }}>{primaryColorVars ? (<style>{`- .light {+ html.light [data-space-branding] {--primary: ${primaryColorVars.light};--primary-foreground: ${primaryColorVars.lightForeground};}- .dark {+ html.dark [data-space-branding] {--primary: ${primaryColorVars.dark};--primary-foreground: ${primaryColorVars.darkForeground};}`}</style>) : null}{children}- </>+ </div>);}diff --git a/apps/web/tests/authentication.spec.ts b/apps/web/tests/authentication.spec.tsindex f1ca9715b..405829e78 100644--- a/apps/web/tests/authentication.spec.ts+++ b/apps/web/tests/authentication.spec.ts@@ -166,7 +166,7 @@ test.describe.serial(() => {).toBeVisible();// Verify email is pre-filled as a UX improvement- const emailInput = page.getByPlaceholder("[email protected]");+ const emailInput = page.getByRole("textbox", { name: "Email" });await expect(emailInput).toHaveValue(testUserEmail);});diff --git a/apps/web/tests/create-delete-poll.spec.ts b/apps/web/tests/create-delete-poll.spec.tsindex 74320bb5f..dce932e09 100644--- a/apps/web/tests/create-delete-poll.spec.ts+++ b/apps/web/tests/create-delete-poll.spec.ts@@ -24,7 +24,7 @@ test.describe.serial(() => {// delete the poll we just createdtest("delete existing poll", async () => {- const manageButton = page.getByText("Manage");+ const manageButton = page.getByRole("button", { name: "Manage" });await manageButton.waitFor();await manageButton.click();await page.click("text=Delete");diff --git a/apps/web/tests/new-poll-page.ts b/apps/web/tests/new-poll-page.tsindex 2047ddefe..78f443042 100644--- a/apps/web/tests/new-poll-page.ts+++ b/apps/web/tests/new-poll-page.ts@@ -11,6 +11,7 @@ export class CreatePollSuccessDialog {async goToPollPage() {await this.page.getByRole("link", { name: "Manage" }).click();await this.page.waitForURL(/\/poll\/[^/]+/);+ await this.dialog.waitFor({ state: "detached" });return new PollPage(this.page);}}