Skip to content

fix(query): keep parsed search data stable during navigation - #635

Merged
ryansolid merged 1 commit into
solidjs:nextfrom
everton-dgn:fix/query-search-stability
Sep 30, 2026
Merged

ryansolid merged 1 commit into
solidjs:nextfrom
everton-dgn:fix/query-search-stability

Conversation

@everton-dgn

Copy link
Copy Markdown

Closes #624.

Moving from /one?tag=a&tag=b to /two?tag=a&tag=b used to rebuild the parsed query. Components that spread or enumerate location.query reran, and tag became a new array even though the search string had not changed.

Query parsing now tracks the search string. Pathname and hash changes keep the existing data; changing the search still updates consumers. The public query proxy and queryWrapper API stay the same.

Tests cover enumeration, repeated parameters, queryWrapper, and back/forward navigation.

Validation:

  • The three new regression tests failed before the fix and pass with it.
  • pnpm test: 445 client tests, 38 server tests and the test typecheck pass.
  • TypeScript/Rollup build, the filesystem bundle gate and the distribution type check pass.
  • Changed lines follow Prettier; existing formatting differences elsewhere in routing.ts and search-params.spec.tsx are unchanged. git diff --check passes.

Track the search string when parsing location.query so pathname and hash
changes do not invalidate query consumers or recreate repeated values.

Cover enumeration, queryWrapper, search changes and history navigation.
@changeset-bot

changeset-bot Bot commented Sep 29, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 6e47fbb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@solidjs/router Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ryansolid
ryansolid merged commit 2a1cd8f into solidjs:next Sep 30, 2026
4 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