Repository navigation
Conversation
…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]>
…ite-docs-fumadocs-loader
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 (
renderServerComponentof 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
serializePageTree, the loader preloads the page through thecollections/browserclient loader, and the page renders it in Suspense withuseFumadocsLoader. Collections stay on the Config API (synccollections/server), the one that keeps search working on the Worker (the async macro collection renders structured data throughfumadocs-core/server, which resolves to its throwing browser build under the Worker'sbrowsercondition).tanstackStart({rsc}), the Cloudflare child environment,@vitejs/plugin-rscin 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), theDocsShellsplit and the 12'use client'marks added for it. The star count is unchanged.Numbers (preview build, headless Chromium, median of 10)
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=sitegreen after merging #1256's head;oxfmt --checkclean.🤖 Generated with Claude Code