Query enumeration recomputes on pathname/hash-only navigation with unchanged search (Solid 2)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 74/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- frontend
Research direction
Start at createLocation in src/routing.ts, especially the separate search memo and queryFn shown in the issue, then reproduce the behavior with the memory router and the supplied /one and /two URLs. Confirm that pathname-only and hash-only navigation do not reparse or invalidate query consumers when the search string is unchanged, while actual search changes and back/forward navigation still return correct values.
Written by the indexing model from the issue text.
Description
Summary
With @solidjs/[email protected] and Solid 2.0.0-rc.10, computations enumerating location.query rerun when only the pathname or hash changes, although the search string and parsed values remain unchanged. Repeated parameters also receive new array references.
The public query proxy remains stable; the unnecessary updates affect the parsed data and its consumers.
Reproduction
Using a memory router with a /*rest route, keep the same consumer mounted:
const location = useLocation();
const navigate = useNavigate();
let runs = 0;
const snapshot = createMemo(() => {
runs++;
return { ...location.query };
});
Start at:
/one?tag=a&tag=b&empty=#start
Read snapshot(), then navigate to either of these independently, flush, and read again:
/two?tag=a&tag=b&empty=#start — pathname only
/one?tag=a&tag=b&empty=#end — hash only
The computation runs again and produces a new snapshot and tag array, although both snapshots contain:
{ tag: ["a", "b"], empty: "" }
Actual search changes and back/forward navigation return correct values.
Source observation
createLocation on next derives search separately, but query parsing tracks the entire URL:
const search = createMemo(() => url().search);
// ...
const queryFn = createMemo(() => extractSearchParams(url()));
The parser only consumes url.searchParams.
Expected behavior
When the search string is unchanged, pathname-only or hash-only navigation should not reparse query parameters or invalidate computations that depend only on those parameters.
Actual behavior
Query parsing tracks the entire URL, so unrelated pathname/hash changes recreate the parsed query data and rerun query-enumerating consumers. The query values remain correct, but the reactive dependency is broader than the data being consumed.
(Submitted by GPT-6 Astra on behalf of the user.)
- Dominant language
- TypeScript
- Stars
- 1.3k
- Forks
- 180
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 20
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from solidjs/solid-router
-
<A> costs ~6us of server CPU per instance during SSR (20x a plain <a>), mostly mergeProps/splitPropsOpen
Difficulty 4/5 3-5 days Newbie friendliness 55/100
solidjs/solid-router#583 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
solidjs/solid-router#569 · 3 comments ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 3/5 1-2 days Newbie friendliness 38/100
solidjs/solid-router#518 · 2 comments ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 3/5 1-2 days Newbie friendliness 64/100
solidjs/solid-router#502 · 4 comments ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
solidjs/solid-router#482 · 2 comments ·
Maintainers usually reply within 1 day
All issues in solidjs/solid-router
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
rohitg00/agentmemory#1428 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
boxlite-ai/boxlite#1729 ·
Maintainers usually reply within 1 day
-
detectors enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
SM260845/readme-gen#1 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
angular/angularfire#3774 ·
Maintainers usually reply within 2 days