Skip to content

Conversation

alex-delia
Copy link
Contributor

@alex-delia alex-delia commented Oct 10, 2025

Zod 3.24.0+ implements Standard Schema, therefore it can it be used without an adapter just as the Arktype, Valibot and Effect guides instruct. This docs change shows users how to use zod 3.24.0+ to validate search params without requiring the use of the @tanstack/zod-adapter package.

Summary by CodeRabbit

  • Documentation
    • Revised guidance on search parameter validation with a prominent warning about Zod 3.24.0+ compatibility.
    • Added adapterless examples for Zod 3.24.0+, including input/output typing and error handling.
    • Provided adapter-based workflow instructions for Zod versions below 3.24.0.
    • Expanded coverage for Standard Schema and alternative libraries (Valibot, ArkType, Effect/Schema) with comparable examples and notes.
    • Clarified behavior of validateSearch, onError handling, defaults/fallbacks, and typing implications.
    • Highlighted navigation/linking considerations when using adapters and how to enable or bypass them.

@github-actions github-actions bot added the documentation Everything documentation related label Oct 10, 2025
Copy link
Contributor

coderabbitai bot commented Oct 10, 2025

Walkthrough

Documentation for React router search-params was rewritten to detail Zod 3.24.0+ adapter-less validation, provide adapter-based paths for older Zod and other libraries, add full examples, warnings, and clarify typing, error handling, and Link/navigation implications.

Changes

Cohort / File(s) Summary
Docs — Search params validation and adapters
docs/router/framework/react/guide/search-params.md
Rewrote Zod section with warning for 3.24.0+, added adapter-less example, added adapter-based flow for Zod <3.24.0 with zod-adapter, expanded narrative for Standard Schema, Valibot, ArkType, Effect/Schema; clarified validateSearch, onError, defaults/catches, fallback typing, and Link/navigation behaviors.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant U as User
  participant R as Route
  participant VS as validateSearch
  participant Z as Zod 3.24.0+
  participant A as Adapter (Zod<3.24 / Other libs)
  participant H as onError Handler

  U->>R: Navigate with search params
  R->>VS: validateSearch(params)
  alt Adapter-less (Zod ≥ 3.24.0)
    VS->>Z: parse(params)
    alt Valid
      Z-->>VS: parsed, typed result
      VS-->>R: ok(result)
    else Invalid
      Z-->>VS: error
      VS->>H: onError(error)
      H-->>VS: fallback/default
      VS-->>R: fallback result
    end
  else Adapter-based (Zod<3.24 / other schema libs)
    VS->>A: coerce/transform(params)
    alt Valid
      A-->>VS: parsed, typed result (via adapter)
      VS-->>R: ok(result)
    else Invalid
      A-->>VS: error
      VS->>H: onError(error)
      H-->>VS: fallback/default (.default()/.catch())
      VS-->>R: fallback result
    end
  end
  R-->>U: Render with validated search state
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I thump my paws at params so fine,
Zod hops ahead in versioned line.
With or without an adapter’s tune,
We parse the breeze of query soon.
If errors sprout, I nibble—mild—
Then bound along, defaults compiled. 🥕🐇

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly identifies the main change by indicating an update to the search params guide for Zod 3.24.0+ with Standard Schema, directly reflecting the key content of the documentation edits without unnecessary detail or ambiguity. It is clear, specific, and aligned with the changeset.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 51da7fb and 470607c.

📒 Files selected for processing (1)
  • docs/router/framework/react/guide/search-params.md (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
docs/**/*.{md,mdx}

📄 CodeRabbit inference engine (AGENTS.md)

Use internal docs links relative to the docs/ folder (e.g., ./guide/data-loading)

Files:

  • docs/router/framework/react/guide/search-params.md
docs/{router,start}/**

📄 CodeRabbit inference engine (AGENTS.md)

Place router docs under docs/router/ and start framework docs under docs/start/

Files:

  • docs/router/framework/react/guide/search-params.md

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

nx-cloud bot commented Oct 10, 2025

View your CI Pipeline Execution ↗ for commit 470607c

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

☁️ Nx Cloud last updated this comment at 2025-10-10 01:48:22 UTC

Copy link

pkg-pr-new bot commented Oct 10, 2025

More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/arktype-adapter@5428

@tanstack/directive-functions-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/directive-functions-plugin@5428

@tanstack/eslint-plugin-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/eslint-plugin-router@5428

@tanstack/history

npm i https://pkg.pr.new/TanStack/router/@tanstack/history@5428

@tanstack/nitro-v2-vite-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/nitro-v2-vite-plugin@5428

@tanstack/react-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router@5428

@tanstack/react-router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-devtools@5428

@tanstack/react-router-ssr-query

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-router-ssr-query@5428

@tanstack/react-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start@5428

@tanstack/react-start-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-client@5428

@tanstack/react-start-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/react-start-server@5428

@tanstack/router-cli

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-cli@5428

@tanstack/router-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-core@5428

@tanstack/router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools@5428

@tanstack/router-devtools-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-devtools-core@5428

@tanstack/router-generator

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-generator@5428

@tanstack/router-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-plugin@5428

@tanstack/router-ssr-query-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-ssr-query-core@5428

@tanstack/router-utils

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-utils@5428

@tanstack/router-vite-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/router-vite-plugin@5428

@tanstack/server-functions-plugin

npm i https://pkg.pr.new/TanStack/router/@tanstack/server-functions-plugin@5428

@tanstack/solid-router

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router@5428

@tanstack/solid-router-devtools

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-router-devtools@5428

@tanstack/solid-start

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start@5428

@tanstack/solid-start-client

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-client@5428

@tanstack/solid-start-server

npm i https://pkg.pr.new/TanStack/router/@tanstack/solid-start-server@5428

@tanstack/start-client-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-client-core@5428

@tanstack/start-plugin-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-plugin-core@5428

@tanstack/start-server-core

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-server-core@5428

@tanstack/start-static-server-functions

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-static-server-functions@5428

@tanstack/start-storage-context

npm i https://pkg.pr.new/TanStack/router/@tanstack/start-storage-context@5428

@tanstack/valibot-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/valibot-adapter@5428

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/TanStack/router/@tanstack/virtual-file-routes@5428

@tanstack/zod-adapter

npm i https://pkg.pr.new/TanStack/router/@tanstack/zod-adapter@5428

commit: 470607c

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

Labels

documentation Everything documentation related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant