Skip to content

docs: fix sidebar 404s and validate config.json nav targets - #2278

Merged
crutchcorn merged 3 commits into
TanStack:mainfrom
irfanfandi:docs/fix-dead-nav-entries
Aug 8, 2026
Merged

docs: fix sidebar 404s and validate config.json nav targets#2278
crutchcorn merged 3 commits into
TanStack:mainfrom
irfanfandi:docs/fix-dead-nav-entries

Conversation

@irfanfandi

@irfanfandi irfanfandi commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

docs/config.json contains sidebar entries pointing at reference pages that don't exist on disk, so those nav links render as 404s. This removes the dead entries and teaches verify-links.ts to catch them, so they can't come back.

Nothing in CI validated config.json before: scripts/verify-links.ts only extracts links written inside .md files, so entries in the nav config were never checked. That's how these drifted out of sync unnoticed.

The 6 dead entries

Found by the new check, verified against the source and the generated docs:

Nav entry to Why it 404s
API Reference > Types / FieldInfo reference/type-aliases/FieldInfo FieldInfo is an interface (packages/form-core/src/types.ts:1253), so typedoc emits no type-aliases/ page — and no interfaces/FieldInfo.md is generated either
API Reference > Types / FieldMeta reference/type-aliases/FieldMeta Type no longer exists in source
API Reference > Types / FieldState reference/type-aliases/FieldState Type no longer exists in source
API Reference > react > Functions / useTransform framework/react/reference/functions/useTransform Not exported from @tanstack/react-form; it lives in react-form-{nextjs,remix,start}, none of which are registered in scripts/generate-docs.ts
API Reference > vue > Types / UseField framework/vue/reference/type-aliases/UseField vue-form exports UseFieldOptions / UseFieldOptionsBound, no UseField
API Reference > solid > Types / CreateField framework/solid/reference/type-aliases/CreateField solid-form exports CreateFieldOptions / CreateFieldOptionsBound, no CreateField

FieldMeta.md, FieldState.md and FieldInfo.md were dropped by the docs generator in 6a73479 (ci: apply automated fixes and generate docs), but config.json was never updated to match.

Changes

  • Removed the 5 entries with no valid target.

  • Repointed Types / FieldMetaTypes / AnyFieldMeta (packages/form-core/src/types.ts:834), the surviving public field-metadata type. Its page already exists but wasn't reachable from the sidebar, so this keeps field metadata covered rather than just deleting the entry.

  • verify-links.ts now walks every to in config.json (children and frameworks, recursively) and resolves it the same way markdown links are resolved — including the framework/{fw}/examples/{name}examples/{fw}/{name} directory mapping. Failures report the nav breadcrumb so the offending entry is easy to find:

    docs/config.json
      nav:       API Reference > vue > Types / UseField
      link:      framework/vue/reference/type-aliases/UseField
      resolved:  .../docs/framework/vue/reference/type-aliases/UseField.md
      why:       Not found
    

The example-path and .md resolution logic is factored into a shared resolveDocTarget() used by both checks, so the two paths can't drift apart.

Relationship to #2226 and other open PRs

Worth being explicit, since this looks adjacent to work already in flight:

The remaining 5 entries aren't covered by any open PR or issue that I could find.

Not included

The check only validates that nav entries resolve. It deliberately does not flag the reverse — generated pages that exist but aren't in the nav (currently ~150, including revalidateLogic, which every framework's dynamic-validation guide references). That's a larger judgment call about what belongs in the sidebar, and better as its own PR.

Verification

pnpm test:pr                         # nx affected → sherif, knip, docs — all pass
pnpm run test:docs                   # 285 markdown files, 166 nav entries, no broken links
pnpm exec eslint scripts/verify-links.ts
pnpm exec tsc --noEmit               # root tsconfig includes scripts/
pnpm exec prettier --check docs/config.json scripts/verify-links.ts

Confirmed the check actually fails rather than silently passing: injecting a bogus type-aliases/ entry and a bogus examples/ entry makes it report both and exit 1; removing them returns exit 0. Before this change, the same bogus entries passed CI.

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm test:pr.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

Summary by CodeRabbit

  • Documentation

    • Updated API reference navigation to reflect the current documentation structure.
    • Removed outdated type and framework-specific reference links.
    • Improved navigation consistency across nested documentation sections.
  • Chores

    • Expanded link validation to cover configuration-based and Markdown links.
    • Added clearer navigation breadcrumbs to link verification errors.
    • Improved detection and reporting of invalid documentation and example links.

irfanfandi and others added 2 commits August 7, 2026 15:14
…ages

Six sidebar entries in docs/config.json referenced reference pages that do
not exist, so each rendered as a 404.

FieldMeta, FieldState and FieldInfo lost their generated pages in 6a73479
without config.json being updated to match. useTransform is not exported
from @tanstack/react-form, and vue/solid never had UseField/CreateField
types. Repoint the FieldMeta entry to AnyFieldMeta, the surviving public
field-metadata type, and drop the rest.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017z89Nb8dzFPu7VnsvN2VA9
verify-links only extracted links written inside .md files, so sidebar
entries in docs/config.json were never checked and could point at pages
that no longer exist without failing CI.

