Skip to content

fix(site): docs render through fumadocs' TanStack Start loader, and server components are off - #1259

Open
omridevk wants to merge 2 commits into
feat/site-docs-demosfrom
fix/site-docs-fumadocs-loader
Open

omridevk wants to merge 2 commits into
feat/site-docs-demosfrom
fix/site-docs-fumadocs-loader

Conversation

@omridevk

Copy link
Copy Markdown
Contributor

Stacked on #1256. The docs render through fumadocs' TanStack Start loader, and server components are off.

Why

The docs body was a TanStack Start server component (renderServerComponent of the page in the route loader), a shape fumadocs documents only for React Router. On a first dev load it raised React's "This library called use() to suspend in a previous render but did not call use() when it finished" error from the RSC decode. Server components were wanted only for the GitHub star count, which left them in #1221, so nothing needs them.

What changes

  • The docs route is fumadocs' TanStack Start setup: a server function returns the page path and serializePageTree, the loader preloads the page through the collections/browser client loader, and the page renders it in Suspense with useFumadocsLoader. Collections stay on the Config API (sync collections/server), the one that keeps search working on the Worker (the async macro collection renders structured data through fumadocs-core/server, which resolves to its throwing browser build under the Worker's browser condition).
  • Removed: the rsc plugin, tanstackStart({rsc}), the Cloudflare child environment, @vitejs/plugin-rsc in the site and the catalog, docs.functions.ts (llms.txt, llms-full.txt, .md, sitemap, search and OG read the source again), the root route's try-it server function import (Start RSC mode: server functions imported only from 'use client' modules are missing from the production manifest ("Server function info not found") TanStack/router#7943), the DocsShell split and the 12 'use client' marks added for it. The star count is unchanged.

Numbers (preview build, headless Chromium, median of 10)

  • Worker: 37,639,346 B to 35,274,362 B.
  • Docs page JS: about +65 to +110 KB per page (the page's MDX chunk and fumadocs' client loader in place of the RSC payload decode); fewer scripts (58 to 39 at 390, 122 to 102 at 1280).
  • First load: FCP 228-276 ms to 220-244 ms, load 339-504 ms to 324-366 ms.

Checked

0 "called use()" warnings and 0 console errors in 40 dev and 40 preview loads at 390 and 1280; client navigation between docs pages; llms.txt, llms-full.txt, /docs/.md (200 and 404), sitemap, /api/search (60 results), OG (200 and 404); prerender still 143 routes; turbo run typecheck test --filter=site green after merging #1256's head; oxfmt --check clean.

🤖 Generated with Claude Code

omridevk and others added 2 commits November 29, 2026 02:39
…erver components are off

The docs body was a TanStack Start server component (renderServerComponent of the page in the route loader), a
shape fumadocs documents only for React Router. On a first dev load it raised React's "called use() to suspend
... did not call use()" error from the RSC decode. The docs route now follows fumadocs' TanStack Start setup: a
server function returns the page path and serializePageTree, the loader preloads the page through the
collections/browser client loader, and the page renders it in Suspense with useFumadocsLoader. Collections stay
on the Config API (source.config.ts, collections/server sync), which keeps search working on the Worker: the
async macro collection renders structured data through fumadocs-core/server, which resolves to its throwing
browser build under the Worker's "browser" condition.

Nothing else used server components (the star count left them in #1221), so RSC mode is off and every piece it
added is gone: the rsc plugin, tanstackStart({rsc}), the Cloudflare child environment, @vitejs/plugin-rsc in the
site and the catalog, docs.functions.ts (llms.txt, llms-full.txt, .md, sitemap, search and OG read the source
again), the root route's try-it server function import (TanStack/router#7943), the DocsShell client split
(folded back into the route) and the 'use client' marks added for it. docs-paths.ts stays: start.ts runs on
every page and must not import the docs source.

Worker 37,639,346 B to 35,274,362 B; 0 use() warnings and 0 console errors in 40 dev and 40 preview loads.

Inspired by: fumadocs examples/tanstack-start-min (src/routes/docs/$.tsx) and docs/mdx/entry/browser (TanStack Start tab)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@omridevk omridevk added the no-changeset PR intentionally ships no release note label Nov 29, 2026
@coderabbitai

coderabbitai Bot commented Nov 29, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 643abdc4-57fa-4fc0-9db7-64b8cdd7ccbd

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changeset PR intentionally ships no release note

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant