Skip to content

docs: generate API reference for the React server adapters - #2308

Open
irfanfandi wants to merge 1 commit into
TanStack:mainfrom
irfanfandi:docs/generate-server-adapter-reference
Open

docs: generate API reference for the React server adapters#2308
irfanfandi wants to merge 1 commit into
TanStack:mainfrom
irfanfandi:docs/generate-server-adapter-reference

Conversation

@irfanfandi

@irfanfandi irfanfandi commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

The three React server adapters have never had reference docs generated. This registers them, and links them from the sidebar.

Refs #2075.

Root cause

scripts/generate-docs.ts registered 7 of the 14 packages that ship a tsconfig.docs.json. The three server adapters were not among them, so these exports have never had a reference page:

Adapter API with no reference page
react-form-nextjs useTransform, createServerValidate, initialFormState, ServerValidateError
react-form-remix same
react-form-start same, plus getFormData

This is why #2075's link 404s. useTransform is not part of @tanstack/react-form — it lives in each adapter package, and none of them were fed to TypeDoc.

Three things that were not obvious

Registering the packages alone generates nothing. Their tsconfig.docs.json mapped only @tanstack/form-core, so TypeDoc failed on every @tanstack/react-form import and emitted zero files:

packages/react-form-remix/src/index.ts:1:15 - error TS2307:
Cannot find module '@tanstack/react-form' or its corresponding type declarations.

Worth flagging: the run still printed ✅ All markdown files have been processed! and exited 0. generateReferenceDocs skips a package when app.convert() returns undefined, and it rms the output directory before converting — so a broken docs tsconfig silently empties a framework's reference tree while CI stays green. That lives in @tanstack/config, so it is out of scope here, but I am happy to open an issue there if useful.

Each adapter needs its own output directory. All three export a useTransform and a ServerValidateError; nextjs and remix also both export createServerValidate and initialFormState. A shared directory would overwrite two of the three adapters with no warning.

react-store is excluded alongside react-form. The adapters re-export useStore and useSelector from it, which the React reference already documents — without the exclusion each adapter added a third duplicate of both pages.

On #2075 specifically

The URL in that issue, framework/react/reference/functions/useTransform, will still 404 after this PR, and I would rather say so up front than have a reviewer find it.

useTransform is declared export const useTransform: (fn, deps?) => ..., so TypeDoc classifies it as a Variable, not a Function. The canonical pages are:

  • framework/react/reference/nextjs/variables/useTransform
  • framework/react/reference/remix/variables/useTransform
  • framework/react/reference/start/variables/useTransform

