Run oracles in a real browser (Vitest browser mode)
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ó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 18/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- javascript, playwright
- Lĩnh vực
- testing
Hướng nghiên cứu
Start with the imports in oracleProperty (node:async_hooks, node:fs, node:util) and with useOracleClock, then read oracle-gaps/capture-setup.mjs where ORACLE_GAPS_STATE is read through readFileSync. Running a test file under Vitest browser mode should show these failures, such as AsyncLocalStorage is not a constructor. Done means a browser-safe entry imports and runs in browser mode, and the gap check either runs there or is documented as unsupported.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Problem
An oracle for DOM code must run in jsdom today, so its driver supplies the
browser facts that jsdom lacks: layout, scroll positions, the targets where
scroll events fire, ResizeObserver notifications, and computed styles. When
the driver's stand-in and production rest on the same wrong belief about the
browser, the oracle passes, and only a human or a real browser finds the bug.
We hit this three times in one pull request (react-headroom):
- The stand-in notified a
ResizeObserveron any size change. Chrome notifies
a content-box observer only when the content box changes, so a header that
changes only its padding kept a stale height. - The stand-in decided that a body with
overflow-y: autoscrolls itself.
Withhtml { overflow-y: scroll } body { overflow-x: hidden }, Chrome
computes the body'soverflow-yasauto, but the body grows with its
content and the page scrolls. - The stand-in gave a body the viewport's height. In Chrome, a body that does
not scroll itself grows with the page.
We checked each fact by hand in headless Chrome. An oracle that runs in
Chrome would have checked them on every run.
What stops it at 4749f61
oraclePropertyimportsnode:async_hooks(AsyncLocalStoragefor probe
windows),node:fs(appendFileSync) andnode:util(inspect,
isDeepStrictEqual,types). In Vitest browser mode the test file fails
to import:AsyncLocalStorage is not a constructor.- The gap check's setup file (
oracle-gaps/capture-setup.mjs) reads its run
state fromprocess.env.ORACLE_GAPS_STATEwithreadFileSync. In browser
mode, setup files run in the page.
Request
- Let
oraclePropertyanduseOracleClockrun in Vitest browser mode, for
example with a browser-safe entry that replacesAsyncLocalStorage,fs
andutilwith browser equivalents or leaves those features out. - Let
oracle-gapsrun an oracle in browser mode, or document that it cannot,
and recommend a pattern: for example, an oracle that runs in Chrome for its
laws, and the same oracle in jsdom for the gap check.
Workaround we considered
Keep the oracle in Node and drive a Chrome page through Playwright: the
driver sends each history to the page, which runs it against a bundle of
production and returns the observations. This needs a page bundle, a
page-side clock in place of useOracleClock, and two copies of the driver
environment. The gap check still cannot mutate the code in the page.
- Ngôn ngữ chính
- JavaScript
- Star
- 5
- Fork
- 1
- Merge trung bình
- 8 giờ 31 phút
- Pull request đã merge (30 ngày)
- 60
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
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 TanStack/oracles
-
Độ 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
-
Độ 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
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của TanStack/oracles
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Edit: Telemante [YT]Đang mởchannels:edit check:passed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
swc-project/swc-next-issues#490 ·
-
[workshop-sim] Improve: Add predict-and-check practice and checkpoint to Step 4 Actions introĐang mởfeedback simulation workshop
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 69/100
githubnext/gh-aw-workshop#5826 ·
Maintainer thường phản hồi trong vòng 1 ngày