mirror of
https://github.com/TanStack/router.git
synced 2026-11-16 19:38:07 +00:00
Wait for this PR before merging: https://github.com/TanStack/router/pull/4987. It adds unit tests that should help make sure we're not breaking anything here. --- The functions used to serialize and deserialize search params are called *a lot*, but they are creating many unnecessary objects. This PR refactors - `encode` to be only as generic as what we need => in practice we only need to handle 1 value per key (i.e. `.set()` and not `.append()`) so we don't need a special case for arrays - `decode` can avoid creating many arrays - `stringifySearchWith` (and `defaultStringifySearch`) don't need to pre-stringify the input into a `<string,string>` dictionary as `encode` now accepts a stringifier function <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - Breaking Changes - Removed encode and decode from React Router and Solid Router public exports. - Query string prefix support removed in encode/decode. - Refactor - Updated query string handling: arrays encode as comma-separated values; duplicate keys decode into arrays. - Streamlined error handling and avoided input mutation; consistent leading “?” management. - Tests - Updated tests to match new encoding/decoding behavior and removed prefix-related cases. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> |
History
|
|
|---|---|---|
| .. | ||
| json.test.ts | ||
| lru.test.ts | ||
| match-by-path.test.ts | ||
| optional-path-params-clean.test.ts | ||
| optional-path-params.test.ts | ||
| path.test.ts | ||
| processRouteTree.test.ts | ||
| qss.test.ts | ||
| searchParams.test.ts | ||
| utils.test-d.ts | ||
| utils.test.ts | ||