The old path was never valid — it came from a docs/config.json entry pointing at a page TypeDoc had no way to produce (removed in #2278). If you would prefer a redirect for the old URL instead of, or in addition to, the new pages, say the word.

Sidebar

Three entries, mirroring the existing React Reference rather than listing all 16 pages — the React section curates 6 entries out of 24 generated pages, and each adapter's index.md already links to every one of its children, so nothing is orphaned.

Verification

Check Result
test:docs 301 markdown files, 169 nav entries, 0 broken links
test:docs with a deliberately broken new nav entry exits 1, reports API Reference > react > Next.js Reference
prettier / eslint / tsc --noEmit clean
sherif / knip clean (knip's @tanstack/react-start hint is pre-existing on main)
generate-docs run twice no diff against the 184 existing reference files
Generated source links all point at github.com/TanStack/form

No changeset: tsconfig.docs.json sits outside each package's published files (["dist", "src"]), so nothing shipped changes.

Summary by CodeRabbit

  • Documentation
    • Added API reference documentation for React integrations with Next.js, Remix, and Start.
    • Documented server validation, validation errors, form state, data transformation, and form data helpers.
    • Added navigation entries and indexes for the new framework-specific references.
    • Improved documentation generation and TypeScript configuration for these integrations.

…entation

- Added new reference entries for Next.js, Remix, and Start in the configuration file.
- Created documentation for Next.js, including classes, variables, and functions.
- Added documentation for Remix, covering similar structures as Next.js.
- Enhanced Start reference documentation with new classes, variables, and functions.
- Updated TypeScript configuration for all three packages to include paths for `@tanstack/react-form`.
@irfanfandi
irfanfandi requested a review from a team as a code owner August 10, 2026 02:37
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 9c410f18-74a0-438a-a4e8-df8c65651e74

📥 Commits

Reviewing files that changed from the base of the PR and between 462926e and 8ddd7da.

📒 Files selected for processing (21)
  • docs/config.json
  • docs/framework/react/reference/nextjs/classes/ServerValidateError.md
  • docs/framework/react/reference/nextjs/functions/createServerValidate.md
  • docs/framework/react/reference/nextjs/index.md
  • docs/framework/react/reference/nextjs/variables/initialFormState.md
  • docs/framework/react/reference/nextjs/variables/useTransform.md
  • docs/framework/react/reference/remix/classes/ServerValidateError.md
  • docs/framework/react/reference/remix/functions/createServerValidate.md
  • docs/framework/react/reference/remix/index.md
  • docs/framework/react/reference/remix/variables/initialFormState.md
  • docs/framework/react/reference/remix/variables/useTransform.md
  • docs/framework/react/reference/start/classes/ServerValidateError.md
  • docs/framework/react/reference/start/functions/createServerValidate.md
  • docs/framework/react/reference/start/index.md
  • docs/framework/react/reference/start/variables/getFormData.md
  • docs/framework/react/reference/start/variables/initialFormState.md
  • docs/framework/react/reference/start/variables/useTransform.md
  • packages/react-form-nextjs/tsconfig.docs.json
  • packages/react-form-remix/tsconfig.docs.json
  • packages/react-form-start/tsconfig.docs.json
  • scripts/generate-docs.ts

📝 Walkthrough

Walkthrough

Added Typedoc generation support and API reference pages for the Next.js, Remix, and Start React adapters. Updated documentation TypeScript paths and navigation entries for the new references.

Changes

React adapter documentation

Layer / File(s) Summary
Documentation generation wiring
packages/react-form-*/tsconfig.docs.json, scripts/generate-docs.ts, docs/config.json
Typedoc now generates separate references for Next.js, Remix, and Start. Documentation path mappings and navigation links include the new adapters.
Next.js API reference
docs/framework/react/reference/nextjs/...
Added reference pages for ServerValidateError, createServerValidate, initialFormState, and useTransform.
Remix API reference
docs/framework/react/reference/remix/...
Added reference pages for ServerValidateError, createServerValidate, initialFormState, and useTransform.
Start API reference
docs/framework/react/reference/start/...
Added reference pages for ServerValidateError, createServerValidate, getFormData, initialFormState, and useTransform.

Estimated code review effort: 2 (Simple) | ~15 minutes

Suggested reviewers: alemtuzlak

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: generating API reference documentation for the React server adapters.
Description check ✅ Passed The description thoroughly explains the changes, motivation, verification results, and release impact, despite not using the template headings.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@nx-cloud

nx-cloud Bot commented Aug 11, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 8ddd7da

Command Status Duration Result
nx affected --targets=test:sherif,test:knip,tes... ✅ Succeeded 3m 2s View ↗
nx run-many --target=build --exclude=examples/** ✅ Succeeded 8s View ↗

☁️ Nx Cloud last updated this comment at 2026-08-11 08:04:29 UTC

@pkg-pr-new

pkg-pr-new Bot commented Aug 11, 2026

Copy link
Copy Markdown
More templates

@tanstack/angular-form

npm i https://pkg.pr.new/@tanstack/angular-form@2308

@tanstack/form-core

npm i https://pkg.pr.new/@tanstack/form-core@2308

@tanstack/form-devtools

npm i https://pkg.pr.new/@tanstack/form-devtools@2308

@tanstack/lit-form

npm i https://pkg.pr.new/@tanstack/lit-form@2308

@tanstack/preact-form

npm i https://pkg.pr.new/@tanstack/preact-form@2308

@tanstack/react-form

npm i https://pkg.pr.new/@tanstack/react-form@2308

@tanstack/react-form-devtools

npm i https://pkg.pr.new/@tanstack/react-form-devtools@2308

@tanstack/react-form-nextjs

npm i https://pkg.pr.new/@tanstack/react-form-nextjs@2308

@tanstack/react-form-remix

npm i https://pkg.pr.new/@tanstack/react-form-remix@2308

@tanstack/react-form-start

npm i https://pkg.pr.new/@tanstack/react-form-start@2308

@tanstack/solid-form

npm i https://pkg.pr.new/@tanstack/solid-form@2308

@tanstack/solid-form-devtools

npm i https://pkg.pr.new/@tanstack/solid-form-devtools@2308

@tanstack/svelte-form

npm i https://pkg.pr.new/@tanstack/svelte-form@2308

@tanstack/vue-form

npm i https://pkg.pr.new/@tanstack/vue-form@2308

commit: 8ddd7da

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (6892ed0) to head (8ddd7da).
⚠️ Report is 268 commits behind head on main.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #2308       +/-   ##
==========================================
- Coverage   90.35%   0.00%   -90.36%     
==========================================
  Files          38      11       -27     
  Lines        1752      99     -1653     
  Branches      444      29      -415     
==========================================
- Hits         1583       0     -1583     
+ Misses        149      85       -64     
+ Partials       20      14        -6     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants