Skip to content

perf: reuse Valibot for starter search parameters - #1306

Merged
LadyBluenotes merged 1 commit into
TanStack:mainfrom
LadyBluenotes:perf/starter-search-valibot
Sep 30, 2026
Merged

LadyBluenotes merged 1 commit into
TanStack:mainfrom
LadyBluenotes:perf/starter-search-valibot

Conversation

@LadyBluenotes

@LadyBluenotes LadyBluenotes commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Summary

Use the already-shipped Valibot package for application starter search parameters instead of loading Zod in shared startup code.

Keep optional fields, package-manager choices, custom feature parameters, and rejection of malformed inputs intact. Reject arrays explicitly because the two libraries treat object inputs differently.

Checks

  • Added focused tests for accepted values, unknown feature options, and malformed inputs.
  • Full pnpm test passed: 531 passed, 3 skipped, 0 failed.
  • Production build, TypeScript, and targeted lint passed.
  • Built output with the companion chart change contains no Zod or D3 modules in the shared startup graph.

Summary by CodeRabbit

  • Bug Fixes
    • Search parameters now reject array inputs and invalid values for supported fields, while retaining optional and custom parameters without coercion.
  • Tests
    • Added coverage for valid and invalid search parameters, including custom fields and non-object inputs.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 8ce4b687-90af-45e8-a58b-6e64691d6c8f

📥 Commits

Reviewing files that changed from the base of the PR and between 543f740 and 3a9957d.

📒 Files selected for processing (2)
  • src/routes/application-starter.index.tsx
  • tests/application-starter-search.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

The application starter route now uses Valibot to validate search parameters. Tests cover accepted inputs, preserved custom fields, and invalid values.

Changes

Search parameter validation

Layer / File(s) Summary
Valibot schema and validation tests
src/routes/application-starter.index.tsx, tests/application-starter-search.test.ts
The route replaces its Zod schema with a Valibot pipeline. It validates the existing optional fields and allowed values, rejects arrays, and preserves unknown parameters. Tests cover the Standard Schema interface, accepted inputs, and invalid values.

Priority: ⬇️ Low

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

Change: Refactor

Merge Risk: ⚪ Minimal · up to 3a995

This change swaps the search-parameter validator for one that is already shipped, with the same accepted and rejected inputs. It adds focused tests. No remaining merge-blocking risk was found.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 3a995

The inspected change preserves accepted parameters, rejects malformed known values, and does not demonstrate broader access or additional privileges. Risk remains low rather than minimal because validation-failure handling through actual navigation and initialization recovery remain unverified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The demonstrated attacker-controlled flow reaches browser-side starter configuration and the project definition derived from it. The inspected migration establishes no additional service, tenant, credential, or persistent-store authority; downstream generation/export exposure remains outside the inspected scope.

Trust Boundaries and Controls

  • observed — The route registers the new schema as validateSearch, and direct tests verify its rejection behavior. This proves the configured validation boundary and schema results, not runtime navigation ordering or error handling before consumers receive search values.

Resilience and Maintainability Implications

  • observed — Feature-loading failure still sets featuresLoaded true, allowing the existing one-shot URL initialization to proceed without a successfully loaded registry. Initialization performs several separate mutations and schedules synchronization release without explicit timeout cleanup. These pre-existing behaviors leave degraded-mode and recovery guarantees unresolved, rather than establishing a PR-induced weakness.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: reusing Valibot for application starter search-parameter validation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
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 a new PR

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.

@LadyBluenotes
LadyBluenotes merged commit 948da15 into TanStack:main Sep 30, 2026
6 checks passed
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