Skip to content

feat: upgrade fumadocs v16#459

Merged
mittalyashu merged 11 commits intov0-2from
feat/bump-fumadocs-v16
Jan 30, 2026
Merged

feat: upgrade fumadocs v16#459
mittalyashu merged 11 commits intov0-2from
feat/bump-fumadocs-v16

Conversation

@mittalyashu
Copy link
Member

@mittalyashu mittalyashu commented Jan 28, 2026

Summary by CodeRabbit

  • New Features

    • Image zoom for documentation images.
    • Integrated API docs component for improved OpenAPI rendering.
  • Updates

    • Simplified API reference pages by removing redundant route metadata and streamlining API component usage.
    • Upgraded core docs and framework packages for compatibility.
    • Centralized icon handling and unified syntax-highlighting themes.
    • Normalized API metadata and response descriptions for clearer docs.
  • Style

    • Footer layout simplified to a static rendering.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 28, 2026

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

⚠️ Parsing warnings (1)
Validation error: Unrecognized key(s) in object: 'path_filters'
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
📝 Walkthrough

Walkthrough

Removes explicit _openapi.route frontmatter and webhooks/hasHead props from many API MDX files; bumps fumadocs and Next.js deps; adds an APIPage factory component with shiki options; migrates sources to plugin-based loaders (openapi, lucide icons); standardizes Page prop types and adjusts layout/provider imports. (41 words)

Changes

