Skip to content

Commit 938d578

Browse files
Wevespablonyx
andauthored
Upgrade to latest NextJS + switch to turbopack (#3027)
* Upgrade to NextJS 15 + use turbopacK * Remove unintended change * Update nextjs version * Remove override * Upgrade react * Fix charts * Style * Style * Fix prettier * slight modification --------- Co-authored-by: pablodanswer <pablo@danswer.ai>
1 parent 70f703c commit 938d578

File tree

36 files changed

+2002
-1531
lines changed

36 files changed

+2002
-1531
lines changed

web/next.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ const { withSentryConfig } = require("@sentry/nextjs");
1010
/** @type {import('next').NextConfig} */
1111
const nextConfig = {
1212
output: "standalone",
13-
swcMinify: true,
1413
publicRuntimeConfig: {
1514
version,
1615
},

web/package-lock.json

Lines changed: 1255 additions & 1356 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "0.2-dev",
44
"private": true,
55
"scripts": {
6-
"dev": "next dev",
6+
"dev": "next dev --turbopack",
77
"build": "next build",
88
"start": "next start",
99
"lint": "next lint"
@@ -12,6 +12,8 @@
1212
"@dnd-kit/core": "^6.1.0",
1313
"@dnd-kit/modifiers": "^7.0.0",
1414
"@dnd-kit/sortable": "^8.0.0",
15+
"@dnd-kit/utilities": "^3.2.2",
16+
"@headlessui/react": "^2.2.0",
1517
"@headlessui/tailwindcss": "^0.2.1",
1618
"@phosphor-icons/react": "^2.0.8",
1719
"@radix-ui/react-dialog": "^1.0.5",
@@ -39,7 +41,7 @@
3941
"lodash": "^4.17.21",
4042
"lucide-react": "^0.454.0",
4143
"mdast-util-find-and-replace": "^3.0.1",
42-
"next": "^14.2.3",
44+
"next": "^15.0.2",
4345
"npm": "^10.8.0",
4446
"postcss": "^8.4.31",
4547
"posthog-js": "^1.176.0",
@@ -71,5 +73,8 @@
7173
"eslint": "^8.48.0",
7274
"eslint-config-next": "^14.1.0",
7375
"prettier": "2.8.8"
76+
},
77+
"overrides": {
78+
"react-is": "^19.0.0-rc-69d4b800-20241021"
7479
}
7580
}

web/public/Wikipedia.svg

Lines changed: 535 additions & 1 deletion
Loading

web/src/app/admin/assistants/[id]/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ import { AdminPageTitle } from "@/components/admin/Title";
1010
import CardSection from "@/components/admin/CardSection";
1111
import Title from "@/components/ui/title";
1212

13-
export default async function Page({ params }: { params: { id: string } }) {
13+
export default async function Page(props: { params: Promise<{ id: string }> }) {
14+
const params = await props.params;
1415
const [values, error] = await fetchAssistantEditorInfoSS(params.id);
1516

1617
let body;

web/src/app/admin/bot/[id]/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ import {
1313
} from "@/lib/assistants/fetchAssistantsSS";
1414
import { getStandardAnswerCategoriesIfEE } from "@/components/standardAnswers/getStandardAnswerCategoriesIfEE";
1515

16-
async function Page({ params }: { params: { id: string } }) {
16+
async function Page(props: { params: Promise<{ id: string }> }) {
17+
const params = await props.params;
1718
const tasks = [
1819
fetchSS("/manage/admin/slack-bot/config"),
1920
fetchSS("/manage/document-set"),

web/src/app/admin/connector/[ccPairId]/page.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { Button } from "@/components/ui/button";
1616
import Title from "@/components/ui/title";
1717
import { Separator } from "@/components/ui/separator";
1818
import { useRouter } from "next/navigation";
19-
import { useCallback, useEffect, useRef, useState } from "react";
19+
import { useCallback, useEffect, useRef, useState, use } from "react";
2020
import useSWR, { mutate } from "swr";
2121
import { AdvancedConfigDisplay, ConfigDisplay } from "./ConfigDisplay";
2222
import { DeletionButton } from "./DeletionButton";
@@ -278,7 +278,8 @@ function Main({ ccPairId }: { ccPairId: number }) {
278278
);
279279
}
280280

281-
export default function Page({ params }: { params: { ccPairId: string } }) {
281+
export default function Page(props: { params: Promise<{ ccPairId: string }> }) {
282+
const params = use(props.params);
282283
const ccPairId = parseInt(params.ccPairId);
283284

284285
return (

web/src/app/admin/connectors/[connector]/auth/callback/route.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@ import {
99
import { processCookies } from "@/lib/userSS";
1010

1111
export const GET = async (request: NextRequest) => {
12+
const requestCookies = await cookies();
1213
const connector = request.url.includes("gmail") ? "gmail" : "google-drive";
1314
const callbackEndpoint = `/manage/connector/${connector}/callback`;
1415
const url = new URL(buildUrl(callbackEndpoint));
1516
url.search = request.nextUrl.search;
1617

1718
const response = await fetch(url.toString(), {
1819
headers: {
19-
cookie: processCookies(cookies()),
20+
cookie: processCookies(requestCookies),
2021
},
2122
});
2223

@@ -33,7 +34,7 @@ export const GET = async (request: NextRequest) => {
3334
? GMAIL_AUTH_IS_ADMIN_COOKIE_NAME
3435
: GOOGLE_DRIVE_AUTH_IS_ADMIN_COOKIE_NAME;
3536

36-
if (cookies().get(authCookieName)?.value?.toLowerCase() === "true") {
37+
if (requestCookies.get(authCookieName)?.value?.toLowerCase() === "true") {
3738
return NextResponse.redirect(
3839
new URL(`/admin/connectors/${connector}`, getDomain(request))
3940
);

web/src/app/admin/connectors/[connector]/page.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import { ConfigurableSources } from "@/lib/types";
22
import ConnectorWrapper from "./ConnectorWrapper";
33

4-
export default async function Page({
5-
params,
6-
}: {
7-
params: { connector: string };
4+
export default async function Page(props: {
5+
params: Promise<{ connector: string }>;
86
}) {
7+
const params = await props.params;
98
return (
109
<ConnectorWrapper
1110
connector={params.connector.replace("-", "_") as ConfigurableSources}

web/src/app/admin/documents/explorer/page.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@ import { ZoomInIcon } from "@/components/icons/icons";
33
import { Explorer } from "./Explorer";
44
import { fetchValidFilterInfo } from "@/lib/search/utilsSS";
55

6-
const Page = async ({
7-
searchParams,
8-
}: {
9-
searchParams: { [key: string]: string };
6+
const Page = async (props: {
7+
searchParams: Promise<{ [key: string]: string }>;
108
}) => {
9+
const searchParams = await props.searchParams;
1110
const { connectors, documentSets } = await fetchValidFilterInfo();
1211

1312
return (

0 commit comments

Comments
 (0)