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

chore: next 15 & react 19 #260

Merged
merged 5 commits into from
Dec 14, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/depd-npm-2.0.0-b6c51a4b43-c0c8ff3607.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/etag-npm-1.8.1-54a3b989d9-571aeb3dbe.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/mime-npm-1.6.0-60ae95038a-b7d98bb1e0.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/ms-npm-2.0.0-9e1101a471-0e6a22b8b7.zip
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed .yarn/cache/vary-npm-1.1.2-b49f70ae63-31389debef.zip
Binary file not shown.
1 change: 0 additions & 1 deletion apps/admin/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ const nextConfig = {
},
],
},
swcMinify: true,
experimental: {
typedRoutes: true,
},
Expand Down
26 changes: 15 additions & 11 deletions apps/admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"author": "dnd-academy",
"scripts": {
"open-browser": "open http://localhost:3001",
"dev": "next dev -H localhost -p 3001 & yarn open-browser",
"dev": "next dev --turbopack -H localhost -p 3001 & yarn open-browser",
"build": "next build",
"start": "next start",
"lint": "eslint '**/*.{js,jsx,ts,tsx}' --fix",
Expand All @@ -27,30 +27,30 @@
"dependencies": {
"@dnd-academy/core": "workspace:*",
"@dnd-academy/ui": "workspace:*",
"@tanstack/react-query": "5.52.0",
"@tanstack/react-query": "5.62.7",
"@vercel/blob": "0.23.4",
"clsx": "2.1.1",
"google-auth-library": "9.15.0",
"google-spreadsheet": "4.1.4",
"motion": "11.11.17",
"next": "14.2.15",
"next-auth": "5.0.0-beta.19",
"react": "18.3.1",
"react-dom": "18.3.1",
"motion": "11.14.4",
"next": "15.0.4",
"next-auth": "5.0.0-beta.25",
"react": "19.0.0",
"react-dom": "19.0.0",
"react-perfect-scrollbar": "1.5.8"
},
"devDependencies": {
"@dnd-academy/eslint-config": "workspace:*",
"@next/eslint-plugin-next": "14.2.15",
"@next/eslint-plugin-next": "15.0.4",
"@testing-library/dom": "10.3.1",
"@testing-library/jest-dom": "6.4.6",
"@testing-library/react": "16.0.0",
"@testing-library/react": "16.1.0",
"@types/identity-obj-proxy": "^3",
"@types/jest": "29.5.9",
"@types/jest-plugin-context": "2.9.7",
"@types/node": "20",
"@types/react": "18.3.2",
"@types/react-dom": "18.3.0",
"@types/react": "19.0.1",
"@types/react-dom": "19.0.2",
"@typescript-eslint/eslint-plugin": "7.9.0",
"@typescript-eslint/parser": "7.9.0",
"eslint": "8.56.0",
Expand All @@ -73,5 +73,9 @@
"sass": "1.69.6",
"typescript": "5.2.2",
"webpack": "5.95.0"
},
"resolutions": {
"@types/react": "19.0.1",
"@types/react-dom": "19.0.2"
}
}
4 changes: 3 additions & 1 deletion apps/admin/src/app/api/blob/latest/[name]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import { api, ApiError, getLatestItemReduce } from '@dnd-academy/core';
import { list } from '@vercel/blob';