Walk every `to` in the nav config and resolve it the same way markdown
links are resolved, including the framework examples directory mapping.
Failures report the nav breadcrumb so the offending entry is easy to
locate. The shared resolution logic is extracted into resolveDocTarget so
the two checks cannot drift apart.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017z89Nb8dzFPu7VnsvN2VA9
@irfanfandi
irfanfandi requested a review from a team as a code owner August 7, 2026 08:24
@coderabbitai

coderabbitai Bot commented Aug 7, 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: 6248ce83-4fa3-4813-82c6-6fc9aba0732c

📥 Commits

Reviewing files that changed from the base of the PR and between b1798d7 and ca14dee.

📒 Files selected for processing (1)
  • scripts/verify-links.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • scripts/verify-links.ts

📝 Walkthrough

Walkthrough

The documentation link verifier now checks Markdown links and nested navigation targets from docs/config.json. It reports navigation breadcrumbs for missing targets. The navigation removes obsolete references and replaces several type links with AnyFieldMeta.

Changes

Documentation Link Verification

Layer / File(s) Summary
Shared documentation target resolution
scripts/verify-links.ts
The verifier uses resolveDocTarget for example and Markdown targets. Link errors can include navigation context.
Navigation validation and cleanup
scripts/verify-links.ts, docs/config.json
The verifier traverses nested navigation entries and frameworks. The entry point runs Markdown and configuration checks. The navigation removes obsolete references and adds the AnyFieldMeta reference.

Estimated code review effort: 3 (Moderate) | ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the sidebar fixes and config.json navigation validation.
Description check ✅ Passed The description explains the problem, changes, verification, checklist items, and release impact.
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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/verify-links.ts`:
- Line 187: Update the verifyLinks rejection handler so failures from reading or
parsing docs/config.json log the error and set a non-zero process exit status.
Preserve the existing verifyLinks() invocation while ensuring test:docs cannot
succeed when the check rejects.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 28af4de7-5770-478e-94a9-0470f66145db

📥 Commits

Reviewing files that changed from the base of the PR and between 093ce62 and b1798d7.

📒 Files selected for processing (2)
  • docs/config.json
  • scripts/verify-links.ts

Comment thread scripts/verify-links.ts Outdated
The rejection handler only logged, so Node still exited 0. Reading or
parsing docs/config.json can now throw, which meant test:docs could pass
while the navigation check never ran.

Confirmed by pointing the script at malformed and missing config files:
both exited 0 before this change and exit 1 after.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017z89Nb8dzFPu7VnsvN2VA9
@nx-cloud

nx-cloud Bot commented Aug 8, 2026

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit ca14dee

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

☁️ Nx Cloud last updated this comment at 2026-08-08 21:57:12 UTC

@pkg-pr-new

pkg-pr-new Bot commented Aug 8, 2026

Copy link
Copy Markdown
More templates

@tanstack/angular-form

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

@tanstack/form-core

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

@tanstack/form-devtools

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

@tanstack/lit-form

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

@tanstack/preact-form

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

@tanstack/react-form

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

@tanstack/react-form-devtools

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

@tanstack/react-form-nextjs

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

@tanstack/react-form-remix

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

@tanstack/react-form-start

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

@tanstack/solid-form

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

@tanstack/solid-form-devtools

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

@tanstack/svelte-form

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

@tanstack/vue-form

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

commit: ca14dee

@crutchcorn
crutchcorn merged commit 77d6815 into TanStack:main Aug 8, 2026
9 checks passed
crutchcorn added a commit that referenced this pull request Aug 8, 2026
* docs: use the dynamic README header endpoint (#2266)

* docs: fix sidebar 404s and validate config.json nav targets (#2278)

* docs(config): remove nav entries pointing at non-existent reference pages

Six sidebar entries in docs/config.json referenced reference pages that do
not exist, so each rendered as a 404.

FieldMeta, FieldState and FieldInfo lost their generated pages in 6a73479
without config.json being updated to match. useTransform is not exported
from @tanstack/react-form, and vue/solid never had UseField/CreateField
types. Repoint the FieldMeta entry to AnyFieldMeta, the surviving public
field-metadata type, and drop the rest.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017z89Nb8dzFPu7VnsvN2VA9

* chore(scripts): verify docs/config.json nav targets in verify-links

verify-links only extracted links written inside .md files, so sidebar
entries in docs/config.json were never checked and could point at pages
that no longer exist without failing CI.

Walk every `to` in the nav config and resolve it the same way markdown
links are resolved, including the framework examples directory mapping.
Failures report the nav breadcrumb so the offending entry is easy to
locate. The shared resolution logic is extracted into resolveDocTarget so
the two checks cannot drift apart.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017z89Nb8dzFPu7VnsvN2VA9

* fix(scripts): fail verify-links when the check itself throws

The rejection handler only logged, so Node still exited 0. Reading or
parsing docs/config.json can now throw, which meant test:docs could pass
while the navigation check never ran.

Confirmed by pointing the script at malformed and missing config files:
both exited 0 before this change and exit 1 after.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017z89Nb8dzFPu7VnsvN2VA9

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
# Conflicts:
#	docs/config.json

---------

Co-authored-by: Irfan fandi <irfanfandi38@gmail.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

Documentation API Link not Found

2 participants