Skip to content

Commit 75dcc5a

Browse files
Migrate to Next.js 16, React 19, and Fumadocs v16
- Updated Next.js from 15.1.0 to 16.0.7 - Updated React to 19.2.1 (latest) - Updated Fumadocs packages from v14 to v16.2.3 - Updated Tailwind CSS to v4.1.17 with new PostCSS plugin - Fixed breaking changes: - Updated async request APIs (params already awaited) - Fixed Fumadocs provider imports - Updated theme toggle to use next-themes directly - Fixed sidebar components API changes - Updated source imports and exports - Removed deprecated patch file - Updated all dev dependencies to latest versions
1 parent a7016d0 commit 75dcc5a

12 files changed

Lines changed: 424 additions & 101 deletions

File tree

app/(home)/Navbar.tsx

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
1-
import { ThemeToggle } from "fumadocs-ui/components/layout/theme-toggle";
1+
"use client";
2+
23
import { SiteLogo } from "./SiteLogo";
34
import Link from "next/link";
5+
import { useTheme } from "next-themes";
6+
import { useEffect, useState } from "react";
47

58
export function Navbar() {
9+
const { theme, setTheme } = useTheme();
10+
const [mounted, setMounted] = useState(false);
11+
12+
useEffect(() => {
13+
setMounted(true);
14+
}, []);
15+
616
return (
717
<>
818
<div className="backdrop-blur-sm w-full h-16 px-4 flex items-center justify-between fixed top-0">
@@ -11,7 +21,14 @@ export function Navbar() {
1121
</Link>
1222

1323
<div className="flex items-center space-x-4">
14-
<ThemeToggle />
24+
{mounted && (
25+
<button
26+
onClick={() => setTheme(theme === "dark" ? "light" : "dark")}
27+
className="p-2 rounded-md hover:bg-gray-200 dark:hover:bg-gray-700"
28+
>
29+
{theme === "dark" ? "🌞" : "🌙"}
30+
</button>
31+
)}
1532
</div>
1633
</div>
1734
</>

app/docs/SidebarItem.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
"use client";
22

33
import { CratesIoLogo, NpmLogo } from "@/lib/logos";
4-
import { type SidebarComponents } from "fumadocs-ui/layouts/docs/shared";
5-
import { SidebarItem } from "fumadocs-ui/layouts/docs/sidebar";
4+
import { SidebarItem } from "fumadocs-ui/components/sidebar/base";
65

7-
export const components: Partial<SidebarComponents> = {
8-
Item: ({ item }) => {
6+
export const components = {
7+
Item: ({ item }: any) => {
98
// TODO: generalise this and configure it for all revelant links
109
if (item.url === "/docs/rspc/client/vanilla") {
1110
return (

app/docs/[[...slug]]/page.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,11 @@ export default async function Page(props: {
2121
<DocsPage
2222
toc={page.data.toc}
2323
full={page.data.full}
24-
lastUpdate={page.data.lastModified}
2524
editOnGithub={{
2625
repo: "website",
2726
owner: "specta-rs",
2827
sha: "main",
29-
path: `content/docs/${page.file.path}`,
28+
path: `content/docs/${page.slugs.join('/')}`,
3029
}}
3130
>
3231
<DocsTitle>{page.data.title}</DocsTitle>

app/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { RootProvider } from "fumadocs-ui/provider";
1+
import { RootProvider } from "fumadocs-ui/provider/next";
22
import { Metadata } from "next";
33
import { Inter } from "next/font/google";
44
import type { ReactNode } from "react";

lib/source.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import { docs, meta } from "@/.source";
1+
import { docs, meta } from "../.source/server";
2+
import { toFumadocsSource } from "fumadocs-mdx/runtime/server";
23
import Image from "next/image";
3-
import { createMDXSource } from "fumadocs-mdx";
44
import { loader } from "fumadocs-core/source";
55
import { createElement } from "react";
66
import { CratesIoLogo, NpmLogo } from "./logos";
77

88
export const source = loader({
99
baseUrl: "/docs",
10-
source: createMDXSource(docs, meta),
10+
source: toFumadocsSource(docs, meta),
1111
icon(icon) {
1212
if (!icon) return;
1313

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@
1414
"fumadocs-ui": "16.2.3",
1515
"next": "16.0.7",
1616
"next-sitemap": "^4.2.3",
17+
"next-themes": "^0.4.6",
1718
"react": "^19.2.1",
1819
"react-dom": "^19.2.1"
1920
},
2021
"devDependencies": {
22+
"@tailwindcss/postcss": "^4.1.17",
2123
"@types/mdx": "^2.0.13",
2224
"@types/node": "24.10.1",
2325
"@types/react": "^19.2.7",
@@ -30,8 +32,5 @@
3032
"typescript": "^5.9.3"
3133
},
3234
"pnpm": {
33-
"patchedDependencies": {
34-
"fumadocs-ui": "patches/fumadocs-ui.patch"
35-
}
3635
}
3736
}

patches/fumadocs-ui.patch

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)