Cohort / File(s) Summary
API Reference MDX edits
content/api-reference/.../*.mdx
Removed _openapi.route frontmatter entries and removed webhooks and hasHead props from APIPage invocations across API doc MDX files.
OpenAPI metadata
content/api-reference/openapi.yaml, content/api-reference/meta.json
Filled previously-empty response descriptions (e.g., 200 -> "OK", 201 -> "Created") and normalized internal page reference strings in meta.json.
Dependency bumps
package.json
Updated fumadocs packages and next to newer exact v16+ versions.
APIPage component & MDX integration
src/components/ApiPage.ts, src/components/MDXComponents.tsx, src/lib/openapi.ts
Added APIPage factory export wired to local openapi with shiki theme options; removed APIPage mapping from MDXComponents; removed shikiOptions from src/lib/openapi.ts.
Source system & plugins
src/lib/source.ts
Reworked sources to use loader(...)/multiple(...) with plugins: introduced lucideIconsPlugin() across sources and integrated openapiPlugin()/openapiSource() for /api-reference.
Page signature standardization
src/app/*/[[...slug]]/page.tsx
Replaced inline props types with typed PageProps<"/.../[[...slug]]"> across dynamic route page files.
API reference page rendering
src/app/api-reference/[[...slug]]/page.tsx
Switched layout import to notebook layout, imported APIPage, and added conditional rendering: for page.data.type === "openapi" render DocsPage with APIPage using page.data.getAPIPageProps().
Root provider import
src/app/layout.tsx
Changed RootProvider import path to fumadocs-ui/provider/next.
Footer / Sidebar cleanup
src/components/Footer.tsx
Removed active useSidebar() usage and dynamic sidebar-based margin adjustments (left commented); footer now renders without sidebar-driven layout changes.
Config and TS updates
source.config.ts, tsconfig.json
Removed mdxOptions from source.config.ts; changed TS jsx to react-jsx, added fumadocs-mdx:collections/* path alias and included Next dev types in tsconfig.json.

Sequence Diagram(s)

sequenceDiagram
  participant Browser
  participant NextPage as "Next Page (app/.../page.tsx)"
  participant DocsPage as "DocsPage"
  participant APIPage as "APIPage"
  participant OpenAPISource as "openapiSource / openapiPlugin"

  Browser->>NextPage: request /api-reference/...
  NextPage->>OpenAPISource: resolve page data (type, getAPIPageProps)
  alt page.data.type == "openapi"
    NextPage->>DocsPage: render DocsPage for openapi
    DocsPage->>APIPage: mount with props from getAPIPageProps()
    APIPage->>OpenAPISource: fetch OpenAPI document/operations
    APIPage-->>Browser: render API docs UI
  else non-openapi
    NextPage->>DocsPage: render MDX body via MDXComponents
    DocsPage-->>Browser: render docs page
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related issues

  • Bump fumadocs to v16 #447: Matches the fumadocs v16 dependency upgrades and the migration to factory/plugin-based APIs implemented in this PR.
🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title 'feat: upgrade fumadocs v16' directly and clearly summarizes the main change—upgrading the fumadocs library to version 16, which is the primary objective evidenced by dependency updates and comprehensive refactoring across the codebase.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/bump-fumadocs-v16

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@src/app/developing/`[[...slug]]/page.tsx:
- Around line 12-14: Add the missing type import for PageProps used by the Page
component: import the PageProps type from "fumadocs-core/framework/next" and
place it with the other top-of-file imports so the signature export default
async function Page(props: PageProps<"/developing/[[...slug]]">) and any other
usages of PageProps compile correctly.

In `@src/lib/source.ts`:
- Around line 44-50: The pageTree currently contains a commented-out
transformerOpenAPI call in the openApiSource definition; either re-enable it by
uncommenting the transformer and ensuring transformerOpenAPI is imported so
loader(... pageTree) includes transformers: [transformerOpenAPI()] to restore
OpenAPI decorations, or remove the commented transformer line and any unused
transformerOpenAPI import entirely to clean up the code—update the openApiSource
pageTree and imports accordingly (referencing openApiSource, loader,
apiReference.toFumadocsSource(), and transformerOpenAPI).
🧹 Nitpick comments (5)
src/app/guide/[[...slug]]/page.tsx (1)

37-38: Inconsistent destructuring pattern across page files.

This file uses direct destructuring (const { slug } = await props.params) while all other page files in this PR use const params = await props.params followed by params.slug. Consider aligning for consistency.

Suggested change for consistency
 export async function generateMetadata(
   props: PageProps<"/guide/[[...slug]]">,
 ): Promise<Metadata> {
-  const { slug } = await props.params;
-  const page = guideSource.getPage(slug);
+  const params = await props.params;
+  const page = guideSource.getPage(params.slug);
   if (!page) notFound();
src/components/Footer.tsx (2)

74-82: Dead code: sidebarExists state and effect are unused.

The sidebarExists state and its associated useEffect are still present but no longer used since the marginInlineStart style logic is commented out. This leaves unnecessary DOM queries running on every mount.

Either remove this dead code entirely or restore the sidebar-based layout adjustment.

🧹 Proposed cleanup
 export function Footer() {
   const currentYear = new Date().getFullYear();
-  // const { collapsed } = useSidebar();
-  const [sidebarExists, setSidebarExists] = useState(false);
-
-  useEffect(() => {
-    const exists = !!document?.querySelector(
-      `.\\*\\:w-\\(\\--fd-sidebar-width\\)`,
-    );
-    setSidebarExists(exists);
-  }, []);

   return (

Also remove the unused imports at the top:

-import { useEffect, useState } from "react";
+import React from "react";

96-102: Commented-out code should be removed or restored.

Leaving commented-out code in production degrades readability. If the sidebar-based margin adjustment is no longer needed with fumadocs v16, remove this block entirely. If it's temporarily disabled pending further investigation, add a TODO comment explaining why.

src/lib/source.ts (2)

22-30: Redundant icon handling: lucideIconsPlugin and manual icon() callback both present.

selfHostingSource includes both plugins: [lucideIconsPlugin()] and a manual icon() callback. The lucideIconsPlugin already handles icon resolution from lucide-react, making the manual callback redundant.

If there's a specific reason to keep both (e.g., fallback behavior), please document it. Otherwise, consider removing the manual callback for consistency with other sources.

♻️ Proposed fix to remove redundant icon callback
 export const selfHostingSource = loader({
   source: selfHosting.toFumadocsSource(),
   baseUrl: "/self-hosting",
   plugins: [lucideIconsPlugin()],
-  icon(icon) {
-    if (icon && icon in icons)
-      return createElement(icons[icon as keyof typeof icons]);
-  },
 });

3-4: Commented-out import should be removed.

Dead import comments add noise. If transformerOpenAPI is no longer needed with fumadocs v16, remove the comment entirely.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@package.json`:
- Around line 18-25: The Next.js bump to 16.1.6 in package.json is incompatible
with `@opennextjs/cloudflare` which only supports Next.js 15.x; revert the "next"
entry to a 15.x-compatible version (e.g., ^15.3.0) in package.json, update the
lockfile by running your package manager (npm/yarn/pnpm install) and re-run the
build to confirm, or alternatively remove/hold the `@opennextjs/cloudflare`
upgrade until it adds Next 16 support — target the "next" field in package.json
and the dependency "@opennextjs/cloudflare" when making the change.

In `@src/app/api-reference/`[[...slug]]/page.tsx:
- Around line 13-15: The Page component uses PageProps but there's no import;
add a type import "import type { PageProps } from 'fumadocs-ui/page';" at the
top of the file or, if that type isn't exported by the installed fumadocs-ui
version, define an equivalent local type (e.g., props: { params: Promise<{
slug?: string[] }> }) and update the Page signature to use it; ensure you
reference the Page function and PageProps symbol when making the change.
🧹 Nitpick comments (3)
src/components/MDXComponents.tsx (1)

31-31: Consider typing APIPage props instead of any.
This keeps MDX component typing aligned with the generated APIPage component.

♻️ Suggested type-safe update
-import type { ImageProps } from "next/image";
+import type { ImageProps } from "next/image";
+import type { ComponentProps } from "react";
@@
-  APIPage: (props: any) => <APIPage {...props} />,
+  APIPage: (props: ComponentProps<typeof APIPage>) => <APIPage {...props} />,
src/lib/source.ts (1)

1-5: Remove unused imports.

createElement and icons are no longer needed since the plugin-based approach (lucideIconsPlugin) handles icon resolution internally.

♻️ Suggested cleanup
-import { createElement } from "react";
 import { loader, multiple } from "fumadocs-core/source";
 import { openapiPlugin, openapiSource } from "fumadocs-openapi/server";
 import { lucideIconsPlugin } from "fumadocs-core/source/lucide-icons";
-import { icons } from "lucide-react";
src/app/guide/[[...slug]]/page.tsx (1)

37-38: Minor inconsistency in destructuring pattern.

This file uses const { slug } = await props.params while other similar pages use const params = await props.params followed by params.slug. Both work, but consistency across files improves maintainability.

♻️ Option to align with other pages
 export async function generateMetadata(
   props: PageProps<"/guide/[[...slug]]">,
 ): Promise<Metadata> {
-  const { slug } = await props.params;
-  const page = guideSource.getPage(slug);
+  const params = await props.params;
+  const page = guideSource.getPage(params.slug);
   if (!page) notFound();

@mittalyashu mittalyashu force-pushed the feat/bump-fumadocs-v16 branch from bd71d9c to e43a83b Compare January 30, 2026 11:58
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Fix all issues with AI agents
In `@src/components/MDXComponents.tsx`:
- Line 31: Replace the use of the `any` type on the MDX component wrapper for
APIPage: locate the object entry `APIPage: (props: any) => <APIPage {...props}
/>` and change the prop type to `React.ComponentProps<typeof APIPage>`; ensure
`React` is imported if needed for `React.ComponentProps` to resolve. This
updates the signature for the wrapper so it forwards correctly typed props to
the `APIPage` component.

In `@src/lib/source.ts`:
- Around line 1-5: Remove the unused React and lucide imports: delete
"createElement" from the React import and "icons" from the lucide-react import
in the top-level imports; update the corresponding import statements (imports of
createElement and icons are no longer referenced anywhere in this module, e.g.,
remove createElement from the import list that currently imports from "react"
and remove icons from the import list that currently imports from
"lucide-react") so the linter warning disappears and the remaining imports stay
valid.
- Around line 41-52: openApiSource currently configures loader(multiple(...), {
plugins: [openapiPlugin()] }) but omits lucideIconsPlugin(), so frontmatter
icons (e.g., icon: BookOpen in content/api-reference/index.mdx) won't resolve;
update the plugin array for the openApiSource call to include
lucideIconsPlugin() alongside openapiPlugin() (locate the openApiSource
definition that calls loader(...) with multiple({ docs:
apiReference.toFumadocsSource(), openapi: await openapiSource(...) }) and add
lucideIconsPlugin() to that plugins list).

@mittalyashu
Copy link
Member Author

LGTM

@mittalyashu mittalyashu merged commit eef9731 into v0-2 Jan 30, 2026
6 checks passed
@mittalyashu mittalyashu deleted the feat/bump-fumadocs-v16 branch January 30, 2026 12:54
@github-actions github-actions bot locked and limited conversation to collaborators Jan 30, 2026
@mittalyashu mittalyashu linked an issue Feb 13, 2026 that may be closed by this pull request
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bump fumadocs to v16

1 participant