Query enumeration recomputes on pathname/hash-only navigation with unchanged search (Solid 2)
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 74/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
- Lĩnh vực
- frontend
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.)
- Ngôn ngữ chính
- TypeScript
- Star
- 1.3k
- Fork
- 180
- Merge trung bình
- 1 ngày 4 giờ
- Pull request đã merge (30 ngày)
- 27
Chuẩn bị môi trường
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của solidjs/solid-router
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 50/100
solidjs/solid-router#625 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
<A> costs ~6us of server CPU per instance during SSR (20x a plain <a>), mostly mergeProps/splitPropsĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
solidjs/solid-router#583 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
solidjs/solid-router#569 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 38/100
solidjs/solid-router#518 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 64/100
solidjs/solid-router#502 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của solidjs/solid-router
Issue tương tự
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
inu-appcenter/memorIN-frontend#106 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
kind/bug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 7 ngày
-
[Bug] @deck.gl/arcgis dist import resolves to unpublished @deck.gl/core source path (9.3.11, 9.4.0)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
fix: CopyFilters ignores tabĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
CSCfi/sd-search-ui#145 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add: Cbeebies pl SDĐang mởcheck:passed streams:add
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày