Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

⬆️ Upgrade to Next.js 15.2 #1596

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/web/next-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
22 changes: 12 additions & 10 deletions apps/web/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,6 @@ const nextConfig = {
"@rallly/posthog",
"@rallly/emails",
],
webpack(config) {
config.module.rules.push({
test: /\.svg$/,
use: ["@svgr/webpack"],
});

return config;
},
eslint: {
ignoreDuringBuilds: true,
},
Expand All @@ -58,9 +50,19 @@ const nextConfig = {
},
];
},
serverExternalPackages: ["@aws-sdk", "@sentry/nextjs"],
experimental: {
// necessary for server actions using aws-sdk
serverComponentsExternalPackages: ["@aws-sdk"],
turbo: {
rules: {
"*.svg": {
loaders: ["@svgr/webpack"],
as: "*.js",
},
},
},
},
devIndicators: {
position: "bottom-right",
},
};

Expand Down
11 changes: 7 additions & 4 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0",
"private": true,
"scripts": {
"dev": "next dev",
"dev": "next dev --turbopack",
"build": "next build",
"build:test": "NODE_ENV=test next build",
"analyze": "cross-env ANALYZE=true next build",
Expand All @@ -22,7 +22,7 @@
"@aws-sdk/client-s3": "^3.645.0",
"@aws-sdk/s3-request-presigner": "^3.645.0",
"@hookform/resolvers": "^3.3.1",
"@next/bundle-analyzer": "^12.3.4",
"@next/bundle-analyzer": "15.2.0",
"@panva/hkdf": "^1.2.1",
"@radix-ui/react-slot": "^1.0.1",
"@radix-ui/react-switch": "^1.0.2",
Expand All @@ -34,7 +34,7 @@
"@rallly/posthog": "*",
"@rallly/tailwind-config": "*",
"@rallly/ui": "*",
"@sentry/nextjs": "*",
"@sentry/nextjs": "^9.3.0",
"@svgr/webpack": "^6.5.1",
"@t3-oss/env-nextjs": "^0.11.0",
"@tanstack/react-query": "^4.0.0",
Expand Down Expand Up @@ -81,7 +81,10 @@
"smoothscroll-polyfill": "^0.4.4",
"spacetime": "^7.4.7",
"superjson": "^2.0.0",
"timezone-soft": "^1.5.1"
"timezone-soft": "^1.5.1",
"next": "^15.2.0",
"react": "^19.0.0",
"react-dom": "^19.0.0"
},
"devDependencies": {
"@playwright/test": "^1.49.1",
Expand Down
14 changes: 8 additions & 6 deletions apps/web/src/app/[locale]/(admin)/events/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import {
} from "@/app/components/page-layout";
import { getTranslation } from "@/i18n/server";

export default async function Page({ params }: { params: Params }) {
export default async function Page(props: { params: Promise<Params> }) {
const params = await props.params;
const { t } = await getTranslation(params.locale);
return (
<PageContainer>
Expand All @@ -28,11 +29,12 @@ export default async function Page({ params }: { params: Params }) {
);
}

export async function generateMetadata({
params,
}: {
params: { locale: string };
}) {
export async function generateMetadata(
props: {
params: Promise<{ locale: string }>;
}
) {
const params = await props.params;
const { t } = await getTranslation(params.locale);
return {
title: t("events", {
Expand Down
3 changes: 2 additions & 1 deletion apps/web/src/app/[locale]/(admin)/menu/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import {
} from "@/app/components/page-layout";
import { getTranslation } from "@/i18n/server";

export default async function Page({ params }: { params: Params }) {
export default async function Page(props: { params: Promise<Params> }) {
const params = await props.params;
const { t } = await getTranslation(params.locale);
return (
<PageContainer>
Expand Down
14 changes: 8 additions & 6 deletions apps/web/src/app/[locale]/(admin)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import {
import { getTranslation } from "@/i18n/server";
import { createSSRHelper } from "@/trpc/server/create-ssr-helper";

export default async function Page({ params }: { params: Params }) {
export default async function Page(props: { params: Promise<Params> }) {
const params = await props.params;
const { t } = await getTranslation(params.locale);
const helpers = await createSSRHelper();
await helpers.dashboard.info.prefetch();
Expand All @@ -41,11 +42,12 @@ export default async function Page({ params }: { params: Params }) {
);
}

export async function generateMetadata({
params,
}: {
params: { locale: string };
}) {
export async function generateMetadata(
props: {
params: Promise<{ locale: string }>;
}
) {
const params = await props.params;
const { t } = await getTranslation(params.locale);
return {
title: t("home", {
Expand Down
24 changes: 13 additions & 11 deletions apps/web/src/app/[locale]/(admin)/polls/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ import {
} from "@/app/components/page-layout";
import { getTranslation } from "@/i18n/server";

export default async function Page({
params,
}: {
params: Params;
children?: React.ReactNode;
}) {
export default async function Page(
props: {
params: Promise<Params>;
children?: React.ReactNode;
}
) {
const params = await props.params;
const { t } = await getTranslation(params.locale);
return (
<PageContainer>
Expand All @@ -39,11 +40,12 @@ export default async function Page({
);
}

export async function generateMetadata({
params,
}: {
params: { locale: string };
}) {
export async function generateMetadata(
props: {
params: Promise<{ locale: string }>;
}
) {
const params = await props.params;
const { t } = await getTranslation(params.locale);
return {
title: t("polls", {
Expand Down
17 changes: 11 additions & 6 deletions apps/web/src/app/[locale]/(admin)/settings/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,17 @@ import { getTranslation } from "@/i18n/server";

import { SettingsMenu } from "./settings-menu";

export default async function ProfileLayout({
children,
params,
}: React.PropsWithChildren<{
params: { locale: string };
}>) {
export default async function ProfileLayout(
props: React.PropsWithChildren<{
params: { locale: string };
}>
) {
const params = await props.params;

const {
children
} = props;

const { t } = await getTranslation(params.locale);
return (
<PageContainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ export default async function Page() {
return <PreferencesPage />;
}

export async function generateMetadata({ params }: { params: Params }) {
export async function generateMetadata(props: { params: Promise<Params> }) {
const params = await props.params;
const { t } = await getTranslation(params.locale);
return {
title: t("preferences"),
Expand Down
3 changes: 2 additions & 1 deletion apps/web/src/app/[locale]/(admin)/settings/profile/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ export default async function Page() {
return <ProfilePage />;
}

export async function generateMetadata({ params }: { params: Params }) {
export async function generateMetadata(props: { params: Promise<Params> }) {
const params = await props.params;
const { t } = await getTranslation(params.locale);
return {
title: t("profile"),
Expand Down
14 changes: 8 additions & 6 deletions apps/web/src/app/[locale]/(auth)/auth/login/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ const magicLinkParams = z.object({
token: z.string(),
});

export default function Page({ searchParams }: { searchParams: SearchParams }) {
export default async function Page(props: { searchParams: Promise<SearchParams> }) {
const searchParams = await props.searchParams;
const parse = searchParamsSchema.safeParse(searchParams);

if (!parse.success) {
Expand All @@ -42,11 +43,12 @@ export default function Page({ searchParams }: { searchParams: SearchParams }) {
return <LoginPage magicLink={magicLink} email={email} />;
}

export async function generateMetadata({
params,
}: {
params: { locale: string };
}) {
export async function generateMetadata(
props: {
params: Promise<{ locale: string }>;
}
) {
const params = await props.params;
const { t } = await getTranslation(params.locale);
return {
title: t("login"),
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/app/[locale]/(auth)/login/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export async function setVerificationEmail(email: string) {
});

if (user) {
cookies().set("verification-email", user.email, {
(await cookies()).set("verification-email", user.email, {
httpOnly: true,
secure: process.env.NODE_ENV === "production",
sameSite: "lax",
Expand Down
26 changes: 14 additions & 12 deletions apps/web/src/app/[locale]/(auth)/login/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,14 @@ import { LoginWithOIDC } from "./components/login-with-oidc";
import { OrDivider } from "./components/or-divider";
import { SSOProvider } from "./components/sso-provider";

export default async function LoginPage({
searchParams,
}: {
searchParams?: {
redirectTo?: string;
};
}) {
export default async function LoginPage(
props: {
searchParams?: Promise<{
redirectTo?: string;
}>;
}
) {
const searchParams = await props.searchParams;
const { t } = await getTranslation();

const oidcProvider = OIDCProvider();
Expand Down Expand Up @@ -87,11 +88,12 @@ export default async function LoginPage({
);
}

export async function generateMetadata({
params,
}: {
params: { locale: string };
}) {
export async function generateMetadata(
props: {
params: Promise<{ locale: string }>;
}
) {
const params = await props.params;
const { t } = await getTranslation(params.locale);
return {
title: t("login"),
Expand Down
13 changes: 7 additions & 6 deletions apps/web/src/app/[locale]/(auth)/login/verify/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { OTPForm } from "./components/otp-form";

export default async function VerifyPage() {
const { t } = await getTranslation();
const email = cookies().get("verification-email")?.value;
const email = (await cookies()).get("verification-email")?.value;
if (!email) {
return redirect("/login");
}
Expand Down Expand Up @@ -53,11 +53,12 @@ export default async function VerifyPage() {
);
}

export async function generateMetadata({
params,
}: {
params: { locale: string };
}) {
export async function generateMetadata(
props: {
params: Promise<{ locale: string }>;
}
) {
const params = await props.params;
const { t } = await getTranslation(params.locale);
return {
title: t("verifyEmail", {
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/app/[locale]/(auth)/register/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { cookies } from "next/headers";

export async function setToken(token: string) {
cookies().set("registration-token", token, {
(await cookies()).set("registration-token", token, {
httpOnly: true,
secure: process.env.NODE_ENV === "production",
sameSite: "lax",
Expand Down
22 changes: 12 additions & 10 deletions apps/web/src/app/[locale]/(auth)/register/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ import {
} from "../components/auth-page";
import { RegisterNameForm } from "./components/register-name-form";

export default async function Register({
params,
}: {
params: { locale: string };
}) {
export default async function Register(
props: {
params: Promise<{ locale: string }>;
}
) {
const params = await props.params;
const { t } = await getTranslation(params.locale);

return (
Expand Down Expand Up @@ -58,11 +59,12 @@ export default async function Register({
);
}

export async function generateMetadata({
params,
}: {
params: { locale: string };
}) {
export async function generateMetadata(
props: {
params: Promise<{ locale: string }>;
}
) {
const params = await props.params;
const { t } = await getTranslation(params.locale);
return {
title: t("register"),
Expand Down
Loading
Loading