// eslint-disable-next-line import/prefer-default-export
export async function GET(_: NextRequest, { params }: { params: { name: string } }) {
export async function GET(_: NextRequest, props: { params: Promise<{ name: string }> }) {
const params = await props.params;

if (!params?.name) {
return NextResponse.json(null, {
status: 400,
Expand Down
2 changes: 1 addition & 1 deletion apps/admin/src/app/current-applicant-count/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import CurrentApplicantCountAction from '@/components/CurrentApplicantCountActio
import styles from './page.module.scss';

async function Page() {
const headersList = headers();
const headersList = await headers();
const host = headersList.get('host');

const protocol = process.env.NODE_ENV === 'production' ? 'https' : 'http';
Expand Down
5 changes: 3 additions & 2 deletions apps/admin/src/app/login/page.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import SignIn from '@/components/auth/SignIn';

type Props = {
searchParams: { [key: string]: string | undefined; };
searchParams: Promise<{ [key: string]: string | undefined; }>;
};

async function LoginPage({ searchParams }: Props) {
const params = await searchParams;
return (
<>
<div>login</div>
{searchParams?.error === 'unauthorized_email' && (
{params?.error === 'unauthorized_email' && (
<div>
접근이 불가능한 이메일 입니다.
</div>
Expand Down
2 changes: 1 addition & 1 deletion apps/admin/src/app/total-count-status/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import TotalCountStatusForm from '@/components/TotalCountStatusForm';
import styles from './page.module.scss';

async function Page() {
const headersList = headers();
const headersList = await headers();
const host = headersList.get('host');

const protocol = process.env.NODE_ENV === 'production' ? 'https' : 'http';
Expand Down
4 changes: 2 additions & 2 deletions apps/admin/src/components/TotalCountStatusForm/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import { useFormState } from 'react-dom';
import { useActionState } from 'react';

import { type TotalCountStatus } from '@dnd-academy/core';
import clsx from 'clsx';
Expand All @@ -15,7 +15,7 @@ type Props = {
};

function TotalCountStatusForm({ initialTotalCountStatus }: Props) {
const [state, formAction] = useFormState(totalCountStatusAction, null);
const [state, formAction] = useActionState(totalCountStatusAction, null);

const {
cumulativeApplicants, dropouts, totalParticipants, totalProjects,
Expand Down
2 changes: 1 addition & 1 deletion apps/admin/src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { NextResponse } from 'next/server';
import { auth as middleware } from '@/auth';
import { isEmailAllowed } from '@/utils';

export default middleware((req) => {
export default middleware((req: any) => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

next auth type error

if (req.nextUrl.pathname === '/login' || process.env.NODE_ENV === 'development') {
return NextResponse.next({
request: req,
Expand Down
2 changes: 1 addition & 1 deletion apps/web/@types/svg.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
declare module '*.svg' {
const content: React.FunctionComponent<React.SVGAttributes<SVGElement>>;
const content: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;

export default content;
}
1 change: 0 additions & 1 deletion apps/web/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ const nextConfig = {
},
],
},
swcMinify: true,
experimental: {
typedRoutes: true,
},
Expand Down
40 changes: 22 additions & 18 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@
"@channel.io/channel-web-sdk-loader": "1.1.7",
"@dnd-academy/core": "workspace:*",
"@dnd-academy/ui": "workspace:*",
"@next/third-parties": "14.2.15",
"@next/third-parties": "15.0.4",
"@vercel/blob": "0.23.4",
"clsx": "2.1.1",
"dayjs": "1.11.11",
"motion": "11.11.17",
"next": "14.2.15",
"react": "18.3.1",
"motion": "11.14.4",
"next": "15.0.4",
"react": "19.0.0",
"react-countup": "6.5.3",
"react-dom": "18.3.1",
"react-dom": "19.0.0",
"react-fast-marquee": "1.6.4",
"react-pdf": "9.1.1",
"react-perfect-scrollbar": "1.5.8",
Expand All @@ -59,26 +59,26 @@
"@chromatic-com/storybook": "2.0.2",
"@codecov/nextjs-webpack-plugin": "1.2.0",
"@dnd-academy/eslint-config": "workspace:*",
"@next/env": "14.2.15",
"@next/eslint-plugin-next": "14.2.15",
"@storybook/addon-essentials": "8.3.3",
"@storybook/addon-interactions": "8.3.3",
"@storybook/addon-links": "8.3.3",
"@storybook/blocks": "8.3.3",
"@storybook/nextjs": "8.3.3",
"@storybook/react": "8.3.3",
"@storybook/test": "8.3.3",
"@next/env": "15.0.4",
"@next/eslint-plugin-next": "15.0.4",
"@storybook/addon-essentials": "8.4.7",
"@storybook/addon-interactions": "8.4.7",
"@storybook/addon-links": "8.4.7",
"@storybook/blocks": "8.4.7",
"@storybook/nextjs": "8.4.7",
"@storybook/react": "8.4.7",
"@storybook/test": "8.4.7",
"@svgr/webpack": "8.1.0",
"@testing-library/dom": "10.3.1",
"@testing-library/jest-dom": "6.4.6",
"@testing-library/react": "16.0.0",
"@testing-library/react": "16.1.0",
"@types/identity-obj-proxy": "^3",
"@types/jest": "29.5.9",
"@types/jest-plugin-context": "2.9.7",
"@types/node": "20",
"@types/prop-types": "^15",
"@types/react": "18.3.2",
"@types/react-dom": "18.3.0",
"@types/react": "19.0.1",
"@types/react-dom": "19.0.2",
"@types/react-responsive-masonry": "^2",
"@typescript-eslint/eslint-plugin": "7.9.0",
"@typescript-eslint/parser": "7.9.0",
Expand Down Expand Up @@ -108,8 +108,12 @@
"sass": "1.69.6",
"sass-loader": "12.6.0",
"start-server-and-test": "1.14.0",
"storybook": "8.3.3",
"storybook": "8.4.7",
"typescript": "5.2.2",
"webpack": "5.95.0"
},
"resolutions": {
"@types/react": "19.0.1",
"@types/react-dom": "19.0.2"
}
}
4 changes: 3 additions & 1 deletion apps/web/src/app/api/blob/latest/[name]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import { api, ApiError, getLatestItemReduce } from '@dnd-academy/core';
import { list } from '@vercel/blob';

// eslint-disable-next-line import/prefer-default-export
export async function GET(_: NextRequest, { params }: { params: { name: string } }) {
export async function GET(_: NextRequest, props: { params: Promise<{ name: string }> }) {
const params = await props.params;

if (!params?.name) {
return NextResponse.json(null, {
status: 400,
Expand Down
6 changes: 4 additions & 2 deletions apps/web/src/app/jobs/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ type SearchParams = {
flag: string | undefined;
};

function Page({ searchParams }: { searchParams?: SearchParams; }) {
const jobs = getJobs({ flag: searchParams?.flag });
async function Page({ searchParams }: { searchParams?: Promise<SearchParams>; }) {
const params = await searchParams;

const jobs = getJobs({ flag: params?.flag });

return (
<JobsPage jobs={jobs} />
Expand Down
13 changes: 7 additions & 6 deletions apps/web/src/app/organizers/[id]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Metadata } from 'next';
import { notFound } from 'next/navigation';

import OrganizerPage from '@/components/pages/OrganizerPage';
Expand All @@ -8,12 +7,13 @@ import METADATA, { DEFAULT_METADATA } from '@/lib/constants/metadata';
export const dynamicParams = false;

type Props = {
params: {
params: Promise<{
id: string;
};
}>;
};

export function generateMetadata({ params }: Props): Metadata {
export async function generateMetadata(props: Props) {
const params = await props.params;
const organizer = getOrganizer({ id: Number(params.id) });

if (!organizer) {
Expand Down Expand Up @@ -53,8 +53,9 @@ export function generateStaticParams() {
}));
}

function Page({ params }: Props) {
const organizer = getOrganizer({ id: Number(params.id) });
async function Page({ params }: Props) {
const resolvedParams = await params;
const organizer = getOrganizer({ id: Number(resolvedParams.id) });

if (!organizer) {
notFound();
Expand Down
6 changes: 4 additions & 2 deletions apps/web/src/app/organizers/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ type SearchParams = {
position: string | undefined;
};

function Page({ searchParams }: { searchParams?: SearchParams; }) {
const organizers = getOrganizers({ position: searchParams?.position, isArchived: false });
async function Page({ searchParams }: { searchParams?: Promise<SearchParams>; }) {
const params = await searchParams;

const organizers = getOrganizers({ position: params?.position, isArchived: false });

return (
<>
Expand Down
6 changes: 4 additions & 2 deletions apps/web/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ export const metadata = DEFAULT_METADATA;
type ParamsKey = 'tab';

type Props = {
searchParams: Record<ParamsKey, string | undefined>;
searchParams: Promise<Record<ParamsKey, string | undefined>>;
};

async function Home({ searchParams }: Props) {
const params = await searchParams;

const faqData = await api<FAQ[]>({
url: '/faq.json',
type: 'blob',
Expand All @@ -23,7 +25,7 @@ async function Home({ searchParams }: Props) {

return (
<HomePage
tab={searchParams.tab}
tab={params.tab}
eventStatus={eventStatus}
faqItems={faqData}
applicantTotalCount={applicantCount.total}
Expand Down
13 changes: 7 additions & 6 deletions apps/web/src/app/projects/[id]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Metadata } from 'next';
import { notFound } from 'next/navigation';

import ProjectPage from '@/components/pages/ProjectPage';
Expand All @@ -8,12 +7,13 @@ import METADATA, { DEFAULT_METADATA } from '@/lib/constants/metadata';
export const dynamicParams = false;

type Props = {
params: {
params: Promise<{
id: string;
};
}>;
};

export function generateMetadata({ params }: Props): Metadata {
export async function generateMetadata(props: Props) {
const params = await props.params;
const project = getProject({ id: Number(params.id) });

if (!project) {
Expand Down Expand Up @@ -52,8 +52,9 @@ export function generateStaticParams() {
}));
}

function Page({ params }: Props) {
const project = getProject({ id: Number(params.id) });
async function Page({ params }: Props) {
const resolvedParams = await params;
const project = getProject({ id: Number(resolvedParams.id) });

if (!project) {
notFound();
Expand Down
5 changes: 3 additions & 2 deletions apps/web/src/app/projects/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ type SearchParams = {
ordinal: string | undefined;
};

function Page({ searchParams }: { searchParams?: SearchParams; }) {
const projects = getProjects({ ordinal: searchParams?.ordinal });
async function Page({ searchParams }: { searchParams?: Promise<SearchParams>; }) {
const params = await searchParams;
const projects = getProjects({ ordinal: params?.ordinal });

return (
<>
Expand Down
5 changes: 3 additions & 2 deletions apps/web/src/app/reviews/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ type SearchParams = {
position: string | undefined;
};

function Page({ searchParams }: { searchParams?: SearchParams; }) {
const reviews = getReviews({ position: searchParams?.position });
async function Page({ searchParams }: { searchParams?: Promise<SearchParams>; }) {
const params = await searchParams;
const reviews = getReviews({ position: params?.position });

return (
<ReviewsPage reviews={reviews} />
Expand Down
6 changes: 3 additions & 3 deletions apps/web/src/components/global/GlobalPortal/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PropsWithChildren } from 'react';
import ReactDOM from 'react-dom';
import { PropsWithChildren, ReactNode } from 'react';
import { createPortal } from 'react-dom';

import { useIsMounted } from 'usehooks-ts';

Expand All @@ -20,7 +20,7 @@ function GlobalPortal({ elementId = 'portal-container', children }: PropsWithChi
return null;
}

return ReactDOM.createPortal(children, portalRoot);
return createPortal((children as ReactNode), portalRoot);
}

export default GlobalPortal;
Loading
Loading