Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Query enumeration recomputes on pathname/hash-only navigation with unchanged search (Solid 2)

Abierto
#624 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
74/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
typescript
Área
frontend

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.)

Lenguaje dominante
TypeScript
Estrellas
1.3k
Forks
180
Merge medio
1 d 4 h
PR fusionados (30 d)
27

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de solidjs/solid-router

Todos los issues de solidjs/solid-router

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.