You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Wait for this PR before merging:
#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>
0 commit comments