@effect/ui: expose node-to-component ownership lookup for custom renderers

Đang mở
#11,086 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

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ó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
56/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ệ
typescript
Lĩnh vực
developer-experience

Hướng nghiên cứu

Start from the custom Renderer.Host and the browser picker’s BrowserHost.instanceAt implementation referenced in the issue, then trace how mounted nodes map to component instances and how unmounting clears that ownership. Add a non-DOM host test with two keyed Counter children: looking up the second button should return its child instance, and looking up its node after unmount should return no owner.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

What is the problem this feature would solve?

In our AppKit inspector, clicking a native control should show the model and last update of the component instance that rendered it. AppKit tells us which view was clicked, and MessageLog tells us which instances updated. The missing link is going from the host node to its owning instance in that session.

Effect-TS/ui#465 solved this for DOM nodes with BrowserHost.instanceAt(root, node). In the UI revision checked we couldn't find an equivalent public lookup for a custom Renderer.Host.

What is the feature you are proposing to solve the problem?

Expose a read-only lookup for a mounted root and a host node. The result should identify the owning instance so tools can correlate it with MessageLog, using the same ownership rules as the browser picker. Hit testing and inspector UI can stay in the host.

A concrete acceptance case:

  1. Mount two keyed Counter children in a non-DOM host, each rendering a button titled Count: 0.
  2. Look up the second button's node. The result should identify the second child, not its sibling or the root.
  3. Unmount that child and look up the old node. It should have no owner.
What alternatives have you considered?

Our inspector walks private renderer records. This works, but makes the integration sensitive to internal changes. Walking the native view hierarchy alone isn't enough: it records layout, not which Effect component authored a node.

Ngôn ngữ chính
TypeScript
Star
16.7k
Fork
808
Merge trung bình
21 giờ 22 phút
Pull request đã merge (30 ngày)
486

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

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Effect-TS/effect

Tất cả issue của Effect-TS/effect

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.