Skip to content

Commit 23e501a

Browse files
authored
πŸ‘Œ IMPROVE: Next.js 15 Migration (#168)
* πŸ› FIX: CVE-2026-23864 * πŸ‘Œ IMPROVE: Migration fixes * πŸ› FIX: Build * πŸ“¦ NEW: Node version
1 parent 0fc0a43 commit 23e501a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+2491
-850
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22

β€Žapps/baseai.dev/next.config.mjsβ€Ž

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@ import withSearch from './src/mdx/search.mjs';
55
const nextConfig = {
66
pageExtensions: ['js', 'jsx', 'ts', 'tsx', 'mdx'],
77
images: {
8-
domains: ['raw.githubusercontent.com/']
8+
remotePatterns: [
9+
{
10+
protocol: 'https',
11+
hostname: 'raw.githubusercontent.com',
12+
},
13+
],
914
},
1015
transpilePackages: ['next-mdx-remote'],
1116
async redirects() {

β€Žapps/baseai.dev/package.jsonβ€Ž

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
"dependencies": {
1414
"@algolia/autocomplete-core": "^1.7.3",
1515
"@cloudflare/workers-types": "^4.20240405.0",
16-
"@headlessui/react": "^1.7.15",
16+
"@headlessui/react": "^2.2.0",
1717
"@headlessui/tailwindcss": "^0.2.0",
1818
"@heroicons/react": "^2.1.3",
1919
"@mdx-js/loader": "^3.0.0",
2020
"@mdx-js/react": "^3.0.0",
21-
"@next/mdx": "^14.0.4",
21+
"@next/mdx": "^15.0.0",
2222
"@radix-ui/react-accordion": "^1.2.0",
2323
"@radix-ui/react-dialog": "^1.0.5",
2424
"@radix-ui/react-slot": "^1.0.2",
@@ -27,8 +27,8 @@
2727
"@tailwindcss/typography": "^0.5.10",
2828
"@types/mdx": "^2.0.8",
2929
"@types/node": "^20.10.8",
30-
"@types/react": "^18.2.47",
31-
"@types/react-dom": "^18.2.18",
30+
"@types/react": "^19",
31+
"@types/react-dom": "^19",
3232
"@types/react-highlight-words": "^0.16.4",
3333
"@types/three": "^0.168.0",
3434
"@xyflow/react": "^12.0.4",
@@ -39,20 +39,19 @@
3939
"dayjs": "^1.11.12",
4040
"fast-glob": "^3.3.0",
4141
"flexsearch": "^0.7.31",
42-
"framer-motion": "^10.18.0",
42+
"framer-motion": "^11.18.0",
4343
"gray-matter": "^4.0.3",
4444
"html2canvas": "^1.4.1",
4545
"lucide-react": "^0.378.0",
4646
"mdast-util-to-string": "^4.0.0",
4747
"mdx-annotations": "^0.1.1",
4848
"mxcn": "^2.0.0",
49-
"next": "14.2.35",
49+
"next": "15.5.10",
5050
"next-mdx-remote": "^5.0.0",
5151
"next-themes": "^0.2.1",
52-
"react": "^18.2.0",
53-
"react-dom": "^18.2.0",
52+
"react": "^19",
53+
"react-dom": "^19",
5454
"react-highlight-words": "^0.20.0",
55-
"recoil": "^0.7.7",
5655
"remark": "^15.0.1",
5756
"remark-gfm": "^4.0.0",
5857
"remark-mdx": "^3.0.0",
@@ -73,8 +72,8 @@
7372
"@cloudflare/next-on-pages": "^1.11.0",
7473
"@types/uuid": "^10.0.0",
7574
"enquirer": "^2.4.1",
76-
"eslint": "^8.56.0",
77-
"eslint-config-next": "^14.0.4",
75+
"eslint": "^9",
76+
"eslint-config-next": "15.5.10",
7877
"prettier": "^3.1.1",
7978
"prettier-plugin-tailwindcss": "^0.5.11",
8079
"sharp": "0.33.1",

β€Žapps/baseai.dev/src/app/docs/[section]/[slug]/layout.tsxβ€Ž

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@ import { FrontmatterT } from "@/types/markdown";
44
export async function generateMetadata({
55
params
66
}: {
7-
params: { section: string; slug: string };
7+
params: Promise<{ section: string; slug: string }>;
88
}) {
9+
const { section, slug } = await params;
910
let frontmatter: FrontmatterT;
1011

1112
if (process.env.NODE_ENV === 'production') {
1213
const data = await getDocsBySlug({
13-
section: params.section,
14-
slug: params.slug
14+
section: section,
15+
slug: slug
1516
});
1617

1718
frontmatter = data.frontmatter as unknown as FrontmatterT;
@@ -20,8 +21,8 @@ export async function generateMetadata({
2021

2122
const data = await getContentBySlugOnDev({
2223
type: 'docs',
23-
slug: params.slug,
24-
section: params.section,
24+
slug: slug,
25+
section: section,
2526
});
2627

2728
frontmatter = data.frontmatter;
@@ -58,7 +59,7 @@ export default async function RootLayout({
5859
children
5960
}: {
6061
children: React.ReactNode;
61-
params: { section: string; slug: string };
62+
params: Promise<{ section: string; slug: string }>;
6263
}) {
6364
return <>{children}</>;
6465
}

β€Žapps/baseai.dev/src/app/docs/[section]/[slug]/page.tsxβ€Ž

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
1+
export const runtime = 'edge';
2+
13
import Content from '../../../../components/content';
24
import docsContent from '../../../../../content/docs/docs.json';
35
import { ContentT } from '@/types/markdown';
46

57
export default async function SingleDocPage({
68
params
79
}: {
8-
params: { section: string; slug: string };
10+
params: Promise<{ section: string; slug: string }>;
911
}) {
12+
const { section, slug } = await params;
1013
let content: ContentT;
1114

1215
if (process.env.NODE_ENV === 'production') {
1316
const docContent = docsContent.find(
14-
doc => doc.slug === params.slug && doc.section === params.section
17+
doc => doc.slug === slug && doc.section === section
1518
);
1619

1720
content = docContent?.content;
@@ -21,8 +24,8 @@ export default async function SingleDocPage({
2124

2225
const data = await getContentBySlugOnDev({
2326
type: 'docs',
24-
slug: params.slug,
25-
section: params.section,
27+
slug: slug,
28+
section: section,
2629
});
2730

2831
content = data.content;

β€Žapps/baseai.dev/src/app/docs/[section]/layout.tsxβ€Ž

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@ import { FrontmatterT } from "@/types/markdown";
44
export async function generateMetadata({
55
params
66
}: {
7-
params: { section: string, slug: string };
7+
params: Promise<{ section: string; slug: string }>;
88
}) {
9+
const { section } = await params;
910
let frontmatter: FrontmatterT;
1011

1112
if (process.env.NODE_ENV === 'production') {
1213
const data = await getDocsBySlug({
1314
section: 'docs',
14-
slug: params.section
15+
slug: section
1516
});
1617

1718
frontmatter = data.frontmatter as unknown as FrontmatterT;
@@ -20,7 +21,7 @@ export async function generateMetadata({
2021

2122
const data = await getContentBySlugOnDev({
2223
type: 'docs',
23-
slug: params.section,
24+
slug: section,
2425
section: 'docs',
2526
});
2627

@@ -58,7 +59,7 @@ export default async function RootLayout({
5859
children
5960
}: {
6061
children: React.ReactNode;
61-
params: { section: string };
62+
params: Promise<{ section: string }>;
6263
}) {
6364
return <>{children}</>;
6465
}

β€Žapps/baseai.dev/src/app/docs/[section]/page.tsxβ€Ž

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
1+
export const runtime = 'edge';
2+
13
import Content from '../../../components/content';
24
import docsContent from '../../../../content/docs/docs.json';
35
import { ContentT } from '@/types/markdown';
46

57
export default async function SingleDocPage({
68
params
79
}: {
8-
params: { section: string };
10+
params: Promise<{ section: string }>;
911
}) {
12+
const { section } = await params;
1013
let content: ContentT;
1114

1215
if (process.env.NODE_ENV === 'production') {
1316
const docContent = docsContent.find(
14-
doc => doc.slug === params.section && doc.section === 'docs'
17+
doc => doc.slug === section && doc.section === 'docs'
1518
);
1619

1720
content = docContent?.content;
@@ -21,15 +24,15 @@ export default async function SingleDocPage({
2124

2225
let data = await getContentBySlugOnDev({
2326
type: 'docs',
24-
slug: params.section,
27+
slug: section,
2528
section: 'docs',
2629
});
2730

2831
if (!data.content) {
2932
data = await getContentBySlugOnDev({
3033
type: 'docs',
3134
slug: 'index',
32-
section: params.section
35+
section: section
3336
});
3437
}
3538

β€Žapps/baseai.dev/src/app/learn/[section]/[slug]/layout.tsxβ€Ž

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@ import { FrontmatterT } from "@/types/markdown";
44
export async function generateMetadata({
55
params
66
}: {
7-
params: { section: string; slug: string };
7+
params: Promise<{ section: string; slug: string }>;
88
}) {
9+
const { section, slug } = await params;
910
let frontmatter: FrontmatterT;
1011

1112
if (process.env.NODE_ENV === 'production') {
1213
const data = await getLearnBySlug({
13-
section: params.section,
14-
slug: params.slug
14+
section: section,
15+
slug: slug
1516
});
1617

1718
frontmatter = data.frontmatter!;
@@ -21,8 +22,8 @@ export async function generateMetadata({
2122

2223
const data = await getContentBySlugOnDev({
2324
type: 'learn',
24-
slug: params.slug,
25-
section: params.section,
25+
slug: slug,
26+
section: section,
2627
});
2728

2829
frontmatter = data.frontmatter;
@@ -58,7 +59,7 @@ export default async function RootLayout({
5859
children
5960
}: {
6061
children: React.ReactNode;
61-
params: { section: string; slug: string };
62+
params: Promise<{ section: string; slug: string }>;
6263
}) {
6364
return <>{children}</>;
6465
}

β€Žapps/baseai.dev/src/app/learn/[section]/[slug]/page.tsxβ€Ž

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
1+
export const runtime = 'edge';
2+
13
import Content from '../../../../components/content';
24
import learnContent from '../../../../../content/learn/learn.json';
35
import { ContentT } from '@/types/markdown';
46

57
export default async function SingleDocPage({
68
params
79
}: {
8-
params: { section: string; slug: string };
10+
params: Promise<{ section: string; slug: string }>;
911
}) {
12+
const { section, slug } = await params;
1013
let content: ContentT;
1114

1215
if (process.env.NODE_ENV === 'production') {
1316
const docContent = learnContent.find(
14-
doc => doc.slug === params.slug && doc.section === params.section
17+
doc => doc.slug === slug && doc.section === section
1518
);
1619

1720
content = docContent?.content;
@@ -21,8 +24,8 @@ export default async function SingleDocPage({
2124

2225
const data = await getContentBySlugOnDev({
2326
type: 'learn',
24-
slug: params.slug,
25-
section: params.section,
27+
slug: slug,
28+
section: section,
2629
});
2730

2831
content = data.content;

β€Žapps/baseai.dev/src/app/learn/[section]/layout.tsxβ€Ž

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@ import { FrontmatterT } from "@/types/markdown";
44
export async function generateMetadata({
55
params
66
}: {
7-
params: { section: string, slug: string };
7+
params: Promise<{ section: string; slug: string }>;
88
}) {
9+
const { section } = await params;
910
let frontmatter: FrontmatterT;
1011

1112
if (process.env.NODE_ENV === 'production') {
1213
const data = await getLearnBySlug({
1314
section: 'learn',
14-
slug: params.section
15+
slug: section
1516
});
1617

1718
frontmatter = data.frontmatter as unknown as FrontmatterT;
@@ -20,7 +21,7 @@ export async function generateMetadata({
2021

2122
const data = await getContentBySlugOnDev({
2223
type: 'learn',
23-
slug: params.section,
24+
slug: section,
2425
section: 'learn',
2526
});
2627

@@ -58,7 +59,7 @@ export default async function RootLayout({
5859
children
5960
}: {
6061
children: React.ReactNode;
61-
params: { section: string };
62+
params: Promise<{ section: string }>;
6263
}) {
6364
return <>{children}</>;
6465
}

0 commit comments

Comments
Β (0)